Files
resatennis_tyroltenn/www/site_marchand/admin/commande.php

165 lines
4.7 KiB
PHP
Executable File

<?php
session_start();
$loguer=$HTTP_GET_VARS["loguer"];
?>
<html>
<head>
<title>
Partie Administrateur
</title>
</head>
<body>
<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>
<?php
if (isset($_SESSION['idadm']))
{
?>
<div align="center">
<?php
/* SI ERREUR DE CONNEXION */
if(!$loguer)
{
?>
<table>
<tr>
<td align="center">
Erreur de connexion
<br><br> <a href="login.php?login=<?php print $login?>">Retour</a>
</td>
</tr>
</table>
<?php
} else {
?>
<br><br><br>
<?php
require("../connexion.php");
$conn = mysql_connect($host, $user, $password);
mysql_select_db($bdd) or die("Impossible d'ouvrir la base de donnee $bdd");
$requete2 = "select idcmde,datecmde,montantcmde,etatcmde,modepaiement,message,idcli from commande where etatcmde='debut'";
$result2=mysql_query($requete2) or die ("Erreur SQL :$requete2<br>".mysql_error()."...");
$requete8 = "select count(*) from commande where etatcmde='debut'";
$result8=mysql_query($requete8) or die ("Erreur SQL :$requete2<br>".mysql_error()."...");
while ($ligne8=mysql_fetch_row($result8))
{
$nombre=$ligne8[0];
}
?>
<div align="left">
<h4>Nouvelles commandes a valider : <?php print $nombre?></h4>
</div>
<table>
<tr>
<?php
if ($nombre!=0)
{
?>
<td>
<a href="selectcmd.php?loguer=oui&etatcmde=debut&<?php print session_name()?>=<?php print session_id()?>">Commandes non validees</a>
</td>
<?php
}
?>
<td>
<a href="selectcmd.php?loguer=oui&etatcmde=print&<?php print session_name()?>=<?php print session_id()?>">Commandes en cours</a>
</td>
<td>
<a href="selectcmd.php?loguer=oui&etatcmde=fin&<?php print session_name()?>=<?php print session_id()?>">Commandes traitees </a>
</td>
</tr>
</table>
<table>
<?php
while ($ligne2=mysql_fetch_row($result2))
{
$idcmde=$ligne2[0];
$datecmde=$ligne2[1];
$montantcmde=$ligne2[2];
$etatcmde=$ligne2[3];
$modepaiement=$ligne2[4];
$message=$ligne2[5];
$idcli=$ligne2[6];
?>
<tr>
<td align="left">
<form name="fc" action="modifcom.php" method="post">
<a href="detcmd.php?idcmde=<?php print $idcmde?>&idcli=<?php print $idcli?>">id commande : <?php print $idcmde ?></a><br>
<table border=1>
<tr>
<td>
date : <?php print $idcmde ?>
</td>
<td>
montant : <?php print $montantcmde ?>
</td>
</tr>
<tr>
<td>
Etat : <?php print $etatcmde ?>
</td>
<td>
Mode paiement : <?php print $modepaiement ?>
</td>
</tr>
<tr>
<td colspan=2>
Message : <?php print $message ?>
</td>
</tr>
<tr>
<td>
<input type="hidden" name="<?php print session_name();?>" value="<?php print session_id();?>"/>
<input type="hidden" name="loguer" value="oui"/>
</td>
</tr>
</table>
</form>
</td>
</tr>
<?php
}
}
?>
</table>
<br><br>
</div>
<?php
if ($loguer)
{
?>
<br>
<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
}
?>
<?php
}
else
{
print "Erreur de connection";
}
?>
</body>
</html>