Utilisation de la nouvelle fonction pour afficher le résultat de l'action dans la fiche
This commit is contained in:
parent
ca35f6605e
commit
9cbb97c51f
@ -26,6 +26,7 @@ require("../propal.class.php3");
|
|||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
$mesg = '';
|
||||||
|
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
{
|
{
|
||||||
@ -49,10 +50,11 @@ if ($action == 'addinpropal')
|
|||||||
$propal->insert_product($id, $HTTP_POST_VARS["qty"]);
|
$propal->insert_product($id, $HTTP_POST_VARS["qty"]);
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
|
$mesg = 'Produit ajouté à la proposition '.$propal->ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'update')
|
if ($action == 'update' && $cancel <> 'Annuler')
|
||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
|
|
||||||
@ -64,6 +66,7 @@ if ($action == 'update')
|
|||||||
|
|
||||||
$product->update($id, $user);
|
$product->update($id, $user);
|
||||||
$action = '';
|
$action = '';
|
||||||
|
$mesg = 'Fiche mise à jour';
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -71,7 +74,6 @@ if ($action == 'update')
|
|||||||
*/
|
*/
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
|
|
||||||
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
|
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||||
|
|
||||||
@ -102,7 +104,7 @@ else
|
|||||||
|
|
||||||
if ( $result )
|
if ( $result )
|
||||||
{
|
{
|
||||||
print '<div class="titre">Fiche produit : '.$product->ref.'</div><br>';
|
print_fiche_titre('Fiche produit : '.$product->ref, $mesg);
|
||||||
|
|
||||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
@ -125,7 +127,7 @@ else
|
|||||||
print '<hr><div class="titre">Edition de la fiche produit : '.$product->ref.'</div><br>';
|
print '<hr><div class="titre">Edition de la fiche produit : '.$product->ref.'</div><br>';
|
||||||
|
|
||||||
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
|
print "<form action=\"$PHP_SELF?id=$id\" method=\"post\">\n";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4"><tr>';
|
print '<table border="1" width="100%" cellspacing="0" cellpadding="4"><tr>';
|
||||||
print '<td width="20%">Référence</td><td><input name="ref" size="20" value="'.$product->ref.'"></td></tr>';
|
print '<td width="20%">Référence</td><td><input name="ref" size="20" value="'.$product->ref.'"></td></tr>';
|
||||||
@ -139,7 +141,8 @@ else
|
|||||||
print '<textarea name="desc" rows="8" cols="50">';
|
print '<textarea name="desc" rows="8" cols="50">';
|
||||||
print $product->description;
|
print $product->description;
|
||||||
print "</textarea></td></tr>";
|
print "</textarea></td></tr>";
|
||||||
print '<tr><td> </td><td><input type="submit" value="Enregistrer"></td></tr>';
|
print '<tr><td> </td><td><input type="submit" value="Enregistrer"> ';
|
||||||
|
print '<input type="submit" name="cancel" value="Annuler"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user