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); 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->montant_min = (float)$this->montant_min; $this->montant_max = (float)$this->montant_max; $this->flags = new Flagset($flags); return $link; } // }}} // {{{ function check() 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})."; } else { return true; } } // }}} // {{{ function init() function init($val, &$meth) { require_once('money/'.$meth->inc); $this->api = new $api($val); } // }}} // {{{ function prepareform() function prepareform() { return $this->api->prepareform($this); } function event() { if ($this->asso_id) { $res = XDB::query("SELECT eid, a.diminutif FROM groupex.evenements AS e, groupex.asso AS a WHERE e.asso_id = {?} AND a.id = {?}", $this->asso_id, $this->asso_id); return $res->fetchOneAssoc(); } return null; } } // }}} // {{{ class PayMethod class PayMethod { // {{{ properties var $id; var $text; var $inc; // }}} // {{{ constructor function PayMethod($id=-1) { 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); list($this->id, $this->text, $this->inc) = $res->fetchOneRow(); } // }}} } // }}} // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?>