Exemplo n.º 1
0
<?php

$reservation = new Reservation();
$infos_trajet = Trajet::getInformationTrajet($_GET['id_trajet_r'])[0];
$tmp = $infos_trajet['timestamp_trajet'];
$jour = date('d', $tmp);
$mois = moisFrancais(date('n', $tmp));
$annee = date('Y', $tmp);
$heure = date('H : i', $tmp);
$date_depart = $jour . ' ' . $mois . ' ' . $annee . ' ' . $heure;
if ($infos_trajet['nb_place'] == 0) {
    $reservation = "Complet";
} else {
    $reservation = '<select name="nb_place_reserver">';
    for ($i = 1; $i <= $infos_trajet['nb_place']; $i++) {
        $reservation .= '<option value="' . $i . '">' . $i . ' place(s)</option>';
    }
    $reservation .= '</select>';
}
$html = '<div class="reservation">';
$html .= '<form method="POST" action="/Controller/ReservationController.php"> <table class="pure-table pure-table-bordered">';
$html .= '<thead><tr > <th colspan="2"> Trajet : ' . ucfirst($infos_trajet['ville_depart']) . '-' . ucfirst($infos_trajet['ville_arrive']) . '</th></tr></thead>';
$html .= '<tbody><tr> <td>Conducteur : </td><td><a title="Voir Profil" href="/Controller/ProfilController.php?context=profil&id_membre=' . $infos_trajet['id_conducteur'] . '">' . Utilisateur::getUsername($infos_trajet['id_conducteur']) . '</a></td></tr>';
$html .= '<tr> <td> Date : </td><td>' . $date_depart . '</td></tr>';
$html .= '<tr> <td> Places restante : </td><td>' . $infos_trajet['nb_place'] . '</td></tr>';
$html .= '<tr> <td> Prix Place : </td><td> ' . $infos_trajet['prix'] . '&#8364;</td></tr>';
$html .= '<tr><td> Réserver : </td> <td>' . $reservation . '</td></tr>';
$html .= '</tbody></table> <button type="submit" class="button-success pure-button"><i class="fa fa-car"></i> Réserver vos places </button><input type="hidden" name="id_trajet" value="' . $infos_trajet['id'] . '"></form></div>';
echo $html;
Exemplo n.º 2
0
    }
    $info_trajet = Trajet::getInformationTrajet($_GET['id_trajet'])[0];
    $reservations = Reservation::getUtilisateurReservation($info_trajet['id']);
    if (count($reservations) != 0 && count($info_trajet) != 0) {
        $html .= '<div class="liste_reservation"> <table class="pure-table pure-table-bordered"><thead> <tr> <th> Reservation </th> <th> Nombre de place prise</th>  <th> Note </th></tr> </thead>';
        foreach ($reservations as $array => $reservation) {
            //Notation
            $notation = array(5 => 'Amazing!', 4 => 'Super bon', 3 => 'Ca peut aller', 2 => 'Peut mieux faire', 1 => 'Ca fait mal');
            $notation_select = '<form method="POST" action="/Controller/ProfilController.php?context=trajets&id_trajet=' . $info_trajet['id'] . '&id_u=' . $reservation['id_membre'] . '"><select name="note">';
            foreach ($notation as $note => $description) {
                $notation_select .= '<option value="' . $note . '">' . $note . '-' . $description . '</option>';
            }
            $notation_select .= '</select> <button type="submit" class="button-success pure-button" name="confirmation_note"><i class="fa fa-thumbs-up"></i> Note</button></form></form>';
            $notation_r = Trajet::isTrajetValide($info_trajet['id']) ? $notation_select : 'Vous ne pouvez pas noter un trajet non valide';
            $notation_r = Note::isNoteExisteU($info_trajet['id'], $reservation['id_membre']) ? 'Vous avez noté cette personne' : $notation_r;
            $html .= '<tbody><tr> <td><a href="/Controller/ProfilController.php?context=profil&id_membre=' . $reservation['id_membre'] . '">' . Utilisateur::getUsername($reservation['id_membre']) . '    <a href="/Controller/MessageController.php?context=envoie&id_membre=' . $reservation['id_membre'] . '"><img src="/image/mail.png" alt="Message"/></a></td>';
            $html .= '<td>' . Reservation::getNombrePlaceReserve($info_trajet['id'], $reservation['id_membre']) . '</td>';
            $html .= '<td>' . $notation_r . '</td></tr>';
        }
        if (!Trajet::isTrajetValide($info_trajet['id'])) {
            $html .= '<tr> <td colspan="4"><a class="button-validation pure-button" href="/Controller/ProfilController.php?context=trajets&id_trajet=' . $info_trajet['id'] . '&validation_trajet=1"> Validation du trajet </a></td> </tr>';
            $html .= '<tr> <td colspan="4"> <a class="button-warning pure-button" href="/Controller/ProfilController.php?context=trajets&id_trajet=' . $info_trajet['id'] . '&annulation_trajet=1"> Annuler le trajet </a></tr>';
        } else {
            $html .= '<tr> <td colspan="4"> Trajet Validé </td></tr>';
        }
        $html .= '</tbody></table> </div>';
    } elseif (count($reservations) == 0 && count($info_trajet) != 0) {
        $html .= '<div class="erreur"><p> Il n\' y a aucune réservation sur ce trajet </p></div>';
    }
} elseif (isset($_GET['id_trajet']) && !empty(trim($_GET['id_trajet'])) && !Trajet::trajetExiste($_GET['id_trajet'])) {
    $html .= "<p> Ce trajet n'existe plus !</p>";
Exemplo n.º 3
0
<?php

$messages = Utilisateur::getAllMessage();
$html = '<div class="liste_reservation"><table class="pure-table pure-table-bordered"><thead><tr><th>Destinataire</th><th>Réception</th><th>Message</th><th>Lire Message</th></tr></thead><tbody>';
if (count($messages) == 0) {
    $html .= '<tr><td> Pas de message </th>';
} else {
    foreach ($messages as $array => $message) {
        if (strlen($message['contenu']) > 90) {
            $cont = substr($message['contenu'], 0, 50) . '...';
        } else {
            $cont = $message['contenu'];
        }
        $date = date('d-n-Y H:i', $message['timestamp_message']);
        $html .= '<tr>';
        $html .= '<td><a href="/Controller/ProfilController.php?context=profil&id_membre=' . $message['id_expediteur'] . '">' . Utilisateur::getUsername($message['id_expediteur']) . '</a></td>';
        $html .= '<td>' . $date . '</td>';
        $html .= '<td>' . $cont . '</td>';
        $html .= '<td><a href="/Controller/MessageController.php?context=lire&id_message=' . $message['id'] . '"> <img src="/image/readed.png" alt="Read"> </a></td>';
        $html .= '</tr>';
    }
}
$html .= '</tbody></table></div>';
echo $html;
Exemplo n.º 4
0
</td></tr>
<tr> <td class="bold_td"> Membre depuis : </td><td><?php 
echo date('d-n-Y', $membre['timestamp_creation']);
?>
</td></tr>
<tr> <td class="bold_td"> Type de compte : </td><td><?php 
echo $type_compte;
?>
</td></tr>
<tr> <td class="bold_td"> Trajet Effectué : </td><td><?php 
echo $membre['nb_trajet_effectue'];
?>
</td></tr>
<tr> <td class="bold_td"> Trajet Annulé : </td><td><?php 
echo $membre['nb_trajet_annule'];
?>
</td></tr>
<tr> <td class="bold_td"> Note Moyenne : </td><td><?php 
echo $note;
?>
</td></tr> </tbody> </table>

<table class="profil pure-table pure-table-bordered"> <thead> <tr> <th colspan="2"> Voiture de <?php 
echo Utilisateur::getUsername($membre['id']);
?>
</th></tr></thead>
<tbody>
<?php 
echo $table;
?>
</tbody></table>
<?php 
if (isset($_POST['arrive']) && $_POST['arrive'] == -1) {
    $liste_trajet = Trajet::afficherListeTrajet($_POST['depart']);
} else {
    $liste_trajet = Trajet::afficherListeTrajet($_POST['depart'], $_POST['arrive']);
}
foreach ($liste_trajet as $main_array => $result) {
    $temps = date('d-n-Y H:i', $result['timestamp_trajet']);
    $html = '<div class="liste_reservation"><table class="pure-table pure-table-bordered"><thead><tr><th>Départ</th><th>Arrivé</th><th>Date Départ</th><th>Conducteur</th><th>Prix</th><th>Place Disponible</th><th></th></tr></thead><tbody>';
    $html .= '<tr><td>' . ucfirst($result['ville_depart']) . '</td>';
    $html .= '<td>' . ucfirst($result['ville_arrive']) . '</td>';
    $html .= '<td>' . $temps . '</td>';
    $html .= '<td> <a href="/Controller/ProfilController.php?context=profil&id_membre=' . Trajet::getTrajetConducteurId($result['id']) . '">' . Utilisateur::getUsername(Trajet::getTrajetConducteurId($result['id'])) . '</a></td>';
    $html .= '<td>' . $result['prix'] . '&#8364;</td>';
    $place = $result['nb_place'] == 0 ? "Complet" : $result['nb_place'];
    $html .= '<td>' . $place . '</td>';
    $html .= '<td><a class="button-success pure-button" href="/Controller/ReservationController.php?id_trajet_r=' . $result['id'] . '"><i class="fa fa-car"></i> Réserver</a></td></tr></tbody></table>';
    echo $html;
}
Exemplo n.º 6
0
            echo $error;
        }
    }
}
$html = '<div class="liste_reservation_L">';
if (count($reservations) != 0) {
    $html .= '<table class="pure-table pure-table-bordered"><thead><tr><th> Conducteur </th> <th> Trajet </th> <th> Date </th> <th>Prix </th> <th> Nombre de place prise </th> <th> Note </th></tr></thead><tbody>';
    foreach ($reservations as $array => $reservation) {
        $info_trajet = Trajet::getInformationTrajet($reservation['id_trajet'])[0];
        $notation = array(5 => 'Amazing!', 4 => 'Super bon', 3 => 'Ca peut aller', 2 => 'Peut mieux faire', 1 => 'Ca fait mal');
        $notation_select = '<form method="POST" action="/Controller/ProfilController.php?context=reservations&id_trajet=' . $info_trajet['id'] . '"><select name="note">';
        foreach ($notation as $note => $description) {
            $notation_select .= '<option value="' . $note . '">' . $note . '-' . $description . '</option>';
        }
        $notation_select .= '</select> <button type="submit" class="button-success pure-button" name="confirmation_note"><i class="fa fa-thumbs-up"></i> Note</button></form>';
        $notation_r = Trajet::isTrajetValide($reservation['id_trajet']) ? $notation_select : 'Vous ne pouvez pas noter un trajet non valide';
        $notation_r = Note::isNoteExiste($info_trajet['id']) ? 'Vous avez noté cette personne' : $notation_r;
        $date = date('d-n-Y H:i', $info_trajet['timestamp_trajet']);
        $html .= '<tr><td><a href="/Controller/ProfilController.php?context=profil&id_membre=' . $info_trajet['id_conducteur'] . '">' . Utilisateur::getUsername($info_trajet['id_conducteur']) . '<a href="/Controller/MessageController.php?context=envoie&id_membre=' . $info_trajet['id_conducteur'] . '"><img src="/image/mail.png" alt="Message"/></a></td>';
        $html .= '<td>' . ucfirst($info_trajet['ville_depart']) . ' - ' . ucfirst($info_trajet['ville_arrive']) . '</td>';
        $html .= '<td>' . $date . '</td>';
        $html .= '<td>' . $info_trajet['prix'] . '</td>';
        $html .= '<td>' . $reservation['nb_place'] . '</td>';
        $html .= '<td>' . $notation_r . '</td></tr>';
    }
    $html .= '</tbody></table>';
} else {
    $html .= '<div class="erreur"><p> Vous n\'avez pas de réservations pour le moment</p></div>';
}
$html .= '</div>';
echo $html;
Exemplo n.º 7
0
<?php

$message = Messagerie::getMessage($_GET['id_message']);
if (!$message) {
    echo '<div class="erreur"><p>Il semble y avoir un problème</p></div>';
} else {
    $message = $message[0];
    Messagerie::messageLu($message['id']);
    $html = '<div class="liste_reservation"> <table class="pure-table pure-table-bordered"> <thead> <tr><th colspan="2"> Message Envoyé par ' . Utilisateur::getUsername($message['id_expediteur']) . '</th></thead>';
    $html .= '<tbody> <tr><td> Date :</td><td>' . date('d-n-Y H:i', $message['timestamp_message']) . '</td></tr>';
    $html .= '<tr><td colspan="2">' . $message['contenu'] . '</td></tr></tbody></table>';
    echo $html;
}
Exemplo n.º 8
0
<?php

if (!isset($_GET['id_membre'])) {
    header('Location: /Vue/rechercherTrajet.php');
}
$message = new Messagerie();
if (isset($message)) {
    if ($message->_erreurs) {
        foreach ($message->_erreurs as $erreur) {
            echo '<div class="erreur"><p>' . $erreur . '</p></div>';
        }
    }
    if ($message->_confirmation) {
        echo '<div class="confirmation"><p>' . $message->_confirmation . '</p></div>';
    }
}
?>
<div class="border_element_L">
<h2 class="title"> Envoyer un message à <?php 
echo Utilisateur::getUsername($_GET['id_membre']);
?>
 </h2>

	<form action="" method="POST" class="  pure-form pure-form-stacked">
	<textarea rows="10" cols="50"  name="message" placeholder="Tapez votre message ici"></textarea>

	<button type="submit" class="pure-button pure-button-primary" name="envoie_message"><i class="fa fa-envelope-o"></i> Envoyer le Message </button>
</form>
</div>
		
Exemplo n.º 9
0
<?php

$trajets = Administration::getToutTrajets();
$html = '<table border="1" class="tableadmin"> <tr> <th> Conducteur </th> <th> Ville Départ </th> <th>Ville Arrivé</th> <th> Prévu le  </th> <th> Prix</th> <th> Place Restante </th></tr>';
foreach ($trajets as $array => $trajet) {
    $creation = date('d-n-Y H:i', $trajet['timestamp_trajet']);
    $html .= '<tr> <td>' . Utilisateur::getUsername($trajet['id_conducteur']) . '</td>';
    $html .= ' <td>' . ucfirst($trajet['ville_depart']) . '</td>';
    $html .= ' <td>' . ucfirst($trajet['ville_arrive']) . '</td>';
    $html .= ' <td>' . $creation . '</td>';
    $html .= ' <td>' . $trajet['prix'] . '</td>';
    $html .= ' <td>' . $trajet['nb_place'] . '</td></tr>';
}
$html .= '</table>';
echo $html;