Ejemplo n.º 1
0
										<input type="date" class="form-control" name = "input_date" id="input_date" value="">
									  </div>
									</div>
									<div class="form-group">
									  <label for="input_heure" control-label">Heure de la traversée</label>
									  <div>
										<input type="text" class="form-control" name = "input_heure" id="input_heure" placeholder="9:30" value="">
									  </div>
									</div>
									<div class="form-group">
									  <div>
									    <label for="select_liaison" control-label">Liaison effectuée</label>
										<select class="form-control" name="select_liaison" id="select_liaison">';
$stmt = retourneStatementSelect('SELECT code, idportdepart, idportarrivee FROM liaison');
while ($resultat = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $lignes .= '	<option value="' . $resultat['code'] . '">' . returnNomLiaison($resultat['idportdepart'], $resultat['idportarrivee']) . '</option>';
}
$lignes .= '
										</select>
									  </div>
									</div>
									<div class="form-group">
									  <div>
									    <label for="select_bateau" control-label">Bateau utilisé</label>
										<select class="form-control" name="select_bateau" id="select_bateau">';
$stmt = retourneStatementSelect('SELECT idbateau, nom FROM bateau');
while ($resultat = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $lignes .= '	<option value="' . $resultat['idbateau'] . '">' . $resultat['nom'] . '</option>';
}
$lignes .= '
										</select>
										  </fieldset>
										  <div class="col-lg-4"></div>
									</form>';
$lignes = $lignesFormChoix;
/****** affichage des reservations *****/
$stmt = retourneStatementSelect('SELECT idreservation, nom, adresse, cp, ville, idtraversee, dateEnregistrement FROM reservation ' . $WHERE . ' ORDER BY dateEnregistrement DESC');
while ($resultat = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $lignes .= '<div class="bloc_reservation" style="clear:both">';
    $lignes .= '<br><br><span><b>' . $resultat['nom'] . '</b>, réservation du <b>' . setTimestampFormatLecture($resultat['dateEnregistrement']) . '</b></span>';
    $lignes .= '<br>' . $resultat['adresse'] . ' ' . $resultat['cp'] . ' ' . $resultat['ville'] . '<br>';
    $stmtTraversee = retourneStatementSelect('Select dateTraversee, heure, idliaison, idbateau From traversee WHERE num =' . $resultat['idtraversee']);
    while ($resultatTraversee = $stmtTraversee->fetch(PDO::FETCH_ASSOC)) {
        $lignes .= 'Réservation pour le ' . setDateFormatLecture($resultatTraversee['dateTraversee']) . ' à ' . $resultatTraversee['heure'];
        $stmtLiaison = retourneStatementSelect('Select code, idsecteur, idportdepart, idportarrivee, distance From liaison WHERE code =' . $resultatTraversee['idliaison']);
        while ($resultatLiaison = $stmtLiaison->fetch(PDO::FETCH_ASSOC)) {
            $lignes .= ' pour la liaison ' . returnNomLiaison($resultatLiaison['idportdepart'], $resultatLiaison['idportarrivee']);
        }
    }
    $lignes .= '<br><table class="table table-striped><thead colspan="8"><b>Places</b></thead><tbody>';
    $lignes .= '<tr>';
    $stmtTickettes = retourneStatementSelect('Select lettre, num, quantite From enregistrer WHERE idreservation =' . $resultat['idreservation']);
    while ($resultatTickettes = $stmtTickettes->fetch(PDO::FETCH_ASSOC)) {
        $lignes .= '<th>' . $resultatTickettes['lettre'] . $resultatTickettes['num'] . '</th>';
    }
    $lignes .= '</tr><tr>';
    $stmtTickettes = retourneStatementSelect('Select lettre, num, quantite From enregistrer WHERE idreservation =' . $resultat['idreservation']);
    while ($resultatTickettes = $stmtTickettes->fetch(PDO::FETCH_ASSOC)) {
        if ($resultatTickettes['quantite'] == 0) {
            $lignes .= '<td>-</td>';
        } else {
            $lignes .= '<td>' . $resultatTickettes['quantite'] . '</td>';