/** * Affiche la liste de commandes * @return renvoie true si le tableau n'est pas vide */ function afficherListeCommandes() { //requete sql $fin_req = ""; if ($this->numclient) { $fin_req .= " AND numclient='{$this->numclient}'"; } if ($this->erreur_paiement) { $fin_req .= " AND erreur_paiement='{$this->erreur_paiement}'"; } if ($this->type_reg) { $fin_req .= " AND tpereg='{$this->type_reg}'"; } if ($this->date_du && $this->date_au) { $fin_req .= " AND hcrea BETWEEN {$this->date_du} AND {$this->date_au}"; } else { if ($this->date_du) { $fin_req .= " AND hcrea >= {$this->date_du}"; } else { if ($this->date_au) { $fin_req .= " AND hcrea <= {$this->date_au}"; } } } /*if ($this->formation) $result=mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE if_bo_com.numcom=if_bo_detail.numcom AND if_bo_detail.designation='Inscription formation' $fin_req ORDER BY hcrea DESC"); else $result=mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE etat $this->etat $fin_req AND if_bo_com.numcom=if_bo_detail.numcom ORDER BY hcrea DESC");*/ if ($this->formation) { $result = mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE if_bo_com.numcom=if_bo_detail.numcom AND if_bo_detail.designation='Inscription formation' {$fin_req} ORDER BY hcrea DESC"); } else { //$result=mysql_query("SELECT if_bo_com.numcom FROM if_bo_com,if_bo_detail WHERE etat $this->etat $fin_req AND if_bo_com.numcom=if_bo_detail.numcom ORDER BY hcrea DESC"); $result = mysql_query("SELECT if_bo_com.numcom FROM if_bo_com WHERE etat {$this->etat} {$fin_req} ORDER BY hcrea DESC"); } // echo "SELECT numcom FROM if_bo_com WHERE etat $this->etat $fin_req ORDER BY hcrea DESC"; while ($row = mysql_fetch_row($result)) { $uneCommande = new Commande(); $uneCommande->numcom = $row[0]; $uneCommande->infosCommande(); $this->commandes[] = $uneCommande; } if (count($this->commandes) >= 1) { return true; } }
</table> <?php } else { ?> Vous n'avez aucune commande en cours. <?php } //fin du else if ($nb_com) } else { if ($numcom) { //fin else if ($_SESSION['numclient'] && !$numcom) $voirCom = new Commande(); $voirCom->numcom = $numcom; $voirCom->infosCommande(); ?> <h2 class="supprmarge">Détail de la commande n° <?php echo $numcom; ?> <!--<?php echo $voirCom->numerop; ?> --> du <?php echo $voirCom->dcrea; ?> </h2> <strong>Etat : </strong><?php if ($voirCom->etat == "1") { echo "en attente de validation"; } else {
<? } else if($radioReg=="vi") { ?> <form action= 'index.php?id=<?=$id?>&cnx=<?=$cnx?>&pg_admin=<?=$pg_admin?>&spec=<?=$spec?>&numpage=<?=$numpage?>&numrub=<?=$numrub?>&numcateg=<?=$numcateg?>&numsscateg=<?=$numsscateg?>&cont=<?=$cont?>&lg=<?=$lg?>' method="post"> <input type ="hidden" name="action" value="<?=$action?>"> <input type ="hidden" name="radioReg" value="vi"> <? } else if($radioReg=="cb") { ?> <? if ($_SESSION['numcom']) { $laCom= new Commande(); $laCom->numclient=$_SESSION['numclient']; $laCom->numcom=$_SESSION['numcom']; if ($forma) {//Le client règle une formation suite au mail reçu par l'admin $laCom->infosCommande(); $montantCh=$laCom->montantTTC; } else {//Le client règle des docs (ouvrage,article, etc...) $numpays=$laCom->getNumPays(); $lePanier=new Panier(); $lePanier->numcom=$_SESSION['numcom']; $lePanier->pays=$numpays; $lePanier->infosPanier(); $laCom->montantHT=$lePanier->totalHT; $laCom->montantTTC=$lePanier->totalTTC; $laCom->fraisPort=$lePanier->fraisPort; $montantCh=$lePanier->totalTTC; } $laCom->etat="1"; $laCom->validerCommandeCB();