Check that the trade is within credit limits */ if (OverLimit('$Cheque["AccountID"]', $Amount, 'Buyer')) { if (WasWarned("{$ToAccount}", "{$Cheque['AccountID']}", "")) { $title = 'Unable to Process'; include "header.php"; print "<h2>Insufficient Funds</h2>\nThe account on which this cheque was written, Account #{$Cheque['AccountID']}: {$Acct['AccountName']}, is extended beyond its credit limit, and members of Account #{$ToAccount} have received a previous warning about making sales to the chequing account. <p>\nRe-submission of this cheque is permitted once Account #{$Cheque['AccountID']}: {$Acct['AccountName']} has returned to within acceptable credit limits."; include "footer.php"; exit; } if (!empty($AdminType)) { mail(); } else { $SellerWarning = "<strong>WARNING: the Account from which you received this cheque, #{$Cheque['AccountID']}: {$Acct['AccountName']}, is over its limit"; } } $testseller = OverLimit($ToAccount, $Amount, 'Seller'); switch ($testseller) { case 1: $title = 'Unable to Process'; include "header.php"; print "<h2>Account Balance Too High</h2>\n\t\tYour account, number {$ToAccount}, has a balance that exceeds the permitted maximum. You cannot enter this cheque until your balance returns to within acceptable limits."; include "footer.php"; exit; break; case 2: $SellerOver = "<strong>WARNING:</strong>"; break; default: } // seems all is good. Now we can record the trade. include "recordtrade.php";
$ConfirmationWarning .= "<strong>WARNING: </strong>The seller account named in this transaction (Account #{$SellerID}) is currently over the credit limit.<strong> Future purchases from this account will not be permitted until such time as the account's balance is within acceptable levels.</strong><p>"; } break; case 'seller': switch (OverLimit($SellerID, $Amount, 'seller')) { case 1: $title = "Account Balance Too High"; include "header.php"; print "<h1>Trade not authorized</h1>\n\t\t Your account, <strong>(Account #{$SellerID})</strong>, has a balance that exceeds the maximum allowable level.<p>\n\t\t <em>Until you bring your balance within your permitted range, further purchase by this account are not permitted.</em>\n\t\t For information or advice on how to use the system to purchase goods and services, contact the <a href=\"mailto:{$SystemEmail}\">{$Systemname} Administrator</a>.<p>\n\t\t You may attempt to re-enter this trade when your balance has been brought to within acceptable limits."; include "footer.php"; exit; case 2: $ConfirmationWarning .= "<strong>WARNING: </strong> This trade puts your account balance above the maximum allowable level. <strong>Your account will be restricted from further sales until your balance is brought to within acceptable levels.</strong><p>"; default: } if (OverLimit($BuyerID, $Amount, 'buyer')) { if (WasWarned($SellerID, $BuyerID, 'Over Limit')) { $title = "Trade not authorized"; include "header.php"; print "<h1>Trade not authorized</h1>\n\t\t Account #{$BuyerID} has surpassed the maximum allowable credit. Database records show that <em>your account (#{$SellerID}) received a warning to this effect on <strong>{$WarningDate}.</strong></em><p>\n\t\t As you have received a previous warning about the current status of this account, entry of this trade is forbidden.<p>\n\t\t If you have cause to believe that this information is incorrect or invalid, please contact the <a href=\"mailto:{$SystemEmail}\">{$Systemname} Administrator</a>."; include "footer.php"; exit; } $ConfirmationWarning .= "<strong>WARNING: </strong>The buyer account named in this transaction (Account #{$BuyerID}) is currently over the credit limit.<strong> Future sales to this account will not be permitted until such time as the account's balance is within acceptable levels.</strong><p>"; } } /* Look up a Transaction ID. This is done by inserting a timestamp and the memberID into the transactionlookup table, then querying the table for transactionID based on those same details */ $transIDtime = time(); if (!mysql_query("INSERT INTO transidlookup\n \t\t VALUES ('','{$transIDtime}','{$MemberID}')")) {