14 if (!defined(
'IN_PEEL')) {
38 foreach(get_object_vars($obj) as $name => $val) {
39 if ($name ==
'nom_' .
$_SESSION[
'session_langue'] || $name ==
'nom_produit') {
41 }
elseif ($name ==
'couleur' && !empty($val)) {
42 $val =
"Couleur : " . $val;
46 if (!empty($this->in_catalog)) {
47 $this->lien =
'<a href="' .
$GLOBALS[
'administrer_url'] .
'/produits.php?mode=modif&id=' . $this->produit_id .
'">' . $this->nom .
'</a>';
49 $this->lien = $this->nom .
' ('.$GLOBALS[
"STR_ADMIN_PRODUITS_NO_MORE_IN_CATALOG"].
')';
51 $this->lien .=
' - ' . $this->couleur .
' - <a href="' .
get_current_url(
false) .
'?id=' . $this->produit_id .
'">'.$GLOBALS[
"STR_ADMIN_PRODUITS_BUYERS_LIST"].
'</a>';
63 $sql =
"SELECT ca.produit_id,
68 SUM( ca.quantite ) AS quantite_totale,
69 SUM( ca.total_prix ) AS montant_total,
70 IF(p.id IS NOT NULL, 1,0) AS in_catalog
71 FROM peel_commandes_articles ca
72 INNER JOIN peel_commandes c ON ca.commande_id = c.id AND " .
get_filter_site_cond(
'commandes',
'c',
true) .
"
73 INNER JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
74 LEFT JOIN peel_produits p ON p.id = ca.produit_id AND " .
get_filter_site_cond(
'produits',
'p') .
"
76 AND sp.technical_code IN ('being_checked','completed')
78 " . (!empty(
$id)?
" AND ca.produit_id='" . intval(
$id) .
"'":
"") .
"
79 GROUP BY IF(ca.produit_id>0,ca.produit_id,ca.nom_produit), ca.couleur, ca.taille
80 ORDER BY quantite_totale DESC
81 LIMIT " . intval($limit);
130 SUM(ca.total_prix) AS total_paye,
131 SUM(ca.quantite) AS total_quantite
132 FROM peel_utilisateurs u
133 RIGHT JOIN peel_commandes c ON c.id_utilisateur = u.id_utilisateur AND " .
get_filter_site_cond(
'commandes',
'c',
true) .
"
134 INNER JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
135 INNER JOIN peel_commandes_articles ca ON ca.commande_id=c.id AND " .
get_filter_site_cond(
'commandes_articles',
'ca',
true) .
"
136 WHERE ca.produit_id = " . intval($this->produit_id) .
" AND ca.quantite > 0 AND sp.technical_code IN ('being_checked','completed') AND " .
get_filter_site_cond(
'utilisateurs',
'u',
true) .
"
137 GROUP BY u.id_utilisateur");
clients()
ProductsBought::clients()
find_all($limit=500)
ProductsBought::find_all()
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
_sql_de_base($id=null, $limit=500)
ProductsBought::_sql_de_base()
ProductsBought($obj)
ProductsBought::ProductsBought()
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
fetch_object($query_result)
fetch_object()
find($id)
ProductsBought::find()
$GLOBALS['page_columns_count']
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']