<?php
include('../include/session.php');

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time()); 	

$saved_status=$_GET['saved_status'];
$status=$_GET['status_group'];
$order_no=$_GET['order_no'];

$table_name = $_SESSION['db_prefix']."_purchase";
$update_query = "UPDATE $table_name SET authorised = '".$status."' WHERE purchase_order = '".$order_no."' ";
execsql($update_query);


$table_name = $_SESSION['db_prefix']."_tracking_store";
$trackingQuery = "INSERT INTO $table_name (entry_date, user_name, action, details_1, details_2, details_3, details_4) VALUES ('".$entry_date."' ,'".$_SESSION['username']."', '187', '".$order_no."' ,'".$saved_status."','".$status."','' )";
$trackingResult = mySQL_query($trackingQuery);


?>

<script language="javascript" type="text/javascript">
          window.location="../store/void_purchase_order_list.php?date=";
</script>