JezK
Edit File: onhandstockView.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%; } html{overflow-x: hidden} @media(max-width:767px){ #example_filter label:after{ right:12px; } .resArrow { margin-top: 38px; } } </style> <div class="container ml-1 resArrow"> <a href="javascript:history.back(1)" class="text-dark pl-md-5"> <img src="images/back_main.png"></a> </div> <div id="material-view-table" class="container first-position myquotation-table"> <!-- onhand-view-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"> <?php echo $warehouseName['warehouse_name']?> <?php echo $lang['ONHAND_STOCK'] ?></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 myquotation-table onhandviewTable" style="width:100%"> <thead> <tr> <th><?php echo $lang['SNO'];?></th> <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_CODE']?></th> <th><?php echo $lang['TOTAL_QUANTITY'] ?></th> <th><?php echo $lang['BALANCE_QUANTITY'] ?></th> <th><?php echo $lang['PALLET_NO'] ?></th> <!-- <th>Cost</th> --> <!-- <th>Status</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 pl-2"> <a id="export1" href="export-onhandStock.php?wid=<?php echo $wid; ?>" class="btn btn-primary"><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 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/onhandstocktransaction-ajax.php?wid=<?php echo $wid; ?>", "ordering": false, "fnDrawCallback": function( oSettings ) { rowCount=oSettings.json.iTotalRecords; if(rowCount<1){ $("#export1").addClass("d-none") } }, "aoColumns": [ { mData: 'sln' },{ mData: 'quotation_id' } , { mData: 'warehouse_id' } , { mData: 'warehouse_name' } , { mData: 'itemcode' }, { mData: 'qty' }, { mData: 'available_quantity' }, { mData: 'pallet_no' }, { mData: 'action' } ] } ); // $('#startDate,#endDate').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'] ?>'}}, "pagingType": "full_numbers", "bProcessing": true, "bServerSide": true, "sAjaxSource": "./app/onhandstocktransaction-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: 'qty' }, { mData: 'available_quantity' }, { mData: 'pallet_no' }, { mData: 'cost' }, { mData: 'action' } ] }); } }); </script>