<?php
include("../includes/database.php");
include("../functions/functions.php");
if(isset($_POST["send_buttonID"])){
$send_buttonID = mysqli_real_escape_string($con, $_POST["send_buttonID"]);
$send_custOrdrID = mysqli_real_escape_string($con, $_POST["send_custOrdrID"]);
$send_placedOn = mysqli_real_escape_string($con, $_POST["send_placedOn"]);
$mod_string = "checked";
$mod_string2 = "Complete";
$mod_string3 = "Delivered";
$fetch_invNo_qu = "select * from customer_orders where order_id = '$send_custOrdrID'";
$run_fetch_invNo_qu = mysqli_query($con, $fetch_invNo_qu);
$row_fetch_invNo_qu = mysqli_fetch_array($run_fetch_invNo_qu);
$fetch_invNo = $row_fetch_invNo_qu["invoice_no"];
$upd_Det_Query4 = "UPDATE assign_driver set order_status = '$mod_string3' where invoice_no = '$fetch_invNo'";
$run_Det_Query4 = mysqli_query($con, $upd_Det_Query4);
$upd_Det_Query3 = "UPDATE pending_orders set order_status = '$mod_string3' where invoice_no = '$fetch_invNo'";
$run_Det_Query3 = mysqli_query($con, $upd_Det_Query3);
$upd_Det_Query2 = "UPDATE customer_orders set order_status = '$mod_string2', order_date = '$send_placedOn' where order_id = '$send_custOrdrID'";
$run_Det_Query2 = mysqli_query($con, $upd_Det_Query2);
$upd_Det_Query = "UPDATE order_tracking set track_status = '$mod_string', present_time = NOW() where trackID = '$send_buttonID'";
$run_Det_Query = mysqli_query($con, $upd_Det_Query);
}
?>