Example #1
0
$f->finTable();
$f->fin();
$reqSel = "SELECT cp.nom, " . "           cp.prenom, " . "           ins.instance_id, " . "           pos.sgiPoste_no, " . "           pos.sgiPoste_nom, " . "           aff.date_arrivee, " . "           aff.date_depart " . " FROM   sgiAffec as aff, " . "           sgInstances as ins, " . "           sgiPostes as pos, " . "           cPerson as cp " . " WHERE aff.sgiPoste_id = pos.sgiPoste_id " . "     AND aff.instance_id = ins.instance_id " . "     AND aff.cPerson_id = cp.cPerson_id " . "     AND aff.instance_id = ins.instance_id " . "     AND INSTR('{$instances}', aff.instance_id) " . " ORDER by cp.nom ASC, " . "               cp.prenom, " . "               date_arrivee ASC ";
$resSel = $bd->execRequete($reqSel);
print "<table width='950' border='1' cellpadding='2' cellspacing='0'>";
print "   <tr>";
print "      <th>nom</th>";
print "      <th>prénom</th>";
print "      <th>ins</th>";
print "      <th>no</th>";
print "      <th>poste nom</th>";
print "      <th>début</th>";
print "      <th>fin</th>";
print "   </tr>";
$nomTemp = "xxxxx";
while ($per = $bd->objetSuivant($resSel)) {
    $nomPre = $per->nom . $per->prenom;
    if ($nomPre != $nomTemp) {
        if ($couleur == "#EBEBEB") {
            $couleur = "#FFFFFF";
        } else {
            $couleur = "#EBEBEB";
        }
        $nomTemp = $nomPre;
    }
    $posteNom = stripslashes($per->sgiPoste_nom);
    if ($posteNom == "Directeur du département des génies civil, géologique et des mines") {
        $posteNom = "Département CGM";
    }
    if ($posteNom == "Directeur du département de génie informatique et génie logiciel") {
        $posteNom = "Département GIGL";
Example #2
0
        $f->champValider("envoyer les courriels", "action");
        $f->champCache(msgFinal, $msgFinal);
        $f->champCache(titreFinal, $titreFinal);
        $f->champCache(instance, $instance);
        $f->finTable();
        $f->fin();
        print "</td></tr></table>\n";
        print Html3("bas");
        break;
    case "envoyer les courriels":
        //----------------------------------------------------
        $organisme = "Archives Polytechnique";
        $emetteur = "*****@*****.**";
        $header = "MIME-Version : 1.0\r\r\n";
        $header .= "Content-type: text/html; charset=iso-8859-1\r\r\n";
        $header .= "From: {$organisme} <{$emetteur}>\r\r\n";
        $msgFinal = stripslashes($msgFinal);
        $titreFinal = stripslashes($titreFinal);
        $bd = new BD(USAGER, PASSE, BASE, SERVEUR);
        $reqMemad = "SELECT * FROM usagers_acces as usa, usagers as us " . " WHERE notif_pv > '0'  " . " AND no_unite LIKE '%memad%' " . " AND us.no_usager = usa.no_usager " . " ORDER BY nomPrenom_usager ";
        $resultat = $bd->execRequete($reqMemad);
        while ($ligne = $bd->objetSuivant($resultat)) {
            $msgFinal2 = $msgFinal . $msgFin;
            mail($ligne->email_usager, $titreFinal, $msgFinal2, $header, "-f {$emetteur}");
        }
        $bd->quitter();
        $url = "Location: http://www.polymtl.ca/archives";
        header($url);
        exit;
        break;
}