X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fpayment%2Fmoney.inc.php;h=93c69cbb8fbd986a148c703de66a1abd96a204c5;hb=12262f1306059765d8625a6752364679c8625d31;hp=c38d1c305025bb66377c24427385a52605a32dfc;hpb=edfdbe40a2eb4cd9b576214613431b32975baf84;p=platal.git diff --git a/modules/payment/money.inc.php b/modules/payment/money.inc.php index c38d1c3..93c69cb 100644 --- a/modules/payment/money.inc.php +++ b/modules/payment/money.inc.php @@ -1,6 +1,6 @@ money->mpay_def_id : $ref; - $res = XDB::query("SELECT id, text, url, flags, mail, montant_min, montant_max, montant_def, asso_id - FROM {$globals->money->mpay_tprefix}paiements WHERE id={?}", $r); + $res = XDB::query("SELECT id, text, url, flags, mail, amount_min, amount_max, amount_def, asso_id + FROM payments WHERE id={?}", $r); list($this->id, $this->text, $this->url, $flags, $this->mail, - $this->montant_min, $this->montant_max, $this->montant_def, $this->asso_id) = $res->fetchOneRow(); + $this->amount_min, $this->amount_max, $this->amount_def, $this->asso_id) = $res->fetchOneRow(); - $this->montant_min = (float)$this->montant_min; - $this->montant_max = (float)$this->montant_max; + $this->amount_min = (float)$this->amount_min; + $this->amount_max = (float)$this->amount_max; $this->flags = new PlFlagSet($flags); } @@ -58,10 +58,10 @@ class Payment function check($value) { $v = (float)strtr($value, ',', '.'); - if ($this->montant_min > $v) { - return "Montant inférieur au minimum autorisé ({$this->montant_min})."; - } elseif ($v > $this->montant_max) { - return "Montant supérieur au maximum autorisé ({$this->montant_max})."; + if ($this->amount_min > $v) { + return "Montant inférieur au minimum autorisé ({$this->amount_min})."; + } elseif ($v > $this->amount_max) { + return "Montant supérieur au maximum autorisé ({$this->amount_max})."; } else { return true; } @@ -88,9 +88,9 @@ class Payment { if ($this->asso_id) { $res = XDB::query("SELECT e.eid, a.diminutif - FROM groupex.evenements AS e - INNER JOIN groupex.asso AS a ON (e.asso_id = a.id) - LEFT JOIN groupex.evenements_participants AS p ON (p.eid = e.eid AND p.uid = {?}) + FROM group_events AS e + INNER JOIN groups AS a ON (e.asso_id = a.id) + LEFT JOIN group_event_participants AS p ON (p.eid = e.eid AND p.uid = {?}) WHERE e.paiement_id = {?} AND p.uid IS NULL", S::i('uid'), $this->id); if ($res->numRows()) { return $res->fetchOneAssoc(); @@ -118,7 +118,7 @@ class PayMethod { global $globals; $i = $id==-1 ? $globals->money->mpay_def_meth : $id; - $res = XDB::query("SELECT id,text,include FROM {$globals->money->mpay_tprefix}methodes WHERE id={?}", $i); + $res = XDB::query("SELECT id,text,include FROM payment_methods WHERE id={?}", $i); list($this->id, $this->text, $this->inc) = $res->fetchOneRow(); }