= current_date;", array($mail)); if ($result) { $row = pg_fetch_array($result); return $row[0]; } return 0; } function getTrajetsReserves($db, $mail) { $result = pg_query_params($db, "SELECT COUNT(*) FROM trajet tr, reserver r WHERE r.codetrajet = tr.codetrajet AND mailutilisateur = $1 AND etatres != 'Annulée' AND estAnnule = false AND datedepart >= current_date;", array($mail)); if ($result) { $row = pg_fetch_array($result); return $row[0]; } return 0; } function getMessagesNonLus($db, $mail) { $result = pg_query_params($db, "SELECT COUNT(*) from Message WHERE mailRecepteur = $1 AND estLu = FALSE;", array($mail)); if ($result) { $row = pg_fetch_array($result); $login = $row[0]; return $login; } } function getAvisNonLus($db, $mail) { global $db; $result = pg_query_params($db, "SELECT COUNT(tr.mailProposition) FROM Trajet tr, Avis av WHERE tr.codeTrajet = av.codeTrajet AND av.estLu = false AND tr.mailProposition = $1;", array($mail)); if ($result) { $row = pg_fetch_array($result); $login = $row[0]; return $login; } } function getPathImgProfil($mail) { if (file_exists("../imageProfil/$mail.png")) { return "../imageProfil/$mail.png"; } return "../imageProfil/default.svg"; } function addVoiture($db, $matricule, $marque, $modele, $nbplaces, $anneefab) { $requete = "INSERT INTO public.voiture (matricule, marque, modele, nbplaces, anneefab, mail) VALUES ('" . $matricule . "','" . $marque . "','" . $modele . "','" . $nbplaces . "','" . $anneefab . "','" . $_SESSION['mail'] . "');"; pg_query($db, $requete); } function changeVoiture($db, $matricule, $marque, $modele, $nbplaces, $anneefab) { $requete = "UPDATE public.voiture SET (matricule, marque, modele, nbplaces, anneefab) = ('" . $matricule . "','" . $marque . "','" . $modele . "','" . $nbplaces . "','" . $anneefab . "') WHERE mail = '" . $_SESSION['mail'] . "';"; echo "requete =" . $requete; pg_query($db, $requete); } function showVoiture($db) { $requete = "SELECT * FROM public.voiture WHERE voiture.mail = '" . $_SESSION['mail'] . "';"; if ($donnees = pg_query($db, $requete)) { while ($res = pg_fetch_assoc($donnees)) { echo "matricule = " . $res['matricule'] . "
"; echo "marque = " . $res['marque'] . "
"; echo "modele = " . $res['modele'] . "
"; echo "nombre de places = " . $res['nbplaces'] . "
"; echo "année de fabrication = " . $res['anneefab'] . "
"; } } } ?> Tableau de bord

Bienvenue

Vous avez trajets proposés à effectuer.

Vous avez trajets réservés à effectuer.

Vous avez messages non lus.

Vous avez avis non lus.

Ajouter une voiture Modifier ma voiture Afficher ma voiture