📄 preorder.php
字号:
<?php
session_start();
?>
<html>
<head>
<title>InterShop-View Shopping Cart</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../style.css">
<script language=javascript>
function view(id)
{
var arg= "width=500,height=400,resizable=no,scrollbars=yes,status=0,top=0,left=0";
window.open ("itemdetail.php?ItemID="+ id ,"a",arg);
}
</script>
</head>
<body >
<form action="custtype.php" method="post" name="frmList">
<table width="500" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td valign="top" >
<?php
require("../dbcon.inc");
require("functions.php");
$items=$chkids;
$items=str_replace (",", "','", $items);
$wh=" and (activate=1 and ItemID in ('";
$wh .=$items."'))";
$sortby=" order by ItemName";
$totalRows = 0;
$stSQL ="select ItemID,ItemName,AuthName,";
$stSQL .="Price,Weight from tblBooks,";
$stSQL .=" tblauthors where tblBooks.AuthID";
$stSQL .="= tblauthors.AuthID ".$wh;
$stSQL.=$sortby;
// echo $stSQL;
$result = mysql_query($stSQL, $link);
$totalRows=mysql_num_rows($result);
?>
<table border="0" width="100%">
<tr><td align=left><h2>Your Shopping Cart
</h2></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="middle" valign="top" >
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="center">
<td width="5%" height="14" align="middle"><font face="Arial" color="#ff6600">No</td>
<td width="30%" height="14"><font face="Arial" color="#ff6600">Item Name</td>
<td width="10%" height="14"><font face="Arial" color="#ff6600">
Quantity</td>
<td width="10%" height="14"><font face="Arial" color="#ff6600">Price</td>
<td width="10%" height="14"><font face="Arial" color="#ff6600">Disc.%</td>
<td width="10%" height="14"><font face="Arial" color="#ff6600">Amount</td>
<td width="25%" height="14">
<div><font face="Arial" color="#ff6600">Author Name</div>
</td>
</tr>
<tr valign="top">
<td colspan="7" align="middle">
<hr noshade size="1">
</td>
</tr>
<?php
if($totalRows>0)
{
$No=1;
$amount=0;$totalamount=0;
$lsitems="";$weight=0;
while ($row = mysql_fetch_array ($result))
{
$itemid=$row["ItemID"];
$discount= ReturnDiscount($itemid);
$itemname=$row["ItemName"];
$authname=$row["AuthName"];
$qtty=$HTTP_POST_VARS{"txtqtty".$itemid};
$price=$row["Price"];
$weight=$row["Weight"];
$amount =$price*$qtty;
$amount -=$amount*$discount;
$totalamount +=$amount;
$lsitems .="(tensp".$No."=".$itemname.")(masp".$No."=".$itemid.")(qtty".$No."=".$qtty.")(discount".$No."=".$discount.")(weight".$No."=".$weight.")(price".$No."=".$price.")(amount".$No."=".$amount.")";
$No+=1;
?>
<tr valign="top">
<td align="middle">
<?=$No-1?>
</td>
<td >
<a href="javascript:view('<?=$itemid?>');">
<?=$itemname?>
</a></td>
<td align=center>
<?=$qtty?>
</td>
<td >
<?=$price?>
</td>
<td >
<?=$discount?>
</td>
<td >
<?=$amount?>
</td>
<td>
<?=$authname?>
</td>
</tr>
<?php
}
$lsitems="(No=".($No-1).")".$lsitems."()";
session_register("lsitems");
//echo $lsitems;
?>
<tr valign="top">
<td colspan="7" align="middle">
<hr noshade size="1">
</td>
</tr>
<tr valign="top">
<td colspan=7>
<table width="100%" border="0">
<tr>
<td width="5%"> </td>
<td width="30%" nowrap>
<input type=submit value="Continue" class=button>
<input type=hidden name="chkids" value="<?=$chkids?>">
<input type=button value="Back"
onlick="history.go(-1);" class=button>
</td>
<td width="10%" align=right>Total </td>
<td width="10%" align=right> Amount</td>
<td width="10%"> </td>
<td width="10%" height="14"><b><?=number_format($totalamount,2)?></b></td>
<td width="25%" height="14"> </td>
</tr>
</td>
</tr>
<?php
}
else{
?>
<tr valign="top">
<td width="5%" align="middle"> </td>
<td colspan=6 valign=center align="center"><b><font face="Arial" color="#FF0000">Oop!
There is not Items in your cart! please addto shopping cart at least one.</b></td>
</tr>
<tr valign="top">
<td width="5%" align="middle"> </td>
<td colspan=6 valign=center>
<input type=button value="Back" onlick="history.go(-1);" class=button>
</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -