JezK
Edit File: active_warehouse.php
<?php include_once("./app/checkSession.php"); if(empty($_SESSION['user_id'])&& $_SESSION['user_id']=='') { header("Location: ../owner_login.php"); } include("header.php"); ?> <style> .previous{ border-radius: 7px !important; background-color: #1988ff !important; border-color: #1988ff !important; color: white !important; font-weight: bold; } .next{ border-radius: 7px !important; background-color: #1988ff !important; border-color: #1988ff !important; color: white !important; font-weight: bold; } </style> <div class="container myquotation-table"> <div class="container mt-3 px-md-5 px-3"> <div class="row"> <div class="col-md-4"> <h5>Active Warehouse</h5> </div> <div class="col-md-4"> </div> <div class="col-md-4"> <!-- <div class="input-group search-button mb-2" style="margin-right:10px;"> <input class="form-control border-right-0 border align-self-right border-rad-left" type="text" value="" id="myInput"> <span class="input-group-append"> <button class="btn btn-outline-secondary border-left-0 border border-rad-right" type="button"> <i class="fa fa-search"></i> </button> </span> </div> --> </div> </div> </div> <div class="container "> <div class="table-responsive p-md-4 p-0 "> <?php $activeCount=$pendingCount=$rejectedCount=0; $id=$res=$val=$activewarehouses=$countryData=''; $activewarehouseList = array(); $countryList=$wareHouseAdminObj->getCountryList(); $warehouseDetails=$wareHouseAdminObj->fetchLoginAdminwarehousesActive($_SESSION['user_id']); ?> <table id="example" class="display bg-white tbl-border table-borderless" style="width:100%"> <thead> <tr> <th>Sno</th> <th>Warehouse Number</th> <th>Warehouse Name</th> <th>Warehouse Id</th> <th>Country</th> <th>Status</th> <th>Action</th> </tr> </thead> <tbody> <?php $i=1; foreach($warehouseDetails as $activewarehouses) { ?> <tr> <td><?php echo $i++; ?></td> <td><?php if(isset($activewarehouses['warehouse_number']))echo $activewarehouses['warehouse_number'] ?></td> <td><?php if(isset($activewarehouses['warehouse_name']))echo $activewarehouses['warehouse_name'] ?></td> <td><?php if(isset($activewarehouses['warehouse_id']))echo $activewarehouses['warehouse_id'] ?></td> <td> <?php if(isset($countryList) && count($countryList)>0) { foreach($countryList as $res) { $selected=''; if($res['country_id']==$activewarehouses['warehouse_country_id']) { $selected=$res['country_name']; if(isset($activewarehouses['warehouse_country_id'])) echo $selected; // echo $countryData; } } } ?></td> <td><?php if(isset($activewarehouses['warehouse_status'])){ if($id==0){echo "Active"; }else if($id==1){echo "active"; }}if($id==2){echo "Rejected"; }?></td> <td><a href="view-warehouse.php?wid=<?php echo $activewarehouses['warehouse_id'] ?>"> <i class="fa fa-eye icon icon-display" id="togglePassword"></i></a></td> </tr> <?php } ?> </tbody> </table> </div> </div> <!-- <div class="container position-relative"> <div class="row export_csv"> <div class="col-md-3 offset-md-9 "> <button id="export" class="btn btn-primary"><i class="fa fa-download"></i><span class="pl-2">EXPORT.CSV</span></button> </div> </div> </div> --> </div> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <form method="post" id="quote_form"> <input type="hidden" name="quotation_id" id="quotation_id"> <input type="hidden" name="uid" id="uid" value="<?php echo $_SESSION['user_id']; ?>"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Quotation Rate</h4> </div> <div class="modal-body"> <p>Please update quotation rate</p> <div class="form-group"> <label>Expected Rate</label> <input type="number" name="expected_rate" id="expected_rate" class="form-control" required="required" /> </div> <div class="form-group"> <label>Status</label> <select name="quotation_status" id="quotation_status" class="form-control" required="required"> <option value="0">Pending</option> <option value="1">Accept</option> <option value="2">Reject</option> </select> </div> <div class="form-group"> <label>Message</label> <textarea name="whadmin_description" id="whadmin_description" class="form-control" required="required"></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary" name="btn_submit">Submit</button> </div> </div> </form> </div> </div> <!-- footer --> <?php include("footer.php"); ?> <script> jQuery(document).ready(function() { jQuery('#example').DataTable( { language: { search: '', searchPlaceholder: "Search" }, "processing": true, "dataSrc": "", "sDom": 'Bfrtip', // "sDom": 'Rlfrtlip', // "serverSide": true, // dom: 'Bfrtip', buttons: [ { extend: 'csvHtml5', text: '<i class="fa fa-download p-1"></i>Export to csv', titleAttr: 'CSV' }, ] } ); jQuery('#quote_form').validate(); } ); $(document).ready(function (e) { $("#quote_form").on('submit', (function (e) { e.preventDefault(); $.ajax({ url: 'savequote_warehouse.php', type: "POST", data: new FormData(this), contentType: false, cache: false, processData: false, success: function (data) { if(data==1) { alert("Quotation Rate Added successfully"); window.location.reload(true); } }, error: function () { // alert("Fail") } }); })); }); </script>