diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index 2819aa91f45..5a3467a66ee 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -1,6 +1,7 @@ +/* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2003-2005 Éric Seigne + * Copyright (C) 2006 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 @@ -18,14 +19,21 @@ * * $Id$ * $Source$ - * */ + +/** + \file htdocs/boutique/client/fiche.php + \ingroup boutique + \brief Page fiche client OSCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); llxHeader(); if ($action == 'update' && !$cancel) { - $client = new Client($db); + $client = new Client($dbosc); $client->nom = $nom; $client->update($id, $user); } @@ -37,7 +45,7 @@ if ($action == 'update' && !$cancel) { if ($_GET['id']) { - $client = new Client($db); + $client = new Client($dbosc); $result = $client->fetch($_GET['id']); if ( $result ) { @@ -53,20 +61,20 @@ if ($_GET['id']) * Commandes * */ - $sql = "SELECT o.orders_id, o.customers_id,".$db->pdate("date_purchased")." as date_purchased, t.value as total"; + $sql = "SELECT o.orders_id, o.customers_id,".$dbosc->pdate("date_purchased")." as date_purchased, t.value as total"; $sql .= " FROM ".OSC_DB_NAME.".orders as o, ".OSC_DB_NAME.".orders_total as t";; $sql .= " WHERE o.customers_id = " . $client->id; $sql .= " AND o.orders_id = t.orders_id AND t.class = 'ot_total'"; - if ( $db->query($sql) ) + if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $i = 0; print ''; print ""; print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; @@ -78,19 +86,19 @@ if ($_GET['id']) $i++; } print "
Commandes
"; - $db->free(); + $dbosc->free(); } else { print "

ERROR 1

\n"; - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } } else { print "

ERROR 1

\n"; - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } @@ -111,7 +119,7 @@ else // Pas d'action -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/client/index.php b/htdocs/boutique/client/index.php index 0378858380b..2d09fe811d4 100644 --- a/htdocs/boutique/client/index.php +++ b/htdocs/boutique/client/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2006 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 @@ -18,9 +18,15 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/client/index.php + \ingroup boutique + \brief Page gestion client OSCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); $langs->load("companies"); @@ -44,11 +50,11 @@ print_barre_liste("Liste des clients", $page, "index.php"); $sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter"; $sql .= " FROM ".OSC_DB_NAME.".customers as c"; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); -if ( $db->query($sql) ) +if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $i = 0; print ""; print ""; @@ -59,7 +65,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; print '\n"; @@ -70,14 +76,14 @@ if ( $db->query($sql) ) $i++; } print "
'.$objp->customers_firstname."
"; - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/client/pre.inc.php b/htdocs/boutique/client/pre.inc.php index 8e0cf074a3e..e4e466dffcf 100644 --- a/htdocs/boutique/client/pre.inc.php +++ b/htdocs/boutique/client/pre.inc.php @@ -28,6 +28,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/client.class.php'); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); function llxHeader($head = "", $urlp = "") @@ -44,6 +45,7 @@ function llxHeader($head = "", $urlp = "") $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/commande/ca.php b/htdocs/boutique/commande/ca.php index 1dd0678e88a..596e144270c 100644 --- a/htdocs/boutique/commande/ca.php +++ b/htdocs/boutique/commande/ca.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2006 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 @@ -18,9 +18,15 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/commande/ca.php + \ingroup boutique + \brief Page ca commandes du module OsCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); llxHeader(); @@ -48,14 +54,14 @@ $sql = "SELECT sum(t.value) as value"; $sql .= " FROM ".OSC_DB_NAME.".orders_total as t"; $sql .= " WHERE t.class = 'ot_subtotal'"; -if ( $db->query($sql) ) +if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $var=True; if ($num > 0) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; print 'Somme des commandes'; @@ -65,25 +71,25 @@ if ( $db->query($sql) ) $i++; } - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } $sql = "SELECT sum(t.value) as value"; $sql .= " FROM ".OSC_DB_NAME.".orders_total as t"; $sql .= " WHERE t.class = 'ot_shipping'"; -if ( $db->query($sql) ) +if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $var=True; if ($num > 0) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; print 'Somme des frais de port'; @@ -91,17 +97,17 @@ if ( $db->query($sql) ) $i++; } - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } print ""; -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/commande/fiche.php b/htdocs/boutique/commande/fiche.php index d7373175597..df2ddd9f9f8 100644 --- a/htdocs/boutique/commande/fiche.php +++ b/htdocs/boutique/commande/fiche.php @@ -1,7 +1,7 @@ +/* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2003-2005 Éric Seigne - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2006 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 @@ -19,19 +19,21 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/commande/fiche.php + \ingroup boutique + \brief Page fiche commande OSCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); $langs->load("products"); llxHeader(); -/* - * - * - */ if ($_GET['id']) { @@ -67,9 +69,9 @@ if ($_GET['id']) $sql .= " FROM ".OSC_DB_NAME.".orders_products"; $sql .= " WHERE orders_id = " . $commande->id; - if ( $db->query($sql) ) + if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $i = 0; print ''; print ''; @@ -78,7 +80,7 @@ if ($_GET['id']) $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; print '
'.$langs->trans("Products").'
'; @@ -95,11 +97,11 @@ if ($_GET['id']) $i++; } print "
"; - $db->free(); + $dbosc->free(); } else { - print $db->error(); + print $dbosc->error(); } /* @@ -144,7 +146,7 @@ print '
'; -$db->close(); +$dbosc->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?> diff --git a/htdocs/boutique/commande/index.php b/htdocs/boutique/commande/index.php index 515e520c4a5..3c24504c39e 100644 --- a/htdocs/boutique/commande/index.php +++ b/htdocs/boutique/commande/index.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -47,16 +46,16 @@ $offset = $limit * $page ; print_barre_liste("Liste des commandes", $page, "commande.php"); - $sql = "SELECT o.orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified,".$db->pdate("date_purchased")." as date_purchased, orders_status, orders_date_finished, currency, currency_value, t.value"; + $sql = "SELECT o.orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified,".$dbosc->pdate("date_purchased")." as date_purchased, orders_status, orders_date_finished, currency, currency_value, t.value"; $sql .= " FROM ".OSC_DB_NAME.".orders as o, ".OSC_DB_NAME.".orders_total as t"; $sql .= " WHERE o.orders_id = t.orders_id AND t.class = 'ot_total'"; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); -if ( $db->query($sql) ) +if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $i = 0; print ""; print ""; @@ -68,7 +67,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; @@ -81,14 +80,14 @@ if ( $db->query($sql) ) $i++; } print "
"; - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } -$db->close(); +$dbosc->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?> diff --git a/htdocs/boutique/commande/pre.inc.php b/htdocs/boutique/commande/pre.inc.php index 272a6138165..ea5e73f0dcf 100644 --- a/htdocs/boutique/commande/pre.inc.php +++ b/htdocs/boutique/commande/pre.inc.php @@ -27,7 +27,9 @@ */ require("../../main.inc.php"); -require(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); +require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); + function llxHeader($head = "", $urlp = "") { @@ -43,6 +45,7 @@ function llxHeader($head = "", $urlp = "") $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/critiques/bestproduct.php b/htdocs/boutique/critiques/bestproduct.php index 6a147a97eaf..b81d3c24000 100644 --- a/htdocs/boutique/critiques/bestproduct.php +++ b/htdocs/boutique/critiques/bestproduct.php @@ -53,7 +53,7 @@ $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); +$sql .= $dbosc->plimit( $limit ,$offset); print "

"; print "'; print "\n"; -$resql=$db->query($sql); +$resql=$dbosc->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $num = $dbosc->num_rows($resql); $i = 0; $var=True; while ($i < $num) { - $objp = $db->fetch_object($resql); + $objp = $dbosc->fetch_object($resql); $var=!$var; print ""; print ''; @@ -81,17 +81,17 @@ if ($resql) print "\n"; $i++; } - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } print "
".$langs->trans("Ref"); @@ -63,15 +63,15 @@ print 'Status
'.$objp->products_model.'
"; -$db->close(); +$dbosc->close(); llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/critiques/fiche.php b/htdocs/boutique/critiques/fiche.php index 8c14a866cb3..0e05d42f476 100644 --- a/htdocs/boutique/critiques/fiche.php +++ b/htdocs/boutique/critiques/fiche.php @@ -1,5 +1,6 @@ + * Copyright (C) 2006 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 @@ -36,7 +37,7 @@ llxHeader(); if ($id) { - $critique = new Critique($db); + $critique = new Critique($dbosc); $result = $critique->fetch($id); if ( $result ) @@ -77,7 +78,7 @@ print '
'; -$db->close(); +$dbosc->close(); llxFooter('$Date$ - $Revision$'); diff --git a/htdocs/boutique/critiques/index.php b/htdocs/boutique/critiques/index.php index 999ce5c7f10..0c32a78d4aa 100644 --- a/htdocs/boutique/critiques/index.php +++ b/htdocs/boutique/critiques/index.php @@ -49,7 +49,7 @@ $sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name F $sql .= " WHERE r.reviews_id = d.reviews_id AND r.products_id=p.products_id"; $sql .= " AND p.language_id = ".OSC_LANGUAGE_ID. " AND d.languages_id=".OSC_LANGUAGE_ID; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); print "

"; print ''; @@ -59,14 +59,14 @@ print ""; print ""; print "\n"; -$resql=$db->query($sql); +$resql=$dbosc->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $num = $dbosc->num_rows($resql); $i = 0; $var=True; while ($i < $num) { - $objp = $db->fetch_object($resql); + $objp = $dbosc->fetch_object($resql); $var=!$var; print ""; print "\n"; @@ -75,17 +75,17 @@ if ($resql) { print "\n"; $i++; } - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } print "
Note
".substr($objp->products_name, 0, 30)."
"; -$db->close(); +$dbosc->close(); llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/critiques/pre.inc.php b/htdocs/boutique/critiques/pre.inc.php index 982040881c2..71ecf6db628 100644 --- a/htdocs/boutique/critiques/pre.inc.php +++ b/htdocs/boutique/critiques/pre.inc.php @@ -29,6 +29,8 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/boutique/critiques/critique.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); + function llxHeader($head = "", $urlp = "") { @@ -44,6 +46,7 @@ function llxHeader($head = "", $urlp = "") $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/notification/fiche.php b/htdocs/boutique/notification/fiche.php index 1c52cc7c505..7115aff7219 100644 --- a/htdocs/boutique/notification/fiche.php +++ b/htdocs/boutique/notification/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2006 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 @@ -18,15 +18,21 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/notification/fiche.php + \ingroup boutique + \brief Page fiche notification OS Commerce + \version $Revision$ +*/ + require("./pre.inc.php"); llxHeader(); if ($action == 'add') { - $editeur = new Editeur($db); + $editeur = new Editeur($dbosc); $editeur->nom = $nom; @@ -34,14 +40,14 @@ if ($action == 'add') { } if ($action == 'addga') { - $editeur = new Editeur($db); + $editeur = new Editeur($dbosc); $editeur->linkga($id, $ga); } if ($action == 'update' && !$cancel) { - $editeur = new Editeur($db); + $editeur = new Editeur($dbosc); $editeur->nom = $nom; @@ -74,7 +80,7 @@ else if ($id) { - $editeur = new Editeur($db); + $editeur = new Editeur($dbosc); $result = $editeur->fetch($id); if ( $result ) @@ -137,7 +143,7 @@ if ($action != 'create') print ''; -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/notification/index.php b/htdocs/boutique/notification/index.php index 40458157060..f05b4384524 100644 --- a/htdocs/boutique/notification/index.php +++ b/htdocs/boutique/notification/index.php @@ -1,7 +1,7 @@ - * Copyright (C) 2003 Éric Seigne - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2004-2006 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 @@ -19,9 +19,15 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/notification/index.php + \ingroup boutique + \brief Page gestion notification OS Commerce + \version $Revision$ +*/ + require("./pre.inc.php"); $langs->load("products"); @@ -48,11 +54,11 @@ $sql .= ",".OSC_DB_NAME.".customers as c"; $sql .= " WHERE n.customers_id = c.customers_id AND p.products_id=n.products_id"; $sql .= " AND p.language_id = ".OSC_LANGUAGE_ID; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); -if ( $db->query($sql) ) +if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $i = 0; print ""; print ""; @@ -62,7 +68,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; print "\n"; @@ -71,14 +77,14 @@ if ( $db->query($sql) ) $i++; } print "
rowid\">$objp->customers_firstname $objp->customers_lastname
"; - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/notification/pre.inc.php b/htdocs/boutique/notification/pre.inc.php index 831c2f22851..7091c36d034 100644 --- a/htdocs/boutique/notification/pre.inc.php +++ b/htdocs/boutique/notification/pre.inc.php @@ -17,40 +17,31 @@ * * $Id$ * $Source$ - * */ + require("../../main.inc.php"); -require("../livre/livre.class.php"); -require("./notification.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); +require_once(DOL_DOCUMENT_ROOT.'/boutique/notification/notification.class.php'); -function llxHeader($head = "", $urlp = "") { - global $user, $conf; - - /* - * - * - */ - top_menu($head); - - $menu = new Menu(); - - $menu->add(DOL_URL_ROOT."/boutique/client/", "Clients"); - - $menu->add(DOL_URL_ROOT."/boutique/commande/", "Commandes"); - - $menu->add(DOL_URL_ROOT."/boutique/notification/", "Notifications"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/produits.php", "Produits"); - - $menu->add(DOL_URL_ROOT."/boutique/newsletter/", "Newsletter"); - - $menu->add_submenu(DOL_URL_ROOT."/boutique/newsletter/fiche.php?action=create", "Nouvelle newsletter"); - - left_menu($menu->liste); - /* - * - * - */ +function llxHeader($head = "", $urlp = "") +{ + global $user,$conf, $langs; + $langs->load("shop"); + + top_menu($head); + + $menu = new Menu(); + + $menu->add(DOL_URL_ROOT."/boutique/index.php", $langs->trans("OSCommerceShop")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/produits/osc-liste.php", $langs->trans("Products")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); + $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); + + left_menu($menu->liste); } ?> diff --git a/htdocs/boutique/notification/produits.php b/htdocs/boutique/notification/produits.php index 8135b71ef5a..a9f3585b404 100644 --- a/htdocs/boutique/notification/produits.php +++ b/htdocs/boutique/notification/produits.php @@ -1,6 +1,7 @@ - * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2003 Éric Seigne + * Copyright (C) 2006 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 @@ -18,9 +19,15 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/notification/produits.php + \ingroup boutique + \brief Page fiche notification produits OS Commerce + \version $Revision$ +*/ + require("./pre.inc.php"); llxHeader(); @@ -44,11 +51,12 @@ $sql .= " FROM ".OSC_DB_NAME.".products_notifications as n,".OSC_DB_NAME.".produ $sql .= " WHERE p.products_id=n.products_id"; $sql .= " AND p.language_id = ".OSC_LANGUAGE_ID; $sql .= " GROUP BY p.products_name, p.products_id"; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); -if ( $db->query($sql) ) +$resql=$dbosc->query($sql); +if ($resql) { - $num = $db->num_rows(); + $num = $dbosc->num_rows($resql); $i = 0; print "

"; print ""; @@ -59,7 +67,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object($resql); $var=!$var; print ""; @@ -73,14 +81,14 @@ if ( $db->query($sql) ) $i++; } print "
"; - $db->free(); + $dbosc->free(); } else { - print $db->error(); + dolibarr_print_error($dbosc); } -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/pre.inc.php b/htdocs/boutique/pre.inc.php index 6d9534cbeb4..579985b1263 100644 --- a/htdocs/boutique/pre.inc.php +++ b/htdocs/boutique/pre.inc.php @@ -28,6 +28,7 @@ */ require("../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); //affichages dans la page d'accueil define("OSC_MAXNBCOM", 5); @@ -46,6 +47,7 @@ function llxHeader($head = "", $urlp = "") $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/produits/index.php b/htdocs/boutique/produits/index.php index a462421a7ce..0e7cc22bcb4 100644 --- a/htdocs/boutique/produits/index.php +++ b/htdocs/boutique/produits/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2006 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 @@ -18,9 +18,15 @@ * * $Id$ * $Source$ - * */ +/** + \file htdocs/boutique/produits/index.php + \ingroup boutique + \brief Page gestion produits du module OsCommerce + \version $Revision$ +*/ + require("./pre.inc.php"); $langs->load("companies"); @@ -44,11 +50,11 @@ print_barre_liste("Liste des clients", $page, "index.php"); $sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter"; $sql .= " FROM ".DB_NAME_OSC.".customers as c"; $sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); -if ( $db->query($sql) ) +if ( $dbosc->query($sql) ) { - $num = $db->num_rows(); + $num = $dbosc->num_rows(); $i = 0; print ""; print ""; @@ -59,7 +65,7 @@ if ( $db->query($sql) ) $var=True; while ($i < $num) { - $objp = $db->fetch_object(); + $objp = $dbosc->fetch_object(); $var=!$var; print ""; print '\n"; @@ -70,14 +76,14 @@ if ( $db->query($sql) ) $i++; } print "
'.$objp->customers_firstname."
"; - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } -$db->close(); +$dbosc->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/produits/osc-liste.php b/htdocs/boutique/produits/osc-liste.php index 342349cc742..b2d0a1ef237 100644 --- a/htdocs/boutique/produits/osc-liste.php +++ b/htdocs/boutique/produits/osc-liste.php @@ -56,7 +56,7 @@ if ($reqstock=='epuise') } //$sql .= " ORDER BY $sortfield $sortorder "; -$sql .= $db->plimit( $limit ,$offset); +$sql .= $dbosc->plimit( $limit ,$offset); print "

"; print ''; @@ -68,15 +68,16 @@ print ''; print ''; print "\n"; -$resql=$db->query($sql); +$resql=$dbosc->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $num = $dbosc->num_rows($resql); $i = 0; $var=True; - while ($i < $num) { - $objp = $db->fetch_object($resql); + while ($i < $num) + { + $objp = $dbosc->fetch_object($resql); $var=!$var; print ""; print "\n"; @@ -88,17 +89,17 @@ if ($resql) print "\n"; $i++; } - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } print "
StockStatus
$objp->products_id
"; -$db->close(); +$dbosc->close(); llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/boutique/produits/pre.inc.php b/htdocs/boutique/produits/pre.inc.php index e30ada71472..7386651acc9 100644 --- a/htdocs/boutique/produits/pre.inc.php +++ b/htdocs/boutique/produits/pre.inc.php @@ -27,6 +27,8 @@ */ require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); + function llxHeader($head = "", $urlp = "") { @@ -42,6 +44,7 @@ function llxHeader($head = "", $urlp = "") $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders")); diff --git a/htdocs/boutique/promotion/index.php b/htdocs/boutique/promotion/index.php index 0d0c3d5ed06..4221f32cf58 100644 --- a/htdocs/boutique/promotion/index.php +++ b/htdocs/boutique/promotion/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2004-2006 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 @@ -33,12 +33,12 @@ llxHeader(); if ($action == "inactive") { - $promotion = new Promotion($db); + $promotion = new Promotion($dbosc); $promotion->set_inactive($id); } if ($action == "active") { - $promotion = new Promotion($db); + $promotion = new Promotion($dbosc); $promotion->set_active($id); } @@ -60,16 +60,16 @@ print_barre_liste("Liste des promotions", $page, "index.php", "",$sortfield, $so $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 .= ",".$dbosc->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); +$sql .= $dbosc->plimit( $limit ,$offset); -$resql=$db->query($sql); +$resql=$dbosc->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $num = $dbosc->num_rows($resql); $i = 0; print ''; print ""; @@ -82,7 +82,7 @@ if ($resql) $var=True; while ($i < $num) { - $objp = $db->fetch_object( $i); + $objp = $dbosc->fetch_object( $i); $var=!$var; print ""; @@ -110,13 +110,13 @@ if ($resql) $i++; } print "
"; - $db->free(); + $dbosc->free(); } else { - dolibarr_print_error($db); + dolibarr_print_error($dbosc); } -$db->close(); +$dbosc->close(); llxFooter('$Date$ - $Revision$'); diff --git a/htdocs/boutique/promotion/pre.inc.php b/htdocs/boutique/promotion/pre.inc.php index 057356368bc..91902cfce6d 100644 --- a/htdocs/boutique/promotion/pre.inc.php +++ b/htdocs/boutique/promotion/pre.inc.php @@ -28,7 +28,9 @@ */ require("../../main.inc.php"); -require("./promotion.class.php"); +require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); +require_once(DOL_DOCUMENT_ROOT.'/boutique/promotion/promotion.class.php'); + function llxHeader($head = "", $urlp = "") { @@ -44,6 +46,7 @@ function llxHeader($head = "", $urlp = "") $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/index.php", $langs->trans("Critiques")); $menu->add_submenu(DOL_URL_ROOT."/boutique/critiques/bestproduct.php", "Meilleurs produits",2); $menu->add_submenu(DOL_URL_ROOT."/boutique/promotion/index.php", $langs->trans("Promotion")); + $menu->add_submenu(DOL_URL_ROOT."/boutique/notification/", $langs->trans("Notifications")); $menu->add_submenu(DOL_URL_ROOT."/boutique/client/", $langs->trans("Customers")); $menu->add_submenu(DOL_URL_ROOT."/boutique/commande/", $langs->trans("Orders"));