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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
<?php include("connect.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>ADMIN SearchUser</TITLE>
</HEAD>
<BODY>
<BR>
<DIV align="center"> <H2> Menu de gestion des utilisateurs par l'ADMIN </H2> </DIV>
<DIV align="center"> <H3> Interface de consultation des utilisateurs </H3> </DIV>
<BR><BR><BR>
<FORM ACTION="" NAME = "F1" METHOD ="GET" action ="SearchUser.php">
<DIV align="left">
Rechercher
<BR>
<label>
<INPUT NAME="Rechercher" TYPE="TEXT" SIZE="40" MAXLENGTH="40" />
</label> <BR><BR>
<label>
<INPUT type="submit" name="bouton" value="Envoyer">
</label> <BR><BR><BR>
<?php
$tablrole = array(); // role
$tablloc = array(); // localite
$tablreg = array(); // région
// Parcours de la liste utilisateur role
$statementrole = $db-> prepare('SELECT * from utilisateurrole');
//Execution
$statementrole->execute();
if ($statementrole->execute())
$tablrole = $statementrole->fetchAll (PDO::FETCH_OBJ);
// Parcours de la liste utilisateur Région
$statementreg = $db-> prepare('SELECT * from region');
//Execution
$statementreg->execute();
if ($statementreg->execute())
$tablreg = $statementreg->fetchAll (PDO::FETCH_OBJ);
// Parcours de la liste utilisateur localite
$statementloc = $db-> prepare('SELECT * from localite');
//Execution
$statementloc->execute();
if ($statementloc->execute())
$tablloc = $statementloc->fetchAll (PDO::FETCH_OBJ);
//Parcours de la liste userrole à partir de la BD REUSSITE <br>';
$afficher = $db->query
('
SELECT us.IdUtilisateur, us.Username, us.Password, usrol.RoleUser, loc.NomLocalite, rg.NomRegion
FROM utilisateur us, utilisateurrole usrol, localite loc, region rg
WHERE ((usrol.IdRoleUtilisateur = us.RoleUser) AND (loc.idLocalite = us.LocaliteUser) AND (rg.idRegion = us.RegionUser) AND (us.Username LIKE us.Username \'%".$_GET['Rechercher']."%\'))
');
// On affiche chaque entrée une à une
while ($donnees = $afficher->fetch())
{
?>
<DIV align="center">
<TABLE border=2 >
<TR align="center">
<TD align="center" bgcolor="#A4A4A4" style="font-weight:bold;" WIDTH=30% >
<strong>ID :</strong> <BR>
<?php echo $donnees['IdUtilisateur']; ?><br />
</TD >
<TD align="center" bgcolor="#A4A4A4" style="font-weight:bold;" WIDTH=30% >
<strong>Username :</strong> <BR>
<INPUT NAME="Username" TYPE="TEXT" SIZE="20" MAXLENGTH="20"
VALUE= '<?= $donnees['Username'] ?>'/>
</TD>
<TD align="center" bgcolor="#A4A4A4" style="font-weight:bold;" WIDTH=30% >
<strong>Password :</strong> <BR>
<INPUT NAME="Password" TYPE="TEXT" SIZE="20" MAXLENGTH="20"
VALUE= '<?= $donnees['Password'] ?>'/>
</TD>
<TD align="center" bgcolor="#A4A4A4" style="font-weight:bold;" WIDTH=30% >
<strong>RoleUser :</strong> <BR>
<INPUT NAME="RoleUser" TYPE="TEXT" SIZE="20" MAXLENGTH="20"
VALUE= '<?= $donnees['RoleUser'] ?>'/>
</TD>
<TD align="center" bgcolor="#A4A4A4" style="font-weight:bold;" WIDTH=30% >
<strong>RégionUser :</strong> <BR>
<INPUT NAME="NomRegion" TYPE="TEXT" SIZE="20" MAXLENGTH="20"
VALUE= '<?= $donnees['NomRegion'] ?>'/>
</TD>
<TD align="center" bgcolor="#A4A4A4" style="font-weight:bold;" WIDTH=30% >
<strong>LocalitéUser :</strong> <BR>
<INPUT NAME="NomLocalite" TYPE="TEXT" SIZE="20" MAXLENGTH="20"
VALUE= '<?= $donnees['NomLocalite'] ?>'/>
</TD>
<TD align="center">
<a href = "AdminModifUser.php?ref=<?php echo $donnees['IdUtilisateur']; ?>">
<INPUT type="submit" value=" Modifier " >
</a>
</TD >
<TD align="center">
<a href = "AdminSuppUser.php?ref=<?php echo $donnees['IdUtilisateur']; ?> &supp=ok">
<INPUT type="reset" value=" Supprimer">
</a>
</TD >
</TR>
</TABLE>
<?php
}
$afficher->closeCursor(); // Termine le traitement de la requête
?>
</DIV>
</FORM>
<?php include("footer.php"); ?>
</BODY>
</HTML> |
Partager