git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-358
new_admin_page('marketing/private.tpl');
$uid = Env::get('uid');
-$res = $globals->xdb->query("SELECT nom, prenom, promo FROM auth_user_md5 WHERE user_id={?} AND perms='pending'", $uid);
+$res = $globals->xdb->query("SELECT nom, prenom, promo, matricule FROM auth_user_md5 WHERE user_id={?} AND perms='pending'", $uid);
-if (list($nom, $prenom, $promo) = $res->fetchOneRow()) {
+if (list($nom, $prenom, $promo, $matricule) = $res->fetchOneRow()) {
+ require_once('register.inc.php');
+ $matricule_X = get_X_mat($matricule);
$page->gassign('nom');
$page->gassign('prenom');
$page->gassign('promo');
+ $page->gassign('matricule');
+ $page->assign('matricule_X',$matricule_X);
} else {
$page->kill('uid invalide');
}
}
// }}}
+// {{{ function get_X_mat
+function get_X_mat($ourmat)
+{
+ if (!preg_match('/^[0-9]{8}$/', $ourmat)) {
+ // le matricule de notre base doit comporter 8 chiffres
+ return 0;
+ }
+
+ $year = intval(substr($ourmat, 0, 4));
+ $rang = intval(substr($ourmat, 5, 3));
+ $year = intval(substr(1900 - $year, 1, 3));
+
+ return sprintf('%03u%03u', $year, $rang);
+}
+
+// }}}
// {{{ function check_mat
function check_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid)
{/if}
{perms level='admin'}
<a href="{rel}/marketing/private.php?uid={$c.user_id}">{*
- *}<img src="{rel}/images/admin.png" alt='admin' title="administrer user" /></a>
+ *}<img src="{rel}/images/admin.png" alt='admin' title="marketter user" /></a>
<a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&anc_id={$c.matricule_ax}">{*
*}<img src="{rel}/images/ax.png" alt='AX' title="fiche AX" /></a>
{/perms}
<h1>Marketing de {$prenom} {$nom}</h1>
+<h2>Matricules</h2>
+Matricule École (à rentrer lors de l'inscription) : <strong>{$matricule_X}</strong>
+<br />
+Matricule polytechnique.org : {$matricule}
+
{if $pending}
<h2>Inscription en cours</h2>
6 chiffres terminant par le numéro d'entrée (ex: 960532 ou 101532)<br />
Voir sur le GU ou un bulletin de solde pour trouver cette information<br /><br />
Pour les élèves étrangers voie 2, il est du type :<br />
- Promotion: 1995, Matricule: 960XXX - Promotion: 2001, Matricule 102XXX.
+ Promotion: 1996, Matricule: 970XXX - Promotion: 2001, Matricule 102XXX.
</td>
</tr>
{/if}