- $res = XDB::query(
- "SELECT m.uid, u.promo, u.nom, u.prenom, u.matricule, u.naissance_ini, FIND_IN_SET('watch', u.flags)
- FROM register_marketing AS m
- INNER JOIN auth_user_md5 AS u ON u.user_id = m.uid
- WHERE m.hash={?}", $hash);
- if (list($uid, $promo, $nom, $prenom, $ourmat, $naiss, $watch) = $res->fetchOneRow()) {
- $sub_state['uid'] = $uid;
- $sub_state['hash'] = $hash;
- $sub_state['promo'] = $promo;
- $sub_state['nom'] = $nom;
- $sub_state['prenom'] = $prenom;
- $sub_state['ourmat'] = $ourmat;
- $sub_state['watch'] = $watch;
- $sub_state['naissance_ini'] = $naiss;
-
- XDB::execute(
- "REPLACE INTO register_mstats (uid,sender,success)
- SELECT m.uid, m.sender, 0
+ $nameTypes = DirEnum::getOptions(DirEnum::NAMETYPES);
+ $nameTypes = array_flip($nameTypes);
+ $res = XDB::query("SELECT a.uid, pd.promo, pnl.name AS lastname, pnf.name AS firstname, p.xorg_id AS xorgid,
+ p.birthdate_ref AS birthdateRef, FIND_IN_SET('watch', a.flags) AS watch, m.hash