<?php include("config/database.php"); $order_id = $_POST['order_id']; $receipt_id = $_POST['receipt_id']; $quiqueCode = $_POST['quiqueCode']; $unique_code = implode('$',$quiqueCode); foreach($quiqueCode as $qC) { $ubarcode = intval($qC); mysqli_query($cn,"update `tbl_barcode` SET `status`=1 where `ubarcode`='$ubarcode'"); } if($order_id==0){ mysqli_query($cn,"update `tbl_order` SET `status`=5, `unique_code`='".$unique_code."', `dispatch_date`=Now() where `receipt_id`='$receipt_id'"); }else{ mysqli_query($cn,"update `tbl_order` SET `status`=5, `unique_code`='".$unique_code."', `dispatch_date`=Now() where `order_id`='$order_id'"); } header("location:home.php?pages=dispatchOrder"); ?>