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: #3663c8 !important; border-color: #3663c8 !important; color: white !important; font-weight: bold; } .next{ border-radius: 7px !important; background-color: #3663c8 !important; border-color: #3663c8 !important; color: white !important; font-weight: bold; } </style> <div class="container pl-5 "> <div class="row pl-3"> <a href="dashboard.php"><img src="images/back_main.png"></a> </div> </div> <div class="container first-position"> <div class="container mt-3 position-2"> <div class="row"> <div class="col-md-6 col-lg-4 col-sm-12 mt-3 ml-4"> <h5><?php echo $lang['ACTIVE_WAREHOUSES'];?></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 myquotation-table"> <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 activeWarehouseTable" style="width:100%"> <thead> <tr> <th><?php echo $lang['SNO'];?></th> <th><?php echo $lang['WAREHOUSE_NUMBER'];?></th> <th><?php echo $lang['WAREHOUSE_NAME'];?></th> <th><?php echo $lang['WAREHOUSE_ID'];?></th> <th><?php echo $lang['COUNTRY'];?></th> <th><?php echo $lang['STATUS'];?></th> <th><?php echo $lang['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 '<span style="color:orange"> Pending </span>'; }else if($id==1){echo '<span style="color:orange"> Active </span>'; }}if($id==2){echo '<span style="color:orange"> Rejected </span>'; }?></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-7 pl-4 button-alignment"> <a id="export" href="export_warehouse.php?type=1" class="btn btn-primary mobile-alignment"><i class="fa fa-download"></i><span class="pl-2">EXPORT.XLSX</span></a> </div> </div> </div> </div> </div> <!-- footer --> <?php include("footer.php"); ?> <script> jQuery(document).ready(function() { jQuery('#example').DataTable( { "processing": false, "dataSrc": "", "sDom": 'Rfrtlip', 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/dashboard-ajax.php?id=1", "ordering": false, "fnDrawCallback": function( oSettings ) { rowCount=oSettings.json.iTotalRecords; if(rowCount<1){ $("#export").addClass("d-none") } }, "aoColumns": [{ mData: 'id' } , { mData: 'warehouse_number' } , { mData: 'warehouse_name' }, { mData: 'warehouse_id' }, { mData: 'country_name' }, { mData: 'status' }, { mData: 'action' } ] } ); } ); $(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") } }); })); }); $(document).ready(function() { jQuery('#example2').DataTable( { dom: 'Bfrtip', buttons: [ { extend: 'excel', text: '<i class="fa fa-file-text-o"></i>Export to csv', } ] } ); } ); </script> <style> #export{ margin-bottom:-35px } div#example_length { display: none; } </style>