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

WEB Mail

Development Platform:

PHP

  1. //script valide
  2. <?
  3. session_start();
  4. include("page_haut.inc");
  5. include "configuration.php";
  6. require ("xml_domit_parser.php");
  7. require ("xml_domit_utilities.php");
  8. require ("xml_domit_nodemaps.php"); 
  9. $expire="$carteexpire"."/"."$mois"."/"."$annee";
  10. $split = explode(",",$list);
  11. foreach ($split as $item) {
  12. $check = explode("+",$item);
  13. $cl=& new DOMIT_Document();
  14. $suces=$cl->loadXML("./modules/client/admin/modules/administration/clients.xml");
  15. $comp=count($cl->documentElement->childNodes);
  16. for($j=0;$j<$comp;$j++){
  17. $curtcl =& $cl->documentElement->childNodes[$j];
  18.          $clientid=$curtcl->childNodes[0]->firstChild->nodeValue;
  19. if($clientid==$clid){
  20. $clientnom=$curtcl->childNodes[1]->firstChild->nodeValue;
  21. $clientvl=$curtcl->childNodes[3]->firstChild->nodeValue;
  22. $clientpa=$curtcl->childNodes[4]->firstChild->nodeValue;
  23. $clientadr=$curtcl->childNodes[5]->firstChild->nodeValue;
  24. $clienttel=$curtcl->childNodes[6]->firstChild->nodeValue;
  25. $clientmail=$curtcl->childNodes[7]->firstChild->nodeValue;
  26.      }
  27.  }
  28.                $prd=& new DOMIT_Document();
  29.               $success=$prd->loadXML("./modules/client/admin/modules/administration/produits.xml");
  30.               
  31.              $cmp = count($prd->documentElement->childNodes);
  32. for ($i = 0; $i < $cmp; $i++) {
  33. $currentprd =& $prd->documentElement->childNodes[$i];
  34.         $prdid=$currentprd->childNodes[0]->firstChild->nodeValue;
  35.             if($prdid==$check[0]){
  36.                  $prdnom=$currentprd->childNodes[1]->firstChild->nodeValue; 
  37.                  $prdphoto=$currentprd->childNodes[8]->firstChild->nodeValue;
  38.                   $prdprix=$currentprd->childNodes[2]->firstChild->nodeValue;
  39.                   $prdfrais=$currentprd->childNodes[6]->firstChild->nodeValue;
  40. $price = $prdprix * $check[1];
  41. $price = sprintf("%0.3f", $price);
  42.                   
  43. if (!IsSet($total)) {
  44. $total = 0;
  45. }
  46. $total = $total + $price;
  47. $total = sprintf("%0.3f", $total);
  48. if (!IsSet($order)) {
  49. $order = "$check[1] x $prdnom";
  50.                   $quantite = $check[1];
  51. } else {
  52. $order = "$order,; $check[1] x $prdnom";
  53.                         $quantite = ($order + $check[1]);
  54. }
  55. }
  56. }
  57. $price = $total;
  58.  }
  59. $date = date("j-m-y");
  60. $time=strftime("%H:%M:%S",time());
  61.  $cmd=& new DOMIT_Document();
  62.               $success=$cmd->loadXML("./modules/client/admin/modules/administration/commande.xml");
  63. $num = count($cmd->documentElement->childNodes);
  64. if($num==0)
  65. {
  66. $nb=0;
  67. }
  68. else{ $currentcmd =& $cmd->documentElement->childNodes[$num-1];
  69.         $cmdid=$currentcmd->childNodes[0]->firstChild->nodeValue;
  70. $nb=$cmdid+1;
  71. }
  72. $newnode=$cmd->createElement("commande");
  73. $cmd->documentElement->appendChild($newnode);
  74. $newchild=& $cmd->documentElement->lastChild;
  75. $newchild->appendChild($cmd->createElement("id"));
  76. $newchild->appendChild($cmd->createElement("articles"));
  77. $newchild->appendChild($cmd->createElement("qte"));
  78. $newchild->appendChild($cmd->createElement("prix"));
  79. $newchild->appendChild($cmd->createElement("nom"));
  80. $newchild->appendChild($cmd->createElement("adresse"));
  81. $newchild->appendChild($cmd->createElement("ville"));
  82. $newchild->appendChild($cmd->createElement("pays"));
  83. $newchild->appendChild($cmd->createElement("tel"));
  84. $newchild->appendChild($cmd->createElement("email"));
  85. $newchild->appendChild($cmd->createElement("typecarte"));
  86. $newchild->appendChild($cmd->createElement("titulaire"));
  87. $newchild->appendChild($cmd->createElement("carteexpire"));
  88. $newchild->appendChild($cmd->createElement("cartenumero"));
  89. $newchild->appendChild($cmd->createElement("comments"));
  90. $newchild->appendChild($cmd->createElement("active"));
  91. $newchild->appendChild($cmd->createElement("cmde"));
  92. $newchild->appendChild($cmd->createElement("hid"));
  93. $newtextnod=& $cmd->createTextNode($nb);
  94. $newtextnodee=& $cmd->createTextNode($order);
  95. $newtextnode=& $cmd->createTextNode($quantite);
  96. $newtextnode1=& $cmd->createTextNode($price);
  97. $newtextnode2=& $cmd->createTextNode($clientnom);
  98. $newtextnode3=& $cmd->createTextNode($clientadr);
  99. $newtextnode5=& $cmd->createTextNode($clientvl);
  100. $newtextnode6=& $cmd->createTextNode($clientpa);
  101. $newtextnode7=& $cmd->createTextNode($clienttel);
  102. $newtextnode9=& $cmd->createTextNode($clientmail);
  103. $newtextnode10=& $cmd->createTextNode($typecarte);
  104. $newtextnode11=& $cmd->createTextNode($titulaire);
  105. $newtextnode12=& $cmd->createTextNode($expire);
  106. $newtextnode13=& $cmd->createTextNode($cartenumero);
  107. $newtextnode14=& $cmd->createTextNode($comments);
  108. $newtextnode15=& $cmd->createTextNode($active);
  109. $newtextnode16=& $cmd->createTextNode($date);
  110. $newtextnode17=& $cmd->createTextNode($hid);
  111. $new=& $cmd->documentElement->lastChild;
  112. $idnew=& $new->firstChild;
  113. $articlesnew=& $idnew->nextSibling;
  114. $qtenew=& $articlesnew->nextSibling;
  115. $prixnew=& $qtenew->nextSibling;
  116. $nomnew=& $prixnew->nextSibling;
  117. $adressenew=& $nomnew->nextSibling;
  118. $villenew=& $adressenew->nextSibling;
  119. $paysnew=& $villenew->nextSibling;
  120. $telnew=& $paysnew->nextSibling;
  121. $emailnew=& $telnew->nextSibling;
  122. $typecartenew=& $emailnew->nextSibling;
  123. $titulairenew=& $typecartenew->nextSibling;
  124. $carteexpirenew=& $titulairenew->nextSibling;
  125. $cartenumeronew=& $carteexpirenew->nextSibling;
  126. $commentsnew=& $cartenumeronew->nextSibling;
  127. $activenew=& $commentsnew->nextSibling;
  128. $cmdenew=& $activenew->nextSibling;
  129. $hidnew=& $cmdenew->nextSibling;
  130. $idnew->appendChild($newtextnod);
  131. $articlesnew->appendChild($newtextnodee);
  132. $qtenew->appendChild($newtextnode);
  133. $prixnew->appendChild($newtextnode1);
  134. $nomnew->appendChild($newtextnode2);
  135. $adressenew->appendChild($newtextnode3);
  136. $villenew->appendChild($newtextnode5);
  137. $paysnew->appendChild($newtextnode6);
  138. $telnew->appendChild($newtextnode7);
  139. $emailnew->appendChild($newtextnode9);
  140. $typecartenew->appendChild($newtextnode10);
  141. $titulairenew->appendChild($newtextnode11);
  142. $carteexpirenew->appendChild($newtextnode12);
  143. $cartenumeronew->appendChild($newtextnode13);
  144. $commentsnew->appendChild($newtextnode14);
  145. $activenew->appendChild($newtextnode15);
  146. $cmdenew->appendChild($newtextnode16);
  147. $hidnew->appendChild($newtextnode17);
  148. $succes=& $cmd->saveXML("./modules/client/admin/modules/administration/commande.xml");
  149. $fichier = "./modules/client/admin/modules/administration/commande.xml";
  150.  $id_fichier = fopen($fichier, "rb");
  151.  $contenu = fread($id_fichier, filesize ($fichier));
  152. @fclose($fichier);
  153. @unlink ("./modules/client/admin/modules/administration/commande.xml");
  154. $f=fopen("./modules/client/admin/modules/administration/commande.xml","w");
  155. fputs($f,"<?xml version='1.0' encoding='ISO-8859-1' ?>r");
  156. fputs($f,$contenu);
  157. ?>
  158. <script>
  159. document.location='?m=client&a=clients&nom=<? echo $clientnom ?>&id=<? echo $nb; ?>';
  160. </script>