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
|
<?php
//Vérifie que l'admin est connection via sa session
require_once("../Login/VerifSessionAdmin.php");
require_once("../Scripts/GraphismeDynamic.js");
//Insertion du header
require_once("../Include/header.php");
//Insertion du menu
require_once("../Include/menu.php");
//Connection à la base de données
require_once("../Connection/Connection.php");
// ----------------------Affichage de la liste des agents
$query = "SELECT IdAgent, Nom, CodeAlliance, IdEntite, IdSite FROM agents ";
$result = @mysql_query ($query) or die (mysql_error());
if(mysql_num_rows($result)<=0)
{// il n'y a pas d'agent dans la base
echo "<div align='center' class='Titre'>Administration</div>
<table width='720' border='0' align='center' cellpadding='10' cellspacing='1'>
<tr>
<th><div align='center'>Liste des agents</div><br></th>
</tr>
<tr>
<td height='100' class='TDDonnees'><div align='center' class='menu'>Il n'y a pas d'agent dans la base actuellement</div></td>
</tr>
</table>";
}
else
{//4 Affiche la liste des agents
echo "<div align='center' class='Titre'>Administration<br /><span class='menu'>Liste des agents</span></div>
<table width='720' border='0' align='center' cellpadding='10' cellspacing='1'>
<tr valign='top'>
<th><a class='ath' href=ListeAgentAdmin.php?Tri=Nom ASC>Nom</a></th>
<th><a class='ath' href=ListeAgentAdmin.php?Tri=Prenom ASC>Prénom</a></th>
<th><a class='ath' href=ListeAgentAdmin.php?Tri=Code Alliance ASC>Code Alliance</a></th>
<th><a class='ath' href=ListeAgentAdmin.php?Tri=Entite ASC>Entité</a></th>
<th >Modification</th>
<th >Suppression</th>
</tr>";
while($temp=mysql_fetch_assoc($result)){
$query2 = "SELECT agents.IdAgent, agents.Nom, agents.Prenom, agents.CodeAlliance, entites.Entite ";
$query2 .="FROM agents, entites ";
$query2 .="WHERE agents.IdAgent='".$temp['IdAgent']."' AND entites.IdEntite='".$temp['IdEntite']."' ";
$query2 .="ORDER BY agents.Nom ";
$result2 = @mysql_query ($query2) or die (mysql_error());
while($temp2=mysql_fetch_assoc($result2)){
echo "<tr valign='top' class='TDDonnees' onmouseover=\"setPointer('over', this, '#FFFFFF', '', '', '')\" onmouseout=\"setPointer('out', this, '#f5f5f5', '', '', '')\">
<td >".$temp2['Nom']."</td>
<td >".$temp2['Prenom']."</td>
<td>".$temp2['CodeAlliance']."</td>
<td>".$temp2['Entite']."</td>
<td ><a href=\"ModifAgent.php?IdAgent=".$temp2['IdAgent']."\">[Modifier]</a></td>
<td ><a href=\"ValidSuppAgent.php?IdAgent=".$temp2['IdAgent']."\">[Supprimer]</a></td>
</tr>";
}
}
}
echo "</table>";
//insertion du footer
require_once("../Include/footer.php");
?> |
Partager