Commit for release
This commit is contained in:
parent
94446fb402
commit
e81e80ab12
@ -220,5 +220,19 @@ print "</table>";
|
|||||||
print "</form>";
|
print "</form>";
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter();
|
/*
|
||||||
|
* Repertoire
|
||||||
|
*/
|
||||||
|
|
||||||
|
print_titre("Chemins d'accés aux documents");
|
||||||
|
|
||||||
|
print '<table border="1" cellpadding="3" cellspacing="0">';
|
||||||
|
print '<TR class="liste_titre">';
|
||||||
|
print '<td>Nom</td><td>Valeur</td>';
|
||||||
|
print "</TR>\n";
|
||||||
|
print '<tr><td>Répertoire</td><td><a href="file:/'.FAC_OUTPUTDIR.'">'.FAC_OUTPUTDIR.'</a></td></tr>';
|
||||||
|
print '<tr><td>URL</td><td><a href="'.FAC_OUTPUT_URL.'">'.FAC_OUTPUT_URL.'</a></td></tr>';
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -24,54 +24,29 @@ llxHeader();
|
|||||||
|
|
||||||
print_titre("Configuration Dolibarr (version ".DOL_VERSION.")");
|
print_titre("Configuration Dolibarr (version ".DOL_VERSION.")");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<table border="1" cellpadding="3" cellspacing="0">';
|
print '<table border="1" cellpadding="3" cellspacing="0">';
|
||||||
|
print '<TR class="liste_titre">';
|
||||||
print '<tr><td>css</td><td>' . $conf->css . '</td></tr>';
|
print '<td>Nom</td><td>Valeur</td><td>Action</td>';
|
||||||
print '<tr><td>theme</td><td>' . $conf->theme . '</td></tr>';
|
print "</TR>\n";
|
||||||
print '<tr><td>document root</td><td>' . $DOCUMENT_ROOT . '</td></tr>';
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td bgcolor="#e0e0e0" colspan="2">Database</td></tr>';
|
print '<tr><td>Version</td><td>' . DOL_VERSION . '</td><td> </td></tr>';
|
||||||
print '<tr><td>type</td><td>' . $conf->db->type . '</td></tr>';
|
print '<tr><td>css</td><td>' . $conf->css . '</td><td> </td></tr>';
|
||||||
print '<tr><td>host</td><td>' . $conf->db->host . '</td></tr>';
|
print '<tr><td>theme</td><td>' . $conf->theme . '</td><td> </td></tr>';
|
||||||
print '<tr><td>user</td><td>' . $conf->db->user . ' </td></tr>';
|
print '<tr><td>document root</td><td>' . DOL_DOCUMENT_ROOT . '</td><td> </td></tr>';
|
||||||
print '<tr><td>pass</td><td>' . $conf->db->pass . ' </td></tr>';
|
|
||||||
print '<tr><td>Database name</td><td>' . $conf->db->name . '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr class="list_sep"><td bgcolor="#e0e0e0" colspan="2">Propale</td></tr>';
|
|
||||||
print '<tr><td>templates</td><td>' . $conf->propal->templatesdir . '</td></tr>';
|
|
||||||
print '<tr><td>output dir</td><td>' . $conf->propal->outputdir . '</td></tr>';
|
|
||||||
print '<tr><td>output url</td><td>' . $conf->propal->outputurl . '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr class="list_sep"><td bgcolor="#e0e0e0" colspan="2">Facture</td></tr>';
|
|
||||||
print '<tr><td>templates</td><td>' . $conf->facture->templatesdir . '</td></tr>';
|
|
||||||
print '<tr><td>output dir</td><td>' . $conf->facture->outputdir . '</td></tr>';
|
|
||||||
print '<tr><td>output url</td><td>' . $conf->facture->outputurl . '</td></tr>';
|
|
||||||
|
|
||||||
|
|
||||||
if ($conf->fichinter->enabled) {
|
print '<tr class="liste_titre"><td colspan="3">Database</td></tr>';
|
||||||
print '<tr><td bgcolor="#e0e0e0" colspan="2">Fiche d\'intervention</td></tr>';
|
print '<tr><td>type</td><td>' . $conf->db->type . '</td><td> </td></tr>';
|
||||||
print '<tr><td>templates</td><td>' . $conf->fichinter->templatesdir . '</td></tr>';
|
print '<tr><td>host</td><td>' . $conf->db->host . '</td><td> </td></tr>';
|
||||||
print '<tr><td>output dir</td><td>' . $conf->fichinter->outputdir . '</td></tr>';
|
print '<tr><td>user</td><td>' . $conf->db->user . ' </td><td> </td></tr>';
|
||||||
print '<tr><td>output url</td><td>' . $conf->fichinter->outputurl . '</td></tr>';
|
print '<tr><td>pass</td><td>' . $conf->db->pass . ' </td><td> </td></tr>';
|
||||||
}
|
print '<tr><td>Database name</td><td>' . $conf->db->name . '</td><td> </td></tr>';
|
||||||
|
|
||||||
if ($conf->don->enabled) {
|
|
||||||
print '<tr><td bgcolor="#e0e0e0" colspan="2">Dons</td></tr>';
|
|
||||||
print '<tr><td>Paiement en ligne</td><td>' . $conf->don->onlinepayment . '</td></tr>';
|
|
||||||
print '<tr><td>Don minimum</td><td>' . $conf->don->minimum . '</td></tr>';
|
|
||||||
print '<tr><td>Email Moderateurs</td><td>'.$conf->don->email_moderator.'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td bgcolor="#e0e0e0" colspan="2">Webcal</td></tr>';
|
|
||||||
print '<tr><td>type</td><td>' . $conf->webcal->db->type . '</td></tr>';
|
|
||||||
print '<tr><td>host</td><td>' . $conf->webcal->db->host . '</td></tr>';
|
|
||||||
print '<tr><td>user</td><td>' . $conf->webcal->db->user . ' </td></tr>';
|
|
||||||
print '<tr><td>pass</td><td>' . $conf->webcal->db->pass . ' </td></tr>';
|
|
||||||
print '<tr><td>Database name</td><td>' . $conf->webcal->db->name . '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,6 +15,9 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php3");
|
require("./pre.inc.php3");
|
||||||
@ -92,49 +92,52 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$propales = $projet->get_propal_list();
|
$propales = $projet->get_propal_list();
|
||||||
|
|
||||||
if (sizeof($propales)>0 && is_array($propales)) {
|
if (sizeof($propales)>0 && is_array($propales))
|
||||||
|
{
|
||||||
|
|
||||||
print '<p>Listes des propales associées au projet';
|
print_titre('Listes des propales associées au projet');
|
||||||
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
|
|
||||||
print "<TR bgcolor=\"#e0e0e0\">";
|
|
||||||
print "<TD>Réf</TD>";
|
|
||||||
print '<TD>Date</TD>';
|
|
||||||
print '<TD align="right">Prix</TD>';
|
|
||||||
print '<TD align="center">Statut</TD>';
|
|
||||||
print '</TR>';
|
|
||||||
|
|
||||||
for ($i = 0; $i<sizeof($propales);$i++){
|
|
||||||
$propale = new Propal($db);
|
|
||||||
$propale->fetch($propales[$i]);
|
|
||||||
|
|
||||||
$var=!$var;
|
print '<TR class="liste_titre">';
|
||||||
print "<TR $bc[$var]>";
|
print "<TD>Réf</TD>";
|
||||||
print "<TD><a href=\"../propal.php3?propalid=$propale->id\">$propale->ref</a></TD>\n";
|
print '<TD>Date</TD>';
|
||||||
|
print '<TD align="right">Prix</TD>';
|
||||||
print '<TD>'.strftime("%d %B %Y",$propale->datep).'</a></TD>';
|
print '<TD align="center">Statut</TD>';
|
||||||
|
|
||||||
print '<TD align="right">'.price($propale->price).'</TD>';
|
|
||||||
print '<TD align="center">statut</TD>';
|
|
||||||
print '</TR>';
|
print '</TR>';
|
||||||
|
|
||||||
$total = $total + $propale->price;
|
for ($i = 0; $i<sizeof($propales);$i++){
|
||||||
}
|
$propale = new Propal($db);
|
||||||
|
$propale->fetch($propales[$i]);
|
||||||
print '<tr><td>'.$i.' propales</td>';
|
|
||||||
print '<td colspan="2" align="right"><b>Total : '.price($total).'</b></td>';
|
$var=!$var;
|
||||||
print '<td align="left"><b>Euros HT</b></td></tr>';
|
print "<TR $bc[$var]>";
|
||||||
print "</TABLE>";
|
print "<TD><a href=\"../propal.php3?propalid=$propale->id\">$propale->ref</a></TD>\n";
|
||||||
} else {
|
|
||||||
print "pas de propales";
|
print '<TD>'.strftime("%d %B %Y",$propale->datep).'</a></TD>';
|
||||||
}
|
|
||||||
}
|
print '<TD align="right">'.price($propale->price).'</TD>';
|
||||||
|
print '<TD align="center">'.$propale->statut.'</TD>';
|
||||||
|
print '</TR>';
|
||||||
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
|
|
||||||
|
$total = $total + $propale->price;
|
||||||
print "<td align=\"center\" width=\"25%\"><a href=\"fiche.php3?id=$id&action=edit\">Editer</a></td>";
|
}
|
||||||
|
|
||||||
|
print '<tr><td>'.$i.' propales</td>';
|
||||||
|
print '<td colspan="2" align="right"><b>Total : '.price($total).'</b></td>';
|
||||||
|
print '<td align="left"><b>Euros HT</b></td></tr>';
|
||||||
|
print "</TABLE>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "pas de propales";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
|
||||||
|
|
||||||
|
print "<td align=\"center\" width=\"25%\"><a href=\"fiche.php3?id=$id&action=edit\">Editer</a></td>";
|
||||||
|
|
||||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||||
|
|
||||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||||
|
|||||||
@ -30,7 +30,6 @@ if ($user->societe_id > 0)
|
|||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
|||||||
@ -36,7 +36,8 @@ llxHeader();
|
|||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
|
||||||
if ($action == 'setstatut') {
|
if ($action == 'setstatut')
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Cloture de la propale
|
* Cloture de la propale
|
||||||
*/
|
*/
|
||||||
@ -233,8 +234,7 @@ if ($propalid)
|
|||||||
print '<td align="center" width="25%">-</td>';
|
print '<td align="center" width="25%">-</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||||
|
|
||||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||||
|
|
||||||
|
|
||||||
@ -305,120 +305,111 @@ if ($propalid)
|
|||||||
|
|
||||||
if ($sortfield == "")
|
if ($sortfield == "")
|
||||||
{
|
{
|
||||||
$sortfield="lower(p.label)";
|
$sortfield="p.datep";
|
||||||
}
|
}
|
||||||
if ($sortorder == "")
|
if ($sortorder == "")
|
||||||
{
|
{
|
||||||
$sortorder="ASC";
|
$sortorder="DESC";
|
||||||
}
|
}
|
||||||
|
|
||||||
$yn["t"] = "oui";
|
|
||||||
$yn["f"] = "non";
|
|
||||||
|
|
||||||
if ($page == -1)
|
if ($page == -1)
|
||||||
{
|
{
|
||||||
$page = 0 ;
|
$page = 0 ;
|
||||||
}
|
}
|
||||||
$limit = 26;
|
|
||||||
$offset = $limit * $page ;
|
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
$limit = $conf->liste_limit;
|
||||||
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
|
print_barre_liste("Propositions commerciales", $page, $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder);
|
||||||
print "<table width=\"100%\">";
|
|
||||||
print "<tr><td><div class=\"titre\">Propositions commerciales</div></td>";
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
|
||||||
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c ";
|
$sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c ";
|
||||||
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
|
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut in(2,4)";
|
||||||
|
|
||||||
if ($socidp) {
|
if ($socidp)
|
||||||
$sql .= " AND s.idp = $socidp";
|
{
|
||||||
}
|
$sql .= " AND s.idp = $socidp";
|
||||||
|
|
||||||
if ($viewstatut <> '') {
|
|
||||||
$sql .= " AND c.id = $viewstatut";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($month > 0) {
|
|
||||||
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
|
||||||
}
|
|
||||||
if ($year > 0) {
|
|
||||||
$sql .= " AND date_format(p.datep, '%Y') = $year";
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql .= " ORDER BY p.fk_statut, datep DESC";
|
|
||||||
|
|
||||||
if ( $db->query($sql) ) {
|
|
||||||
$num = $db->num_rows();
|
|
||||||
$i = 0;
|
|
||||||
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
|
||||||
|
|
||||||
$oldstatut = -1;
|
|
||||||
$subtotal = 0;
|
|
||||||
while ($i < $num) {
|
|
||||||
$objp = $db->fetch_object( $i);
|
|
||||||
|
|
||||||
if ($objp->statut <> $oldstatut ) {
|
|
||||||
$oldstatut = $objp->statut;
|
|
||||||
|
|
||||||
if ($i > 0) {
|
|
||||||
print "<tr><td align=\"right\" colspan=\"5\">Total : <b>".price($subtotal)."</b></td>\n";
|
|
||||||
print "<td align=\"left\">Euros HT</td></tr>\n";
|
|
||||||
}
|
|
||||||
$subtotal = 0;
|
|
||||||
|
|
||||||
print '<TR class="liste_titre">';
|
|
||||||
print "<TD>Réf</TD>";
|
|
||||||
print "<TD>Société</td>";
|
|
||||||
print "<TD align=\"right\" colspan=\"2\">Date</TD>";
|
|
||||||
print "<TD align=\"right\">Prix</TD>";
|
|
||||||
print "<TD align=\"center\">Statut <a href=\"$PHP_SELF?viewstatut=$objp->statutid\">";
|
|
||||||
print '<img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a></td>';
|
|
||||||
print "</TR>\n";
|
|
||||||
$var=True;
|
|
||||||
}
|
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
print "<TR $bc[$var]>";
|
|
||||||
print "<TD><a href=\"$PHP_SELF?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
|
|
||||||
print "<TD><a href=\"fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
|
||||||
|
|
||||||
$now = time();
|
|
||||||
$lim = 3600 * 24 * 15 ;
|
|
||||||
|
|
||||||
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) {
|
|
||||||
print "<td><b> > 15 jours</b></td>";
|
|
||||||
} else {
|
|
||||||
print "<td> </td>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<TD align=\"right\">";
|
|
||||||
$y = strftime("%Y",$objp->dp);
|
|
||||||
$m = strftime("%m",$objp->dp);
|
|
||||||
|
|
||||||
print strftime("%d",$objp->dp)."\n";
|
|
||||||
print " <a href=\"propal.php3?year=$y&month=$m\">";
|
|
||||||
print strftime("%B",$objp->dp)."</a>\n";
|
|
||||||
print " <a href=\"propal.php3?year=$y\">";
|
|
||||||
print strftime("%Y",$objp->dp)."</a></TD>\n";
|
|
||||||
|
|
||||||
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
|
|
||||||
print "<TD align=\"center\">$objp->statut</TD>\n";
|
|
||||||
print "</TR>\n";
|
|
||||||
|
|
||||||
$total = $total + $objp->price;
|
|
||||||
$subtotal = $subtotal + $objp->price;
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</TABLE>";
|
if ($viewstatut <> '')
|
||||||
$db->free();
|
{
|
||||||
} else {
|
$sql .= " AND c.id = $viewstatut";
|
||||||
print $db->error();
|
}
|
||||||
}
|
|
||||||
|
if ($month > 0)
|
||||||
|
{
|
||||||
|
$sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($year > 0)
|
||||||
|
{
|
||||||
|
$sql .= " AND date_format(p.datep, '%Y') = $year";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||||
|
$sql .= $db->plimit( $limit ,$offset);
|
||||||
|
|
||||||
|
if ( $db->query($sql) )
|
||||||
|
{
|
||||||
|
$num = $db->num_rows();
|
||||||
|
$i = 0;
|
||||||
|
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||||
|
print '<TR class="liste_titre">';
|
||||||
|
print "<TD>Réf</TD>";
|
||||||
|
print "<TD>Société</td>";
|
||||||
|
print '<td align="right" colspan="2">Date</td>';
|
||||||
|
print '<td align="right">Prix</td>';
|
||||||
|
print '<td align="center">Statut</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object( $i);
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<TR $bc[$var]>";
|
||||||
|
print "<TD><a href=\"$PHP_SELF?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
|
||||||
|
print "<TD><a href=\"fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||||
|
|
||||||
|
$now = time();
|
||||||
|
$lim = 3600 * 24 * 15 ;
|
||||||
|
|
||||||
|
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
|
||||||
|
{
|
||||||
|
print "<td><b> > 15 jours</b></td>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<td> </td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<TD align=\"right\">";
|
||||||
|
$y = strftime("%Y",$objp->dp);
|
||||||
|
$m = strftime("%m",$objp->dp);
|
||||||
|
|
||||||
|
print strftime("%d",$objp->dp)."\n";
|
||||||
|
print " <a href=\"propal.php3?year=$y&month=$m\">";
|
||||||
|
print strftime("%B",$objp->dp)."</a>\n";
|
||||||
|
print " <a href=\"propal.php3?year=$y\">";
|
||||||
|
print strftime("%Y",$objp->dp)."</a></TD>\n";
|
||||||
|
|
||||||
|
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
|
||||||
|
print "<TD align=\"center\">$objp->statut</TD>\n";
|
||||||
|
print "</TR>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
$db->free();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $db->error();
|
||||||
|
print "<br>$sql";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$db->close();
|
$db->close();
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class Form {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function select_tva($name='')
|
Function select_tva($name='', $defaulttx = 19.6)
|
||||||
{
|
{
|
||||||
if (! strlen(trim($name)))
|
if (! strlen(trim($name)))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Product {
|
class Product
|
||||||
|
{
|
||||||
var $db ;
|
var $db ;
|
||||||
|
|
||||||
var $id ;
|
var $id ;
|
||||||
@ -29,28 +30,34 @@ class Product {
|
|||||||
var $description;
|
var $description;
|
||||||
var $price ;
|
var $price ;
|
||||||
|
|
||||||
Function Product($DB, $id=0) {
|
Function Product($DB, $id=0)
|
||||||
$this->db = $DB;
|
{
|
||||||
$this->id = $id ;
|
$this->db = $DB;
|
||||||
}
|
$this->id = $id ;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function create($user) {
|
Function create($user)
|
||||||
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO llx_product (fk_user_author) VALUES (".$user->id.")";
|
$sql = "INSERT INTO llx_product (fk_user_author) VALUES (".$user->id.")";
|
||||||
|
|
||||||
if ($this->db->query($sql) ) {
|
if ($this->db->query($sql) )
|
||||||
$id = $this->db->last_insert_id();
|
{
|
||||||
|
$id = $this->db->last_insert_id();
|
||||||
if ( $this->update($id, $user) ) {
|
|
||||||
return $id;
|
if ( $this->update($id, $user) )
|
||||||
}
|
{
|
||||||
} else {
|
return $id;
|
||||||
print $this->db->error() . ' in ' . $sql;
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $this->db->error() . ' in ' . $sql;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -58,44 +65,53 @@ class Product {
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function update($id, $user) {
|
Function update($id, $user)
|
||||||
|
{
|
||||||
|
|
||||||
$sql = "UPDATE llx_product ";
|
$sql = "UPDATE llx_product ";
|
||||||
$sql .= " SET label = '" . trim($this->libelle) ."'";
|
$sql .= " SET label = '" . trim($this->libelle) ."'";
|
||||||
$sql .= ",ref = '" . trim($this->ref) ."'";
|
$sql .= ",ref = '" . trim($this->ref) ."'";
|
||||||
$sql .= ",price = " . $this->price ;
|
$sql .= ",price = " . $this->price ;
|
||||||
$sql .= ",description = '" . trim($this->description) ."'";
|
$sql .= ",tva_tx = " . $this->tva_tx ;
|
||||||
|
$sql .= ",description = '" . trim($this->description) ."'";
|
||||||
$sql .= " WHERE rowid = " . $id;
|
|
||||||
|
$sql .= " WHERE rowid = " . $id;
|
||||||
if ( $this->db->query($sql) ) {
|
|
||||||
return 1;
|
if ( $this->db->query($sql) )
|
||||||
} else {
|
{
|
||||||
print $this->db->error() . ' in ' . $sql;
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $this->db->error() . ' in ' . $sql;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function fetch ($id) {
|
Function fetch ($id)
|
||||||
|
{
|
||||||
|
|
||||||
$sql = "SELECT rowid, ref, label, description, price FROM llx_product WHERE rowid = $id";
|
$sql = "SELECT rowid, ref, label, description, price, tva_tx";
|
||||||
|
$sql .= " FROM llx_product WHERE rowid = $id";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
if ( $result ) {
|
if ( $result )
|
||||||
$result = $this->db->fetch_array();
|
{
|
||||||
|
$result = $this->db->fetch_array();
|
||||||
|
|
||||||
$this->id = $result["rowid"];
|
$this->id = $result["rowid"];
|
||||||
$this->ref = $result["ref"];
|
$this->ref = $result["ref"];
|
||||||
$this->label = $result["label"];
|
$this->label = $result["label"];
|
||||||
$this->description = $result["description"];
|
$this->description = $result["description"];
|
||||||
$this->price = $result["price"];
|
$this->price = $result["price"];
|
||||||
}
|
$this->tva_tx = $result["tva_tx"];
|
||||||
$this->db->free();
|
}
|
||||||
return $result;
|
$this->db->free();
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user