<?php
require "./Cart.php";

if (!empty($approved)) {
     $ON = $approved;
     $act = 'approved';
     mysql_query("UPDATE Orders SET OrderStatus = '$act' WHERE OrderNumber = $ON");
}
if (!empty($denied)) {
     $ON = $denied;
     $act = 'denied';
     mysql_query("UPDATE Orders SET OrderStatus = '$act' WHERE OrderNumber = $ON");
}
if (!empty($deleted)) {
     $ON = $deleted;
     $act = 'deleted';
     mysql_query("DELETE FROM Orders WHERE OrderNumber = $ON");
     mysql_query("DELETE FROM Receipts WHERE OrderNumber = $ON");
}

adminHeader('','');

echo "Order Number $ON has been $act";

if (empty($deleted)) {
     echo "<br>You can mail Buyer about<br>Enter mail text:<br>";
     echo "<form method=\"post\" action=\"$PHP_SELF?topic=processMail.php\">";
     echo "<input type=\"hidden\" name=\"ON\" value=\"$ON\">";
     echo '<textarea name="text" rows="10" cols="60">'.$MailHeader.'</textarea><br><br>';
     echo '<input type="submit" name="mail" value=" Mail ">';
     echo '</form>';
}

adminFooter($Relative);
?>
