caddie.php
Upload User: feiyaoda
Upload Date: 2016-11-21
Package Size: 9556k
Code Size: 6k
Category:

WEB Mail

Development Platform:

PHP

  1. //script caddie
  2. <?
  3. include "configuration.php";
  4. include "page_haut.inc";
  5. require ("xml_domit_parser.php");
  6. require ("xml_domit_utilities.php");
  7. require ("xml_domit_nodemaps.php");
  8. echo"<br><br>";
  9. ?>
  10. <table  width="90%" cellpadding="1" cellspacing="1" >
  11. <tr><td><img src="./images/panier.png"></td></tr>
  12. <tr><td>&nbsp;</td></tr>
  13. </table>
  14. <?
  15. if (!session_is_registered('list')) {
  16. echo "<font class='moyen' color='#6F9AC4' >Vous n'avez pas de produits dans votre caddie!</font>";
  17. ?>
  18. <table width="50%">
  19. <tr><td>&nbsp;</td></tr>
  20. <tr><td align=left><input type=button class=button12 value="Voir promos" Onclick="document.location='?m=client&a=promos'"></td>
  21. <td align=right ><input type=button class=button12 value="Voir catalogue" onclick="document.location='?m=client&a=catalogue'">
  22. </tr></table>
  23. <?
  24. } else {
  25. if ($list == "") {
  26. echo  "<font class='moyen' color='#6F9AC4'> Vous n'avez pas de produits dans votre caddie!</font>";
  27. ?>
  28. <table width="50%">
  29. <tr><td>&nbsp;</td></tr>
  30. <tr><td align=left><input type=button class=button12 value="Voir promos" onclick="document.location='?m=client&a=promos'"></td>
  31. <td align=right ><input type=button class=button12 value="Voir catalogue" onclick="document.location='?m=client&a=catalogue'">
  32. </tr></table>
  33. <?
  34. include "page_bas.inc";
  35. } else {
  36. echo "<center><font color=navy><b>Votre Caddie contient</b></font></center>
  37. <table><tr><td>&nbsp;</td></tr></table>";
  38. echo "<table  border="1" bordercolordark="white" bordercolorlight="black" width="90%" cellspacing="0">";
  39. echo "<tr class=entete>";
  40. echo "<td><center><font color=black>Articles</center></font></td>";
  41. echo "<td><center><font color=black>Photo</center></font></td>";
  42. echo "<td><center><font color=black>Qte</center></font></td>";
  43. echo "<td><center><font color=black>Prix</center></font></td>";
  44. echo "<td><center><font color=black>Frais</center></font></td>";
  45. echo "<td><center><font color=black>Total HT</center></font></td>";
  46. echo "<td><center><font color=black>Total TTC</center></font></td>";
  47. echo "<td>&nbsp;</td>";
  48. $split = explode(",",$list);
  49. foreach ($split as $item) {
  50. $check = explode("+",$item);
  51. $prd=& new DOMIT_Document();
  52.               $success=$prd->loadXML("./modules/client/admin/modules/administration/produits.xml");
  53.               
  54.              $comp = count($prd->documentElement->childNodes);
  55.          for($i=0;$i<$comp;$i++){
  56.             $currentprd =& $prd->documentElement->childNodes[$i];
  57.     $prdid=$currentprd->childNodes[0]->firstChild->nodeValue;
  58. if($prdid==$check[0]){
  59.                $prdnom=$currentprd->childNodes[1]->firstChild->nodeValue;
  60.                $prdphoto=$currentprd->childNodes[8]->firstChild->nodeValue;
  61.                $prdan=$currentprd->childNodes[5]->firstChild->nodeValue;
  62.                $prdprix=$currentprd->childNodes[2]->firstChild->nodeValue;
  63.                $prdfrais=$currentprd->childNodes[6]->firstChild->nodeValue;
  64. echo "</tr><tr>";
  65. echo "<td><center><b>$prdnom</b></center></td>";
  66. $split = explode("../", $prdphoto);
  67. $prdphoto = $split[1];
  68. $img = "<img src="./modules/client/$prdphoto" border="0" width='60'hight='72'>";
  69.                   echo "<td><center>$img</center></td>";
  70. echo "<td><center><form action='?m=client&a=quantite' method='post' target='_self'>
  71. <input type='hidden' value='$check[0]' name='id'>
  72. <input type='text' size='3' name='montant' value='$check[1]'><input class=button1 type='submit' value='ok'></form><br>
  73. </td>";
  74. $frais = $prdfrais;
  75.                   $fraisx = $frais * $check[1];
  76. $fraisx1 = sprintf("%0.3f", $fraisx);
  77. $price = ($prdprix +  $prdfrais) * $check[1];
  78. $price = sprintf("%0.3f", $price);
  79.                   $prixht = $price / $tva;
  80.                   $prixht2 = sprintf("%0.3f", $prixht);
  81. $totalgeneral1 = ($price +  $prdfrais);
  82. $prixunit = $prdprix;
  83. $prixunit = sprintf("%0.3f", $prixunit);
  84. echo "<td align="center"><font class=petit><b>$prixunit</b></td>";
  85. echo "<td align="center"><font class=petit><b>$fraisx1</b></td>";
  86. echo "<td align="center"><b>$prixht2</b></td>";
  87.                   echo "<td align="center"><b>$price</b></td>";
  88. echo "<td><center><a href='?m=client&a=supprime&id=$check[0]' target='_self'><font class='petit'><font color='red'><b>Supprimer</b></font></a></td>";
  89. if (!IsSet($total)) {
  90. $total = 0;
  91. }
  92. $total = $total + $price;
  93. $total = sprintf("%0.2f", $total);
  94.                   $totalht = $total / $tva;
  95.                   $totalht2 = sprintf("%0.2f", $totalht);
  96. }
  97. }
  98. }
  99. echo "</tr><tr bgcolor=#f0f4f7>";
  100. echo "<td align="center"><center><form action="?m=client&a=newclient" method="post" target='_self'><input type="submit" class=button2 value="Commander"></td>";
  101. echo "<td align="right">&nbsp;</td>";
  102.             echo "<td align="right">&nbsp;</td>";
  103.             echo "<td align="right">&nbsp;</td>";
  104. echo "<td align="right">&nbsp;</td>";
  105. echo "<td align="center"><b>$totalht2</b></td>";
  106.             echo "<td align="center"><font class=grand><b>$total</b></font></td>";
  107.             echo "<td>&nbsp;</td>";
  108. echo "</tr><tr>";
  109. echo "<td align="right">&nbsp;</td>";
  110.             echo "<td align="right">&nbsp;</td>";
  111. echo "<td align="right">&nbsp;</td>";
  112.             echo "<td align="right">&nbsp;</td>";
  113. echo "<td align="right">&nbsp;</td>";
  114. echo "<td align="center">Total HT</td>";
  115.             echo "<td align="center">Total TTC</td>";
  116.             echo "<td>&nbsp;</td>";
  117. echo "</tr></tr></table></form>";
  118. ?>
  119. <table width="50%">
  120. <tr><td>&nbsp;</td></tr>
  121. <tr><td align=left><input type=button class=button12 value="Voir promos" Onclick="document.location='?m=client&a=promos'"></td>
  122. <td align=right ><input type=button class=button12 value="Voir catalogue" onclick="document.location='?m=client&a=catalogue'">
  123. </tr></table>
  124. <?
  125. include "page_bas.inc";
  126. }
  127. }
  128. ?>