<?php 
include "config.php";
?>
<html>
<head>
  <title>Feenix</title>
  <style>
    th
    {
      font-size:24px;
    }
    td
    {
      font-size:20px;
      font-weight:bold;
    }
  </style>
</head>
<script>
  function enterkeypressed()
{
	//alert(event.keyCode);
	if(event.keyCode=='13'){ window.print(); }
}
</script>
<body onkeydown="enterkeypressed()" >
<table>
<?php 
$print = $_GET['print'];
$single=mysqli_query($connect,"select * from single_transaction where status !='deleted' and ticket = '$print'");
while($singleshow = mysqli_fetch_array($single))
{
   $customer = $singleshow['customer'];
$cus=mysqli_query($connect,"select * from customerdetails where status !='deleted' and code = '$customer'");
while($cusshow = mysqli_fetch_array($cus))
{
    $product = $singleshow['product'];
$pro=mysqli_query($connect,"select * from productdetail where status !='deleted' and productcode = '$product'");
while($proshow = mysqli_fetch_array($pro))
{
    $date = $singleshow['editdate'];
  $datefr = date_create($date);
  $datefrom = date_format($datefr,"d-m-Y");

?>
  <tr>
    <th colspan=4>SMT CRUSHER</th>
  </tr>
  <tr>
    <td colspan="4"><b>To:<?php echo $cusshow['name'] ?></b></td>
  </tr>
  <!-- <tr>
    <td colspan=4><b>Trip-no:</b>
    <span><b><?php echo $singleshow['trip'] ?></b></span></td>
  </tr> -->
  <tr>
    <td colspan=4><b>Ticket No:</b>
    <span><b><?php echo $singleshow['ticket'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4><b><span><?php echo $datefrom?></span>,</b>
    <span><b><?php echo $singleshow['edittime'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=4><b>Material:</b>
    <span><b><?php echo $proshow['productname'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4><b>Units:</b>
    <span><b><?php echo $singleshow['quantity'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=2><b>Details</b>
    </td><td colspan=2><span><b>Weight</b></span></td>
  </tr>
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=2><b>Empty-weight</b>
    </td><td colspan=2><span><b><?php echo $singleshow['emptyweight'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=2><b>Load-weight</b>
    </td><td colspan=2><span><b><?php echo $singleshow['loadweight'] ?></b></span></td>
  </tr>
    <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=2><b>Nett-weight</b>
    </td><td colspan=2><span><b><?php echo $singleshow['netweight'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=4 style="text-align:center">Thank You<td>
  </tr>
  <?php 
}}}
  ?>
</table>

</body>
</html>