<? include "top.php"; ?>
<!DOCTYPE html>
<html>
   <head>
      <?php include('include/head.php'); 
         $stdt=$_POST['stdt'];
         $enddt=$_POST['enddt'];
         $trn_ac=$_POST['trn_ac'];
         //echo $trn_ac;
         if($trn_ac!='0'){
            $sql="SELECT * FROM `tbl_ticket` WHERE stat='$trn_ac' AND strtdt BETWEEN '$stdt' AND '$enddt'";
            $title="Ticket Report of " .$trn_ac. " from ".$stdt." to ".$enddt;
         }else{

               $title="Ticket Report  from ".$stdt." to ".$enddt;
               $sql="SELECT * FROM `tbl_ticket` WHERE strtdt BETWEEN '$stdt' AND '$enddt'";
         }


         ?>
      <title><?=$title?></title>
      <link rel="stylesheet" type="text/css" href="https://sarmac.b-cdn.net/plugins/datatables/media/css/jquery.dataTables.css">
      <link rel="stylesheet" type="text/css" href="https://sarmac.b-cdn.net/plugins/datatables/media/css/dataTables.bootstrap4.css">
      <link rel="stylesheet" type="text/css" href="https://sarmac.b-cdn.net/plugins/datatables/media/css/responsive.dataTables.css">
      <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
      <style type="text/css">
      table{

         width: 100%;
      }
      th{

      font-size: 14px !important;
      min-width: 60px;
      padding: 10px;
      text-align: center;
      background-color: #e5eef5;
      color: #5c5c5c;
      border-right: 1px solid white;
      -webkit-print-color-adjust: exact; 
    }
    td{

      font-size: 12px !important;
      text-align: center;
      border: 1px solid gray;

    }
    tr{

      width: 100%;

    }
    .trtot{

      background-color: #e5eef5;
      color: #5c5c5c;
    }
    .noborder{

      border:0px white;
    }
   </style>
   <style type="text/css" media="print">
  @page { size: landscape; }
</style>
   </head>
   <body style="padding: 3%;">
      <table>
         <tr>
            
            <td class="noborder" style="width: 25%"></td>
            <td class="noborder" style="width: 50%;">
                  
               <h5><?=$title?></h5>


            </td>
            <td class="noborder" style="width: 25%"></td>

         </tr>

   </table><br><br>
      <table class="stripe hover">
         <thead>
            <tr>
               <th class="table-plus datatable-nosort">Sl. No</th>
               <th>Date</th>
                           <th>Customer</th>
                           <th>Type</th>
                           <th>Details</th>
                           <th>Status</th>
               
               
            </tr>
         </thead>
         <tbody>
            <?
               $query=mysqli_query($con,$sql);
               while($arrc=mysqli_fetch_array($query)){$c++;
               $getc=f(q("SELECT * FROM adduser WHERE id='$arrc[custid]'"));
               ?>
            <tr>
               <td class="table-plus"><?=$c?></td>
              <td><?=$arrc['strtdt']?></td>
              <td><?=$getc['name']?><br>
               <?=$getc['address']?><br>
               Landmark: <?=$getc['landmark']?><br>
               Phone: <a href="tel:<?=$getc['phone']?>"><?=$getc['phone']?></a>



                           </td>
                           <td><?=$arrc['pticket']?></td>
                           <td><?=$arrc['pdet']?></td>
                           <td><?=$arrc['stat']?></td>
               
               
            </tr>
            <?}?>	
            
         </tbody>
        
      </table><br><br>
      <?php include('include/script.php'); ?>
      <script src="src/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
      <script src="src/plugins/datatables/media/js/dataTables.bootstrap4.js"></script>
      <script src="src/plugins/datatables/media/js/dataTables.responsive.js"></script>
      <script src="src/plugins/datatables/media/js/responsive.bootstrap4.js"></script>
      <!-- buttons for Export datatable -->
      <script src="src/plugins/datatables/media/js/button/dataTables.buttons.js"></script>
      <script src="src/plugins/datatables/media/js/button/buttons.bootstrap4.js"></script>
      <script src="src/plugins/datatables/media/js/button/buttons.print.js"></script>
      <script src="src/plugins/datatables/media/js/button/buttons.html5.js"></script>
      <script src="src/plugins/datatables/media/js/button/buttons.flash.js"></script>
      <script src="src/plugins/datatables/media/js/button/pdfmake.min.js"></script>
      <script src="src/plugins/datatables/media/js/button/vfs_fonts.js"></script>
      <script>
         $('document').ready(function(){
         	$('.data-table').DataTable({
         		scrollCollapse: true,
         		autoWidth: false,
         		responsive: true,
         		columnDefs: [{
         			targets: "datatable-nosort",
         			orderable: false,
         		}],
         		"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
         		"language": {
         			"info": "_START_-_END_ of _TOTAL_ entries",
         			searchPlaceholder: "Search"
         		},
         	});
         	$('.data-table-export').DataTable({
         		scrollCollapse: true,
         		autoWidth: false,
         		responsive: true,
         		columnDefs: [{
         			targets: "datatable-nosort",
         			orderable: false,
         		}],
         		"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
         		"language": {
         			"info": "_START_-_END_ of _TOTAL_ entries",
         			searchPlaceholder: "Search"
         		},
         		dom: 'Bfrtip',
         		buttons: [
         		'copy', 'csv', 'pdf', 'print'
         		]
         	});
         	var table = $('.select-row').DataTable();
         	$('.select-row tbody').on('click', 'tr', function () {
         		if ($(this).hasClass('selected')) {
         			$(this).removeClass('selected');
         		}
         		else {
         			table.$('tr.selected').removeClass('selected');
         			$(this).addClass('selected');
         		}
         	});
         	var multipletable = $('.multiple-select-row').DataTable();
         	$('.multiple-select-row tbody').on('click', 'tr', function () {
         		$(this).toggleClass('selected');
         	});
         });
      </script>
      <script type="text/javascript"></script>
   </body>
</html>

