<?php 
include "config.php";
?>
<html>
<head>
  <title>Feenix</title>
  <style>
    th
    {
      font-size:24px;
    }
    span
    {
      font-size:20px;
    }
  </style>
</head>
<script>
  function enterkeypressed()
{
	//alert(event.keyCode);
	if(event.keyCode=='13'){ window.print(); }
}
</script>
<body onkeydown="enterkeypressed()" ontouchstart="window.print()" >
<table>
<?php 
$print = $_GET['print'];
//echo $print;
$single=mysqli_query($connect,"select * from ticket 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");
?>
 <?php 
               $proedit=mysqli_query($connect,"select * from partydetail order by id desc");
               while($proshowedi = mysqli_fetch_array($proedit))
               {
                 $party=  $proshowedi['party'];
               }
               
               ?>
               <tr align="center"><th colspan="4"><?php echo $party ?></th></tr>
  <tr>
    <td colspan="4"><b>TO:<?php echo $cusshow['name'] ?></td>
  <!-- <tr>
    <td colspan=4><b>Trip No:</b>
    <span><b><?php echo $singleshow['tripno'] ?></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>vehicle No:</b>
    <span><b><?php echo $singleshow['vehicleno'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4><b><span><?php echo $datefrom ?></span>,</b>
    <span><b><?php echo $singleshow['time'] ?></b></span></td>
  </tr>
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=2><b>Chakka:</b>
    <span><b><?php echo $singleshow['chakka'] ?></b></span></td><td colspan=2></td>
  </tr>
  <tr>
    <td colspan=2><b>Material:</b>
    <span><b><?php echo $proshow['productname'] ?></b></span></td><td colspan=2></td>
  </tr>
  <tr>
    <td colspan=2><b>Vehicle Capacity:</b>
    <span><b><?php echo $singleshow['cft']?></b></span></td>
  </tr>
  
  <!--<tr>
    <td colspan=2><b>Payment Mode:</b>
    <span><b><?php echo $singleshow['modetrans']?></b></span></td>
  </tr>
  
  <tr>
    <td colspan=2><b>UPI.No:</b>
    <span><b><?php echo $singleshow['upi_number']?></b></span></td>
  </tr>-->
  
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=4><b>Load Operator Sign</b>
   
  </tr>
  <tr>
    <td colspan=4>--------------------------------------------------</td>
  </tr>
  <tr>
    <td colspan=4 style="text-align:center">Thank You<td>
  </tr>
  <?php 
}}}
  ?>
</table>

</body>
</html>