SubmitOrder.php 9.1 KB

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