From 12f5ae8fbcc4d44c50ab4f45c3423221ee4c26d6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 18 Jun 2006 10:30:08 +0000 Subject: [PATCH] Suppression de fichiers inutiles --- htdocs/product/album/album.class.php | 324 --------------------- htdocs/product/album/fiche.php | 214 -------------- htdocs/product/album/index.php | 77 ----- htdocs/product/album/pre.inc.php | 64 ---- htdocs/product/groupart/fiche.php | 166 ----------- htdocs/product/groupart/groupart.class.php | 234 --------------- htdocs/product/groupart/index.php | 76 ----- htdocs/product/groupart/pre.inc.php | 59 ---- htdocs/product/osc-liste.php | 97 ------ htdocs/product/osc-productsbyreviews.php | 82 ------ htdocs/product/osc-reviews.php | 76 ----- 11 files changed, 1469 deletions(-) delete mode 100644 htdocs/product/album/album.class.php delete mode 100644 htdocs/product/album/fiche.php delete mode 100644 htdocs/product/album/index.php delete mode 100644 htdocs/product/album/pre.inc.php delete mode 100644 htdocs/product/groupart/fiche.php delete mode 100644 htdocs/product/groupart/groupart.class.php delete mode 100644 htdocs/product/groupart/index.php delete mode 100644 htdocs/product/groupart/pre.inc.php delete mode 100644 htdocs/product/osc-liste.php delete mode 100644 htdocs/product/osc-productsbyreviews.php delete mode 100644 htdocs/product/osc-reviews.php diff --git a/htdocs/product/album/album.class.php b/htdocs/product/album/album.class.php deleted file mode 100644 index 9edc7f82525..00000000000 --- a/htdocs/product/album/album.class.php +++ /dev/null @@ -1,324 +0,0 @@ - - * - * 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. - * - * $Id$ - * $Source$ - * - */ - -class Album { - var $db ; - - var $id ; - var $oscid ; - var $ref; - var $annee; - var $titre; - var $description; - var $price ; - var $status ; - - function Album($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * - * - */ - function create($user) { - - if (strlen($this->annee)) - { - $this->annee = 0; - } - - $sql = "INSERT INTO ".OSC_DB_NAME.".products (products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added) "; - $sql .= "VALUES ('', '', 'Array', '', null, '', '0', '0', '8', now())"; - - if ($this->db->query($sql) ) - { - $idosc = $this->db->last_insert_id(OSC_DB_NAME.".products"); - - $sql = "INSERT INTO ".OSC_DB_NAME.".products_to_categories (products_id, categories_id) VALUES ($idosc, 0)"; - - if ($this->db->query($sql) ) - { - - $sql = "INSERT INTO ".OSC_DB_NAME.".products_description (products_name, products_description, products_url, products_id, language_id) VALUES ('".trim($this->titre)."', '".trim($this->description)."', '', $idosc, '1')"; - - if ($this->db->query($sql) ) - { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."album (osc_id, fk_user_author) VALUES ($idosc, ".$user->id.")"; - - if ($this->db->query($sql) ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."album"); - - if ( $this->update($id, $user) ) - { - return $id; - } - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - else - { - print $this->db->error() . ' in ' . $sql; - } - - } - - /* - * - * - * - */ - function linkga($id, $gaid) - { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."album_to_groupart (fk_album, fk_groupart) VALUES ($id, $gaid)"; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - */ - function liste_groupart() - { - $ga = array(); - - $sql = "SELECT g.rowid, g.nom FROM ".MAIN_DB_PREFIX."groupart as g, ".MAIN_DB_PREFIX."album_to_groupart as l"; - $sql .= " WHERE g.rowid = l.fk_groupart AND l.fk_album = ".$this->id; - $sql .= " ORDER BY g.nom"; - - $result=$this->db->query($sql); - if ($result) - { - $nump = $this->db->num_rows($result); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object($result); - - $ga[$obj->rowid] = $obj->nom; - $i++; - } - $this->db->free($result); - } - return $ga; - } - else - { - print $this->db->error(); - return -1; - } - } - /* - * - * - * - */ - function updateosc() - { - - $sql = "UPDATE ".OSC_DB_NAME.".products_description "; - - $sql .= " SET products_name = '".$this->titre."'"; - - $desc .= '
Info supplémentaires'; - $ga = array(); - $ga = $this->liste_groupart(); - if (sizeof($ga) == 1) - { - foreach ($ga as $key => $value) - { - $gaid = $key; - } - - - $groupart = new Groupart($this->db); - $result = $groupart->fetch($gaid); - - if ( $result ) - { - - $desc = $groupart->nom."

"; - - $desc .= addslashes($this->description); - - $desc .= "

Autres albums : "; - - $gas = $groupart->liste_albums(); - $i = 0; - $sizegas = sizeof($gas) - 1; - foreach ($gas as $key => $value) - { - if ($key <> $this->id) - { - - $otha = new Album($this->db); - $otha->fetch($key); - - $desc .= ''.$value.""; - $i++; - if ($sizegas > $i) - { - $desc .= ", "; - } - } - } - } - } - - - $sql .= ", products_description = '$desc'"; - - $sql .= " WHERE products_id = " . $this->oscid; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function update($id, $user) - { - - if (strlen($this->annee)==0) - { - $this->annee = 0; - } - - $sql = "UPDATE ".MAIN_DB_PREFIX."album "; - $sql .= " SET title = '" . trim($this->titre) ."'"; - $sql .= ", ref = '" . trim(strtoupper($this->ref)) ."'"; - $sql .= ", annee = " . $this->annee ; - $sql .= ",description = '" . trim($this->description) ."'"; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function fetch ($id) { - - $sql = "SELECT rowid, ref, annee, osc_id, title, description FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->ref = $result["ref"]; - $this->annee = $result["annee"]; - $this->titre = $result["title"]; - $this->description = $result["description"]; - $this->oscid = $result["osc_id"]; - - $this->db->free(); - - - $sql = "SELECT products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added"; - $sql .= " FROM ".OSC_DB_NAME.".products WHERE products_id = " . $this->oscid; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->status = $result["products_status"]; - $this->price = $result["products_price"]; - - $this->db->free(); - } - else - { - print $this->db->error(); - } - } - else - { - print $this->db->error(); - } - - return $result; - } - - - /* - * - * - */ - function delete($user) { - - $sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = $idosc "; - - $sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = $idosc"; - - $sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = $idosc"; - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; - - - } - - -} -?> diff --git a/htdocs/product/album/fiche.php b/htdocs/product/album/fiche.php deleted file mode 100644 index 7f24022ce06..00000000000 --- a/htdocs/product/album/fiche.php +++ /dev/null @@ -1,214 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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. - * - * $Id$ - * $Source$ - * - */ -require("./pre.inc.php"); - -llxHeader(); - -if ($action == 'add') { - $album = new Album($db); - - $album->titre = $titre; - $album->ref = $ref; - $album->annee = $annee; - $album->description = $desc; - - $id = $album->create($user); -} - -if ($action == 'addga') { - $album = new Album($db); - - $album->linkga($id, $ga); -} - - -if ($action == 'update') { - $album = new Album($db); - - $album->titre = $titre; - $album->ref = $ref; - $album->annee = $annee; - $album->description = $desc; - - $album->update($id, $user); -} - -if ($action == 'updateosc') { - $album = new Album($db); - $result = $album->fetch($id); - - $album->updateosc($user); -} - -/* - * - * - */ -if ($action == 'create') -{ - - print "

\n"; - print ""; - - print_fiche_titre($langs->trans("NewAlbum")); - - print ''; - print ""; - print ''; - print ''; - print ''; - print '"; - print ''; - print '
'.$langs->trans("Ref").'
Titre
'.$langs->trans("Price").'
'.$langs->trans("Description").''; - print '
 
'; - print '
'; - - -} -else -{ - if ($id) - { - - $album = new Album($db); - $result = $album->fetch($id); - - if ( $result ) - { - - $gas = $album->liste_groupart(); - - - print_fiche_titre('Fiche Album : '.$album->titre); - - print ''; - print ""; - print ''; - print ''; - - print '\n"; - print '"; - print "\n"; - print "\n"; - print ''; - - print '\n"; - - print "
'.$langs->trans("Ref").''.$album->ref.''.$langs->trans("Description").'
'.$langs->trans("Status")."$album->status'.nl2br($album->description)."
Titre$album->titre
Annee$album->annee
'.$langs->trans("Price").''.price($album->price).'
Artiste/Groupe'; - foreach ($gas as $key => $value) - { - print ''.$value."
"; - } - print "
"; - - - if ($action == 'edit') - { - print_fiche_titre('Edition de la fiche Album : '.$album->titre); - - print "
\n"; - print ""; - - print ''; - print ""; - print ''; - print ''; - - print ''; - print '"; - - print ''; - print ''; - - print ''; - - print ''; - - $htmls = new Form($db); - $ga = new Groupart($db); - - print "\n"; - print ""; - - foreach ($gas as $key => $value) - { - print ''; - print '\n"; - } - - print ""; - print ''; - print ""; - print '
'.$langs->trans("Ref").''.$langs->trans("Description").'
Titre
Année
'.$langs->trans("Price").'
 
Artiste/Groupe'.$value."
Artiste/Groupe"; - $htmls->select_array("ga", $ga->liste_array()); - print "
 
'; - - } - - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - -print '
'; -print ''; - -print ''; - -print ''; - -if ($action == 'create') -{ - print ''; -} -else -{ - print ''; -} -print ''; -print '
-[Update Osc]--['.$langs->trans("Edit").']-

'; - - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/product/album/index.php b/htdocs/product/album/index.php deleted file mode 100644 index d213641e8d2..00000000000 --- a/htdocs/product/album/index.php +++ /dev/null @@ -1,77 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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. - * - * $Id$ - * $Source$ - * - */ -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") -{ - $sortfield="lower(a.title)"; -} - -if ($sortorder == "") -{ - $sortorder="ASC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - - -print_barre_liste("Liste des albums", $page, "index.php"); - -$sql = "SELECT a.rowid, a.title, a.osc_id FROM ".MAIN_DB_PREFIX."album as a"; - -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre("Titre","index.php", "a.title"); - print ""; - print ""; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print ''; - print "\n"; - $i++; - } - print "
 
rowid\">$objp->titleurl
"; - $db->free(); -} - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/product/album/pre.inc.php b/htdocs/product/album/pre.inc.php deleted file mode 100644 index e0ea4451489..00000000000 --- a/htdocs/product/album/pre.inc.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * 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. - * - * $Id$ - * $Source$ - * - */ -require("../../main.inc.php"); -require("./album.class.php"); -require("../groupart/groupart.class.php"); - -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/product/album/", "Albums"); - - $menu->add_submenu("../osc-liste.php", "Osc"); - $menu->add_submenu("../osc-liste.php?reqstock=epuise", "Produits Epuisés"); - - $menu->add_submenu(DOL_URL_ROOT."/product/album/fiche.php?&action=create","Nouvel album"); - - $menu->add(DOL_URL_ROOT."/product/groupart/", "Artistes/Groupes"); - - $menu->add_submenu(DOL_URL_ROOT."/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe"); - - $menu->add(DOL_URL_ROOT."/product/concert/", "Concerts"); - - $menu->add_submenu(DOL_URL_ROOT."/product/concert/fiche.php?&action=create","Nouveau concert"); - - $menu->add("../osc-reviews.php", "Critiques"); - - $menu->add_submenu("../osc-productsbyreviews.php", "Meilleurs produits"); - - - left_menu($menu->liste); - /* - * - * - */ - -} -?> diff --git a/htdocs/product/groupart/fiche.php b/htdocs/product/groupart/fiche.php deleted file mode 100644 index 48c96171555..00000000000 --- a/htdocs/product/groupart/fiche.php +++ /dev/null @@ -1,166 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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. - * - * $Id$ - * $Source$ - * - */ -require("./pre.inc.php"); - -llxHeader(); - -if ($action == 'add') -{ - $groupart = new Groupart($db); - $groupart->nom = $nom; - $groupart->desc = $desc; - $groupart->grar = $grar; - $id = $groupart->create($user); -} - -if ($action == 'update') { - $groupart = new Groupart($db); - $groupart->nom = $nom; - $groupart->desc = $desc; - $groupart->grar = $grar; - $groupart->update($id, $user); -} - -if ($action == 'updateosc') { - $groupart = new Groupart($db); - $result = $groupart->fetch($id); - $groupart->updateosc($user); -} - -/* - * - * - */ -if ($action == 'create') -{ - - print "
\n"; - print ""; - - print '
Nouvel Artiste/Groupe

'; - - print ''; - print ""; - print ''; - print ''; - print '"; - print ''; - print '
Nom
Artiste/Groupe
'.$langs->trans("Description").''; - print '
 
'; - print '
'; - - -} -else -{ - if ($id) - { - - $groupart = new Groupart($db); - $result = $groupart->fetch($id); - - if ( $result ) - { - print '
Fiche Artiste/Groupe

'; - - print ''; - print ""; - print "\n"; - print ""; - print "\n"; - print ''; - - $gas = $groupart->liste_albums(); - print '\n"; - print "
Nom".$groupart->nom."
Groupe/Artiste".ucfirst(strtolower(strtoupper($groupart->grar)))."
'.$langs->trans("Description").''.nl2br($groupart->desc).'
Album(s)
    '; - foreach ($gas as $key => $value) - { - print '
  • '.$value."
  • "; - } - print "
"; - } - - if ($action == 'edit') - { - if ($groupart->grar == 'artiste') - { - $grar_opt = 'Groupe'; - } - else - { - $grar_opt = 'Artiste'; - } - print '
Edition de la fiche produit : '.$groupart->ref.'

'; - - print "
\n"; - print ""; - - print ''; - print ''; - print ''; - print '"; - print ''; - print '
Nom
Artiste/Groupe
'.$langs->trans("Description").''; - print '
 
'; - print '
'; - } - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - -print '
'; -print ''; -print ''; -print ''; - -if ($action == 'create') -{ - print ''; -} -else -{ - print ''; -} -print ''; -print '
-[Update Osc]--['.$langs->trans("Edit").']-

'; - - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/product/groupart/groupart.class.php b/htdocs/product/groupart/groupart.class.php deleted file mode 100644 index a08de6b487c..00000000000 --- a/htdocs/product/groupart/groupart.class.php +++ /dev/null @@ -1,234 +0,0 @@ - - * Copyright (C) 2003 Éric Seigne - * - * 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. - * - * $Id$ - * $Source$ - * - */ - -class Groupart { - var $db ; - - var $id ; - var $nom ; - var $desc ; - var $grar ; - - function Groupart($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * - * - */ - function create($user) { - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."groupart (fk_user_author) VALUES (".$user->id.")"; - - if ($this->db->query($sql) ) - - { - - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."groupart"); - - if ( $this->update($id, $user) ) - { - return $id; - } - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - - /* - * - * - * - */ - function update($id, $user) - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."groupart "; - $sql .= " SET nom = '" . trim($this->nom) ."'"; - $sql .= " , description = '" . trim($this->desc) ."'"; - $sql .= " , groupart = '" . trim($this->grar) ."'"; - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - - - /* - * - * - * - */ - function fetch ($id) - { - $sql = "SELECT rowid, nom, groupart, description FROM ".MAIN_DB_PREFIX."groupart WHERE rowid = $id"; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - - $this->id = $result["rowid"]; - $this->nom = $result["nom"]; - $this->desc = $result["description"]; - $this->grar = $result["groupart"]; - } - $this->db->free(); - - return $result; - } - - - /** - * \brief Renvoie le nom clicable - * \param withpicto Inclut le picto dans le lien - * \return string Chaine avec URL - */ - function getNomUrl($withpicto=0) - { - global $langs; - - $result=''; - return ''.$this->nom.''; - } - - - /* - * - * - */ - function liste_albums () - { - $ga = array(); - - $sql = "SELECT a.rowid, a.title FROM ".MAIN_DB_PREFIX."album as a, ".MAIN_DB_PREFIX."album_to_groupart as l"; - $sql .= " WHERE a.rowid = l.fk_album AND l.fk_groupart = ".$this->id; - $sql .= " ORDER BY a.title"; - - $result=$this->db->query($sql); - if ($result) - { - $nump = $this->db->num_rows($result); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object($result); - - $ga[$obj->rowid] = $obj->title; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - return -1; - } - } - /* - * - * - */ - function updateosc() - { - $albs = array(); - $albs = $this->liste_albums(); - - foreach($albs as $key => $value) - { - $alb = new Album($this->db); - $alb->fetch($key); - $alb->updateosc(); - } - } - /* - * - * - */ - function liste_array () - { - $ga = array(); - - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."groupart ORDER BY nom"; - - $result=$this->db->query($sql); - if ($result) - { - $nump = $this->db->num_rows($result); - - if ($nump) - { - $i = 0; - while ($i < $nump) - { - $obj = $this->db->fetch_object($result); - - $ga[$obj->rowid] = $obj->nom; - $i++; - } - } - return $ga; - } - else - { - print $this->db->error(); - return -1; - } - - } - - - - - /* - * - * - */ - function delete($user) { - - $sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = $idosc "; - - $sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = $idosc"; - - $sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = $idosc"; - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id"; - - - } - - -} -?> diff --git a/htdocs/product/groupart/index.php b/htdocs/product/groupart/index.php deleted file mode 100644 index dd21a5731d1..00000000000 --- a/htdocs/product/groupart/index.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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. - * - * $Id$ - * $Source$ - * - */ -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") -{ - $sortfield="lower(g.nom)"; -} -if ($sortorder == "") -{ - $sortorder="ASC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - - -print_barre_liste("Liste des Artistes/Groupes", $page, "index.php"); - -$sql = "SELECT g.rowid, g.nom, groupart FROM ".MAIN_DB_PREFIX."groupart as g"; - -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - print ""; - print ""; - print_liste_field_titre($langs->trans("Ref"),"index.php", "p.ref"); - print ""; - print "\n"; - - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - $i++; - } - print "
 
rowid\">$objp->nom".ucfirst(strtolower(strtoupper($objp->groupart)))."
"; - $db->free(); -} - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/product/groupart/pre.inc.php b/htdocs/product/groupart/pre.inc.php deleted file mode 100644 index b14e378c373..00000000000 --- a/htdocs/product/groupart/pre.inc.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * 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. - * - * $Id$ - * $Source$ - * - */ -require("../../main.inc.php"); -require("./groupart.class.php"); -require("../album/album.class.php"); - -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/product/album/", "Albums"); - - $menu->add_submenu("../album/fiche.php?&action=create","Nouvel album"); - - $menu->add(DOL_URL_ROOT."/product/groupart/", "Artistes/Groupes"); - - $menu->add_submenu(DOL_URL_ROOT."/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe"); - - $menu->add(DOL_URL_ROOT."/product/concert/", "Concerts"); - - $menu->add_submenu(DOL_URL_ROOT."/product/concert/fiche.php?&action=create","Nouveau concert"); - - $menu->add("../osc-reviews.php", "Critiques"); - - - left_menu($menu->liste); - /* - * - * - */ - -} -?> diff --git a/htdocs/product/osc-liste.php b/htdocs/product/osc-liste.php deleted file mode 100644 index 561073c2254..00000000000 --- a/htdocs/product/osc-liste.php +++ /dev/null @@ -1,97 +0,0 @@ - - * Copyright (C) 2005 Éric Seigne - * - * 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. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($_GET['sortfield'] == "") { - $sortfield="lower(p.label),p.price"; -} -if ($_GET['sortorder'] == "") { - $sortorder="ASC"; -} - - -if ($_GET['page'] == -1) { - $page = 0 ; -} -else { - $page = $_GET['page']; -} -$limit = $conf->liste_limit; -$offset = $limit * $page ; - - -print_barre_liste("Liste des produits oscommerce", $page, "osc-liste.php"); - -$sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, d.products_name, m.manufacturers_name, m.manufacturers_id"; -$sql .= " FROM ".OSC_DB_NAME.".products as p, ".OSC_DB_NAME.".products_description as d, ".OSC_DB_NAME.".manufacturers as m"; -$sql .= " WHERE p.products_id = d.products_id AND d.language_id =" . OSC_LANGUAGE_ID; -$sql .= " AND p.manufacturers_id=m.manufacturers_id"; -if ($_GET['reqstock']=='epuise') -{ - $sql .= " AND p.products_quantity <= 0"; -} - -//$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -print "

"; -print ''; -print ""; -print ""; -print ""; -print ""; -print ''; -print ''; - print "\n"; - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print '\n"; - print '\n"; - print "\n"; - $i++; - } - $db->free(); -} - -print "
idRefTitreGroupeStockStatus
$objp->products_id$objp->products_model$objp->products_name$objp->manufacturers_name'.$objp->products_quantity."'.$objp->products_status."
"; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/product/osc-productsbyreviews.php b/htdocs/product/osc-productsbyreviews.php deleted file mode 100644 index 8dee2aad2c1..00000000000 --- a/htdocs/product/osc-productsbyreviews.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * 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. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") { - $sortfield="rat"; -} -if ($sortorder == "") { - $sortorder="DESC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - - -print_barre_liste("Liste des produits classés pas critiques", $page, "osc-productsbyreviews.php"); - -$sql = "SELECT sum(r.reviews_rating)/count(r.reviews_rating) as rat, r.products_id, p.products_model, p.products_quantity, p.products_status"; -$sql .= " FROM ".OSC_DB_NAME.".reviews as r,".OSC_DB_NAME.".products as p "; -$sql .= " WHERE r.products_id = p.products_id"; -$sql .= " GROUP BY r.products_id, p.products_model, p.products_quantity, p.products_status"; - -$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - - print "

"; - print "'; - print ''; - print "\n"; - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print '\n"; - print '\n"; - print '\n"; - print "\n"; - $i++; - } - $db->free(); -} - -print "
".$langs->trans("Ref"); - print 'Indice critiquesQuantité'; - print 'Status
$objp->products_model'.$objp->rat."'.$objp->products_quantity."'.$objp->products_status."
"; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> diff --git a/htdocs/product/osc-reviews.php b/htdocs/product/osc-reviews.php deleted file mode 100644 index 92e99a70f14..00000000000 --- a/htdocs/product/osc-reviews.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * 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. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); - -llxHeader(); - -if ($sortfield == "") { - $sortfield="lower(p.label),p.price"; -} -if ($sortorder == "") { - $sortorder="ASC"; -} - - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - - -print_barre_liste("Liste des produits oscommerce", $page, "osc-reviews.php"); - -$sql = "SELECT r.reviews_rating FROM ".OSC_DB_NAME.".reviews as r"; - -//$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); - -print "

"; -print ''; -print ""; -print ""; -print "\n"; - -if ( $db->query($sql) ) { - $num = $db->num_rows(); - $i = 0; - - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - - print "\n"; - $i++; - } - $db->free(); -} - -print "
Prix de vente
$objp->reviews_rating
"; - - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?>