JezK
Edit File: viewasn.php
<?php include("app/checkSession.php"); //include("app/adminObj.php"); if(empty($_SESSION['user_id'])&& $_SESSION['user_id']=='') { header("Location: ../owner_login.php"); } include("header.php"); $query="SELECT * FROM uflexit_asn_request WHERE asn_id=".(int)$_REQUEST['asn_id']; $alist=$wareHouseAdminObj->db->get_row($query); //print_r($asn_list); $wrow = $wareHouseAdminObj->db->get_row("SELECT * FROM uflexit_master_warehouse WHERE warehouse_id=".(int)$alist['warehouse_id']); $urow = $wareHouseAdminObj->db->get_row("SELECT * FROM uflexit_users WHERE user_id=".(int)$alist['user_id']); $crow = $wareHouseAdminObj->db->get_row("SELECT * FROM uflexit_users WHERE user_id=".(int)$alist['created_by']); ?> <div class="col-md-12 mb-4 px-5"> <a href="javascript:history.back(1)" class="pr-3 pr-md-0 position-relative" style="z-index:9"><img src="images/back_main.png"></a> <!-- <a href='javascript://' onclick="history.go(-1); return false;" title="Back">Back</a> --> </div> <div class="container px-5"> <h4 class="col-sm-12 px-0 mt-4">View ASN</h4> <div class="containercontent"> <div class="card-1 shadow-sm p-3 mb-5 bg-white rounded"> <div class="card-body"> <div class="col-sm-6"> <div class="row mb-3"> <div class="col-md-6"> <label for="invoices"><b>Warehouse Name</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $wrow['warehouse_name'];?> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="whnumber"><b>Warehouse ID</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $alist['warehouse_id'];?> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="whnumber"><b>Quotation ID</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $alist['quotation_id'];?> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="whname"><b>Request Type</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $alist['request_type'];?> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="invoices"><b>Customer Name</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $urow['first_name'];?> <?php echo $urow['last_name'];?> </div> </div> <!-- <div class="col-md-3 pl-4 justify-content-end"> <div class="d-flex flex-row mb-3"> <label for="whnumber"><b>Quotation ID</b></label> <span> <?php echo $alist['quotation_id'];?></span> </div> </div> --> </div> <div class="col-sm-6 mb-5 pb-4"> <div class="row mb-3"> <div class="col-md-6"> <label for="invoices"><b>Customer Type</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $urow['role_id']==3?'Individual':'Business';?> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="customer"><b>Price</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $alist['price'];?> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="whname"><b>Date</b></label> </div> <div class="col-md-6 text-capitalize"> : <input type="text" style="border:none" class="datePicker w-50" id="datePicker" value="<?php echo $alist['date'];?>"> <label for="datePicker"> <span><img src="./images/calendar.png" alt="date"></span></label> <!-- <span><i title="Active" class="fa fa-check-circle text-primary ml-2 updateAsn" aria-hidden="true" style="font-size:19px ;"></i></span> --> </div> </div> <div class="row mb-3"> <div class="col-md-6"> <label for="whname"><b>Created By</b></label> </div> <div class="col-md-6 text-capitalize"> : <?php echo $crow['first_name'];?> <?php echo $crow['last_name'];?> </div> </div> </div> <div class="mt-5"> <table class="table table-bordered table_body text-center mt-4"> <thead class="theadcolor"> <tr> <th> Item Code</th> <th>Item Description</th> <th>Qty</th> <th>Reference Number</th> <th>Cost</th> <th>Pallet Number</th> </tr> </thead> <tbody> <?php $query1="SELECT * FROM uflexit_mini_goods_track WHERE asn_no='".$_REQUEST['asn_id']."'"; $alist_goods=$wareHouseAdminObj->db->get_results($query1); // print_r($alist_goods); foreach ($alist_goods as $glist) { ?> <tr> <td><?php echo $glist['item_code'];?></td> <td><?php echo $glist['item_description'];?></td> <td><?php echo $glist['item_quantity'];?></td> <td><?php echo $glist['ref_number'];?></td> <td><?php echo $glist['price'];?></td> <td><?php echo $glist['pallet_space_num'];?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> <?php include("footer.php"); ?> <script> $=jQuery; var date; $(document).ready(function(){ $('#datePicker').datetimepicker({ format: 'YYYY-MM-DD', minDate:new Date(), }).on('dp.change',function(e){ var quotationId=<?php echo $alist['quotation_id'] ?>; date= jQuery('#datePicker').val() $.ajax(({ url:'ajax.php', type:'post', data:({action:"updateShipmentStatus", dateVal:date, quotationid:quotationId }), success:function(response){ var data=JSON.parse(response) alert("Shipment Status Updated Succuessfully for Quotation Id "+data.result.quotation_id) } })) }); }) jQuery('.updateAsn').click(function(){ alert("hello") }) // jQuery('#datePicker').click(function(){ // // alert("hello") // }) </script>