?? checkout.php
字號:
<?$i=0;$j=0;require("Cart.php");DBinfo();Brand();Root();mysql_connect("$DBHost","$DBUser","$DBPass");if ($UID != "") {$result=mysql( "$DBName", "SELECT * FROM Users WHERE User='$UID'");$num=mysql_num_rows($result);if ($num == "0") {$dt=date( "YmdHis");$UID= "$dt$REMOTE_ADDR";$date=date( "z");mysql( "$DBName", "INSERT INTO Users VALUES ('$UID','$date')");Header( "Location: $PHP_SELF?UID=$UID");}}if ($UID == "") {$dt=date( "YmdHis");$UID= "$dt$REMOTE_ADDR";$date=date( "z");mysql( "$DBName", "INSERT INTO Users VALUES ('$UID','$date')");Header( "Location: $PHP_SELF?UID=$UID");}$result=mysql("$DBName","SELECT * FROM CartItems WHERE UserID='$UID'");$num=mysql_num_rows($result);if ($num == "0") {commonHeader("$Company","View the contents of your shopping cart");blueFont("Arial","Your shopping cart is empty <br><br>");} else {commonHeader("$Company","View the contents of your shopping cart");blueFont("Arial","Your shopping cart contains the following items:<br><br>");echo "<table border='1' cellpadding='5' cellspacing='5'><tr>";echo "<th>";redFont("Arial","Product Code");echo "</th>";echo "<th>";redFont("Arial","Product Name");echo "</th>";echo "<th>";redFont("Arial","Quantity");echo "</th>";echo "<th>";redFont("Arial","Cost");echo "</th>";echo "<th>";redFont("Arial","Shipping");echo "</th>";echo "<th>";redFont("Arial","Total");echo "</th>";echo "<th colspan='2'>";redFont("Arial","Add/Remove Items");echo "</th></tr>";$result=mysql("$DBName","SELECT * FROM CartItems WHERE UserID='$UID'");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));echo "<tr><td>";blueFont("Arial","$IIS");echo "</td><td>";blueFont("Arial","$IIN");echo "</td><td>";blueFont("Arial","$CIQ");echo "</td><td>";$IIC=number_format($IIC,"2",".","thousands_sep");blueFont("Arial","$$IIC");echo "</td><td>";if ($ISC == "0.00") {$ES="1";blueFont("Arial\" size=\"-2","$NoShipping");} else {$ISC=number_format($ISC,"2",".","thousands_sep");blueFont("Arial","$$ISC");}echo "</td><td>";$Tot=number_format($To[$i],"2",".","thousands_sep");blueFont("Arial","<b>$$Tot</b>");echo "<td valign=\"center\"><center>";echo "<FORM ACTION=\"$Relative/addQuantity.php\" METHOD=\"POST\">";echo "<input type=\"hidden\" name=\"CartItemsID\" value=\"$CCI\">";echo "<input type=\"hidden\" name=\"ItemName\" value=\"$IIN\">";echo "<input type=\"hidden\" name=\"UID\" value=\"$UID\">";echo "<input type=\"SUBMIT\" NAME=\"SUBMIT\" value=\"Add\">";echo "</center></td>";echo "</form>";echo "<td><center>";echo "<FORM ACTION=\"$Relative/removeItem.php\" METHOD=\"POST\">";echo "<input type=\"hidden\" name=\"CartItemsID\" value=\"$CCI\">";echo "<input type=\"hidden\" name=\"UID\" value=\"$UID\">";echo "<input type=\"SUBMIT\" NAME=\"SUBMIT\" value=\"Remove\">";echo "</center></td></tr>";echo "</form>";$i++; }}while ($j < $i) {$total=$total+$To[$j];$j++;}echo "<tr><td></td><td></td><td></td>";echo "<td colspan='2'>";redFont("Arial","<center><b><i>Total Cost: </i></b></center>");echo "<td>";$total=number_format($total,"2",".","thousands_sep");if ($ES == "1") {blueFont("Arial","<b><center>$$total</b>");blueFont("Arial\" size=\"-2"," Plus Shipping</center>");} elseif ($ES != "1") {blueFont("Arial","<b><center> $$total </center></b>"); }echo "<td colspan=\"2\"><center>";echo "<FORM ACTION=\"$Relative/emptyCart.php\" METHOD=\"POST\">";echo "<input type=\"hidden\" NAME=\"UID\" value=\"$UID\">";echo "<input type=\"SUBMIT\" NAME=\"SUBMIT\" value=\"Empty This Cart\">";echo "</center></td></tr></table>";echo "</form>";echo "<p>";fontSize("+1","blue","Arial","<b>Are you sure that you want to check out?</b><p>");echo "<form action=\"$Relative/userInfo.php\" method=\"post\"><input type=\"hidden\" name=\"UID\" value=\"$UID\"><input type=\"hidden\" name=\"OrderTotal\" value=\"$total\"><input type=\"submit\" value=\"YES\"></form><form action=\"$Relative/viewCart.php\" method=\"post\"><input type=\"hidden\" name=\"UID\" value=\"$UID\"><input type=\"submit\" value=\"NO\"></form>";}commonFooter($Relative,$UID);?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -