283 lines
6.7 KiB
PHP
Executable File
283 lines
6.7 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
$loguer=$HTTP_GET_VARS["loguer"];
|
|
$idfamille=$HTTP_GET_VARS["idfamille"];
|
|
$idcateg=$HTTP_GET_VARS["idcateg"];
|
|
$idprod=$HTTP_GET_VARS["idprod"];
|
|
$nomcateg=$HTTP_GET_VARS["nomcateg"];
|
|
$action=$HTTP_GET_VARS["action"];
|
|
$nomfamille=$HTTP_GET_VARS["nomfamille"];
|
|
?>
|
|
<html>
|
|
<head>
|
|
<title>Partie Administrateur</title>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
if (isset($_SESSION['idadm']))
|
|
{
|
|
?>
|
|
<div align="center">
|
|
<table border=0>
|
|
<tr>
|
|
<td colspan=2 align="center">
|
|
<br><br><h1>Gestion des produits</h1>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<?php
|
|
require("../connexion.php");
|
|
$conn = mysql_connect($host, $user, $password);
|
|
mysql_select_db($bdd) or die("Impossible d'ouvrir la base de donnee $bdd");
|
|
|
|
if ($loguer)
|
|
{
|
|
|
|
$requete1 = "select idprod,refprod,denomination,description,location,delailivraison,prixht1,pathpdfdocument,pathphotobassedef,pathphotohautedef,idfamille,qteprod1,poidsprod1,qteprod2,prixht2,poidsprod2,qteprod3,prixht3,poidsprod3,coef from produit where idprod='$idprod'";
|
|
$result1=mysql_query($requete1) or die ("Erreur SQL :$requete<br>".mysql_error()."...");
|
|
|
|
while ($ligne=mysql_fetch_row($result1))
|
|
{
|
|
$refprod=$ligne[1];
|
|
$denomination=$ligne[2];
|
|
$description=$ligne[3];
|
|
$location=$ligne[4];
|
|
$delailivraison=$ligne[5];
|
|
$prixht1=$ligne[6];
|
|
$pathpdfdocument=$ligne[7];
|
|
$pathphotobassedef=$ligne[8];
|
|
$pathphotohautedef=$ligne[9];
|
|
$idfamille=$ligne[10];
|
|
$qteprod1=$ligne[11];
|
|
$poidsprod1=$ligne[12];
|
|
$qteprod2=$ligne[13];
|
|
$prixht2=$ligne[14];
|
|
$poidsprod2=$ligne[15];
|
|
$qteprod3=$ligne[16];
|
|
$prixht3=$ligne[17];
|
|
$poidsprod3=$ligne[18];
|
|
$coef=$ligne[19];
|
|
}
|
|
$idfamille=$oldid;
|
|
?>
|
|
<form name="f1" action="modifprod.php" method="POST">
|
|
<table>
|
|
<tr align='left'>
|
|
<td>
|
|
Denomination :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="denomination" value="<?php print $denomination?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Description :
|
|
</td>
|
|
<td>
|
|
<textarea name="description" cols=25 rows=5><?php print $description?></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
Location :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="location" value="<?php print $location?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
Refprod :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="refprod" value="<?php print $refprod?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
delailivraison :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="delailivraison" value="<?php print $delailivraison?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
Coef :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="coef" value="<?php print $coef?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
pathpdfdocument :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="pathpdfdocument" value="<?php print $pathpdfdocument?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
pathphotobassedef :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="pathphotobassedef" value="<?php print $pathphotobassedef?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td>
|
|
pathphotohautedef :
|
|
</td>
|
|
<td>
|
|
<input type="text" name="pathphotohautedef" value="<?php print $pathphotohautedef?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=2>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
<tr bgcolor=#FF9933 align=center>
|
|
<td colspan=2>
|
|
<b> COLISAGE </b>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=2>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
<tr align='left'>
|
|
<td colspan=2>
|
|
<table>
|
|
<tr align=center>
|
|
<td colspan=3 bgcolor=#FF9933>
|
|
Quantite
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<input type="text" name="qteprod1" value="<?php print $qteprod1?>"/>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="qteprod2" value="<?php print $qteprod2?>"/>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="qteprod3" value="<?php print $qteprod3?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align=center>
|
|
<td colspan=3 bgcolor=#FF9933>
|
|
Prix
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<input type="text" name="prixht1" value="<?php print $prixht1?>"/>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="prixht2" value="<?php print $prixht2?>"/>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="prixht3" value="<?php print $prixht3?>"/>
|
|
</td>
|
|
</tr>
|
|
<tr align=center>
|
|
<td colspan=3 bgcolor=#FF9933>
|
|
Poids (pour ports)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<input type="text" name="poidsprod1" value="<?php print $poidsprod1?>"/>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="poidsprod2" value="<?php print $poidsprod2?>"/>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="poidsprod3" value="<?php print $poidsprod3?>"/>
|
|
</td>
|
|
</tr>
|
|
</table
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align=right>
|
|
Famille
|
|
</td>
|
|
<td>
|
|
<select name="idfamille">
|
|
<?php
|
|
$requete2 = "select idfamille,nomfamille from famille";
|
|
$result2=mysql_query($requete2) or die ("Erreur SQL :$requete<br>".mysql_error()."...");
|
|
|
|
while ($ligne=mysql_fetch_row($result2))
|
|
{
|
|
$idf=$ligne[0];
|
|
$nomfamille=$ligne[1];
|
|
|
|
if ($idf==$oldid)
|
|
{
|
|
?>
|
|
<option value="<?php print $idfamille?>" selected="selected"><?php print $nomfamille?></option>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<option value="<?php print $idf?>"><?php print $nomfamille?></option>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=2>
|
|
<input type="hidden" name="<?php print session_name()?>" value="<?php print session_id()?>"/>
|
|
<input type="hidden" name="idcateg" value="<?php print $idcateg?>"/>
|
|
<input type="hidden" name="idprod" value="<?php print $idprod?>"/>
|
|
<input type="hidden" name="action" value="modif"/>
|
|
<input type="hidden" name="loguer" value="oui"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=2 align=center>
|
|
<input type="submit" value="Modifier"/>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<tr><td colspan=4><a href="login.php">Une erreure s'est produite veuillez vous reconnecter</a></td></tr>
|
|
<?php
|
|
session_destroy("loguer");
|
|
}
|
|
?>
|
|
<?php
|
|
if ($loguer==oui)
|
|
{
|
|
?>
|
|
<br><a href="famille.php?loguer=oui&idfamille=<?php print $idfamille?>&idcateg=<?php print $idcateg ?>&<?php print session_name();?>=<?php print session_id();?>">Retour</a>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<br><a href="../index.php?<?php print session_name();?>=<?php print session_id();?>">Retour</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
else
|
|
{
|
|
print "Erreur de connection";
|
|
}
|
|
?>
|
|
|
|
</body>
|
|
</html>
|