buycar_showdd.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. if(!defined('InEmpireCMS'))
  3. {
  4. exit();
  5. }
  6. ?>
  7. <?php
  8. $record="!";
  9. $field="|";
  10. $totalmoney=0;
  11. $totalfen=0;
  12. $buycarr=explode($record,$buycar);
  13. $bcount=count($buycarr);
  14. ?>
  15. <table width="100%" border=0 align=center cellpadding=3 cellspacing=1>
  16. <tr class="header">
  17. <td width="9%" height=23><div align=center>序号</div></td>
  18. <td width="43%"><div align=center>商品名称</div></td>
  19. <td width="19%"><div align=center>单价</div></td>
  20. <td width="10%"><div align=center>数量</div></td>
  21. <td width="19%"><div align=center>小计</div></td>
  22. </tr>
  23. <?php
  24. $j=0;
  25. for($i=0;$i<$bcount-1;$i++)
  26. {
  27. $j++;
  28. $pr=explode($field,$buycarr[$i]);
  29. $productid=$pr[1];
  30. $fr=explode(",",$pr[1]);
  31. //ID
  32. $classid=(int)$fr[0];
  33. $id=(int)$fr[1];
  34. //属性
  35. $addatt='';
  36. if($pr[2])
  37. {
  38. $addatt=$pr[2];
  39. }
  40. //数量
  41. $pnum=(int)$pr[3];
  42. if($pnum<1)
  43. {
  44. $pnum=1;
  45. }
  46. //单价
  47. $price=$pr[4];
  48. $thistotal=$price*$pnum;
  49. $buyfen=$pr[5];
  50. $thistotalfen=$buyfen*$pnum;
  51. if($payby==1)
  52. {
  53. $showprice=$buyfen." 点";
  54. $showthistotal=$thistotalfen." 点";
  55. }
  56. else
  57. {
  58. $showprice=$price." 元";
  59. $showthistotal=$thistotal." 元";
  60. }
  61. //产品名称
  62. $title=stripSlashes($pr[6]);
  63. //返回链接
  64. $titleurl="../../public/InfoUrl/?classid=$classid&id=$id";
  65. $totalmoney+=$thistotal;
  66. $totalfen+=$thistotalfen;
  67. ?>
  68. <tr>
  69. <td align="center"><?=$j?></td>
  70. <td align="center"><a href="<?=$titleurl?>" target="_blank"><?=$title?></a><?=$addatt?' - '.$addatt:''?></td>
  71. <td align="right"><b>¥<?=$showprice?></b></td>
  72. <td align="right"><?=$pnum?></td>
  73. <td align="right"><?=$showthistotal?></td>
  74. </tr>
  75. <?php
  76. }
  77. ?>
  78. <?php
  79. if($payby==1)//点数付费
  80. {
  81. ?>
  82. <tr>
  83. <td colspan=5><div align=right>合计点数:<strong><?=$totalfen?></strong></div></td>
  84. <td>&nbsp;</td>
  85. </tr>
  86. <?php
  87. }
  88. else
  89. {
  90. ?>
  91. <tr>
  92. <td colspan=5><div align=right>合计:<strong>¥<?=$totalmoney?></strong></div></td>
  93. <td>&nbsp;</td>
  94. </tr>
  95. <?php
  96. }
  97. ?>
  98. </table>