$champs['ville'] = $champsRecup['ville']; $champs['id_pays'] = $champsRecup['id_pays']; $champs['email'] = $champsRecup['email']; $champs['observation'] = $champsRecup['observation']; $champs['ref_clt1'] = $champsRecup['ref_clt1']; $champs['ref_clt2'] = $champsRecup['ref_clt2']; $champs['ref_clt3'] = $champsRecup['ref_clt3']; $champs['nom'] = $champsRecup['nom']; $champs['prenom'] = $champsRecup['prenom']; $champs['tel'] = $champsRecup['tel']; $champs['numero_devis'] = $champsRecup['numero_devis']; $champs['numero_facture'] = $champsRecup['numero_facture']; $champs['etat_paiement'] = $champsRecup['etat_paiement']; $champs['date_paiement'] = $champsRecup['date_paiement']; $champs['devise_facture'] = $champsRecup['devise_facture']; $champsRecup = $comptaFact->obtenir_details($_GET['id']); $i = 1; foreach ($champsRecup as $row) { $champs['id' . $i] = $row['id']; $champs['ref' . $i] = $row['ref']; $champs['designation' . $i] = $row['designation']; $champs['quantite' . $i] = $row['quantite']; $champs['pu' . $i] = $row['pu']; $i++; } $formulaire->setDefaults($champs); //$formulaire->setDefaults($champsRecup); $formulaire->addElement('hidden', 'id', $_GET['id']); } //detail devis $formulaire->addElement('header', '', 'Détail Devis');
<?php require_once dirname(__FILE__) . '/../../../sources/Afup/Bootstrap/Http.php'; require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Compta_Facture.php'; $comptaFact = new AFUP_Compta_Facture($bdd); $ref = trim(mcrypt_cbc(MCRYPT_TripleDES, 'PaiementFactureAFUP_AFUP', base64_decode(str_replace(' ', '+', urldecode($_GET['ref']))), MCRYPT_DECRYPT, '@PaiFact')); $facture = $comptaFact->obtenir($ref); if ($facture) { if (isset($_GET['action']) && $_GET['action'] == 'voir-pdf') { $comptaFact->genererFacture($facture['numero_facture']); } else { $details = $comptaFact->obtenir_details($ref); $prix = 0; foreach ($details as $d) { $prix += $d['quantite'] * $d['pu']; } require_once dirname(__FILE__) . '/../../../dependencies/paybox/payboxv2.inc'; $paybox = new PAYBOX(); $paybox->set_langue('FRA'); $paybox->set_site($conf->obtenir('paybox|site')); $paybox->set_rang($conf->obtenir('paybox|rang')); $paybox->set_identifiant('83166771'); $paybox->set_total($prix * 100); $paybox->set_cmd($facture['numero_facture']); $paybox->set_porteur($facture['email']); $paybox->set_effectue('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/paybox_effectue.php'); $paybox->set_refuse('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/paybox_refuse.php'); $paybox->set_annule('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/paybox_annule.php'); $paybox->set_erreur('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/paybox_erreur.php'); $paybox->set_wait(50000); $paybox->set_boutpi('Régler par carte');