Modif register_global
This commit is contained in:
parent
e15b44a4ec
commit
fc827a5de8
@ -41,16 +41,16 @@ if ($_POST["action"] == 'add')
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'update' && $cancel <> 'Annuler')
|
if ($_POST["action"] == 'update' && $_POST["cancel"] <> 'Annuler')
|
||||||
{
|
{
|
||||||
$entrepot = new Entrepot($db);
|
$entrepot = new Entrepot($db);
|
||||||
if ($entrepot->fetch($id))
|
if ($entrepot->fetch($_GET["id"]))
|
||||||
{
|
{
|
||||||
$entrepot->libelle = $_POST["libelle"];
|
$entrepot->libelle = $_POST["libelle"];
|
||||||
$entrepot->description = $_POST["desc"];
|
$entrepot->description = $_POST["desc"];
|
||||||
$entrepot->statut = $_POST["statut"];
|
$entrepot->statut = $_POST["statut"];
|
||||||
|
|
||||||
if ( $entrepot->update($id, $user))
|
if ( $entrepot->update($_GET["id"], $user))
|
||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$mesg = 'Fiche mise à jour';
|
$mesg = 'Fiche mise à jour';
|
||||||
@ -77,6 +77,11 @@ if ($cancel == 'Annuler')
|
|||||||
* Affichage
|
* Affichage
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
* Création
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'create')
|
if ($_GET["action"] == 'create')
|
||||||
{
|
{
|
||||||
print "<form action=\"fiche.php\" method=\"post\">\n";
|
print "<form action=\"fiche.php\" method=\"post\">\n";
|
||||||
@ -99,12 +104,12 @@ if ($_GET["action"] == 'create')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($id)
|
if ($_GET["id"])
|
||||||
{
|
{
|
||||||
if ($action <> 're-edit')
|
if ($_GET["action"] <> 're-edit')
|
||||||
{
|
{
|
||||||
$entrepot = new Entrepot($db);
|
$entrepot = new Entrepot($db);
|
||||||
$result = $entrepot->fetch($id);
|
$result = $entrepot->fetch($_GET["id"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
@ -125,11 +130,11 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (($action == 'edit' || $action == 're-edit') && 1)
|
if (($_GET["action"] == 'edit' || $action == 're-edit') && 1)
|
||||||
{
|
{
|
||||||
print_fiche_titre('Edition de la fiche entrepot', $mesg);
|
print_fiche_titre('Edition de la fiche entrepot', $mesg);
|
||||||
|
|
||||||
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
|
print "<form action=\"fiche.php?id=$entrepot->id\" method=\"post\">\n";
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
@ -177,7 +182,7 @@ if ($action == '' && ($user->rights->produit->modifier || $user->rights->produit
|
|||||||
|
|
||||||
if ($action == '')
|
if ($action == '')
|
||||||
{
|
{
|
||||||
print "<a class=\"tabAction\" href=\"fiche.php?action=edit&id=$id\">Editer</a>";
|
print "<a class=\"tabAction\" href=\"fiche.php?action=edit&id=$entrepot->id\">Editer</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user