Fix: Oubli onglet
This commit is contained in:
parent
33433d41b5
commit
b933977b6f
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -23,11 +23,11 @@
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\file htdocs/product/stock/product.php
|
||||
\ingroup product
|
||||
\brief Page de la fiche produit
|
||||
\version $Revision$
|
||||
/**
|
||||
\file htdocs/product/stock/product.php
|
||||
\ingroup product
|
||||
\brief Page de la fiche produit
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
@ -101,261 +101,273 @@ if ($_POST["action"] == "transfert_stock" && $_POST["cancel"] <> $langs->trans("
|
||||
if ($_GET["id"])
|
||||
{
|
||||
|
||||
$product = new Product($db);
|
||||
|
||||
if ( $product->fetch($_GET["id"]))
|
||||
$product = new Product($db);
|
||||
|
||||
if ( $product->fetch($_GET["id"]))
|
||||
{
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Price");
|
||||
$h++;
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Photos");
|
||||
$h++;
|
||||
|
||||
if ($product->type == 0)
|
||||
{
|
||||
if ($conf->stock->enabled)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Stock");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
if ($conf->fournisseur->enabled) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Suppliers");
|
||||
$h++;
|
||||
}
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Statistics");
|
||||
$h++;
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$h++;
|
||||
|
||||
//erics: pour créer des produits composés de x 'sous' produits
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/pack.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans('Packs');
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans('Bills');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
print($mesg);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td width="40%">'.$product->ref.'</td>';
|
||||
print '<td width="40%">';
|
||||
if ($product->envente)
|
||||
{
|
||||
print $langs->trans("OnSell");
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NotOnSell");
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/product/stats/fiche.php?id='.$product->id.'">'.$langs->trans("Statistics").'</a></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td>'.price($product->price).'</td>';
|
||||
print '<td valign="top" rowspan="2">';
|
||||
print $langs->trans("Suppliers").' [<a href="../fiche.php?id='.$product->id.'&action=ajout_fourn">'.$langs->trans("Add").'</a>]';
|
||||
|
||||
$sql = "SELECT s.nom, s.idp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf";
|
||||
$sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product =$product->id";
|
||||
$sql .= " ORDER BY lower(s.nom)";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="../fourn/fiche.php?socid='.$objp->idp.'">'.$objp->nom.'</a></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
$db->free();
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
print '<tr><td>Stock seuil</td><td>'.$product->seuil_stock_alerte.'</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
/*
|
||||
* Contenu des stocks
|
||||
*
|
||||
*/
|
||||
print '<br><table class="border" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="40%">'.$langs->trans("Warehouse").'</td><td width="60%">Valeur du stock</td></tr>';
|
||||
$sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = ".$product->id;
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<tr><td width="40%">'.$obj->label.'</td><td>'.$obj->reel.'</td></tr>'; ;
|
||||
$total = $total + $obj->reel;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '<tr><td align="right">'.$langs->trans("Total").':</td><td>'.$total."</td></tr></table>";
|
||||
print '<br>';
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Price");
|
||||
$h++;
|
||||
|
||||
if($product->type == 0)
|
||||
{
|
||||
if ($user->rights->barcode->lire)
|
||||
{
|
||||
if ($conf->barcode->enabled)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("BarCode");
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Photos");
|
||||
$h++;
|
||||
|
||||
if ($product->type == 0)
|
||||
{
|
||||
if ($conf->stock->enabled)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Stock");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
if ($conf->fournisseur->enabled) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Suppliers");
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans("Statistics");
|
||||
$h++;
|
||||
|
||||
//erics: pour créer des produits composés de x 'sous' produits
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/pack.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans('Packs');
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id;
|
||||
$head[$h][1] = $langs->trans('Bills');
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
|
||||
|
||||
print($mesg);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td width="40%">'.$product->ref.'</td>';
|
||||
print '<td width="40%">';
|
||||
if ($product->envente)
|
||||
{
|
||||
print $langs->trans("OnSell");
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("NotOnSell");
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/product/stats/fiche.php?id='.$product->id.'">'.$langs->trans("Statistics").'</a></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td>'.price($product->price).'</td>';
|
||||
print '<td valign="top" rowspan="2">';
|
||||
print $langs->trans("Suppliers").' [<a href="../fiche.php?id='.$product->id.'&action=ajout_fourn">'.$langs->trans("Add").'</a>]';
|
||||
|
||||
$sql = "SELECT s.nom, s.idp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf";
|
||||
$sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product =$product->id";
|
||||
$sql .= " ORDER BY lower(s.nom)";
|
||||
|
||||
if ( $db->query($sql) )
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="../fourn/fiche.php?socid='.$objp->idp.'">'.$objp->nom.'</a></td></tr>';
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
$db->free();
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
print '<tr><td>Stock seuil</td><td>'.$product->seuil_stock_alerte.'</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
/*
|
||||
* Contenu des stocks
|
||||
*
|
||||
*/
|
||||
print '<br><table class="border" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="40%">'.$langs->trans("Warehouse").'</td><td width="60%">Valeur du stock</td></tr>';
|
||||
$sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = ".$product->id;
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<tr><td width="40%">'.$obj->label.'</td><td>'.$obj->reel.'</td></tr>'; ;
|
||||
$total = $total + $obj->reel;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '<tr><td align="right">'.$langs->trans("Total").':</td><td>'.$total."</td></tr></table>";
|
||||
print '<br>';
|
||||
|
||||
}
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* Correction du stock
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "correction")
|
||||
/*
|
||||
* Correction du stock
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "correction")
|
||||
{
|
||||
print_titre ("Correction du stock");
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="correct_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td width="20%">'.$langs->trans("Warehouse").'</td><td width="20%"><select name="id_entrepot">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " WHERE statut = 1";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print '<td width="20%"><select name="mouvement">';
|
||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||
print '<option value="1">'.$langs->trans("Delete").'</option>';
|
||||
print '</select></td>';
|
||||
print '<td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||
print '<tr><td colspan="5" align="center"><input type="submit" value="'.$langs->trans('Save').'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print_titre ("Correction du stock");
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="correct_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td width="20%">'.$langs->trans("Warehouse").'</td><td width="20%"><select name="id_entrepot">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " WHERE statut = 1";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print '<td width="20%"><select name="mouvement">';
|
||||
print '<option value="0">'.$langs->trans("Add").'</option>';
|
||||
print '<option value="1">'.$langs->trans("Delete").'</option>';
|
||||
print '</select></td>';
|
||||
print '<td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||
print '<tr><td colspan="5" align="center"><input type="submit" value="'.$langs->trans('Save').'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
/*
|
||||
* Transfert de pièces
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "transfert")
|
||||
/*
|
||||
* Transfert de pièces
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "transfert")
|
||||
{
|
||||
print_titre ("Transfert de stock");
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td width="20%">'.$langs->trans("Source").'</td><td width="20%"><select name="id_entrepot_source">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " WHERE statut = 1";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print_titre ("Transfert de stock");
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="transfert_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td width="20%">'.$langs->trans("Source").'</td><td width="20%"><select name="id_entrepot_source">';
|
||||
|
||||
print '<td width="20%">'.$langs->trans("Target").'</td><td width="20%"><select name="id_entrepot_destination">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " WHERE statut = 1";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print '<td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||
print '<tr><td colspan="6" align="center"><input type="submit" value="'.$langs->trans('Save').'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " WHERE statut = 1";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
|
||||
print '<td width="20%">'.$langs->trans("Target").'</td><td width="20%"><select name="id_entrepot_destination">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " WHERE statut = 1";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td>';
|
||||
print '<td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||
print '<tr><td colspan="6" align="center"><input type="submit" value="'.$langs->trans('Save').'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "definir")
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == "definir")
|
||||
{
|
||||
print_titre ("Créer un stock");
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="create_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td width="20%">'.$langs->trans("Warehouse").'</td><td width="40%"><select name="id_entrepot">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td><td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||
print '<tr><td colspan="4" align="center"><input type="submit" value="'.$langs->trans('Save').'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans('Cancel').'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print_titre ("Créer un stock");
|
||||
print "<form action=\"product.php?id=$product->id\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="create_stock">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td width="20%">'.$langs->trans("Warehouse").'</td><td width="40%"><select name="id_entrepot">';
|
||||
|
||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||
$sql .= " ORDER BY lower(e.label)";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object( $i);
|
||||
print '<option value="'.$obj->rowid.'">'.$obj->label ;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</select></td><td width="20%">Nb de pièce</td><td width="20%"><input name="nbpiece" size="10" value=""></td></tr>';
|
||||
print '<tr><td colspan="4" align="center"><input type="submit" value="'.$langs->trans('Save').'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans('Cancel').'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error();
|
||||
dolibarr_print_error();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user