Can use empty prefix for oscommerce module
This commit is contained in:
parent
f2b6dcfe16
commit
dc4448c423
@ -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.".".OSC_DB_TABLE_PREFIX."languages as l";
|
||||
$sql = "SELECT l.languages_id, l.name, l.code FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."languages as l";
|
||||
|
||||
$sql .= $db->plimit( $limit ,$offset);
|
||||
|
||||
@ -67,7 +67,7 @@ $sql .= $db->plimit( $limit ,$offset);
|
||||
print "<td>Name</td>";
|
||||
print "<TD>Code</TD>";
|
||||
print "</TR>\n";
|
||||
|
||||
|
||||
if ( $db->query($sql) ) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
\class Client
|
||||
\brief Classe permettant de gèrer des clients de la boutique online
|
||||
*/
|
||||
@ -52,8 +52,9 @@ class Client
|
||||
|
||||
function fetch ($id)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT customers_id, customers_lastname, customers_firstname FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."customers WHERE customers_id = $id";
|
||||
$sql = "SELECT customers_id, customers_lastname, customers_firstname FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."customers WHERE customers_id = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\file htdocs/boutique/client/fiche.php
|
||||
\ingroup boutique
|
||||
@ -44,25 +44,25 @@ if ($action == 'update' && !$cancel) {
|
||||
*/
|
||||
if ($_GET['id'])
|
||||
{
|
||||
|
||||
|
||||
$client = new Client($dbosc);
|
||||
$result = $client->fetch($_GET['id']);
|
||||
if ( $result )
|
||||
{
|
||||
{
|
||||
print '<div class="titre">Fiche Client : '.$client->name.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">Nom</td><td width="80%">'.$client->name.'</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Commandes
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT o.orders_id, o.customers_id,".$dbosc->pdate("date_purchased")." as date_purchased, t.value as total";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o, ".$conf->global->OSC_DB_NAME.".".$conf->global->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) )
|
||||
@ -77,9 +77,9 @@ if ($_GET['id'])
|
||||
$objp = $dbosc->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/boutique/commande/fiche.php?id='.$objp->orders_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche"> ';
|
||||
|
||||
|
||||
print dolibarr_print_date($objp->date_purchased,'dayhour')."</a>\n";
|
||||
print $objp->total . "</a></TD>\n";
|
||||
print "</tr>\n";
|
||||
@ -93,15 +93,15 @@ if ($_GET['id'])
|
||||
print "<p>ERROR 1</p>\n";
|
||||
dolibarr_print_error($dbosc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<p>ERROR 1</p>\n";
|
||||
dolibarr_print_error($dbosc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -111,9 +111,9 @@ else
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
// Pas d'action
|
||||
|
||||
@ -48,10 +48,10 @@ $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.".".OSC_DB_TABLE_PREFIX."customers as c";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."customers as c";
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $dbosc->plimit( $limit ,$offset);
|
||||
|
||||
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$num = $dbosc->num_rows();
|
||||
|
||||
@ -51,9 +51,9 @@ 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.".".OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " WHERE t.class = 'ot_subtotal'";
|
||||
|
||||
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$num = $dbosc->num_rows();
|
||||
@ -79,9 +79,9 @@ else
|
||||
}
|
||||
|
||||
$sql = "SELECT sum(t.value) as value";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " WHERE t.class = 'ot_shipping'";
|
||||
|
||||
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$num = $dbosc->num_rows();
|
||||
|
||||
@ -57,8 +57,10 @@ class Commande
|
||||
*/
|
||||
function fetch ($id,$ref='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$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.".".OSC_DB_TABLE_PREFIX."orders";
|
||||
$sql.= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders";
|
||||
$sql.= " WHERE orders_id = ".$id;
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
@ -93,7 +95,7 @@ class Commande
|
||||
* Totaux
|
||||
*/
|
||||
$sql = "SELECT value, class ";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total WHERE orders_id = $id";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total WHERE orders_id = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
|
||||
@ -39,10 +39,10 @@ if ($_GET['id'])
|
||||
{
|
||||
$commande = new Commande($db);
|
||||
$result = $commande->fetch($_GET['id']);
|
||||
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
print '<div class="titre">Fiche Commande : '.$commande->id.'</div><br>';
|
||||
|
||||
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
|
||||
@ -60,13 +60,13 @@ if ($_GET['id'])
|
||||
print "</table>";
|
||||
|
||||
print "<br />";
|
||||
|
||||
|
||||
/*
|
||||
* Produits
|
||||
*
|
||||
*/
|
||||
$sql = "SELECT orders_id, products_id, products_model, products_name, products_price, final_price, products_quantity";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_products";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_products";
|
||||
$sql .= " WHERE orders_id = " . $commande->id;
|
||||
|
||||
if ( $dbosc->query($sql) )
|
||||
@ -78,21 +78,21 @@ if ($_GET['id'])
|
||||
print '<td align="center">'.$langs->trans("Number").'</td><td align="right">'.$langs->trans("Price").'</td><td align="right">Prix final</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $dbosc->fetch_object();
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td align="left" width="40%">';
|
||||
print '<a href="fiche.php?id='.$objp->products_id.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" width="16" height="16" alt="Fiche livre"></a>';
|
||||
|
||||
|
||||
print '<a href="fiche.php?id='.$objp->products_id.'">'.$objp->products_name.'</a>';
|
||||
print "</td>";
|
||||
|
||||
print '<td align="center"><a href="fiche.php?id='.$objp->rowid."\">$objp->products_quantity</a></TD>\n";
|
||||
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->products_price)."</a></TD>\n";
|
||||
print "<td align=\"right\"><a href=\"fiche.php?id=$objp->rowid\">".price($objp->final_price)."</a></TD>\n";
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -116,8 +116,8 @@ if ($_GET['id'])
|
||||
print '<td width="20%">'.$langs->trans("Lastname").'</td><td width="80%">'.price($commande->total_ot_total).' EUR</td></tr>';
|
||||
print "</table>";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -131,17 +131,17 @@ else
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '<td width="20%" align="center">-</td>';
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
@ -48,11 +48,11 @@ 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.".".OSC_DB_TABLE_PREFIX."orders as o, ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o, ".$conf->global->OSC_DB_NAME.".".$conf->global->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);
|
||||
|
||||
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$num = $dbosc->num_rows();
|
||||
|
||||
@ -48,7 +48,7 @@ $offset = $limit * $page ;
|
||||
print_barre_liste("Liste des produits classés 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.".".OSC_DB_TABLE_PREFIX."reviews as r,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products as p ";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."reviews as r,".$conf->global->OSC_DB_NAME.".".$conf->global->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";
|
||||
|
||||
|
||||
@ -41,22 +41,22 @@ class Critique {
|
||||
function Critique($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function fetch ($id) {
|
||||
|
||||
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name";
|
||||
|
||||
$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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."reviews as r, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."reviews_description as d";
|
||||
$sql .= " ,".$conf->global->OSC_DB_NAME.".".$conf->global->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 .= " AND p.language_id = ".$conf->global->OSC_LANGUAGE_ID. " AND d.languages_id=".$conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " AND r.reviews_id=$id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
@ -68,7 +68,7 @@ class Critique {
|
||||
$this->id = $result["reviews_id"];
|
||||
$this->product_name = stripslashes($result["products_name"]);
|
||||
$this->text = stripslashes($result["reviews_text"]);
|
||||
|
||||
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
@ -76,7 +76,7 @@ class Critique {
|
||||
print $this->db->error();
|
||||
print "<p>$sql";
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -45,9 +45,9 @@ $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.".".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 = "SELECT r.reviews_id, r.reviews_rating, d.reviews_text, p.products_name FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."reviews as r, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."reviews_description as d, ".$conf->global->OSC_DB_NAME.".".$conf->global->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 .= " AND p.language_id = ".$conf->global->OSC_LANGUAGE_ID. " AND d.languages_id=".$conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $dbosc->plimit( $limit ,$offset);
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\file htdocs/boutique/index.php
|
||||
\ingroup boutique
|
||||
@ -41,8 +41,8 @@ print '<table width="100%" class="notopnoleftnoright">';
|
||||
print '<tr><td valign="top" width="40%" class="notopnoleft">';
|
||||
|
||||
|
||||
/*
|
||||
/* Chiffre d'affaire
|
||||
/*
|
||||
/* Chiffre d'affaire
|
||||
*/
|
||||
//print_barre_liste("Chiffre d'affaire", $page, "ca.php");
|
||||
|
||||
@ -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.".".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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->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,10 +90,10 @@ else
|
||||
/* mensuel
|
||||
|
||||
$sql = "SELECT sum(t.value) as value";
|
||||
$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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t";
|
||||
$sql .= " JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->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) )
|
||||
{
|
||||
$num = $dbosc->num_rows();
|
||||
@ -128,10 +128,10 @@ 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.".".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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->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) )
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$langs->load("orders");
|
||||
$num = $dbosc->num_rows();
|
||||
@ -162,10 +162,10 @@ else
|
||||
* 5 dernières commandes en attente
|
||||
*/
|
||||
$sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method";
|
||||
$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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->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) )
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$langs->load("orders");
|
||||
$num = $dbosc->num_rows();
|
||||
@ -175,11 +175,11 @@ if ( $dbosc->query($sql) )
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4">'.$langs->trans("En Attente").'</td></tr>';
|
||||
|
||||
|
||||
$num = min($num,OSC_MAXNBCOM);
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $dbosc->fetch_object();
|
||||
print "<tr><td>$obj->orders_id</td><td>$obj->customers_name</td><td>".price($obj->value)."</td><td>$obj->payment_method</td></tr>";
|
||||
$i++;
|
||||
@ -196,10 +196,10 @@ else
|
||||
* Commandes à traiter
|
||||
*/
|
||||
$sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method";
|
||||
$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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->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) )
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$langs->load("orders");
|
||||
$num = $dbosc->num_rows();
|
||||
@ -213,7 +213,7 @@ if ( $dbosc->query($sql) )
|
||||
$num = min($num,OSC_MAXNBCOM);
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $dbosc->fetch_object();
|
||||
print "<tr><td>$obj->orders_id</td><td>$obj->customers_name</td><td>".price($obj->value)."</td><td>$obj->payment_method</td></tr>";
|
||||
$i++;
|
||||
@ -232,11 +232,11 @@ 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.".".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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id ";
|
||||
$sql .= " JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->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) )
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$langs->load("orders");
|
||||
$num = $dbosc->num_rows();
|
||||
@ -246,11 +246,11 @@ if ( $dbosc->query($sql) )
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="7">'.$langs->trans("Derniers clients").'</td></tr>';
|
||||
|
||||
|
||||
$num = min($num,OSC_MAXNBCOM);
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $dbosc->fetch_object();
|
||||
print "<tr><td>$obj->date_purchased</td><td>$obj->customers_name</td><td>$obj->delivery_country</td><td>".price($obj->value)."</td><td>$obj->payment_method</td><td>$obj->orders_id</td><td>$obj->statut</td></tr>";
|
||||
$i++;
|
||||
|
||||
@ -49,13 +49,13 @@ $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.".".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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_notifications as n,".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_description as p";
|
||||
$sql .= ",".$conf->global->OSC_DB_NAME.".".$conf->global->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 .= " AND p.language_id = ".$conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $dbosc->plimit( $limit ,$offset);
|
||||
|
||||
|
||||
if ( $dbosc->query($sql) )
|
||||
{
|
||||
$num = $dbosc->num_rows();
|
||||
|
||||
@ -29,7 +29,7 @@ class Editeur {
|
||||
function Editeur($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
@ -38,17 +38,17 @@ class Editeur {
|
||||
function create($user) {
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."editeur (fk_user_author) VALUES (".$user->id.")";
|
||||
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."editeur");
|
||||
|
||||
|
||||
if ( $this->update($id, $user) )
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -64,14 +64,14 @@ class Editeur {
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$nump = $this->db->num_rows();
|
||||
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
|
||||
$ga[$obj->rowid] = $obj->nom;
|
||||
$i++;
|
||||
}
|
||||
@ -82,7 +82,7 @@ class Editeur {
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
*
|
||||
@ -109,7 +109,7 @@ class Editeur {
|
||||
*
|
||||
*/
|
||||
function fetch ($id) {
|
||||
|
||||
|
||||
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."editeur WHERE rowid = $id";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
@ -120,14 +120,14 @@ class Editeur {
|
||||
|
||||
$this->id = $result["rowid"];
|
||||
$this->nom = stripslashes($result["nom"]);
|
||||
|
||||
|
||||
$this->db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -138,15 +138,17 @@ class Editeur {
|
||||
*/
|
||||
function delete($user) {
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc ";
|
||||
global $conf;
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_to_categories WHERE products_id = $idosc";
|
||||
$sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc ";
|
||||
|
||||
$sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_to_categories WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."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,12 +47,12 @@ $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.".".OSC_DB_TABLE_PREFIX."products_notifications as n,".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description as p";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_notifications as n,".$conf->global->OSC_DB_NAME.".".$conf->global->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 .= " AND p.language_id = ".$conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " GROUP BY p.products_name, p.products_id";
|
||||
$sql .= $dbosc->plimit( $limit ,$offset);
|
||||
|
||||
|
||||
$resql=$dbosc->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -46,13 +46,13 @@ $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.".".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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products as p, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_description as d, ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."manufacturers as m";
|
||||
$sql .= " WHERE p.products_id = d.products_id AND d.language_id =" . $conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " AND p.manufacturers_id=m.manufacturers_id";
|
||||
if ($reqstock=='epuise')
|
||||
{
|
||||
$sql .= " AND p.products_quantity <= 0";
|
||||
}
|
||||
}
|
||||
|
||||
//$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $dbosc->plimit( $limit ,$offset);
|
||||
@ -66,7 +66,7 @@ print "<td>Groupe</td>";
|
||||
print '<td align="center">Stock</td>';
|
||||
print '<TD align="center">Status</TD>';
|
||||
print "</TR>\n";
|
||||
|
||||
|
||||
$resql=$dbosc->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -61,11 +61,11 @@ $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.".".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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."specials as s,".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_description as pd,".$conf->global->OSC_DB_NAME.".".$conf->global->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 = ".$conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||
$sql .= $dbosc->plimit( $limit ,$offset);
|
||||
|
||||
|
||||
$resql=$dbosc->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -84,7 +84,7 @@ if ($resql)
|
||||
{
|
||||
$objp = $dbosc->fetch_object( $i);
|
||||
$var=!$var;
|
||||
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$objp->products_model."</td>";
|
||||
print '<td>'.$objp->products_name."</td>";
|
||||
|
||||
@ -35,16 +35,17 @@ class Promotion {
|
||||
function Promotion($DB, $id=0) {
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function create($user, $pid, $percent) {
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT products_price ";
|
||||
$sql .= " FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products as p";
|
||||
$sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products as p";
|
||||
$sql .= " WHERE p.products_id = $pid";
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
@ -59,20 +60,20 @@ class Promotion {
|
||||
|
||||
$date_exp = "2003-05-01";
|
||||
|
||||
$sql = "INSERT INTO ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials ";
|
||||
$sql = "INSERT INTO ".$conf->global->OSC_DB_NAME.".".$conf->global->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)";
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$id = $this->db->last_insert_id(OSC_DB_NAME.".specials");
|
||||
|
||||
|
||||
return $id;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
@ -100,7 +101,9 @@ class Promotion {
|
||||
*/
|
||||
function set_active($id)
|
||||
{
|
||||
$sql = "UPDATE ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials";
|
||||
global $conf;
|
||||
|
||||
$sql = "UPDATE ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."specials";
|
||||
$sql .= " SET status = 1";
|
||||
|
||||
$sql .= " WHERE products_id = " . $id;
|
||||
@ -110,13 +113,15 @@ class Promotion {
|
||||
} else {
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*/
|
||||
function set_inactive($id)
|
||||
{
|
||||
$sql = "UPDATE ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."specials";
|
||||
global $conf;
|
||||
|
||||
$sql = "UPDATE ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."specials";
|
||||
$sql .= " SET status = 0";
|
||||
|
||||
$sql .= " WHERE products_id = " . $id;
|
||||
@ -126,17 +131,18 @@ class Promotion {
|
||||
} else {
|
||||
print $this->db->error() . ' in ' . $sql;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function fetch ($id) {
|
||||
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT c.categories_id, cd.categories_name, c.parent_id";
|
||||
$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 .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."categories as c,".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."categories_description as cd";
|
||||
$sql .= " WHERE c.categories_id = cd.categories_id AND cd.language_id = ".$conf->global->OSC_LANGUAGE_ID;
|
||||
$sql .= " AND c.categories_id = $id";
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
@ -162,12 +168,14 @@ class Promotion {
|
||||
*/
|
||||
function delete($user) {
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc ";
|
||||
global $conf;
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_to_categories WHERE products_id = $idosc";
|
||||
$sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc ";
|
||||
|
||||
$sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_to_categories WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products_description WHERE products_id = $idosc";
|
||||
|
||||
$sql = "DELETE FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."products_description WHERE products_id = $idosc";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* 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
|
||||
@ -26,17 +26,17 @@
|
||||
class OscCommande
|
||||
{
|
||||
var $db ;
|
||||
|
||||
|
||||
var $id ;
|
||||
var $client_name ;
|
||||
|
||||
|
||||
|
||||
function OscCommande($DB, $id=0)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->id = $id ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
@ -45,23 +45,25 @@ class OscCommande
|
||||
*/
|
||||
function fetch ($id)
|
||||
{
|
||||
$sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."orders as o";
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT o.orders_id, o.customers_name, o.orders_status FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o";
|
||||
$sql .= " WHERE o.orders_id = $id";
|
||||
|
||||
|
||||
$result = $this->db->query($sql) ;
|
||||
|
||||
|
||||
if ( $result )
|
||||
{
|
||||
$result = $this->db->fetch_array();
|
||||
|
||||
|
||||
$this->id = $result["rowid"];
|
||||
$this->client_name = $result["customers_name"];
|
||||
}
|
||||
$this->db->free();
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
@ -78,14 +80,14 @@ class OscCommande
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
$nump = $this->db->num_rows();
|
||||
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object();
|
||||
|
||||
|
||||
$ga[$obj->rowid] = $obj->title;
|
||||
$i++;
|
||||
}
|
||||
@ -95,7 +97,7 @@ class OscCommande
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
|
||||
@ -57,28 +57,28 @@ class box_osc_clients extends ModeleBoxes {
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
global $user, $langs, $db;
|
||||
global $conf, $user, $langs, $db;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleNbOfCustomers",$max));
|
||||
|
||||
if ($user->rights->boutique->lire)
|
||||
{
|
||||
$sql = "SELECT count(*) as cus FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."customers";
|
||||
|
||||
$sql = "SELECT count(*) as cus FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."customers";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="center" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
'url' => DOL_URL_ROOT."/boutique/client/index.php");
|
||||
@ -96,7 +96,7 @@ class box_osc_clients extends ModeleBoxes {
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function showBox()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@ -49,4 +49,5 @@ ActivityOnProjectThisMonth=Activity on project this month
|
||||
ActivityOnProjectThisYear=Activity on project this year
|
||||
ChildOfTaks=Child of project/task
|
||||
NotOwnerOfProject=Not owner of this private project
|
||||
AffectedTo=Affected to
|
||||
AffectedTo=Affected to
|
||||
CantRemoveProject=This project can't be removed as it is referenced by some other objects (invoice, orders or other). See referers tab.
|
||||
@ -49,4 +49,5 @@ ActivityOnProjectThisMonth=Activité sur les projets ce mois
|
||||
ActivityOnProjectThisYear=Activité sur les projets cette année
|
||||
ChildOfTaks=Fille du projet/tâche
|
||||
NotOwnerOfProject=Non responsable de ce projet privé
|
||||
AffectedTo=Affecté à
|
||||
AffectedTo=Affecté à
|
||||
CantRemoveProject=Ce projet ne peut être supprimé car il est référencé par de nombreux objets (factures, commandes ou autre). voir la liste sur l'onglet Reférents.
|
||||
@ -1599,11 +1599,11 @@ function dol_print_error($db='',$error='')
|
||||
{
|
||||
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
||||
{
|
||||
print "<br>\n";
|
||||
print "<b>".$langs->trans("DatabaseTypeManager").":</b> ".$db->type."<br>\n";
|
||||
print "<b>".$langs->trans("RequestLastAccessInError").":</b> ".($db->lastqueryerror()?$db->lastqueryerror():$langs->trans("ErrorNoRequestInError"))."<br>\n";
|
||||
print "<b>".$langs->trans("ReturnCodeLastAccessInError").":</b> ".($db->lasterrno()?$db->lasterrno():$langs->trans("ErrorNoRequestInError"))."<br>\n";
|
||||
print "<b>".$langs->trans("InformationLastAccessInError").":</b> ".($db->lasterror()?$db->lasterror():$langs->trans("ErrorNoRequestInError"))."<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
else // Mode CLI
|
||||
{
|
||||
|
||||
@ -266,17 +266,19 @@ class Project extends CommonObject
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet";
|
||||
$sql .= " WHERE rowid=".$this->id;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dolibarr_syslog("Project::delete sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dolibarr_syslog("Project::delete ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -116,15 +116,15 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user-
|
||||
{
|
||||
$projet = new Project($db);
|
||||
$projet->id = $_GET["id"];
|
||||
if ($projet->delete($user) == 0)
|
||||
$result=$projet->delete($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Header("Location: fiche.php?id=".$projet->id);
|
||||
exit;
|
||||
$mesg='<div class="error">'.$langs->trans("CantRemoveProject").'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,11 +191,9 @@ else
|
||||
|
||||
$projet = new Project($db);
|
||||
$projet->fetch($_GET["id"],$_GET["ref"]);
|
||||
$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->user_resp_id > 0)
|
||||
{
|
||||
$result=$projet->fetch_user($projet->user_resp_id);
|
||||
}
|
||||
|
||||
if ($projet->societe->id > 0) $result=$projet->societe->fetch($projet->societe->id);
|
||||
if ($projet->user_resp_id > 0) $result=$projet->fetch_user($projet->user_resp_id);
|
||||
|
||||
$head=project_prepare_head($projet);
|
||||
dolibarr_fiche_head($head, 'project', $langs->trans("Project"));
|
||||
|
||||
@ -176,7 +176,7 @@ class Translate {
|
||||
*/
|
||||
function Load($domain,$alt=0)
|
||||
{
|
||||
dolibarr_syslog("Translate::Load domain=".$domain." alt=".$alt);
|
||||
//dolibarr_syslog("Translate::Load domain=".$domain." alt=".$alt);
|
||||
|
||||
// Check parameters
|
||||
if (empty($domain))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user