From dc3607d385e4e38b83e42d35d8bec7ca6cc26fe7 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 30 Apr 2002 10:57:25 +0000 Subject: [PATCH] Massive update --- htdocs/product/index.php3 | 134 ++++++++++++++++++++++++++++++++++ htdocs/product/pre.inc.php3 | 138 ++++++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+) create mode 100644 htdocs/product/index.php3 create mode 100644 htdocs/product/pre.inc.php3 diff --git a/htdocs/product/index.php3 b/htdocs/product/index.php3 new file mode 100644 index 00000000000..205b1d83c20 --- /dev/null +++ b/htdocs/product/index.php3 @@ -0,0 +1,134 @@ + + * + * $Id$ + * $Source$ + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +require("./pre.inc.php3"); + +llxHeader(); +$bc[0]="bgcolor=\"#90c090\""; +$bc[1]="bgcolor=\"#b0e0b0\""; + + +$db = new Db(); +if ($sortfield == "") { + $sortfield="lower(p.label),p.price"; +} +if ($sortorder == "") { + $sortorder="ASC"; +} + + +if ($action == 'update') { + + $sql = "UPDATE llx_product SET description='$desc' where rowid = $rowid"; + $db->query($sql); +} + +$yn["t"] = "oui"; +$yn["f"] = "non"; + +if ($page == -1) { $page = 0 ; } +$limit = 26; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +print "Liste

"; + +if ($rowid) { + + $sql = "SELECT p.rowid, p.label, p.price, p.description, p.duration,p.ref FROM llx_product as p"; + $sql .= " WHERE p.rowid = $rowid;"; + + + if ( $db->query($sql) ) { + $num = $db->num_rows(); + $i = 0; + print "

"; + print ""; + print ""; + print ""; + print "\n"; + $var=True; + if ( $num ) { + $objp = $db->fetch_object(0); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + + print ""; + $i++; + } + print "
RéfNom
rowid\">$objp->ref$objp->label
prix$objp->price
duree$objp->duration
desc".nl2br($objp->description)."
"; + $db->free(); + + print "


\n"; + print ""; + print "
"; + print ""; + print "
"; + } + + + +} else { + + $sql = "SELECT p.rowid, p.label, p.price, p.duration,p.ref FROM llx_product as p"; + + $sql .= " ORDER BY $sortfield $sortorder "; + $sql .= $db->plimit( $limit ,$offset); + + if ( $db->query($sql) ) { + $num = $db->num_rows(); + $i = 0; + print "

"; + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + $var=True; + while ($i < $num) { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print ''; + print "\n"; + print "\n"; + $i++; + } + print "
RéfNomPrixDurée
rowid\">$objp->ref$objp->label'.price($objp->price).'$objp->duration
"; + $db->free(); + } + +} +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/product/pre.inc.php3 b/htdocs/product/pre.inc.php3 new file mode 100644 index 00000000000..72d92ee99af --- /dev/null +++ b/htdocs/product/pre.inc.php3 @@ -0,0 +1,138 @@ + + * + * $Id$ + * $Source$ + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +require("../main.inc.php3"); + +function llxHeader($head = "", $urlp = "") { + global $PREFIX, $user; + + print "\n$head\n\n"; + ?> + + \n"; + print ""; + + print "" . $GLOBALS["MAIN_TITLE"] . ""; + print "Technique"; + print "Commercial"; + print "Compta"; + print "Stats"; + print "\n"; + + print ""; + print ""; + + + print ""; + /* + * + */ + print "
"; + + print ""; + print ""; + + print ""; + + + print ""; + /* + * + */ + print ""; + /* + * + */ + print ""; + /* + * + */ + print ""; + /* + * + */ + print ""; + + + print ""; + + print ""; + + print "
"; + print "
" . $GLOBALS["dbname"] . " - " . $user->code ."
"; + print "Accueil
"; + print "Bookmark"; + print "
"; + print "
Societe
\n"; + print "Contact
\n"; + print "
"; + print "\n"; + print "Factures
\n"; + print "Propal FE
\n"; + print "Clôture

\n"; + print "

"; + print ''; + print "
"; + print ''; + print "
"; + print ''; + print "
"; + print "Projets
\n"; + print "
"; + print "Stats
\n"; + print "
"; + print "
Societes
\n"; + print "
"; + print ''; + print ''; + print ' '; + print ""; + print "
"; + + print "
Contacts
\n"; + print "
"; + print ''; + print ''; + print " "; + print ""; + print "
"; + + + print "
"; + print "Soc : "; + print ""; + print "
"; + print "
"; + + print "
\n"; +} + +function llxFooter($foot='') { + print "
\n"; + print "$foot"; +} +/* + * $Id$ + * $Source$ + */ +?>