X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fpaiements.inc.php;h=094252970b15c8c5ded7f9ae255c4ae6e5653ec4;hb=b6ba1a0417b6fc73f3d1701146373b4bec0d1428;hp=62e264a06e647befdeee58e125527e4a6e3a7fbe;hpb=a0c034efcf0777541e087500e94853f515cda1ca;p=platal.git diff --git a/include/validations/paiements.inc.php b/include/validations/paiements.inc.php index 62e264a..0942529 100644 --- a/include/validations/paiements.inc.php +++ b/include/validations/paiements.inc.php @@ -1,6 +1,6 @@ montant_max = $_montantmax; if ($_asso_id) { - $res = XDB::query("SELECT nom FROM groupex.asso WHERE id = {?}", $_asso_id); + $res = XDB::query("SELECT nom FROM #groupex#.asso WHERE id = {?}", $_asso_id); $this->asso = $res->fetchOneCell(); } if ($_asso_id && $_evt) { - $res = XDB::query("SELECT intitule FROM groupex.evenements WHERE asso_id = {?} AND eid = {?}", $_asso_id, $_evt); + $res = XDB::query("SELECT intitule FROM #groupex#.evenements WHERE asso_id = {?} AND eid = {?}", $_asso_id, $_evt); $this->evt_intitule = $res->fetchOneCell(); } } @@ -165,9 +165,9 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais public function commit() { - $res = XDB::query("SELECT MAX(id) FROM paiement.paiements"); + $res = XDB::query("SELECT MAX(id) FROM #paiement#.paiements"); $id = $res->fetchOneCell()+1; - $ret = XDB::execute("INSERT INTO paiement.paiements VALUES + $ret = XDB::execute("INSERT INTO #paiement#.paiements VALUES ( {?}, {?}, {?}, '', {?}, {?}, {?}, {?}, {?}, {?} ) @@ -176,13 +176,13 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais $this->montant, $this->montant_min, $this->montant_max, $this->user->bestEmail(), $this->msg_reponse, $this->asso_id); if ($this->asso_id && $this->evt) { - XDB::execute("UPDATE groupex.evenements + XDB::execute("UPDATE #groupex#.evenements SET paiement_id = {?} WHERE asso_id = {?} AND eid = {?}", $id, $this->asso_id, $this->evt); $res = XDB::query("SELECT a.nom, a.diminutif, e.intitule - FROM groupex.asso AS a - INNER JOIN groupex.evenements AS e ON (a.id = e.asso_id) + FROM #groupex#.asso AS a + INNER JOIN #groupex#.evenements AS e ON (a.id = e.asso_id) WHERE e.eid = {?}", $this->evt); list($nom, $diminutif, $evt) = $res->fetchOneRow(); @@ -201,7 +201,12 @@ Si le télépaiement n'est pas lié à un groupe ou supérieur à 51 euros, lais $mailer->assign('payment', $id); $mailer->assign('prenom', $u['prenom']); $mailer->assign('topay', $topay); - $mailer->assign('to', $u['email']); + + if (strpos($u['email'], '@') === false) { + $mailer->assign('to', $u['email'] . '@' . $globals->mail->domain); + } else { + $mailer->assign('to', $u['email']); + } $mailer->send(); } }