JezK
Edit File: customerInvoice.php
<?php include("./app/checkSession.php"); // print_r($_SESSION);exit; if(empty($_SESSION['admin_name'])&&$_SESSION['admin_name']==""){ echo "<script>window.location.href='index.php'</script>"; } $wid=''; if(isset($_REQUEST['wid'])) { $wid = $_REQUEST['wid']; } include("header.php"); ?> <style> .bootstrap-datetimepicker-widget, .bootstrap-datetimepicker-widget table td.day{ width:200px; inset : unset !important; line-height:unset; padding: unset !important; background:white; position:relative; left:0; right:0; text-align:center; z-index:9; } .bootstrap-datetimepicker-widget{ height:100%; } div#example_length:first-child { display: none; } .warehouseGridView a.nav-link.active { background: #2f58c9; color: #fff !important; border-radius: 10px; padding: 4px 10px; } html{overflow-x: hidden} #material-view-table td:last-child{ text-align: left !important; } @media(max-width:767px){ /* #example_filter label:after{ right:48px; } */ .warehouseGridView{ position:unset !important; } .resArrow { margin-top: 38px; } } </style> <a href="javascript:history.go(-1)" class="ml-5 resArrow"><img src="images/back_main.png" class="mb-3"></a> <ul class="nav nav-tabs mt-4 border-0 d-md-flex justify-content-left warehouseGridView"> <li class="nav-item ml-3 mr-3"> <a class="nav-link border-0 " href="adminInvoice.php"><?php echo $lang['ADMIN_INVOICES']; ?></a> </li> <li class="nav-item ml-3 mr-3"> <a class="nav-link border-0 active show" href="#customerInvoice"><?php echo $lang['CUSTOMER_INVOICES']; ?></a> </li> </ul> <div id="material-view-table" class="container first-position myquotation-table mt-5"> <div class="container mt-3 position-2 "> <div class="row px-md-4 px-0"> <div class="tophead col-lg-4 col-md-12 col-sm-12"> <h6><?php echo $lang['INVOICES'];?></h6> </div> <div class="col-lg-6 col-md-12 col-sm-12 ipaMar"> <div class="row position-relative z-in"> <div class="col-lg-1 col-md-1 col-sm-2"> <label class="mt-1 from_to_label mb-0" ><?php echo $lang['FROM'];?></label> </div> <div class="col-lg-4 col-md-4 col-sm-10"> <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 selectDate" value=""id="startDate" style="padding-left:35px" placeholder="<?php echo $lang['SELECT_DATE'] ?>" autocomplete="off"> </div> <div class="col-lg-1 col-md-1 col-sm-2"> <label class="mt-1 from_to_label" ><?php echo $lang['TO']; ?></label> </div> <div class="col-lg-4 col-md-4 col-sm-10"> <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 selectDate" value="" id="endDate" style="padding-left:35px" placeholder="<?php echo $lang['SELECT_DATE'] ?>" autocomplete="off" /> </div> </div> </div> </div> </div> <div class="container "> <div id="customerInvoice" class="container tab-pane active p-0"> <div class="table-responsive p-md-4 p-0 "> <table id="example" class="display bg-white tbl-border table-borderless customerInvoiceTable" style="width:100%"> <thead> <tr> <th><?php echo $lang['QUOTATION_ID'];?></th> <th><?php echo $lang['WAREHOUSE_ID'];?></th> <th><?php echo $lang['WAREHOUSE_NAME'] ?></th> <th><?php echo $lang['EMAIL'];?></th> <th><?php echo $lang['INVOICE_VALUE'];?></th> <th><?php echo $lang['CURRENCY'];?></th> <th><?php echo $lang['ACTION']; ?></th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> <div class="container position-relative"> <div class="row export_csv buttonAlignment"> <div class="col-md-3 pr-0"> <a id="export1" href="export-customer-invoices.php" class="btn btn-primary ml-2"><i class="fa fa-download"></i><span class="pl-2"> <?php echo $lang['EXPORT.XLSX']; ?></span></a> </div> </div> </div> </div> <!-- footer --> <?php include("footer.php"); ?> <script> $(document).ready(function() { $('#startDate, #endDate').datetimepicker({ format: "DD-MM-YYYY", useCurrent: false }); 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/customer_invoice-ajax-list.php", "ordering": false, "fnDrawCallback": function( oSettings ) { rowCount=oSettings.json.iTotalRecords; if(rowCount<1){ $("#export1").addClass("d-none") } }, "aoColumns": [{ mData: 'quotation_id' } , { mData: 'warehouse_id' } , { mData: 'warehouse_name' }, { mData: 'warehouse_email' } , { mData: 'grandtotal' }, { mData: 'currency' }, { mData: 'action' } ] } ); }); $('.selectDate').on('dp.change', function(e){ var startDate=$("#startDate").val(); var endDate=$("#endDate").val(); if(endDate==""){ return false; } console.log(e) var a; if(endDate!=""&&startDate!=""){ if(moment(endDate,"DD-MM-YYYY")<moment(startDate,"DD-MM-YYYY")) { alert("<?php $lang['FROM_DATE_SHOULD_NOT_BE_GREATER_THAN_TO_DATE']; ?>"); $("#endDate").val(""); $('#endDate').data('DateTimePicker').clear(); return false; } 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'] ?>'}}, "pagingType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "./app/customer_invoice-ajax-list.php?startdate="+startDate+"&enddate="+endDate, "ordering": false, "fnDrawCallback": function( oSettings ) { rowCount=oSettings.json.iTotalRecords; if(rowCount<1){ $("#export1").addClass("d-none") } }, "aoColumns": [{ mData: 'quotation_id' } , { mData: 'warehouse_id' } , { mData: 'warehouse_email' }, { mData: 'warehouse_name' } , { mData: 'grandtotal' } ] } ); } }); </script>