pantiri
10Messages postés
6 juillet 2004Date d'inscription
2 févr. 2007 à 03:22
Merci pour ton aide, voici le code enier
<?php
include("parametres.php");
$DB_link = mysql_connect($host,$user,"");
$requette = " select * from $table where actif = '1' order by date desc, heure desc ";
$resultat = mysql_db_query($database,$requette,$DB_link);
$nbr_entrees = mysql_num_rows($resultat);
$a = array();
function affichage_unique($var)
{
echo "<tr bgcolor=\"#CCCCCC\">";
//Date
$tmp = $var;
echo "<th width=\"10%\" align=left nowrap>".$tmp."</th>";
//email
echo "<th width=\"12%\" align=left nowrap>".$tmp."</th>";
//Type de Message
echo "<th width=\"8%\" align=left nowrap>".$tmp."</th>";
//Message
echo "<th width=\"500\" align=left nowrap>".$tmp."</th>";
//Bouton Repondre
echo "<th width=\"8%\" align=left nowrap>".$tmp."</th>";
//Bouton Supprimer
echo "<th width=\"8%\" align=left nowrap>".$tmp."</th></tr>";
};
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Listing des entrée dans la base : </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body { font-family: Verdana; font-size: 12px; font-weight: normal; color: #000000;}
A:link { font-family: Verdana; font-size: 12px; font-weight: bold; color: #000000}
A:active { font-family: Verdana; font-size: 12px; font-weight: bold; color: #000000}
A:visited { font-family: Verdana; font-size: 12px; font-weight: bold; color: #000000}
.title { font-family: Verdana; font-size: 14px; font-weight: bold; color: #404040; text-decoration: none;}
.menu { font-family: Verdana; font-size: 12px; font-weight: normal; color: #000000; text-decoration: none;}
.texte { font-family: Verdana; font-size: 12px; font-weight: normal; color: #000000; text-decoration: none;}
.com { font-family: Verdana; font-size: 12px; font-weight: bold; color: #000000}
.minitxt { font-family: Verdana; font-size: 9px; font-weight: normal; color: #000000; text-decoration: none;}
.minitxtred{ font-family: Verdana; font-size: 9px; font-weight: normal; color: #FF0000; text-decoration: none;}
.special { font-family: Verdana; font-size: 8px; font-weight: normal; color: #595959; text-decoration: none;}
--></style>
</head>
<body>
<table class="texte" width="100%" border=0 cellspacing=1 cellpadding=2>
<form name="listing" action="<?php echo $PHP_SELF;?>" method="post" >
<tr bgcolor="#FF8F15">
<td class="title" align=center colspan=6> <a class="minitxt" href="listing.php">Le
Sirroco Listing</a><br>
<a class="com" href="index.php">Retour
à la page d'accueil</a> : <a class="com" href="contact.php">Contact</a>
</td>
</tr>
<tr bgcolor="#FFEAD5">
<th align=left width="1%" nowrap></th>
<th align=left width="9%" nowrap>Date</th>
<th align=left width="15%" nowrap>Adresse mail/N° Tel</th>
<th align=left width="10%" nowrap>Type de message</th>
<th align=left width="40%" nowrap>Messages <input type="submit" name = "supprimer" value="Supprimer"> <input type="submit" name ="repondre" value="répondre"> </th>
<th align=left width="8%" nowrap> Statut</th>
</tr>
<?php
if ($nbr_entrees != 0)
{
for ($i = 1; $i <= $nbr_entrees ; $i++)
{ //################################affichage_listing($resultat,$DB_link,($i -1));
$i--;
echo "<tr bgcolor=\"#CCCCCC\">";
// Selection
echo "<th align=left width=\"2%\" nowrap><input type= \"checkbox\" name =\"etat[]\" value =\"$i\" ></th>";
//Date
$tmp = mysql_result($resultat,$i,"date");
$tmp = $tmp."[".mysql_result($resultat,$i,"heure")."]";
echo "<th width=\"9%\" align=left nowrap>".$tmp."</th>";
//email
$tmp = mysql_result($resultat,$i,"email");
echo "<th width=\"12%\" align=left nowrap>".$tmp."</th>";
//Type de Message
if (mysql_result($resultat,$i,"reservation")) $tmp = "Reservation";
else $tmp = "Avis";
echo "<th width=\"8%\" align=left nowrap>".$tmp."</th>";
//Message
$tmp = mysql_result($resultat,$i,"message");
echo "<th width=\"500\" align=left nowrap>".$tmp."</th>";
//Bouton Repondre
$j = $i +1;
echo "<th width=\"8%\" align=left nowrap><a href=\"repondre.php?indice=$i\"> <img src=\"images/Circle_Green.gif\" border =\"0\" width=\"12\" > [$j]</a></th>";
//Bouton Supprimer
//echo "<th width=\"8%\" align=left nowrap><a href=\"supprimer.php?indice=$i\"> Supprimer </a></th></tr>";
//################################}
$i++;
};
//for ($i = 11; $i <= $nbr_entrees ; $i++)
//{
//$indice = $i - 1;
//$delete_email = mysql_result($resultat,$indice,"email");
//$delete_heure = mysql_result($resultat,$indice,"heure");
//$requette2 = "delete from $table where email = '$delete_email' and heure = '$delete_heure'";
//mysql_db_query($database,$requette2,$DB_link);
//};
mysql_close($DB_link);
}
else affichage_unique("tbl vide");
?>
</form>
</table>
<p>---------------------------------------------------------------------------------------------------------------------------------------------------------------</p>
<p>Liste des indice selectionnés : </p>
<p>
<?php
if (isset($supprimer))
{
echo "SUP <br>";
};
if (isset($repondre))
{
echo "REP <br>";
};
for ($j = 0; $j < $nbr_entrees ; $j++)
if ($etat[$j] != "") echo " etat[$j]= $etat[$j] <br>";
?>
</body>
</html>