Ejemplo n.º 1
0
 public function recherche($texte = '', $limiteDebut = '0', $limiteNb = '20', $ordrePar = 'matricule', $ordreSens = 'asc', $whereParticulier = '')
 {
     $requeteWhere = " (matricule LIKE '{$texte}' OR " . "payment LIKE '{$texte}' OR " . "licenseNumber LIKE '{$texte}' OR " . "licenseClass LIKE '{$texte}') ";
     $this->liste = array();
     $resultat = $this->objDatabase->requete("SELECT matricule from st_demande WHERE {$requeteWhere} {$whereParticulier} ORDER BY {$ordrePar} {$ordreSens} LIMIT {$limiteDebut},{$limiteNb}");
     if (mysql_num_rows($resultat) < 1) {
         return false;
     } else {
         $this->objLog->ajoutLog(LOG_NIVEAU_INFO, LOG_MODULE_DEMANDELISTE, null, "Recherche : '{$texte}' : " . mysql_num_rows($resultat) . ' resultats');
     }
     while ($ligne = mysql_fetch_array($resultat)) {
         $demandeTemp = new demande();
         $demandeTemp->ouvrir($ligne['matricule']);
         array_push($this->liste, $demandeTemp);
     }
     $this->reset();
     return true;
 }
Ejemplo n.º 2
0
require_once "class.validation.php";
require_once "class.userData.php";
require_once "class.car.php";
define('CANCEL_DEMAND_POST', 'cancelDemand');
define('REACTIVATE_DEMAND_POST', 'reactivateDemand');
$objAuth = authentification::instance();
$objLog = log::instance();
$objvalid = validation::instance();
$objDemandeListe = new demandeListe();
$objDemande = null;
$fileFieldIndex = 0;
if ($objAuth->estIdentifie()) {
    $matricule = $_SESSION['usager'];
    $submissionTarget = util::getParam($_POST, 'submissionTarget');
    $submissionType = util::getParam($_POST, 'submissionType');
    $demande = new demande($matricule);
    if ($submissionTarget == 'demande') {
        if ($submissionType == CANCEL_DEMAND_POST) {
            $demande->cancelDemand();
            header("Location: demande.php");
        } else {
            if ($submissionType == REACTIVATE_DEMAND_POST) {
                $demande->reactivateDemand();
                header("Location: demande.php");
            } else {
                $demande->getDataFromPost($_POST, $matricule);
                if ($demande->isValid()) {
                    if ($demande->saveToDatabase($matricule)) {
                        header("Location: demande.php");
                    }
                }
Ejemplo n.º 3
0
$response->hasError = false;
if (!isset($status) || !isset($matricules)) {
    $response->statusChangeIndicatorImagePath = $errorIconPath;
    $response->statusChangeMessage = "Argument manquant";
    $response->hasError = true;
    print json_encode($response);
    return;
}
$response->selectedDemands = json_decode($matricules);
try {
    //$matricules = json_decode($matricules);
    $database = database::instance();
    $database->beginTransaction();
    $matricules = json_decode($matricules);
    foreach ($matricules as $matricule) {
        $demand = new demande($matricule);
        $sendSuccesful = $demand->getStatus()->changeStatusTo($status, $details, $sendMail, $includeDetails);
        if (!$sendSuccesful) {
            throw new Exception("Erreur d'envoi du message");
        }
        $demand->refreshStatus();
        $response->newStatus = util::cleanUTF8($demand->getStatus()->getName());
    }
    $database->commitTransaction();
    print json_encode($response);
} catch (Exception $e) {
    $response->statusChangeIndicatorImagePath = $errorIconPath;
    $response->statusChangeMessage = $e->getMessage();
    $response->hasError = true;
    $database->abortTransaction();
    print json_encode($response);
Ejemplo n.º 4
0
function getCar2ProofImageHtml(demande $demande)
{
    return getProofImageHtml($demande->getSecondCar()->getInsurance()->getOutputLocation(), car2TabName);
}
Ejemplo n.º 5
0
require_once 'class.util.php';
require_once 'class.demande.php';
$auth = authentification::instance();
if (!$auth->estIdentifie() || !$auth->isUserAdmin()) {
    header("Location: index.php");
    exit(0);
}
$selectedTab = util::getParam($_GET, 'selectedTab');
$matricule = util::getParam($_GET, 'matricule');
$response->hasError = false;
if (!isset($selectedTab) || !isset($matricule)) {
    $response->hasError = true;
    print json_encode($response);
    exit(0);
}
$demande = new demande($matricule);
$demande->getDataGromDB($matricule);
$response->selectedTab = $selectedTab;
switch ($selectedTab) {
    case 'licenseTab':
        $response = loadLicenseData($demande);
        break;
    case 'residentialProofTab':
        $response = loadResidentialProofData($demande);
        break;
    case 'car1Tab':
        $response = loadFirstCarInsuranceData($demande);
        break;
    case 'car2Tab':
        $response = loadSecondCarInsuranceData($demande);
        break;
Ejemplo n.º 6
0
require_once "class.validation.php";
$objAuth = authentification::instance();
#$objLog  = log::instance();
#$objvalid= validation::instance();
if (getParam('logout') == '1') {
    session_destroy();
    header("Location: auth.php");
    exit;
}
if (!$objAuth->estIdentifie()) {
    header("Location: auth.php");
    exit;
}
$ids = array();
$ids = $_POST['id'];
$objDemande = new demande();
foreach ($ids as $id) {
    $changementStatus = false;
    $objDemande->ouvrir($id);
    $objDemande->setStatus(getParam('form_status'));
    if (getParam('form_status') != $objDemande->getStatus()) {
        $changementStatus = true;
    }
    if (!$objDemande->setStatus(getParam('form_status'))) {
        $changementStatus = false;
    }
    if ($objDemande->sauvegarde()) {
        $statutEnMot = printLecture('statusLong', $objDemande->getStatus());
        $email = file_get_contents('emailStatut.txt');
        $email = preg_replace("/@@PRENOM@@/", $objDemande->getPrenom(), $email);
        $email = preg_replace("/@@NOM@@/", $objDemande->getNom(), $email);
Ejemplo n.º 7
0
<?php

require_once 'class.authentification.php';
require_once 'class.util.php';
require_once 'class.demande.php';
$auth = authentification::instance();
$matricule = util::getParam($_POST, 'matricule');
if ($auth->estIdentifie() && isset($matricule)) {
    $demande = new demande($matricule);
    $demande->updateDataFromDB();
    $userData = $demande->getUserData();
    $tripInfo = $demande->getTripInfo();
    print "<div id='rightSideInfoTabs'>\n\t\t\t\t  <ul>\n\t\t\t\t    <li><a href='#personInfo'><span>Informations</span></a></li>\n\t\t\t\t    <li><a href='#otherInfos'><span>Infos additionnelles</span></a></li>\n\t\t\t\t     <li><a href='#options'><span>Options</span></a></li>\n\t\t\t\t  </ul>\n\t\t\t\t  <div id='personInfo' style='height:100%'>\n\t\t\t\t  \t<label class='infoFieldTitleWithBar' ' >Nom</label>\n\t\t\t\t  \t<label class='infoFieldValue' >" . $userData->getLastName() . ", " . $userData->getFirstName() . " (" . $userData->getMatricule() . ")" . "</label>\n\t\t\t\t  \t\n\t\t\t\t  \t<label class='infoFieldTitleWithBar' >Email</label>\n\t\t\t\t  \t<a class='infoFieldValue' href='mailto:" . $userData->getEmail() . "' target='_blank'>" . $userData->getEmail() . "</a>\n\t\t\t\t  \t\n\t\t\t\t  \t<label class='infoFieldTitleWithBar' >T&eacutel&eacutephone</label>\n\t\t\t\t  \t<label class='infoFieldValue'>" . $userData->getPhone() . "</label>\n\t\t\t\t\t\n\t\t\t\t  \t<label class='infoFieldTitleWithBar' >Adresse</label>\n\t\t\t\t  \t<label class='infoFieldValue'>" . $userData->getAddress() . ", " . $userData->getCity() . ", " . $userData->getZipCode() . "</label>\n\t\t\t\t  \t\n\t\t\t\t  \t<img id='googleMap' src=" . getMapImageUrl($tripInfo) . "></img>\n\t\t\t\t  \t\n\t\t\t\t\t<div class='bottomBorderedElement' style='margin-top:8px'>\n\t\t\t\t\t\t<label style='display:inline'>D&eacutesire faire du covoiturage</label>\n\t\t\t\t\t\t<label class='infoFieldValue' style='float:right; font-weight:bold'>" . ($demande->isCarpooling() ? 'Oui' : 'Non') . "</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div class='bottomBorderedElement' style='margin-top:4px'>\n\t\t\t\t\t\t<label style='display:inline'>D&eacutesire faire du covoiturage avec d'autres</label>\n\t\t\t\t\t\t<label class='infoFieldValue' style='float:right; font-weight:bold'>" . ($demande->isCarpoolingOthers() ? 'Oui' : 'Non') . "</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t  </div>\n\t\t\t\t  <div id='otherInfos' style='height:100%'>\n\t\t\t\t  \t<label class='infoFieldTitleWithBar' ' >M&eacutethode de paiement</label>\n\t\t\t\t  \t<label class='infoFieldValue' >" . util::getPaymentMethodNameFromId($demande->getPaymentMethod()) . "</label>\n\t\t\t\t  \t\n\t\t\t\t\t<label class='infoFieldTitleWithBar' ' >Date de cr&eacuteation</label>\n\t\t\t\t  \t<label class='infoFieldValue' >" . $demande->getModificationDate() . "</label>\n\t\t\t\t  \t\n\t\t\t\t\t<label class='infoFieldTitleWithBar' ' >Date de derni&egravere modification</label>\n\t\t\t\t  \t<label class='infoFieldValue' >" . $demande->getCreationDate() . "</label>\n\t\t\t\t  \t\n\t\t\t\t\t<label class='infoFieldTitleWithBar' ' >Temps de trajet estim&eacute</label>\n\t\t\t\t  \t<label class='infoFieldValue' >" . $demande->getTripInfo()->getDurationInMinutes() . " minutes</label>\n\t\t\t\t  </div>\n\t\t\t\t  <div id='options' style='height:100%'>\n\t\t\t\t  \t\n\t\t\t\t  </div>\n\t\t\t  </div>";
} else {
    exit(0);
}
function getMapImageUrl(tripInfo $tripInfo)
{
    $location = $tripInfo->getLatitude() . "," . $tripInfo->getLongitude();
    $location = rawurlencode(mb_convert_encoding($location, "UTF-8"));
    $poly = "45.504448,-73.614204";
    return "http://maps.googleapis.com/maps/api/staticmap?center={$location}&zoom=10&size=375x200&markers=color:red%7Clabel:P%7C" . $poly . "&markers=color:blue%7Clabel:S%7C" . $location . "&maptype=roadmap&sensor=false";
}
Ejemplo n.º 8
0
<!--<body onload="javascript:window.print()">-->
<?php 
error_reporting(E_ALL);
require_once 'class.authentification.php';
require_once 'class.util.php';
require_once 'class.demande.php';
require_once 'class.database.php';
$auth = authentification::instance();
$matricule = util::getParam($_GET, 'matricule');
$changeStatus = util::getParam($_GET, 'changeStatus');
if (!$auth->isUserAdmin() || empty($matricule)) {
    require_once "header.php";
    print util::cleanUTF8("Problème d'identification ou de matricule");
    exit(0);
}
$demande = new demande($matricule);
$user = new userData($matricule);
$db = database::instance();
if ($changeStatus == "1") {
    $printedStatus = demandStatus::PRINTED_STATUS;
    $result = $db->requete("SELECT description FROM st_status WHERE st_status.statusId={$printedStatus}");
    $resultArray = mysql_fetch_array($result);
    $demande->getStatus()->setToPrinted(util::cleanUTF8($resultArray[demandStatus::STATUS_DESC_DB_FIELD]));
    print '<body>';
} else {
    print '<body onload="javascript:window.print()">';
}
?>
<img src="AEP.gif"/>
<h2>Demande de stationnement</h2>
<p>
Ejemplo n.º 9
0
require_once "class.log.php";
require_once "class.validation.php";
$objAuth = authentification::instance();
#$objLog  = log::instance();
#$objvalid= validation::instance();
if (getParam('logout') == '1') {
    session_destroy();
    header("Location: auth.php");
    exit;
}
if (!$objAuth->estIdentifie()) {
    header("Location: auth.php");
    exit;
}
printn("<body onload=\"javascript:window.print()\">");
$objDemande = new demande();
$objDemande->ouvrir(getParam('id'));
printn("<a href=\"impressionChangementStatut.php?id=" . getParam('id') . "\">Changement statut pour \"Imprimé\".</a><br><br>");
printn("<img src=\"AEP.gif\"><br><br>");
printn("<table>");
printn("<tr><td>Année scolaire</td><td>" . $objDemande->getAnnee() . "</td><tr>");
printn("<tr><td>ID</td><td>" . $objDemande->getId() . "</td></tr>");
printn("<tr><td>Statut</td><td>" . printLecture('statusLong', $objDemande->getId()) . "</td></tr>");
printn("<tr><td>Prénom</td><td>" . $objDemande->getPrenom() . "</td></tr>");
printn("<tr><td>Nom</td><td>" . $objDemande->getNom() . "</td></tr>");
printn("<tr><td>Matricule</td><td>" . $objDemande->getMatricule() . "</td></tr>");
printn("<tr><td>Adresse</td><td>" . $objDemande->getAdresse() . "</td></tr>");
printn("<tr><td>Ville</td><td>" . $objDemande->getVille() . "</td></tr>");
printn("<tr><td>Code Postal</td><td>" . $objDemande->getCodePostal() . "</td></tr>");
printn("<tr><td>Téléphone domicile&nbsp;&nbsp;</td><td>" . $objDemande->getTelDomicile() . "</td></tr>");
printn("<tr><td>Téléphone bureau</td><td>" . $objDemande->getTelBureau() . "</td></tr>");
require_once "class.demande.php";
require_once "class.log.php";
require_once "class.validation.php";
$objAuth = authentification::instance();
#$objLog  = log::instance();
#$objvalid= validation::instance();
if (getParam('logout') == '1') {
    session_destroy();
    header("Location: auth.php");
    exit;
}
if (!$objAuth->estIdentifie()) {
    header("Location: auth.php");
    exit;
}
$objDemande = new demande();
$objDemande->ouvrir(getParam('id'));
$objDemande->setStatus(DEMANDE_STATUS_IMPRIME);
if ($objDemande->sauvegarde()) {
    printn("Le statut est maintenant : imprimé.<br><br>Vous pouvez fermer la fenetre.");
} else {
    printn("Erreur!  Impossible de changer le statut!");
}
exit(0);
function getParam($param)
{
    if (isset($_POST[$param])) {
        return $_POST[$param];
    }
    if (isset($_GET[$param])) {
        return $_GET[$param];
Ejemplo n.º 11
0
<?php

error_reporting(E_ALL);
require_once "class.demande.php";
require_once "class.log.php";
$demande = new demande();
readfile('header.php');
if (@isset($_POST['soumission']) && $_POST['soumission'] == '1') {
    if ($_POST['id'] < 1 || !$demande->ouvrir($_POST['id'])) {
        print "<font color=\"#ff0000\"><b>Demande introuvable!</b></font>\n<br>";
    } else {
        print "Statut de la demande numéro <b>" . $_POST['id'] . "</b> : " . getStatusLecture($demande->getStatus()) . '<br>';
    }
}
?>
<br>
Veuillez indiquer le numéro de votre demande pour vérifier son statut.  Si vous ne connaissez pas le numéro de votre demande, veuillez en avisez <a href="mailto:stationnement@aep.polymtl.ca">stationnement@aep.polymtl.ca</a>.
<br><br>
<form method="POST">
<input type="text" name="id"><br>
<input type="submit" value="Consulter le statut">
<input type="hidden" name="soumission" value="1">
</form>
<?php 
readfile('footer.html');
function getStatusLecture($valeur)
{
    if ($valeur == DEMANDE_STATUS_ATTENTE) {
        return "Demande reçue, en attente...  Pièces justificatives <font color=\"#ff0000\"><b>NON-REÇUES</b></font>.";
    }
    if ($valeur == DEMANDE_STATUS_REFUSE) {