1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
| <?php
$sql = "SELECT service.idservice, logo, nom_service, motif_de_transport, beneficiaires, accompagnement_possible
FROM commune
INNER JOIN intuni
ON commune.id = intuni.id_commune
INNER JOIN transport
ON intuni.id_transport = transport.id
INNER JOIN service
ON intuni.id_service = service.idservice
WHERE commune.id = :id_commune AND transport.id = :id_transport;
";
$reponse = $bdd->prepare($sql);
$reponse->bindValue(':id_commune', $_POST["id_commune"]);
$reponse->bindValue(':id_transport', $_POST["id_transport"]);
$reponse->execute();
while ($donnees = $reponse->fetch(PDO::FETCH_ASSOC))
{?>
<div class="col-lg-12">
<div class="pricing-box-alt">
<div class="pricing-heading">
<div class="col-lg-4">
<img src="img/logos/<?php echo nl2br($donnees['logo']);?>" style="width : 160px;"/>
</div>
<div class="col-lg-8">
<h3 class=""><?php echo ($donnees['nom_service']);?></h3>
<p><strong>Motif de transport :</strong><br><?php echo nl2br($donnees['motif_de_transport']);?> </p><br>
<p class="beneficiaires"><strong>Bénéficiaires : </strong><?php echo nl2br($donnees['beneficiaires']);?><br><br>
<strong>Aides et accompagnement possible : </strong><?php echo ($donnees['accompagnement_possible']);?></p> <br><br>
<a href="service.php?idservice=<?php echo $donnees['idservice']; ?>" class="btnrouge">Plus d'informations</a>
</div>
<div class="pricing-action">
<p style="color: #fcfcfc;"><?php echo ($donnees['nom_service']);?></p>
</div>
</div>
</div></div>
<?php
}
$reponse->closeCursor(); ?>
</article>
</div>
<div class="col-lg-4">
<aside class="right-sidebar">
<div class="widget">
<h5 class="widgetheading">Modifier ma recherche</h5>
<form action="communes.php" method="POST">
<br>
<h4>Choisir une commune</h3>
<form action="communes.php" method="POST">
<?php // communes
$reponse = $bdd->query("SELECT * FROM pbqj_mobilef.commune ORDER BY nom_commune ASC;");
?>
<select value="id_commune" name="id_commune" type="text" class="form-control">
<?php
while ($donnees = $reponse->fetch())
{
echo '<option value="'.$donnees['id'].'">'.$donnees['nom_commune'].'</option>';
}
?>
</select><br>
<h4>Choisir un type de transport</h4>
<?php // categories
$reponse = $bdd->query("SELECT * FROM pbqj_mobilef.transport ORDER BY ordre;");
?>
<p>
<select value="id_transport" name="id_transport" type="text" class="form-control">
<?php
while ($donnees = $reponse->fetch())
{
echo '<option value="'.$donnees['id'].'">'.$donnees['nom_transport'].'</option>';
}
$reponse->closeCursor();
?>
</select>
</p><br>
<input type="submit" value="Rechercher" class="btnrouge"/>
</form> |
Partager