exit; } } /* Check that the "other account" has not expired */ switch ($EnteredBy) { case 'buyer': if (IsExpired($SellerID)) { $title = "Seller Account Expired"; include "header.php"; print "<h1>Unable to Process Trade</h1>\n \t\t\t<h4>Sorry.</h4>The system is unable to process the inputted trade, because: <p><h2>the identified seller account has expired.</h2><p>"; include "footer.php"; exit; } break; case 'seller': if (IsExpired($BuyerID)) { $title = "Buyer Account Expired"; include "header.php"; print "<h1>Unable to Process Trade</h1>\n \t\t\t<h4>Sorry.</h4>The system is unable to process the inputted trade, because: <p><h2>the identified buyer account has expired.</h2><p>"; include "footer.php"; exit; } } /* Check to ensure that neither account is restricted. If the entering account is suspended, deny the trade. Otherwise, look for a warning, and deny or allow the trade as appropriate */ switch ($EnteredBy) { case 'buyer': $BuyerStatus = AccountStatus($BuyerID); if ($BuyerStatus == 'Suspended' || $BuyerStatus == 'Suspended from Purchase') { $title = 'Account Restricted';
/* Check that the submitted accounts exist, and that the Amount field is numeric */ $SellerID["{$trade}"] = ExistsAccount($SellerID["{$trade}"]); $BuyerID["{$trade}"] = ExistsAccount($BuyerID["{$trade}"]); $Amount["{$trade}"] = MakeCurrency($Amount["{$trade}"]); /* Don't process if no data is entered, or if only partial data is submitted. Set the Result[] variable to contain a response to the user, as appropriate */ if (empty($SellerID["{$trade}"]) && empty($BuyerID["{$trade}"]) && empty($Description["{$trade}"]) && empty($Amount["{$trade}"])) { $Result["{$trade}"] = "No trade data entered."; } elseif (empty($SellerID["{$trade}"]) || empty($BuyerID["{$trade}"]) || empty($Description["{$trade}"]) || empty($Amount["{$trade}"])) { $Result["{$trade}"] = "Not processed. <em>Submitted Trade Data incomplete or contains invalid AccountID</em>."; } else { /* Check for expired accounts */ if (IsExpired($SellerID["{$trade}"])) { $Result["{$trade}"] = "Not Processed. <em>The Seller account has expired</em>."; } elseif (IsExpired($BuyerID["{$trade}"])) { $Result["{$trade}"] = "Not Processed. <em>The Buyer account has expired</em>."; } elseif (AccountStatus($BuyerID["{$trade}"]) == 'Suspended' || AccountStatus($BuyerID["{$trade}"]) == 'Suspended from Buy') { if (WasWarned($SellerID["{$trade}"], $BuyerID["{$trade}"], 'Suspension')) { $Result["{$trade}"] = "Not Processed. <em>Buyer Account is under suspension and Seller has received a previous warning</em>."; } } elseif (AccountStatus($SellerID["{$trade}"]) == 'Suspended' || AccountStatus($SellerID["{$trade}"]) == 'Suspended from Sale') { if (WasWarned($BuyerID["{$trade}"], $SellerID["{$trade}"], 'Suspension')) { $Result["{$trade}"] = "Not Processed. <em>Seller Account is under suspension and Buyer has received a previous warning</em>."; } } elseif (BuyerOverLimit($BuyerID["{$trade}"], $Amount["{$trade}"])) { if (WasWarned($SellerID["{$trade}"], $BuyerID["{$trade}"], 'Over Limit')) { $Result["{$trade}"] = "Not Processed. <em>Buyer Account is over limit and Seller has received a previous warning</em>."; } } elseif (SellerOverLimit($SellerID["{$trade}"], $Amount["{$trade}"])) { if (WasWarned($BuyerID["{$trade}"], $SellerID["{$trade}"], 'Over Limit')) {