From 0717cdb2be33b7b8fc55748b1e126619a58b06cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Sep 2006 12:50:08 +0000 Subject: [PATCH] Qual: Suppression pages obsoletes --- htdocs/product/promotion/index.php | 117 ------------ htdocs/product/promotion/pre.inc.php | 85 --------- htdocs/product/promotion/promotion.class.php | 178 ------------------- 3 files changed, 380 deletions(-) delete mode 100644 htdocs/product/promotion/index.php delete mode 100644 htdocs/product/promotion/pre.inc.php delete mode 100644 htdocs/product/promotion/promotion.class.php diff --git a/htdocs/product/promotion/index.php b/htdocs/product/promotion/index.php deleted file mode 100644 index 3d57cb176b5..00000000000 --- a/htdocs/product/promotion/index.php +++ /dev/null @@ -1,117 +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 == "inactive") -{ - $promotion = new Promotion($db); - $promotion->set_inactive($id); -} -if ($action == "active") -{ - $promotion = new Promotion($db); - $promotion->set_active($id); -} - -if ($sortfield == "") -{ - $sortfield="pd.products_name"; -} -if ($sortorder == "") -{ - $sortorder="ASC"; -} - -if ($page == -1) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -print_barre_liste("Liste des promotions", $page, "index.php", "",$sortfield, $sortorder); - -$urladd = "&sortorder=$sortorder&sortfield=$sortfield"; - -$sql = "SELECT pd.products_name, s.specials_new_products_price, p.products_price, p.products_model, s.status, p.products_id"; -$sql .= ",".$db->pdate("expires_date")." as fin"; -$sql .= " FROM ".OSC_DB_NAME.".specials as s,".OSC_DB_NAME.".products_description as pd,".OSC_DB_NAME.".products as p"; -$sql .= " WHERE s.products_id = pd.products_id AND pd.products_id = p.products_id AND pd.language_id = ".OSC_LANGUAGE_ID; -$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.products_model"); - print_liste_field_titre("Titre","index.php", "pd.products_name"); - print ""; - print ''; - print ''; - print "\n"; - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object( $i); - $var=!$var; - - print ""; - print '"; - print '"; - - if ($objp->status == 1) - { - print ''; - print ''; - } - else - { - print ''; - print ''; - } - print ""; - print '"; - print '"; - print ""; - $i++; - } - print "
  FinPrix initialPrix remisé
'.$objp->products_model."'.$objp->products_name."actif'; - print ''; - print ''; - print ''; - print 'inactif".strftime("%d/%m/%Y", $objp->fin)."'.price($objp->products_price)."'.price($objp->specials_new_products_price)."
"; - $db->free(); -} -else -{ - print $db->error(); -} -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); - - -?> diff --git a/htdocs/product/promotion/pre.inc.php b/htdocs/product/promotion/pre.inc.php deleted file mode 100644 index a5972dc6556..00000000000 --- a/htdocs/product/promotion/pre.inc.php +++ /dev/null @@ -1,85 +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("./promotion.class.php"); - -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - if ($conf->boutique->livre->enabled) - { - $menu->add("/boutique/livre/", "Livres"); - - $menu->add_submenu("/boutique/livre/fiche.php?&action=create","Nouvel ouvrage"); - - $menu->add("/boutique/auteur/", "Auteurs"); - - $menu->add_submenu("/boutique/auteur/fiche.php?&action=create","Nouvel auteur"); - - $menu->add("/boutique/editeur/", "Editeurs"); - - $menu->add_submenu("/boutique/editeur/fiche.php?&action=create","Nouvel éditeur"); - - } - - $menu->add("/product/categorie/", "Catégories"); - - $menu->add("/product/promotion/", "Promotions"); - - if ($conf->boutique->album->enabled) - { - $menu->add("/product/album/", "Albums"); - - $menu->add_submenu("../osc-liste.php", "Osc"); - $menu->add_submenu("../osc-liste.php?reqstock=epuise", "Produits Epuisés"); - - $menu->add_submenu("/product/album/fiche.php?&action=create","Nouvel album"); - - $menu->add("/product/groupart/", "Artistes/Groupes"); - - $menu->add_submenu("/product/groupart/fiche.php?&action=create","Nouvel Artiste/Groupe"); - - $menu->add("/product/concert/", "Concerts"); - - $menu->add_submenu("/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/promotion/promotion.class.php b/htdocs/product/promotion/promotion.class.php deleted file mode 100644 index 86c0b66bf34..00000000000 --- a/htdocs/product/promotion/promotion.class.php +++ /dev/null @@ -1,178 +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 Promotion { - var $db ; - - var $id ; - var $parent_id ; - var $oscid ; - var $ref; - var $titre; - var $description; - var $price ; - var $status ; - - function Promotion($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * - * - */ - function create($user, $pid, $percent) { - - $sql = "SELECT products_price "; - $sql .= " FROM ".OSC_DB_NAME.".products as p"; - $sql .= " WHERE p.products_id = $pid"; - - $result = $this->db->query($sql) ; - - if ( $result ) - { - $result = $this->db->fetch_array(); - $this->price_init = $result["products_price"]; - } - - $newprice = 0.95 * $this->price_init; - - $date_exp = "2003-05-01"; - - $sql = "INSERT INTO ".OSC_DB_NAME.".specials "; - $sql .= " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status) "; - $sql .= " VALUES ($pid, $newprice, now(),NULL,'$date_exp',NULL,1)"; - - if ($this->db->query($sql) ) - { - $id = $this->db->last_insert_id(OSC_DB_NAME.".specials"); - - return $id; - } - else - { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function update($id, $user) - { - $sql = "UPDATE ".MAIN_DB_PREFIX."album "; - $sql .= " SET title = '" . trim($this->titre) ."'"; - $sql .= ",description = '" . trim($this->description) ."'"; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function set_active($id) - { - $sql = "UPDATE ".OSC_DB_NAME.".specials"; - $sql .= " SET status = 1"; - - $sql .= " WHERE products_id = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - */ - function set_inactive($id) - { - $sql = "UPDATE ".OSC_DB_NAME.".specials"; - $sql .= " SET status = 0"; - - $sql .= " WHERE products_id = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - function fetch ($id) { - - $sql = "SELECT c.categories_id, cd.categories_name, c.parent_id"; - $sql .= " FROM ".OSC_DB_NAME.".categories as c,".OSC_DB_NAME.".categories_description as cd"; - $sql .= " WHERE c.categories_id = cd.categories_id AND cd.language_id = ".OSC_LANGUAGE_ID; - $sql .= " AND c.categories_id = $id"; - $result = $this->db->query($sql) ; - - if ( $result ) { - $result = $this->db->fetch_array(); - - $this->id = $result["categories_id"]; - $this->parent_id = $result["parent_id"]; - $this->name = $result["categories_name"]; - $this->titre = $result["title"]; - $this->description = $result["description"]; - $this->oscid = $result["osc_id"]; - } - $this->db->free(); - - 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"; - - - } - - -} -?>