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
|
<div class="form-group col-md-4">
<?php
$client = $bdd->prepare('SELECT * FROM interlocuteur WHERE interlocuteur_contact = "'.$_SESSION['Contact_id'].'"
AND interlocuteur_client = "'.$varsociete.'"');
$client->execute();
/* si il existe au moins 1 interlocteur on l'affiche. Sinon, on propose d'en créer un */
$nb = $client->rowCount();
if ($nb == 0)
{ ?>
<div class="alert alert-danger">
<?php echo '<span style="text-align:center; font-size:12px;"> Vous n\'avez pas d\'interlocteur. Merci d\'en créer un. </span> '; ?>
</div>
<?php }
else { ?>
<select type="text" class="form-control">
<div class="form-group col-md-5">
<label for="Adresse">Interlocuteur:</label>
<?php
while ($data = $client->fetch(PDO::FETCH_ASSOC)) {
echo "<option value=\"{$data['interlocuteur_nom']}\">
{$data['interlocuteur_nom']}
</option>";
}
$client->closeCursor(); ?>
</select><?php
} ?>
</div> |
Partager