Là j'ai un tit probleme comme toujours je viens de terminer mon programme mais je veux approter plus de modifications.
Tout d'abord je prensente le programme.
C'est deux cases de recherches Nom et matricule le programme consiste que quand je ne mis pas le matricule il fait la recherche par nom et quand je mis pas le nom il fait la recherche par matricule là les modifs que je veux approté c quand j'ai un seul enregistrement je veux qu'il s'affiche automatiquement sinon s'il y on a plusieurs je veux que çà me donne une liste deroulente avec le des choix que je vais mentionné plus tard jé demandé à un pote qui s'est conné un asp il m'a dit que il faut voir avec la commande count()
si vous pouvez m'aider çà seré sympa :)
le programme est :
--------------------------------------------------------------------------------------------------------------------------------------------
<html>
<body>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE type=text/css>A:visited {
COLOR: #0000cc; TEXT-DECORATION: none
}
A:link {
COLOR: #0000cc; TEXT-DECORATION: none
}
A:hover {
COLOR: #339933; TEXT-DECORATION: none
}
</STYLE>
</HEAD>
<BR>
<table border=0 width="95%" align="center">
<tr>
<td>
<p align="justify">
<font size="2" face="Tahoma"> Cette rubrique vous permet de consulter la liste des agents ayant bénéficié d'une ou de plusieurs formations.</font>
</p>
<p align="justify">
<font size="2" face="Tahoma"> Vous pouvez afficher ces données par entité, par domaine, par théme ou en combinant les trois possibilités. Faites votre sélection, votre critére de tri et validez.</font>
</p>
</td>
</tr>
</table>
<br>
<form method="post" action="index.php">
<TABLE align=center border=0 cellPadding=1 cellSpacing=0>
<TR>
<TD><font size="2" face="Tahoma"> Matricule </font></td>
<td><INPUT name=recherche1 style="HEIGHT: 22px; WIDTH: 81px">
</TD>
</TR>
<TR>
<TD><font size="2" face="Tahoma"> Nom </font></td>
<td><INPUT name=recherche2 style="HEIGHT: 22px; WIDTH: 130px">
</TD>
</TR>
</table>
<TABLE align=center border=1 bordercolor=darkgreen width=60% cellPadding=1 cellSpacing=0>
<tr>
<td>
<TABLE align=center width=100% border=0 cellPadding=1 cellSpacing=0>
<TR>
<td>
<select name="recherche3">
<option value="1997">1997
<option value="1998">1998
<option value="1999">1999
<option value="2000">2000
<option value="2001">2001
<option value="2002">2002
<option value="2003">2003
<option value="2004">2004
<option value="2005">2005
</select>
<td>
<select name="recherche4">
<option value="2005">2005
<option value="2004">2004
<option value="2003">2003
<option value="2002">2002
<option value="2001">2001
<option value="2000">2000
<option value="1999">1999
<option value="1998">1998
<option value="1997">1997
</select>
</td>
<td>
<SELECT name=order id=order>
<option value="date">Date
<option value="matricule">Matricule
<option value="theme">Théme
</SELECT></td><td><br>
<input type="submit" name="B2" value="Envoyer">
</form>
</td>
</tr>
</table>
</table>
<?php
$c = @mysql_connect('localhost','root','') or die('connection impossible');
@mysql_select_db('lydec',$c) or die('selection impossible');
if ($recherche1 == "")
{
$sql = "SELECT * FROM formation2 where nom like '$recherche2' and year(date) >= '$recherche3' and year(au) <= '$recherche4' order by '$order' asc";
($p = @mysql_query($sql,$c))?><br><br>
<center><font size="2" face="tahoma" color="#000000"><b>Les resultats pour le Nom <? print "$recherche2"; ?> entre la periode du <? print "$recherche3"; ?> au <? print "$recherche4"; ?> trie par <? print "$order"; ?> sont :</b></font></td></center>
<table border="1" borderColor="#ffffff" cellPadding="1" cellSpacing="0" width="95%" align="center">
<br>
<tr bgcolor="#000000">
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Theme</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>NOM</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Prénom</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Du</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Au</b></font></td>
<?
while($r = @mysql_fetch_array($p))
{
?>
<tr bgcolor="#000000">
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r[theme]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r[nom]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r[prenom]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r[date]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r[au]"; ?></b></font></td>
<?
}
}
else
{
$sql1 = "SELECT * FROM formation2 where matricule like '$recherche1' and year(date) >= '$recherche3' and year(au) <= '$recherche4' order by '$order' asc";
($p1 = @mysql_query($sql1,$c))?><br><br>
<center><font size="2" face="tahoma" color="#000000"><b>Les resultats pour votre Matricule <? print "$recherche1"; ?> entre la periode du <? print "$recherche3"; ?> au <? print "$recherche4"; ?> trie par <? print "$order"; ?> sont :</b></font></td></center>
<table border="1" borderColor="#ffffff" cellPadding="1" cellSpacing="0" width="95%" align="center">
<br>
<tr bgcolor="#000000">
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Theme</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>NOM</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Prénom</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Du</b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b>Au</b></font></td>
<?
while($r1 = @mysql_fetch_array($p1))
{
?>
<tr bgcolor="#000000">
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r1[theme]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r1[nom]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r1[prenom]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r1[date]"; ?></b></font></td>
<td align="center"><font size="2" face="tahoma" color="#ffffff"><b><? print "$r1[au]"; ?></b></font></td>
<?
}
}
?>
</tr>
</table>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------------------------------
pour une aide en ligne Admin@WebmasterX.be <--- Msn
. :: WebmasterX :: .