X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment.php;h=3f88a0175c4d59580f095c4990be782ee5588477;hb=2c0315bc77abc3c53b5891d2a8c5d4943fd27143;hp=8a761b189270068f34e948ad3f456d3eedfb368b;hpb=fd8f77de8bc10d40395990e3f8e96e0b4a186b46;p=platal.git diff --git a/modules/payment.php b/modules/payment.php index 8a761b1..3f88a01 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -93,15 +93,15 @@ class PaymentModule extends PLModule $page->assign('xorg_title','Polytechnique.org - Télépaiements'); // initialisation - $op = Env::get('op', 'select'); - $meth = new PayMethod(Env::getInt('methode', -1)); + $op = Env::v('op', 'select'); + $meth = new PayMethod(Env::i('methode', -1)); $pay = new Payment($ref); if($pay->flags->hasflag('old')){ $page->trig("La transaction selectionnée est périmée."); $pay = new Payment(); } - $val = Env::get('montant') != 0 ? Env::get('montant') : $pay->montant_def; + $val = Env::v('montant') != 0 ? Env::v('montant') : $pay->montant_def; if (($e = $pay->check($val)) !== true) { $page->trig($e); @@ -111,11 +111,11 @@ class PaymentModule extends PLModule $pay->init($val, $meth); $pay->prepareform($pay); } else { - $res = $globals->xdb->iterator("SELECT timestamp, montant + $res = XDB::iterator("SELECT timestamp, montant FROM paiement.transactions WHERE uid = {?} AND ref = {?} ORDER BY timestamp DESC", - Session::getInt('uid', -1), $ref); + S::v('uid', -1), $ref); if ($res->total()) $page->assign('transactions', $res); } @@ -127,7 +127,7 @@ class PaymentModule extends PLModule $page->assign('pay', $pay); $page->assign('evtlink', $pay->event()); - $page->assign('prefix',$globals->money->mpay_tprefix); + $page->assign('prefix', $globals->money->mpay_tprefix); } function handler_cyber_return(&$page, $uid = null) @@ -151,7 +151,7 @@ class PaymentModule extends PLModule $montant = "$champ201 $champ202"; /* on extrait les informations sur l'utilisateur */ - $res = $globals->xdb->query(" + $res = XDB::query(" SELECT a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET(a.flags,'femme') FROM auth_user_md5 AS a INNER JOIN aliases AS l ON (a.user_id=l.id AND type!='homonyme') @@ -167,7 +167,7 @@ class PaymentModule extends PLModule } echo ($ref = $matches[1]); - $res = $globals->xdb->query("SELECT mail,text,confirmation + $res = XDB::query("SELECT mail,text,confirmation FROM paiement.paiements WHERE id={?}", $ref); if (!list($conf_mail,$conf_title,$conf_text) = $res->fetchOneRow()) { cb_erreur("référence de commande inconnue"); @@ -175,7 +175,7 @@ class PaymentModule extends PLModule /* on extrait le code de retour */ if ($champ906 != "0000") { - $res = $globals->xdb->query("SELECT rcb.text,c.id,c.text + $res = XDB::query("SELECT rcb.text,c.id,c.text FROM paiement.codeRCB AS rcb LEFT JOIN paiement.codeC AS c ON rcb.codeC=c.id WHERE rcb.id='$champ906'"); @@ -187,7 +187,7 @@ class PaymentModule extends PLModule } /* on fait l'insertion en base de donnees */ - $globals->xdb->execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle) + XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle) VALUES ({?},{?},{?},{?},{?},{?})", $champ901, $uid, $ref, $champ200, $montant, $champ905); @@ -226,8 +226,6 @@ class PaymentModule extends PLModule function handler_paypal_return(&$page, $uid = null) { - global $globals; - $page->changeTpl('payment/retour_paypal.tpl'); require_once 'diogenes/diogenes.hermes.inc.php'; @@ -256,7 +254,7 @@ class PaymentModule extends PLModule } /* on extrait les informations sur l'utilisateur */ - $res = $globals->xdb->query(" + $res = XDB::query(" SELECT a.prenom,a.nom,a.promo,l.alias,FIND_IN_SET(a.flags,'femme') FROM auth_user_md5 AS a INNER JOIN aliases AS l ON (a.user_id=l.id AND type!='homonyme') @@ -271,14 +269,14 @@ class PaymentModule extends PLModule } $ref = $matches[1]; - $res = $globals->xdb->query("SELECT mail,text,confirmation + $res = XDB::query("SELECT mail,text,confirmation FROM paiement.paiements WHERE id={?}", $ref); if (!list($conf_mail,$conf_title,$conf_text) = $res->fetchOneRow()) { paypal_erreur("référence de commande inconnue"); } /* on fait l'insertion en base de donnees */ - $globals->xdb->execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle) + XDB::execute("INSERT INTO paiement.transactions (id,uid,ref,fullref,montant,cle) VALUES ({?},{?},{?},{?},{?},{?})", $no_transaction, $uid, $ref, $fullref, $montant, $clef);