Debuggage et nettoyage du module OSCommerce 1.

La base OSCommerce peut etre sur un autre serveur.
This commit is contained in:
Laurent Destailleur 2006-09-03 13:49:00 +00:00
parent 02aff93fa7
commit 2e1e3f2d23
21 changed files with 228 additions and 172 deletions

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003-2005 Éric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<table class="noborder" width="50%">';
print "<tr class=\"liste_titre\"><td>Commandes</td>";
print "</tr>\n";
$var=True;
while ($i < $num) {
$objp = $db->fetch_object();
$objp = $dbosc->fetch_object();
$var=!$var;
print "<tr $bc[$var]>";
@ -78,19 +86,19 @@ if ($_GET['id'])
$i++;
}
print "</table>";
$db->free();
$dbosc->free();
}
else
{
print "<p>ERROR 1</p>\n";
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
}
else
{
print "<p>ERROR 1</p>\n";
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
@ -111,7 +119,7 @@ else
// Pas d'action
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
@ -59,7 +65,7 @@ if ( $db->query($sql) )
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object();
$objp = $dbosc->fetch_object();
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n";
@ -70,14 +76,14 @@ if ( $db->query($sql) )
$i++;
}
print "</table>";
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -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"));

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 "<tr $bc[$var]>";
print '<td>Somme des commandes</td>';
@ -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 "<tr $bc[$var]>";
print '<td>Somme des frais de port</td>';
@ -91,17 +97,17 @@ if ( $db->query($sql) )
$i++;
}
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
print "</table>";
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003-2005 Éric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td align="left" width="40%">'.$langs->trans("Products").'</td>';
@ -78,7 +80,7 @@ if ($_GET['id'])
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object();
$objp = $dbosc->fetch_object();
$var=!$var;
print "<tr $bc[$var]>";
print '<td align="left" width="40%">';
@ -95,11 +97,11 @@ if ($_GET['id'])
$i++;
}
print "</table>";
$db->free();
$dbosc->free();
}
else
{
print $db->error();
print $dbosc->error();
}
/*
@ -144,7 +146,7 @@ print '</table><br>';
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -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 "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
@ -68,7 +67,7 @@ if ( $db->query($sql) )
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object();
$objp = $dbosc->fetch_object();
$var=!$var;
print "<tr $bc[$var]>";
@ -81,14 +80,14 @@ if ( $db->query($sql) )
$i++;
}
print "</table>";
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -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"));

View File

@ -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 "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\"><td>".$langs->trans("Ref");
@ -63,15 +63,15 @@ print '</td><td align="center">Status</TD>';
print "</TR>\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 "<TR $bc[$var]>";
print '<TD><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_model.'</a></TD>';
@ -81,17 +81,17 @@ if ($resql)
print "</TR>\n";
$i++;
}
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
print "</TABLE>";
$db->close();
$dbosc->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '</table><br>';
$db->close();
$dbosc->close();
llxFooter('$Date$ - $Revision$');

View File

@ -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 "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
@ -59,14 +59,14 @@ print "<td align=\"center\">Note</td>";
print "<TD align=\"right\"></TD>";
print "</TR>\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 "<TR $bc[$var]>";
print "<TD>".substr($objp->products_name, 0, 30)."</TD>\n";
@ -75,17 +75,17 @@ if ($resql) {
print "</TR>\n";
$i++;
}
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
print "</TABLE>";
$db->close();
$dbosc->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@ -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"));

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '</div>';
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 "<table class=\noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
@ -62,7 +68,7 @@ if ( $db->query($sql) )
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object();
$objp = $dbosc->fetch_object();
$var=!$var;
print "<tr $bc[$var]>";
print "<td width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->customers_firstname $objp->customers_lastname</a></TD>\n";
@ -71,14 +77,14 @@ if ( $db->query($sql) )
$i++;
}
print "</table>";
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -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);
}
?>

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\">";
@ -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 "<TR $bc[$var]>";
@ -73,14 +81,14 @@ if ( $db->query($sql) )
$i++;
}
print "</TABLE>";
$db->free();
$dbosc->free();
}
else
{
print $db->error();
dolibarr_print_error($dbosc);
}
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -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"));

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
@ -59,7 +65,7 @@ if ( $db->query($sql) )
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object();
$objp = $dbosc->fetch_object();
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n";
@ -70,14 +76,14 @@ if ( $db->query($sql) )
$i++;
}
print "</table>";
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
$db->close();
$dbosc->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -56,7 +56,7 @@ if ($reqstock=='epuise')
}
//$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
$sql .= $dbosc->plimit( $limit ,$offset);
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
@ -68,15 +68,16 @@ print '<td align="center">Stock</td>';
print '<TD align="center">Status</TD>';
print "</TR>\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 "<TR $bc[$var]>";
print "<TD>$objp->products_id</TD>\n";
@ -88,17 +89,17 @@ if ($resql)
print "</TR>\n";
$i++;
}
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
print "</TABLE>";
$db->close();
$dbosc->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@ -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"));

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<table class=\"noborder width="100%">';
print "<tr class=\"liste_titre\">";
@ -82,7 +82,7 @@ if ($resql)
$var=True;
while ($i < $num)
{
$objp = $db->fetch_object( $i);
$objp = $dbosc->fetch_object( $i);
$var=!$var;
print "<tr $bc[$var]>";
@ -110,13 +110,13 @@ if ($resql)
$i++;
}
print "</TABLE>";
$db->free();
$dbosc->free();
}
else
{
dolibarr_print_error($db);
dolibarr_print_error($dbosc);
}
$db->close();
$dbosc->close();
llxFooter('$Date$ - $Revision$');

View File

@ -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"));