X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fvalidations%2Forange.inc.php;h=1d2acda393c0497f0c06135591e6f87bc0bf980f;hb=8a43972f58f0a77015ae9e509f1c073d188874d2;hp=3b960d0b4ea1786d48846fa7e15227850ae407cb;hpb=8320b6fba6fa245dd71ae9c11b2a2a03f923d15d;p=platal.git diff --git a/include/validations/orange.inc.php b/include/validations/orange.inc.php index 3b960d0..1d2acda 100644 --- a/include/validations/orange.inc.php +++ b/include/validations/orange.inc.php @@ -1,6 +1,6 @@ promo_sortie = $_sortie; + $this->newGradYear = $_newGradYear; $res = XDB::query("SELECT entry_year FROM profile_education - WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $_uid); - $this->promo = $res->fetchOneCell(); + WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->user->id()); + $this->entryYear = $res->fetchOneCell(); + $this->oldGradYear = $this->entryYear + 3; } // }}} @@ -83,7 +86,7 @@ class OrangeReq extends Validate { XDB::execute("UPDATE profile_education SET grad_year = {?} - WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->promo_sortie, $this->uid); + WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->newGradYear, $this->user->id()); return true; }