JezK
Edit File: shipmentstatus.php
<?php include("./app/checkSession.php"); if(empty($_SESSION['admin_name'])&&$_SESSION['admin_name']==""){ echo "<script>window.location.href='index.php'</script>"; } include("header.php"); ?> <style> html{overflow-x: hidden} @media(max-width:768px){ table.dataTable tbody td { overflow: unset; } /* #example_filter label:after{ right:48px; } */ } </style> <link href="css/simplePagination.css" type="text/css" rel="stylesheet"/> <div id="material-view-table" class="container first-position"> <!-- shipment-table --> <div class="container mt-3 position-2 "> <div class="row px-md-4 px-0"> <div class="tophead col-md-4"> <h6><?php echo $lang['SHIPMENT_STATUS']; ?></h6> </div> <!-- <div class="col-md-6"> <div class="row position-relative z-in"> <div class="col-md-1"> <label class="mt-1 from_to_label mb-0" >From</label> </div> <div class="col-md-4"> <div class="cal_img_div"> <label for="startDate" class="mb-0" > <img class="cal_img" src="images/calendar.png"> </label> </div> <input class="form-control" value="" id="startDate" style="padding-left:35px" placeholder="Select Date"> </div> <div class="col-md-1"> <label class="mt-1 from_to_label" >To</label> </div> <div class="col-md-4"> <div class="cal_img_div"> <label for="endDate" class="mb-0" > <img class="cal_img" src="images/calendar.png"> </label> </div> <input class="form-control" value="" id="endDate" style="padding-left:35px" placeholder="Select Date" onclick="getTableData()"> </div> </div> </div> --> </div> </div> <div class="container "> <div class="table-responsive p-md-4 p-0 myquotation-table"> <table id="example" class="table table-borderless dataTable bg-white tbl-border shipmentStatusTable" style="width:100%"> <thead> <tr> <th><?php echo $lang['SNO'] ?></th> <th><?php echo $lang['WAREHOUSE_ID']; ?></th> <th><?php echo $lang['WAREHOUSE_NAME']; ?></th> <th><?php echo $lang['VIEW']; ?></th> </tr> </thead> <tbody> </tbody> </table> </div> </div> <div class="container position-relative"> <div class="row export_csv buttonAlignment"> <div class="col-md-3 pl-2"> <a href="export-shipmentStatus.php" id="export1" class="btn btn-primary"><i class="fa fa-download"></i><span class="pl-0"> <?php echo $lang['EXPORT.XLSX']; ?></span></a> </div> </div> </div> </div> <style> div#example_length:first-child { display: none; } table.dataTable tbody tr td{ text-align:center !important; } th { text-align: center; } </style> <!-- footer --> <?php include("footer.php"); ?> <script> $(document).ready(function() { $(function(){ $('#startDate, #endDate').datetimepicker({ format: "DD-MM-YYYY" }); jQuery('#example').DataTable( { "processing": true, "dataSrc": "", "dom": 'Bfrtip', "dom": 'Rlfrtlip', language: { search: '', searchPlaceholder: "<?php echo $lang['SEARCH']; ?>", paginate: {previous: '<?php echo $lang['PREV'] ?>',next: '<?php echo $lang['NEXT'] ?>'}}, "pagingType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "./app/shipment-ajax.php", "ordering": false, "fnDrawCallback": function( oSettings ) { rowCount=oSettings.json.iTotalRecords; if(rowCount<1){ $("#export1").addClass("d-none") } }, "aoColumns": [{ mData: 'id' } , { mData: 'warehouse_id' } , { mData: 'warehouse_name' } , // { // mData: 'country_name' // }, // { // mData: 'price' // }, { mData: 'action' } ] } ); } ); }); var startdate=''; var e function getTableData(){ // var startdate=$('#startDate').on('dp.change', function(e){ console.log(e.date._d); }); var startdate=document.getElementById("startDate").value; // console.log(enddate); if(startdate==""){ return false; } else{ var enddate=$('#endDate').on('dp.change', function(e){ var a; a= moment(e.date._d).format('DD-MM-YYYY') if(startdate!=""&&enddate!=""){ jQuery('#example').empty(); jQuery("#example").DataTable().destroy(); jQuery('#example').DataTable( { "processing": true, "dataSrc": "", "dom": 'Bfrtip', "dom": 'Rlfrtlip', language: { search: '', searchPlaceholder: "<?php echo $lang['SEARCH']; ?>", paginate: {previous: '<?php echo $lang['PREV'] ?>',next: '<?php echo $lang['NEXT'] ?>'} , paginate: {previous: 'Prev',next: 'Next'}}, "pagingType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "./app/shipment-ajax.php?startdate="+startdate+"&enddate="+a, "ordering": false, "aoColumns": [{ mData: 'id' } , { mData: 'warehouse_name' } , { mData: 'warehouse_id' } , { mData: 'request_type' }, // { // mData: 'country_name' // }, // { // mData: 'price' // }, { mData: 'customer_name' }, { mData: 'asn_status' }, { mData: 'action' } ] }); } }); } } </script>