Skip to content
Snippets Groups Projects
Commit 367207c7 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Add compatibility to OSCSS

parent 716cf7d9
No related branches found
No related tags found
No related merge requests found
Showing
with 65 additions and 57 deletions
......@@ -53,7 +53,9 @@ if ($_POST["save"])
$i+=dolibarr_set_const($db,'OSC_DB_NAME',trim($_POST["oscommerce_dbname"]),'chaine',0);
$i+=dolibarr_set_const($db,'OSC_DB_USER',trim($_POST["oscommerce_dbuser"]),'chaine',0);
$i+=dolibarr_set_const($db,'OSC_DB_PASS',trim($_POST["oscommerce_dbpass"]),'chaine',0);
$i+=dolibarr_set_const($db,'OSC_DB_TABLE_PREFIX',trim($_POST["oscommerce_db_table_prefix"]),'chaine',0);
$i+=dolibarr_set_const($db,'OSC_LANGUAGE_ID',1,'chaine',0);
if ($i >= 4)
{
$db->commit();
......@@ -88,7 +90,7 @@ elseif ($_POST["test"])
{
// V�rifie si bonne base par requete sur une table OSCommerce
$sql ="SELECT configuration_value";
$sql.=" FROM configuration";
$sql.=" FROM ".$_POST["oscommerce_db_table_prefix"]."configuration";
$sql.=" WHERE configuration_key='STORE_NAME'";
$resql=$oscommercedb->query($sql);
if ($resql) {
......@@ -96,7 +98,7 @@ elseif ($_POST["test"])
$mesg.="</div>";
}
else {
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase");
$mesg ="<div class=\"error\">".$langs->trans("OSCommerceErrorConnectOkButWrongDatabase",'STORE_NAME',$_POST["oscommerce_db_table_prefix"]."configuration");
$mesg.="</div>";
}
......@@ -139,13 +141,13 @@ $var=true;
print '<form name="oscommerceconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print "<td width=\"30%\">".$langs->trans("Parameter")."</td>";
print "<td width=\"40%\">".$langs->trans("Parameter")."</td>";
print "<td>".$langs->trans("Value")."</td>";
print "<td>".$langs->trans("Examples")."</td>";
print "</tr>";
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$langs->trans("OSCOmmerceServer")."</td>";
print "<td>".$langs->trans("OSCommerceServer")."</td>";
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbhost\" value=\"". ($_POST["oscommerce_dbhost"]?$_POST["oscommerce_dbhost"]:$conf->global->OSC_DB_HOST) . "\" size=\"30\"></td>";
print "<td>localhost";
//print "<br>__dolibarr_main_db_host__ <i>(".$dolibarr_main_db_host.")</i>"
......@@ -153,15 +155,22 @@ print "</td>";
print "</tr>";
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$langs->trans("OSCOmmerceDatabaseName")."</td>";
print "<td>".$langs->trans("OSCommerceDatabaseName")."</td>";
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbname\" value=\"". ($_POST["oscommerce_dbname"]?$_POST["oscommerce_dbname"]:$conf->global->OSC_DB_NAME) . "\" size=\"30\"></td>";
print "<td>oscommerce";
//print "<br>__dolibarr_main_db_name__ <i>(".$dolibarr_main_db_name.")</i>";
print "</td>";
print "</tr>";
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$langs->trans("OSCommercePrefix")."</td>";
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_db_table_prefix\" value=\"". ($_POST["oscommerce_db_table_prefix"]?$_POST["oscommerce_db_table_prefix"]:$conf->global->DB_TABLE_PREFIX) . "\" size=\"30\"></td>";
print "<td>osc_";
print "</td>";
print "</tr>";
$var=!$var;
print "<tr ".$bc[$var].">";
print "<td>".$langs->trans("OSCOmmerceUser")."</td>";
print "<td>".$langs->trans("OSCommerceUser")."</td>";
print "<td><input type=\"text\" class=\"flat\" name=\"oscommerce_dbuser\" value=\"". ($_POST["oscommerce_dbuser"]?$_POST["oscommerce_dbuser"]:$conf->global->OSC_DB_USER) . "\" size=\"30\"></td>";
print "<td>oscommerceuser";
//print "<br>__dolibarr_main_db_user__ <i>(".$dolibarr_main_db_user.")</i>";
......
......@@ -57,7 +57,7 @@ $offset = $limit * $page ;
print_barre_liste("Liste des langues oscommerce", $page, "osc-languages.php");
$sql = "SELECT l.languages_id, l.name, l.code FROM ".OSC_DB_NAME.".languages as l";
$sql = "SELECT l.languages_id, l.name, l.code FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."languages as l";
$sql .= $db->plimit( $limit ,$offset);
......
......@@ -53,7 +53,7 @@ class Client
function fetch ($id)
{
$sql = "SELECT customers_id, customers_lastname, customers_firstname FROM ".OSC_DB_NAME.".customers WHERE customers_id = $id";
$sql = "SELECT customers_id, customers_lastname, customers_firstname FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."customers WHERE customers_id = $id";
$result = $this->db->query($sql) ;
......
......@@ -62,7 +62,7 @@ if ($_GET['id'])
*
*/
$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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."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 ( $dbosc->query($sql) )
......
......@@ -48,7 +48,7 @@ $offset = $limit * $page ;
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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."customers as c";
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $dbosc->plimit( $limit ,$offset);
......
......@@ -51,7 +51,7 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td>';
print '<td align="right">'.$langs->trans("Lastname").'</td></tr>';
$sql = "SELECT sum(t.value) as value";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
$sql .= " WHERE t.class = 'ot_subtotal'";
if ( $dbosc->query($sql) )
......@@ -79,7 +79,7 @@ else
}
$sql = "SELECT sum(t.value) as value";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
$sql .= " WHERE t.class = 'ot_shipping'";
if ( $dbosc->query($sql) )
......
......@@ -59,7 +59,7 @@ class Commande
$sql = "SELECT 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, ".$this->db->pdate("date_purchased") . " as date_purchased, orders_status, orders_date_finished, currency, currency_value";
$sql .= " FROM ".OSC_DB_NAME.".orders WHERE orders_id = $id";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders WHERE orders_id = $id";
$result = $this->db->query($sql) ;
......@@ -93,7 +93,7 @@ class Commande
* Totaux
*/
$sql = "SELECT value, class ";
$sql .= " FROM ".OSC_DB_NAME.".orders_total WHERE orders_id = $id";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total WHERE orders_id = $id";
$result = $this->db->query($sql) ;
......
......@@ -66,7 +66,7 @@ if ($_GET['id'])
*
*/
$sql = "SELECT orders_id, products_id, products_model, products_name, products_price, final_price, products_quantity";
$sql .= " FROM ".OSC_DB_NAME.".orders_products";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_products";
$sql .= " WHERE orders_id = " . $commande->id;
if ( $dbosc->query($sql) )
......
......@@ -48,7 +48,7 @@ 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,".$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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
$sql .= " WHERE o.orders_id = t.orders_id AND t.class = 'ot_total'";
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $dbosc->plimit( $limit ,$offset);
......
......@@ -48,7 +48,7 @@ $offset = $limit * $page ;
print_barre_liste("Liste des produits classs pas critiques", $page, "bestproduct.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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."reviews as r,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."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";
......
......@@ -52,8 +52,8 @@ class Critique {
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name";
$sql .= " FROM ".OSC_DB_NAME.".reviews as r, ".OSC_DB_NAME.".reviews_description as d";
$sql .= " ,".OSC_DB_NAME.".products_description as p";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."reviews as r, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."reviews_description as d";
$sql .= " ,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as p";
$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;
......
......@@ -45,7 +45,7 @@ $offset = $limit * $page ;
print_barre_liste("Critiques", $page, "index.php");
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name FROM ".OSC_DB_NAME.".reviews as r, ".OSC_DB_NAME.".reviews_description as d, ".OSC_DB_NAME.".products_description as p";
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."reviews as r, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."reviews_description as d, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as p";
$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 ";
......
......@@ -53,8 +53,8 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td>';
print '<td align="right">'.$langs->trans("Total").'</td></tr>';
$sql = "SELECT sum(t.value) as value, MONTH(o.date_purchased) as mois";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t";
$sql .= " JOIN ".OSC_DB_NAME.".orders as o ON o.orders_id = t.orders_id";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
$sql .= " JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o ON o.orders_id = t.orders_id";
$sql .= " WHERE t.class = 'ot_subtotal' AND YEAR(o.date_purchased) = YEAR(".$dbosc->idate(mktime()).")";
$sql .= " GROUP BY mois ORDER BY mois";
......@@ -90,8 +90,8 @@ else
/* mensuel
$sql = "SELECT sum(t.value) as value";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t";
$sql .= " JOIN ".OSC_DB_NAME.".orders as o ON o.orders_id = t.orders_id";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
$sql .= " JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o ON o.orders_id = t.orders_id";
$sql .= " WHERE t.class = 'ot_subtotal' AND YEAR(o.date_purchased) = YEAR(".$dbosc->db->idate(mktime()).") AND MONTH(o.date_purchased) = MONTH(".$this->db->idate(mktime()).")";
if ( $dbosc->query($sql) )
......@@ -128,7 +128,7 @@ from orders_total as t
join orders as o on o.orders_id = t.orders_id where t.class = 'ot_subtotal' order by o.date_purchased desc
*/
$sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t JOIN ".OSC_DB_NAME.".orders as o on o.orders_id = t.orders_id ";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id ";
$sql .= " WHERE t.class = 'ot_subtotal' ORDER BY o.date_purchased desc";
if ( $dbosc->query($sql) )
......@@ -162,7 +162,7 @@ else
* 5 dernires commandes en attente
*/
$sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t JOIN ".OSC_DB_NAME.".orders as o on o.orders_id = t.orders_id ";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id ";
$sql .= " WHERE t.class = 'ot_subtotal' and o.orders_status = 5 order by o.date_purchased desc";
if ( $dbosc->query($sql) )
......@@ -196,7 +196,7 @@ else
* Commandes traiter
*/
$sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t JOIN ".OSC_DB_NAME.".orders as o on o.orders_id = t.orders_id ";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id ";
$sql .= " WHERE t.class = 'ot_subtotal' and o.orders_status = 2 order by o.date_purchased desc";
if ( $dbosc->query($sql) )
......@@ -232,8 +232,8 @@ print '</td></tr><tr>';
* Derniers clients qui ont command
*/
$sql = "SELECT o.orders_id, o.customers_name, o.delivery_country, o.date_purchased, t.value, s.orders_status_name as statut";
$sql .= " FROM ".OSC_DB_NAME.".orders_total as t JOIN ".OSC_DB_NAME.".orders as o on o.orders_id = t.orders_id ";
$sql .= " JOIN ".OSC_DB_NAME.".orders_status as s on o.orders_status = s.orders_status_id and s.language_id = 1";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id ";
$sql .= " JOIN ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_status as s on o.orders_status = s.orders_status_id and s.language_id = 1";
$sql .= " WHERE t.class = 'ot_subtotal' order by o.date_purchased desc";
if ( $dbosc->query($sql) )
......
......@@ -49,8 +49,8 @@ $offset = $limit * $page ;
print_barre_liste("Liste des notifications", $page, "index.php");
$sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, p.products_name, p.products_id";
$sql .= " FROM ".OSC_DB_NAME.".products_notifications as n,".OSC_DB_NAME.".products_description as p";
$sql .= ",".OSC_DB_NAME.".customers as c";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_notifications as n,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as p";
$sql .= ",".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."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 ";
......
......@@ -138,11 +138,11 @@ class Editeur {
*/
function delete($user) {
$sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = $idosc ";
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc ";
$sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = $idosc";
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_to_categories WHERE products_id = $idosc";
$sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = $idosc";
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description WHERE products_id = $idosc";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livre WHERE rowid = $id";
......
......@@ -47,7 +47,7 @@ $offset = $limit * $page ;
print_barre_liste("Liste des produits suivis", $page, "produits.php");
$sql = "SELECT p.products_name, p.products_id, count(p.products_id) as nb";
$sql .= " FROM ".OSC_DB_NAME.".products_notifications as n,".OSC_DB_NAME.".products_description as p";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_notifications as n,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as p";
$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";
......
......@@ -46,7 +46,7 @@ $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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products as p, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as d, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."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 ($reqstock=='epuise')
......
......@@ -61,7 +61,7 @@ $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 .= ",".$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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials as s,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as pd,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."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 .= $dbosc->plimit( $limit ,$offset);
......
......@@ -44,7 +44,7 @@ class Promotion {
function create($user, $pid, $percent) {
$sql = "SELECT products_price ";
$sql .= " FROM ".OSC_DB_NAME.".products as p";
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products as p";
$sql .= " WHERE p.products_id = $pid";
$result = $this->db->query($sql) ;
......@@ -59,7 +59,7 @@ class Promotion {
$date_exp = "2003-05-01";
$sql = "INSERT INTO ".OSC_DB_NAME.".specials ";
$sql = "INSERT INTO ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials ";
$sql .= " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status) ";
$sql .= " VALUES ($pid, $newprice, ".$this->db->idate(mktime()).", NULL, '$date_exp',NULL,1)";
......@@ -100,7 +100,7 @@ class Promotion {
*/
function set_active($id)
{
$sql = "UPDATE ".OSC_DB_NAME.".specials";
$sql = "UPDATE ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials";
$sql .= " SET status = 1";
$sql .= " WHERE products_id = " . $id;
......@@ -116,7 +116,7 @@ class Promotion {
*/
function set_inactive($id)
{
$sql = "UPDATE ".OSC_DB_NAME.".specials";
$sql = "UPDATE ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials";
$sql .= " SET status = 0";
$sql .= " WHERE products_id = " . $id;
......@@ -135,7 +135,7 @@ class Promotion {
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 .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."categories as c,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."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) ;
......@@ -162,15 +162,12 @@ class Promotion {
*/
function delete($user) {
$sql = "DELETE FROM ".OSC_DB_NAME.".products WHERE products_id = $idosc ";
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc ";
$sql = "DELETE FROM ".OSC_DB_NAME.".products_to_categories WHERE products_id = $idosc";
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_to_categories WHERE products_id = $idosc";
$sql = "DELETE FROM ".OSC_DB_NAME.".products_description WHERE products_id = $idosc";
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description WHERE products_id = $idosc";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."album WHERE rowid = $id";
}
......
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 ric Seigne <erics@rycks.com>
*
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2005-2008 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
* the Free Software Foundation; either version 2 of the License, or
......@@ -15,10 +16,11 @@
* 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$
*
*/
/**
* \brief Class order OSCommerce
* \version $Id$
*/
class OscCommande
......@@ -43,7 +45,7 @@ class OscCommande
*/
function fetch ($id)
{
$sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".OSC_DB_NAME.".orders as o";
$sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o";
$sql .= " WHERE o.orders_id = $id";
$result = $this->db->query($sql) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment