Exemple #1
0
													<th rowspan="2">Catégorie</th>
													<th rowspan="2">Type</th>
													<th colspan="' . $nbPeriodes . '">Période</th>
												</tr>
												<tr>';
// RECUP CATYPE 'A1' 'A3' etc + libelle type
$stmtCatype = retourneStatementSelect('SELECT CONCAT(lettre, num) as catype, libelle FROM type');
while ($resultatCatype = $stmtCatype->fetch(PDO::FETCH_ASSOC)) {
    $catypes['ID'][] = $resultatCatype['catype'];
    $catypes[$resultatCatype["catype"]] = $resultatCatype['libelle'];
}
$stmtCatype = null;
// RECUP LES ID PERIODE
$stmtPeriode = retourneStatementSelect('SELECT * FROM periode');
while ($resultatPeriode = $stmtPeriode->fetch(PDO::FETCH_ASSOC)) {
    $lignes .= '<td>' . setDateFormatLecture($resultatPeriode['datedeb']) . ' au ' . setDateFormatLecture($resultatPeriode['datefin']) . '</td>';
    $periodes[] = $resultatPeriode['idperiode'];
}
$stmtPeriode = null;
$lignes .= '					</tr>';
// <td rowspan="3">A <span class="pc">- Passager</span></td>
// <td>1 <span class="pc">- Adulte</span></td>
foreach ($catypes['ID'] as $CATYP) {
    $lignes .= '<tr>';
    switch ($CATYP) {
        case 'A1':
            $lignes .= '<td rowspan="3">A <span class="pc">- Passager</span></td>
										<td>1 <span class="pc">- ' . $catypes[$CATYP] . '</span></td>';
            break;
        case 'A2':
            $lignes .= '<td>2 <span class="pc">- ' . $catypes[$CATYP] . '</span></td>';
Exemple #2
0
										<input type="text" placeholder="15/06/2016" class="form-control" name = "input_datefin" id="input_datefin" value="' . setDateFormatLecture($DFIN) . '">
									  </div>
									</div>
									<div>
										<button class="btn btn-blueish">Mettre à jour</button>
										<a id="del_choix" class="btn btn-reddish">Supprimer</a>
									</div>
								  </fieldset><br>
								  <span id="updt_periode_msg"></span>
									  <span id="del_msg"></span>
							</form>';
    echo $lignes;
} else {
    /**** FORM SELECT ID ******/
    $lignesFormChoix = '<form method="post" class="form-horizontal">
									<legend>Choisissez un periode à modifier</legend>
									<fieldset class="col-lg-4">
									<div class="form-group">
										<select class="form-control" name="select_Choix" id="select_Choix">';
    $stmt = retourneStatementSelect('SELECT idperiode, datedeb, datefin FROM periode');
    while ($resultat = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $lignesFormChoix .= '			<option value="' . $resultat['idperiode'] . '">' . setDateFormatLecture($resultat['datedeb']) . ' - ' . setDateFormatLecture($resultat['datefin']) . '</option>';
    }
    $lignesFormChoix .= '		</select>
									</div>
									<div>
										<button type="submit" class="btn btn-blueish">Modifier cet élément</button>
									</div>
								</form>';
    echo $lignesFormChoix;
}
        $heure = $resultattraversee['heure'];
        $idliaison = $resultattraversee['idliaison'];
        $idbateau = $resultattraversee['idbateau'];
    }
    $lignes = ' 			<form method="post" id="update_traversee_form" class="form-horizontal col-lg-4">
									  <legend>Modifier une traversée</legend>
								  <fieldset>
											<div class="form-group">
											  <div>
												<input type="hidden" class="form-control" table = "traversee" champs_id ="num" name = "input_id" id="input_id" value="' . $ID . '">
											  </div>
											</div>
									<div class="form-group">
									  <label for="input_date" control-label">Date de la traversée</label>
									  <div>
										<input type="text" class="form-control" name = "input_date" id="input_date" value="' . setDateFormatLecture($dateTraversee) . '">
									  </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="' . $heure . '">
									  </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)) {
        if ($resultat['code'] == $idliaison) {
											<div>
												<button type="submit" id="choixTrav" class="btn btn-blueish" style="margin-bottom:30px;">Valider traversée</button>
											</div>
										  </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) {
Exemple #5
0
function returnNomPeriode($ID)
{
    $deb = "";
    $fin = "";
    if ($ID != "") {
        $sql = "SELECT datedeb, datefin From periode WHERE idperiode = " . $ID;
        $stmt = retourneStatementSelect($sql);
        while ($resultat = $stmt->fetch(PDO::FETCH_ASSOC)) {
            $deb = setDateFormatLecture($resultat['datedeb']);
            $fin = setDateFormatLecture($resultat['datefin']);
        }
        $stmt = null;
    }
    return $deb . ' -/- ' . $fin;
}