JezK
Edit File: mtransactions.php
<?php include("./app/checkSession.php"); 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"); $warehouseName=$adminObj->getwarehouseName($wid); ?> <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; } html{overflow-x: hidden} @media(max-width:767px){ .tophead { margin-top: 25px; font-size:20px; } /* #example_filter label:after{ right:48px; } */ } </style> <div id="material-view-table" class="container first-position myquotation-table"> <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 class="text-capitalize" style="font-size:15px"><?php echo $warehouseName['warehouse_name']?> <?php echo $lang['WAREHOUSE_MATERIAL_TRANSACTIONS']; ?></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 class="table-responsive p-md-4 p-0 "> <table id="example" class="display bg-white tbl-border table-borderless mtransaction" 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['ITEM_NO'] ; ?></th> <th><?php echo $lang['ITEM_DESCRIPTION'] ; ?></th> <th><?php echo $lang['QUANTITY'] ; ?></th> <th><?php echo $lang['TRANSACTION_TYPE']; ?></th> <th><?php echo $lang['ACTION']; ?></th> </tr> </thead> <tbody> </tbody> </table> </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-materialTransactions.php?wid=<?php echo $wid ?>" class="btn btn-primary ml-2"><i class="fa fa-download text-white"></i><span class="pl-2"> <?php echo $lang['EXPORT.XLSX']; ?></span></a> </div> </div> </div> </div> <!-- footer --> <?php include("footer.php"); ?> <!-- <script src="js/jquery.min.js"></script> --> <!-- <script src="js/jquery.pagination.min.js"></script> --> <!----> <script> // let $ =jQuery; $(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/materialtransaction-ajax.php?wid=<?php echo $wid; ?>", "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: 'itemcode' } , { mData: 'item_desc' } , { mData: 'qty' } , { mData: 'material_status' }, // { // mData: 'country_name' // }, // { // mData: 'price' // }, { mData: 'action' } ] } ); // $('#startDate,#endDate').on('dp.change', function(e){ console.log(e.date._d); }); }); var startdate=''; var e // var startdate=$('#startDate').on('dp.change', function(e){ console.log(e.date._d); }); $('.selectDate').on('dp.change', function(e){ var startDate=$("#startDate").val(); var endDate=$("#endDate").val(); if(endDate==""){ return false; } if(endDate!=""&&startDate!=""){ if(moment(endDate,"DD-MM-YYYY")<moment(startDate,"DD-MM-YYYY")) { alert("<?php echo $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'] ?>'} , paginate: {previous: 'Prev',next: 'Next'}}, "pagingType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "./app/materialtransaction-ajax.php?wid=<?php echo $wid; ?>&startdate="+startDate+"&enddate="+endDate, "ordering": false, "aoColumns": [{ mData: 'quotation_id' } , { mData: 'warehouse_id' } , { mData: 'warehouse_name' } , { mData: 'itemcode' } , { mData: 'item_desc' } , { mData: 'qty' } , { mData: 'material_status' }, // { // mData: 'country_name' // }, // { // mData: 'price' // }, { mData: 'action' } ] }); } }); </script>