SubmitOrder.php
9.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<?php
if(!defined('InEmpireCMS'))
{
exit();
}
?>
<?php
//顯示配送方式
function ShowPs($pid){
global $empire,$dbtbpre,$shoppr,$totalr;
$pid=(int)$pid;
$r=$empire->fetch1("select pid,pname,price,psay from {$dbtbpre}enewsshopps where pid='$pid' and isclose=0");
if(empty($r[pid]))
{
printerror('請選擇配送方式','',1,0,1);
}
$r['price']=ShopSys_PrePsTotal($r['pid'],$r['price'],$totalr['truetotalmoney'],$shoppr);
echo"<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>
<tr>
<td width='69%' height=25>
<strong>".$r[pname]."</strong>
</td>
<td width='31%'><strong>費用:¥".$r['price']."</strong></td>
</tr>
<tr>
<td colspan=2><table width='98%' border=0 align=right cellpadding=3 cellspacing=1><tr><td>".$r[psay]."</td></tr></table></td>
</tr>
</table>";
return $r['price'];
}
//顯示支付方式
function ShowPayfs($payfsid,$r,$price){
global $empire,$public_r,$dbtbpre,$totalr,$shoppr;
$payfsid=(int)$payfsid;
$add=$empire->fetch1("select payid,payname,payurl,paysay,userpay,userfen from {$dbtbpre}enewsshoppayfs where payid='$payfsid' and isclose=0");
if(empty($add[payid]))
{
printerror('請選擇支付方式','',1,0,1);
}
//總金額
$buyallmoney=$totalr['totalmoney']+$price-$totalr['pretotal'];
if($add[userfen]&&$r[fp])
{
printerror("FenNotFp","history.go(-1)",1);
}
//發票
if($r[fp])
{
$fptotal=($totalr['totalmoney']-$totalr['pretotal'])*($shoppr[fpnum]/100);
$afp="+發票費(".$fptotal.")";
$buyallmoney+=$fptotal;
}
$buyallfen=$totalr['totalfen']+$price;
$returntotal="採購總額(".$totalr['totalmoney'].")+配送費(".$price.")".$afp."-優惠(".$totalr['pretotal'].")=總額(<b>".$buyallmoney." 元</b>)";
$mytotal="結算總金額為:<b><font color=red>".$buyallmoney." 元</font></b> 全部";
//是否登陸
if($add[userfen]||$add[userpay])
{
if(!getcvar('mluserid'))
{
printerror("NotLoginTobuy","history.go(-1)",1);
}
$user=islogin();
//點數購買
if($add[userfen])
{
if($buyallfen>$user[userfen])
{
printerror("NotEnoughFenBuy","history.go(-1)",1);
}
$returntotal="採購總點數(".$totalr['totalfen'].")+配送點數費(".$price.")=總點數(<b>".$buyallfen." 點</b>)";
$mytotal="結算總點數為:<b><font color=red>".$buyallfen." 點</font></b> 全部";
}
else//扣除餘額
{
if($buyallmoney>$user[money])
{
printerror("NotEnoughMoneyBuy","history.go(-1)",1);
}
}
}
echo "<table width='100%' border=0 align=center cellpadding=3 cellspacing=1><tr><td>".$add[payname]."</td></tr></table>";
$return[0]=$returntotal;
$return[1]=$mytotal;
return $return;
}
?>
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN>
<html>
<head>
<meta http-equiv=Content-Type content=text/html; charset=utf-8>
<title>訂單確認</title>
<link href=../../data/images/css.css rel=stylesheet type=text/css>
</head>
<body>
<form action="../doaction.php" method="post" name="myorder" id="myorder">
<input type=hidden name=enews value=AddDd>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td height="27" bgcolor="#FFFFFF"><strong>訂單號:
<?=$ddno?>
<input name="ddno" type="hidden" id="ddno" value="<?=$ddno?>">
</strong></td>
</tr>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>選擇的商品</strong></td>
</tr>
<tr>
<td>
<?php
include('buycar/buycar_order.php');
$totalr=array();
$totalr['totalmoney']=$totalmoney;
$totalr['buytype']=$buytype;
$totalr['totalfen']=$totalfen;
//優惠碼
$prer=array();
$pretotal=0;
if($r['precode'])
{
$prer=ShopSys_GetPre($r['precode'],$totalr['totalmoney'],$user,$classids);
$pretotal=ShopSys_PreMoney($prer,$totalr['totalmoney']);
}
$totalr['pretotal']=$pretotal;
$totalr['truetotalmoney']=$totalr['totalmoney']-$pretotal;
?>
</td>
</tr>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>收貨人信息</strong></td>
</tr>
<tr>
<td><table width="100%%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="20%">真實姓名:</td>
<td width="80%">
<?=$r[truename]?>
<input name="truename" type="hidden" id="truename" value="<?=$r[truename]?>"> </td>
</tr>
<tr>
<td>OICQ:</td>
<td>
<?=$r[oicq]?>
<input name="oicq" type="hidden" id="oicq" value="<?=$r[oicq]?>"></td>
</tr>
<tr>
<td>MSN:</td>
<td>
<?=$r[msn]?>
<input name="msn" type="hidden" id="msn" value="<?=$r[msn]?>"></td>
</tr>
<tr>
<td>固定電話:</td>
<td>
<?=$r[mycall]?>
<input name="mycall" type="hidden" id="mycall" value="<?=$r[mycall]?>"> </td>
</tr>
<tr>
<td>移動電話:</td>
<td>
<?=$r[phone]?>
<input name="phone" type="hidden" id="phone" value="<?=$r[phone]?>"></td>
</tr>
<tr>
<td>聯繫郵箱:</td>
<td>
<?=$r[email]?>
<input name="email" type="hidden" id="email" value="<?=$r[email]?>"> </td>
</tr>
<tr>
<td>聯繫地址:</td>
<td>
<?=$r[address]?>
<input name="address" type="hidden" id="address" value="<?=$r[address]?>" size="60"> </td>
</tr>
<tr>
<td>郵編:</td>
<td>
<?=$r[zip]?>
<input name="zip" type="hidden" id="zip" value="<?=$r[zip]?>" size="8"> </td>
</tr>
<tr>
<td>周邊標誌建築:</td>
<td><?=$r[signbuild]?>
<input name="signbuild" type="hidden" id="signbuild" value="<?=$r[signbuild]?>" size="8"></td>
</tr>
<tr>
<td>最佳送貨時間:</td>
<td><?=$r[besttime]?>
<input name="besttime" type="hidden" id="besttime" value="<?=$r[besttime]?>" size="8"></td>
</tr>
<tr>
<td>備註:</td>
<td>
<?=nl2br($r[bz])?> <input name="bz" type="hidden" value="<?=$r[bz]?>" size="8"> </td>
</tr>
</table></td>
</tr>
<?php
if($shoppr['shoppsmust'])
{
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>選擇配送方式
<input name="psid" type="hidden" id="psid" value="<?=$r[psid]?>" size="8">
</strong></td>
</tr>
<tr>
<td height="27">
<?
$price=ShowPs($r[psid]);
?> </td>
</tr>
<?php
}
?>
<?php
if($shoppr['shoppayfsmust'])
{
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>選擇支付方式
<input name="payfsid" type="hidden" id="payfsid" value="<?=$r[payfsid]?>" size="8">
</strong></td>
</tr>
<tr>
<td height="27">
<?
$total=ShowPayfs($r[payfsid],$r,$price);
?> </td>
</tr>
<?php
}
?>
<?php
if($shoppr[havefp]&&$r[fp])
{
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>發票信息</strong></td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="20%">發票費用:</td>
<td width="80%"><?=$shoppr[fpnum]?>%</td>
</tr>
<tr>
<td>發票抬頭:</td>
<td><?=$r['fptt']?></td>
</tr>
<tr>
<td>發票名稱:</td>
<td><?=$r['fpname']?></td>
</tr>
</table>
<input name="fp" type="hidden" id="fp" value="<?=$r[fp]?>">
<input name="fptt" type="hidden" id="fptt" value="<?=$r[fptt]?>">
<input name="fpname" type="hidden" id="fpname" value="<?=$r[fpname]?>"> </td>
</tr>
<?php
}
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>優惠</strong></td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="20%">優惠碼:</td>
<td width="80%"><?=$prer[precode]?><input name="precode" type="hidden" id="precode" value="<?=$r[precode]?>"></td>
</tr>
<tr>
<td>優惠金額:</td>
<td><?=$pretotal?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>結算信息
</strong></td>
</tr>
<tr>
<td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td><div align="center"><?=$total[0]?></div></td>
</tr>
<tr>
<td><div align="center">
<?=$total[1]?>
</div></td>
</tr>
</table></td>
</tr>
<tr height=27>
<td><div align="center">
<input type="button" name="Submit3" value=" 上一步 " onclick="history.go(-1)">
<input type="submit" name="Submit" value=" 提交訂單 ">
</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
</body>
</html>