<% session_start(); require("../gbl.php"); %> View Order Contents


<% if($session["orderid"] == 0){ echo("Your Shopping Cart is Empty!"); exit(); } $SQLStmt = "SELECT * FROM item WHERE OrderidA = " . $session["orderid"] . ";"; $conn = mysql_connect($host, $user, $password); $result = mysql_db_query($dbname, $SQLStmt, $conn); //Initialize variables for this application $thedate = date("n/j/y"); //get the date $thetime = date("g:i A"); //get the time $subtotal = 0; //the subtotal for a row of items $subweight = 0; //the subweight for a row of items $subsize = 0; //the subsize for a row of items %>box1.gif (3493 bytes)

<% while($row = mysql_fetch_object($result)){ %> <% //Calculate the individual totals for a row $lineitemweight = ($row->Weight * $row->Quantity); $subweight += $lineitemweight; $subsize = $subsize + $row->Size; $subtotal = (($row->Quantity) * ($row->Price)); $total = $subtotal; //need to format the above into some kind of currency format $grandtotal = $grandtotal + $subtotal; %> <% if(empty($row->Upsell) || $row->Upsell = ""){ $strdisplay = ""; echo($strdisplay); }else{ $strdisplay = ""; echo($strdisplay); } %> <% //end of while loop } %> <% //do whole order discount here if($TotalDiscount <> 0){ if($grandtotal > $StartDiscount){ $curgrandtotal = $grandtotal; $grandtotal = $grandtotal - ($grandtotal * ($TotalDiscount/100)); $D2flag = 1; } } %> <% //order button starts here if($grandtotal > 0){ %>
<% //end of if statement if(grandtotal >0) } %>
削除 商品番号 商品名 単価 TAX  
delete.gif (318 bytes)
Cut Item
<% echo $row->Item; %> <% echo $row->Description; %> <% echo number_format($row->Quantity,0); %>$ <% echo number_format($row->Price,2)%> <% //Do item Discount if($row->Discount > 0){ $itemdiscount = $row->Discount; $itemdiscount = number_format($itemdiscount,0); $strdisplay = " (" .$itemdiscount . "% off)"; echo($strdisplay); } %> $ <% echo number_format($total,2)%> <% echo $row->Taxed; %>"; $strdisplay = $strdisplay . ""; $strdisplay = $strdisplay . ""; $strdisplay = $strdisplay . "

Customer Comments:

合計 <% if($D2flag == 1){ echo("(Total was " . number_format($curgrandtotal,2) . " Discount of " . number_format($TotalDiscount,0) . "% Applied)"); } %> <% echo number_format($grandtotal,2);%>

 
<%if(mysql_num_rows($result) == 0){%>
お客様のカートは空です!
<%}else{ %> <% //end if else statement if(mysql_num_rows($result) == 0) } %>

Total Weight: <% echo $subweight; %>lbs.

Total Size: <% echo $subsize; %>cu. inches

Total: $ <% echo number_format($grandtotal,2); %>

Order ID:  <% echo $session["orderid"]; %>

Date:  <% echo $thedate; %>

Time:  <% echo $thetime; %>