?? index.php
字號:
<?php
require("../../class/connect.php");
include("../../class/config.php");
include("../../class/q_functions.php");
include("../../class/db_sql.php");
include("../../class/class.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//------------------顯示購物車
function ShowBuycar(){
global $empire,$class_r,$dbtbpre;
$buycar=getcvar('mybuycar');
$record="!";
$field="|";
$r=explode($record,$buycar);
$alltotal=0;
$return[0]=0;
$return[1]=0;
echo"<form name=form1 method=post action=../../enews/index.php>
<table width=100%% border=0 align=center cellpadding=3 cellspacing=1>
<input type=hidden name=enews value=EditBuycar>
<tr bgcolor=#698CC3>
<td width=17% height=20> <div align=center><font color=#FFFFFF>圖片</font></div></td>
<td width=28%> <div align=center><font color=#FFFFFF>商品名稱</font></div></td>
<td width=13%> <div align=center><font color=#FFFFFF>市場價格</font></div></td>
<td width=13%> <div align=center><font color=#FFFFFF>優惠價格</font></div></td>
<td width=8%> <div align=center><font color=#FFFFFF>數量</font></div></td>
<td width=16%> <div align=center><font color=#FFFFFF>小計</font></div></td>
<td width=5%> <div align=center><font color=#FFFFFF>刪除</font></div></td>
</tr>";
for($i=0;$i<count($r)-1;$i++)
{
$pr=explode($field,$r[$i]);
$productid=$pr[1];
$fr=explode(",",$pr[1]);
//ID
$classid=$fr[0];
$id=$fr[1];
//數量
$num=$pr[2];
if(empty($num))
{$num=1;}
//取得產品信息
$productr=$empire->fetch1("select title,tprice,price,titleurl,groupid,classid,newspath,filename,id,titlepic,buyfen from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where classid='$classid' and id='$id' limit 1");
//是否全部積分
if(!$productr[buyfen])
{
$return[0]=1;
}
$return[1]+=$productr[buyfen]*$num;
//產品圖片
if(empty($productr[titlepic]))
{$productr[titlepic]="../../data/images/notimg.gif";}
//返回鏈接
$titleurl=sys_ReturnBqTitleLink($productr);
$thistotal=$productr[price]*$num;
$alltotal+=$thistotal;
echo"<tr>
<td align=center><a href='".$titleurl."' target=_blank><img src='".$productr[titlepic]."' border=0 width=80 height=80></a></td>
<td align=center><a href='".$titleurl."' target=_blank>".$productr[title]."</a></td>
<td align=center>$".$productr[tprice]."</td>
<td align=center><b>$".$productr[price]."</b></td>
<td align=center><input type=text name=num[] value='".$num."' size=6></td>
<td align=center>".$thistotal."</td>
<td align=center><input type=checkbox name=del[] value='".$productid."'></td>
<input type=hidden name=productid[] value='".$productid."'></tr>";
}
//支付積分付費
if(!$return[0])
{
$a="<tr>
<td colspan=6><div align=right>合計積分:<strong>".$return[1]."</strong></div></td>
<td> </td>
</tr>";
}
echo"<tr>
<td colspan=6><div align=right>合計:<strong>$".$alltotal."</strong></div></td>
<td> </td>
</tr>".$a."
<tr>
<td colspan=7><div align=right><a href=../../enews?enews=ClearBuycar><img src=../../data/images/shop/clearbuycar.gif width=92 height=23 border=0></a>
<input name=imageField type=image src=../../data/images/shop/editbuycar.gif width=135 height=23 border=0>
<a href=javascript:window.close();><img src=../../data/images/shop/buynext.gif width=87 height=23 border=0></a> <a href=../order><img src=../../data/images/shop/buycarnext.gif width=87 height=19 border=0></a></div></td>
</tr>
</table>
</form>";
return $return;
}
?>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN>
<html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<title>我的購物車</title>
<link href=../../data/images/qcss.css rel=stylesheet type=text/css>
</head>
<body>
<?
ShowBuycar();
?>
</body>
</html>
<?
db_close();
$empire=null;
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -