?? order.php
字號:
<?require("Cart.php");DBInfo();Root();Brand();mysql_connect("$DBHost","$DBUser","$DBPass");if ($Name == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your NAME. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}if ($BuyAddress1 == "" OR $BuyCity == "" OR $BuyState == "" OR $BuyZip == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your ADDRESS. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}if ($BuyEmail == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your E-MAIL ADDRESS. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}if ($DayPhone == "" AND $EvePhone == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your PHONE NUMBER. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}if ($PayMethod == "Credit" AND $CCType == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your CREDIT CARD TYPE. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}if ($PayMethod == "Credit" AND $CCNum == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your CREDIT CARD NUMBER. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}if ($PayMethod == "Credit" AND $CCExpire == "") {Brand();commonHeader("$Company","Oops...");fontSize("+1","blue","Arial","<b>You forgot to tell me your CREDIT CARD EXPIRATION DATE. Please go back and complete the order form.");commonFooter($Relative,$UserID);exit;}mysql("$DBName","INSERT INTO Buyers VALUES ('$Name','$BuyAddress1','$BuyAddress2','$BuyCity','$BuyState','$BuyZip','$BuyEmail','$DayPhone','$EvePhone','$Contact','$PayMethod','$CCType','$CCNum','$CCExpire','$OrderTotal','$Date','$OrderNumber','$UserID','$BuyerID')");$result=mysql("$DBName","SELECT BuyerID FROM Buyers WHERE UserID='$UserID' AND Date='$Date' AND Name='$Name'");while ($row=mysql_fetch_row($result)) {$BID=$row[0];}mysql("$DBName","INSERT INTO Orders VALUES ('$BID','$UserID','$Date','$OrderTotal','$OrderNumber')");$result=mysql("$DBName","SELECT OrderNumber FROM Orders WHERE UserID='$UserID' AND Date='$Date' AND BuyerID='$BID'");while ($row=mysql_fetch_row($result)) {$ONu=$row[0];}mysql("$DBName","UPDATE Buyers SET OrderNumber='$ONu' WHERE BuyerID='$BID'");$result=mysql( "$DBName", "SELECT * FROM CartItems WHERE UserID='$UserID'");while ($row = mysql_fetch_row($result)) {$CUI=$row[0];$CII=$row[1];$CIQ=$row[2];$CDa=$row[3];$CCI=$row[4]; $result2=mysql( "$DBName", "SELECT * FROM Items WHERE ItemID='$CII'"); while ($row2=mysql_fetch_row($result2)) { $IIS=$row2[0]; $IIN=$row2[1]; $IID=$row2[2]; $IIC=$row2[3]; $ICa=$row2[4]; $ISC=$row2[5]; $III=$row2[6];$To[$i]=(($CIQ * $IIC)+($CIQ * $ISC));mysql("$DBName","INSERT INTO Receipts VALUES ('$BID','$UserID','$ONu','$Date','$III','$IIS','$IIN','$IIC','$ISC','$CIQ','$To[$i]')");$i++; }}mysql("$DBName","DELETE FROM CartItems WHERE UserID='$UserID'");mysql("$DBName","DELETE FROM Users WHERE User='$UserID'");$result=mysql( "$DBName", "SELECT * FROM Buyers WHERE BuyerID='$BID'");while ($row=mysql_fetch_row($result)) {$BNa=$row[0];$BA1=$row[1];$BA2=$row[2];$BCi=$row[3];$BSt=$row[4];$BZi=$row[5];$BEm=$row[6];$BDP=$row[7];$BEP=$row[8];$BCo=$row[9];$BPM=$row[10];$BCT=$row[11];$BCN=$row[12];$BCE=$row[13];$BOT=$row[14];$BDa=$row[15];$BON=$row[16];$BUI=$row[17];$BBI=$row[17];}if ($BCo == "1") {$BCo="Yes";} else {$BCo="No"; }$pieces=explode(":",$BDa);$part1="$BNa\n$BA1\n$BA2\n$BCi, $BSt $BZi\n$BEm\n\nDaytime Phone: $BDP\nEvening Phone: $BEP\n\nContact Before Placing Order? $BCo\n\nPay Via: $BPM\nCC Type: $BCT\n$CC Number: $BCN\nCC Expires: $BCE\n\nDate: $pieces[2]\n\n";$result=mysql( "$DBName","SELECT * FROM Receipts WHERE BuyerID='$BID' AND OrderNumber='$ONu'");while ($row=mysql_fetch_row($result)) {$RBI=$row[0];$RUI=$row[1];$RON=$row[2];$RDa=$row[3];$RII=$row[4];$RIS=$row[5];$RIN=$row[6];$RIC=$row[7];$RSC=$row[8];$RIQ=$row[9];$RTC=$row[10];if ($RSC == "0.00") {$ES="1";$RSC = "$NoShipping"; }$total=$total+$RTC;$part2=$part2."SKU: $RIS\nItem Name: $RIN\nCost: $$RIC\nShipping Cost: $$RSC\nQuantity: $RIQ\nTotal Cost: $$RTC\n\n";}if ($ES == "1") {$part3="TOTAL: $$total Plus Shipping\n\n";} else {$part3="TOTAL: $$total\n\n"; }$footer="This order was automatically generated from your web site.\n\n";mail("$Email","Web Site Order","$part1$part2$part3$footer","From: $BEm");Header("Location: $Relative/receipt.php?BI=$BID&ON=$ONu&PM=$PayMethod&CT=$CCType&Co=$Contact&UID=$UserID");?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -