122 lines
2.4 KiB
PHP
Executable File
122 lines
2.4 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
$loguer=$HTTP_GET_VARS["loguer"];
|
|
?>
|
|
<html>
|
|
<head>
|
|
<title>Partie Administrateur</title>
|
|
</head>
|
|
<body>
|
|
<div align="center">
|
|
<table align=center>
|
|
<tr align="center">
|
|
<td>
|
|
<a href="gestcli.php?loguer=oui&<?php print session_name() ?>=<?php print session_id() ?>">Gestion des clients</a>
|
|
</td>
|
|
<td>
|
|
<a href="produit.php?loguer=oui&<?php print session_name() ?>=<?php print session_id() ?>">Gestion des produits</a>
|
|
</td>
|
|
<td>
|
|
<a href="commande.php?loguer=oui&<?php print session_name() ?>=<?php print session_id() ?>">Gestion des commandes</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br><br><br>
|
|
<table>
|
|
<?php
|
|
if (isset($_SESSION['idadm']))
|
|
{
|
|
|
|
if ($loguer)
|
|
{
|
|
require("../connexion.php");
|
|
$conn = mysql_connect($host, $user, $password);
|
|
mysql_select_db($bdd) or die("Impossible d'ouvrir la base de donnee $bdd");
|
|
|
|
$requete = "select nomcli,prenomcli,societe,telfixe,idcli from client order by nomcli";
|
|
$result=mysql_query($requete) or die ("Erreur SQL :$requete<br>".mysql_error()."...");
|
|
|
|
?>
|
|
<tr>
|
|
<td>
|
|
<table>
|
|
<tr align="center" bgcolor="#FFFFFF">
|
|
<td>
|
|
<b>Nom</b>
|
|
</td>
|
|
<td>
|
|
<b>Prenom</b>
|
|
</td>
|
|
<td>
|
|
<b>societe</b>
|
|
</td>
|
|
<td>
|
|
<b>telfixe</b>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=4>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
while ($ligne=mysql_fetch_row($result))
|
|
{
|
|
$nomcli=$ligne[0];
|
|
$prenomcli=$ligne[1];
|
|
$societe=$ligne[2];
|
|
$telfixe=$ligne[3];
|
|
$idcli=$ligne[4];
|
|
|
|
print " <tr>
|
|
<td>
|
|
<a href=\"modifcli.php?loguer=oui&idcli=$idcli&".session_name()."=".session_id()."\">$nomcli</a>
|
|
</td>
|
|
<td>
|
|
$prenomcli
|
|
</td>
|
|
<td>
|
|
$societe
|
|
</td>
|
|
<td>
|
|
$telfixe
|
|
</td>
|
|
</tr>";
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
print "<tr><td colspan=4><a href=\"login.php\">Une erreure s'est produite veuillez vous reconnecter</a></td></tr>";
|
|
session_destroy("loguer");
|
|
}
|
|
?>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br><br><br>
|
|
<?php
|
|
if ($loguer==oui)
|
|
{
|
|
?>
|
|
<a href="index.php?loguer=oui&<?php print session_name();?>=<?php print session_id();?>">Retour</a>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<a href="index.php?<?php print session_name();?>=<?php print session_id();?>">Retour</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else
|
|
{
|
|
print "Erreur de connection";
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|