order.php
10.3 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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<?php
if(!defined('InEmpireCMS'))
{
exit();
}
?>
<?php
//顯示配送方式
function ShowPs(){
global $empire,$dbtbpre;
$sql=$empire->query("select pid,pname,price,psay,isdefault from {$dbtbpre}enewsshopps where isclose=0 order by pid");
$str='';
while($r=$empire->fetch($sql))
{
$checked=$r[isdefault]==1?' checked':'';
$str.="<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>
<tr>
<td width='69%' height=23>
<input type=radio name=psid value='".$r[pid]."'".$checked."><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 $str;
}
//顯示支付方式
function ShowPayfs($pr,$user){
global $empire,$dbtbpre;
$str='';
$sql=$empire->query("select payid,payname,payurl,paysay,userpay,userfen,isdefault from {$dbtbpre}enewsshoppayfs where isclose=0 order by payid");
while($r=$empire->fetch($sql))
{
$checked=$r[isdefault]==1?' checked':'';
$dis="";
$words="";
//扣點數
if($r[userfen])
{
if($pr['buytype'])
{
$dis=" disabled";
$words=" <font color='#666666'>(您選擇的商品至少有一個不支持點數購買)</font>";
}
else
{
if(getcvar('mluserid'))
{
if($user[userfen]<$pr['totalfen'])
{
$dis=" disabled";
$words=" <font color='#666666'>(您的帳號點數不足,不能使用此支付方式)</font>";
}
}
else
{
$dis=" disabled";
$words=" <font color='#666666'>(您未登錄,不能使用此支付方式)</font>";
}
}
}
//餘額扣除
elseif($r[userpay])
{
if(getcvar('mluserid'))
{
if($user[money]<$pr['totalmoney'])
{
$dis=" disabled";
$words=" <font color='#666666'>(您的帳號餘額不足,不能使用此支付方式)</font>";
}
}
else
{
$dis=" disabled";
$words=" <font color='#666666'>(您未登錄,不能使用此支付方式)</font>";
}
}
//網上支付
elseif($r[payurl])
{
$words="";
}
else
{}
$str.="<tr><td><b><input type=radio name=payfsid value='".$r[payid]."'".$checked."".$dis.">".$r[payname]."</b>".$words."</td></tr><tr><td><table width='98%' border=0 align=right cellpadding=3 cellspacing=1><tr><td>".$r[paysay]."</td></tr></table></td></tr>";
}
if($str)
{
$str="<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>".$str."</table>";
}
return $str;
}
//提交地址
if($shoppr['buystep']==0)
{
$formaction='../SubmitOrder/index.php';
$formconfirm='';
$formsubmit='<input type="submit" name="Submit" value=" 下一步 ">';
$enewshidden='';
$ddno='';
}
else
{
$formaction='../doaction.php';
$formconfirm=' onsubmit="return confirm(\'確認提交?\');"';
$formsubmit='<input type="submit" name="Submit" value=" 提交訂單 ">';
$enewshidden='<input type=hidden name=enews value=AddDd>';
$ddno=ShopSys_ReturnDdNo();//訂單ID
}
?>
<!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/qcss.css rel=stylesheet type=text/css>
</head>
<body>
<form action="<?=$formaction?>" method="post" name="myorder" id="myorder"<?=$formconfirm?>>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<?php
if($ddno)
{
?>
<tr>
<td height="27" bgcolor="#FFFFFF"><strong>訂單號:
<?=$ddno?>
<input name="ddno" type="hidden" id="ddno" value="<?=$ddno?>">
</strong></td>
</tr>
<?php
}
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>選擇的商品</strong> <?=$shoppr['buystep']!=2?'[<a href="../buycar/">修改購物車</a>]':''?></td>
</tr>
<tr>
<td>
<?php
include('buycar/buycar_order.php');
$pr=array();
$pr['totalmoney']=$totalmoney;
$pr['buytype']=$buytype;
$pr['totalfen']=$totalfen;
?>
</td>
</tr>
<tr>
<td height="23" bgcolor="#EFEFEF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><strong>收貨人信息</strong></td>
<td><div align="right">
<?php
if($user['userid'])
{
$addresssql=$empire->query("select addressid,addressname from {$dbtbpre}enewsshop_address where userid='$user[userid]'");
?>
<select name="addressid" id="addressid" onchange="window.location='index.php?addressid='+this.options[this.selectedIndex].value">
<option value="0">選擇預增加的配送地址</option>
<?php
while($chaddressr=$empire->fetch($addresssql))
{
?>
<option value="<?=$chaddressr['addressid']?>"<?=$chaddressr['addressid']==$addressid?' selected':''?>><?=$chaddressr['addressname']?></option>
<?php
}
?>
</select>
<?php
}
?>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="20%" height="25">真實姓名:</td>
<td width="80%"><input name="truename" type="text" id="truename" value="<?=$useraddr[truename]?>" size="65">
<?=stristr($shoppr['ddmust'],',truename,')?'*':''?></td>
</tr>
<tr>
<td height="25">固定電話:</td>
<td><input name="mycall" type="text" id="mycall" value="<?=$useraddr[mycall]?>" size="65">
<?=stristr($shoppr['ddmust'],',mycall,')?'*':''?></td>
</tr>
<tr>
<td height="25">手機:</td>
<td><input name="phone" type="text" id="phone" value="<?=$useraddr[phone]?>" size="65">
<?=stristr($shoppr['ddmust'],',phone,')?'*':''?></td>
</tr>
<tr>
<td height="25">聯繫郵箱:</td>
<td><input name="email" type="text" id="email" value="<?=$email?>" size="65">
<?=stristr($shoppr['ddmust'],',email,')?'*':''?></td>
</tr>
<tr>
<td height="25">OICQ:</td>
<td><input name="oicq" type="text" id="oicq" value="<?=$useraddr[oicq]?>" size="65">
<?=stristr($shoppr['ddmust'],',oicq,')?'*':''?></td>
</tr>
<tr>
<td height="25">MSN:</td>
<td><input name="msn" type="text" id="msn" value="<?=$useraddr[msn]?>" size="65">
<?=stristr($shoppr['ddmust'],',msn,')?'*':''?></td>
</tr>
<tr>
<td height="25">聯繫地址:</td>
<td><input name="address" type="text" id="address" value="<?=$useraddr[address]?>" size="65">
<?=stristr($shoppr['ddmust'],',address,')?'*':''?></td>
</tr>
<tr>
<td height="25">郵編:</td>
<td><input name="zip" type="text" id="zip" value="<?=$useraddr[zip]?>" size="65">
<?=stristr($shoppr['ddmust'],',zip,')?'*':''?></td>
</tr>
<tr>
<td height="25">周邊標誌建築:</td>
<td><input name="signbuild" type="text" id="signbuild" value="<?=$useraddr[signbuild]?>" size="65">
<?=stristr($shoppr['ddmust'],',signbuild,')?'*':''?></td>
</tr>
<tr>
<td height="25">最佳送貨時間:</td>
<td><input name="besttime" type="text" id="besttime" value="<?=$useraddr[besttime]?>" size="65">
<?=stristr($shoppr['ddmust'],',besttime,')?'*':''?></td>
</tr>
<tr>
<td height="25">備註:</td>
<td><textarea name="bz" cols="65" rows="6" id="bz"></textarea>
<?=stristr($shoppr['ddmust'],',bz,')?'*':''?></td>
</tr>
</table></td>
</tr>
<?php
if($shoppr['shoppsmust'])
{
$showps=ShowPs();
if($showps)
{
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>選擇配送方式</strong></td>
</tr>
<tr>
<td>
<?=$showps?> </td>
</tr>
<?php
}
}
?>
<?php
if($shoppr['shoppayfsmust'])
{
$showpayfs=ShowPayfs($pr,$user);
if($showpayfs)
{
?>
<tr>
<td height="23" bgcolor="#EFEFEF"><strong>選擇支付方式</strong></td>
</tr>
<tr>
<td>
<?=$showpayfs?> </td>
</tr>
<?php
}
}
?>
<?
//提供發票
if($shoppr[havefp])
{
?>
<tr>
<td height="23" bgcolor="#EFEFEF">是否需要發票:
<input name="fp" type="checkbox" id="fp" value="1">
是(需增加 <?=$shoppr[fpnum]?>% 的費用)</td>
</tr>
<tr>
<td height="23" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>發票抬頭:
<input name="fptt" type="text" id="fptt" size="38"></td>
</tr>
<tr>
<td>發票名稱:
<select name="fpname" id="fpname">
<?php
$fpnamer=explode("\r\n",$shoppr['fpname']);
$fncount=count($fpnamer);
for($i=0;$i<$fncount;$i++)
{
?>
<option value="<?=$fpnamer[$i]?>"><?=$fpnamer[$i]?></option>
<?php
}
?>
</select> </td>
</tr>
</table></td>
</tr>
<?
}
?>
<tr>
<td height="23" bgcolor="#EFEFEF">使用優惠碼</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="20%">優惠碼:</td>
<td width="80%"><input name="precode" type="text" id="precode" size="65"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="25">
<div align="center">
<?php
if($shoppr['buystep']!=2)
{
?>
<input type="button" name="Submit3" value=" 上一步 " onclick="history.go(-1)">
<?php
}
?>
<?=$formsubmit?>
<?=$enewshidden?>
<input name="alltotal" type="hidden" id="alltotal" value="<?=$pr['totalmoney']?>">
<input name="alltotalfen" type="hidden" id="alltotalfen" value="<?=$pr['totalfen']?>">
</div></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
</body>
</html>