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
| <?PHP
require_once'header.php';
?>
<ul id="nav">
<li><a href="annonce.php?token=<?php echo $_SESSION['login']; ?>">Ajouté une annonce</a></li>
<li><a href="voir_annonce.php?token=<?php echo $_SESSION['login']; ?>">Voir les annonces</a></li>
<li><a href="contact.php?token=<?php echo $_SESSION['login']; ?>">Contact</a></li>
</ul>
<?PHP
$connection->exec('DELETE FROM annonce WHERE timestamp< DATE_SUB(NOW(), INTERVAL jours DAY)');
$connection->exec('DELETE FROM choix_annonce WHERE timestamp< DATE_SUB(NOW(), INTERVAL jours DAY)');
/*}*/
include'function_mini.php';
$annonce_sortie = $connection->prepare('SELECT `idA`,`pseudo`,`ID`,`sexe`,`jours`,`annonce` FROM annonce');
$annonce_sortie->execute(array());
while($result = $annonce_sortie->fetch(PDO::FETCH_OBJ)){
$profil = $connection->prepare("SELECT * FROM photo_profil WHERE id_gal=:id_gal");
$profil->execute(array(':id_gal'=>$result->ID));
while($results = $profil->fetch(PDO::FETCH_OBJ)){
$results->gal;
miniature('image_profil/'.$results->gal.'', 150, 100);
if(!empty($results->gal) == TRUE){
echo'<img src="MINI11image_profil/'.$results->gal.'" border="0" />';
}else{
echo'<img src="imdesign/no_photo.png" width="150" height="100" border="0" />';
}
}
$tab_choix = array();
$annonce_sortie_choix = $connection->prepare('SELECT * FROM choix_annonce WHERE ID=:ID AND jours=:jours');
$annonce_sortie_choix->execute(array('ID'=>$result->ID,'jours'=>$result->jours));
while($result_choix = $annonce_sortie_choix->fetch(PDO::FETCH_OBJ)){
$tab_choix[] = $result_choix->choix;
$list_choix = (!empty($tab_choix))? implode(', ',$tab_choix) : '';
}
?>
</td>
<td style="width:90%;text-align:left;">
<table style="width:100%">
<tr>
<td style="text-align:left;"><b><u><span style="color:#660099">Pseudo</span></u> : </b>
<?PHP
switch($result->sexe){
case"Femme":
echo '<img src="imdesign/f.png" width="20" height="20" title="Femme" /><a href="http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/profil_membre.php.php?nom='.$result->pseudo.'" style="color:#0000FF;">'.$_SESSION['anp_p'].'</a>';
break;
case"Couple":
echo '<img src="imdesign/cpl.png" width="20" height="20" title="Homme"/><a href="http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/profil_membre.php?nom='.$result->pseudo.'" style="color:#0000FF;">'.$result->pseudo.'</a>';
break;
case"Homme":
echo '<img src="imdesign/h.png" width="20" height="20" title="Homme"/><a href="http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/profil_membre.php?nom='.$result->pseudo.'" style="color:#0000FF;">'.$result->pseudo.'</a>';
break;
}
?>
</td>
</tr>
<tr>
<td style="text-align:left;"><b><u><span style="color:#660099">Recherche</span></u> : </b><?PHP echo '<b>'.$list_choix.'</b>'; ?></td>
</tr>
<tr>
<td style="text-align:left;"><b><u><span style="color:#660099">N°: <?PHP echo ''.$result->idA.''; ?> Annonce</span></u> : </b><?PHP echo ''.$result->annonce.''; ?></td>
</tr>
<tr>
<td style="text-align:left;"> <input type="button" class="button_mauve" value="Répondre" id ="valider" onclick="window.location.href='<?PHP echo'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/annonce_message.php?destin='.$result->pseudo.'&nume='.$result->idA.''; ?>'" /></td>
</tr>
</table>
</td>
</tr>
</table>
<?PHP
}
?>
</div>
<div id="colonne-droite"></div>
</div>
</div>
</body>
</html> |
Partager