PEEL Shopping
Open source ecommerce : PEEL Shopping
codes_promos.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: codes_promos.php 47024 2015-09-24 13:35:43Z sdelaporte $
14 define('IN_PEEL_ADMIN', true);
15 include("../configuration.inc.php");
17 necessite_priv("admin_sales,admin_users");
18 
19 $GLOBALS['DOC_TITLE'] = $GLOBALS['STR_ADMIN_CODES_PROMOS_TITLE'];
20 include($GLOBALS['repertoire_modele'] . "/admin_haut.php");
21 
22 $mode = vb($_REQUEST['mode']);
23 $frm = $_POST;
25 
26 switch ($mode) {
27  case "ajout" :
29  break;
30 
31  case "modif" :
32  affiche_formulaire_modif_code_promo(intval($_GET['id']), $frm);
33  break;
34 
35  case "suppr" :
36  supprime_code_promo(intval($_REQUEST['id']));
38  break;
39 
40  case "insere" :
41  if (!verify_token($_SERVER['PHP_SELF'] . $frm['mode'] . $frm['id'])) {
42  $form_error_object->add('token', $GLOBALS['STR_INVALID_TOKEN']);
43  }
44  if (!$form_error_object->count()) {
45  $frm['source'] = 'ADM';
46  $frm['on_check'] = '0';
47  if (insere_code_promo($frm)) {
48  echo $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_MSG_CREATED_OK'], String::strtoupper(vb($_POST['nom'])))))->fetch();
49  } else {
50  echo $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_ERR_ALREADY_EXISTS'], String::strtoupper(vb($_POST['nom'])))))->fetch();
51  }
53  } else {
54  if ($form_error_object->has_error('token')) {
55  echo $form_error_object->text('token');
56  }
58  }
59  break;
60 
61  case "maj" :
62  if (!verify_token($_SERVER['PHP_SELF'] . $frm['mode'] . $frm['id'])) {
63  $form_error_object->add('token', $GLOBALS['STR_INVALID_TOKEN']);
64  }
65  if (!$form_error_object->count()) {
66  maj_code_promo($_POST['id'], $_POST);
67  echo $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_MSG_MODIFY_OK'], String::strtoupper(vb($_POST['nom'])))))->fetch();
69  } else {
70  if ($form_error_object->has_error('token')) {
71  echo $form_error_object->text('token');
72  }
73  affiche_formulaire_modif_code_promo($_REQUEST['id'], $frm);
74  }
75  break;
76 
77  case "code_pour_client" :
78  affiche_liste_code_pour_client(intval($_REQUEST['id_utilisateur']));
79  break;
80 
81  case "envoi_client" :
82  if (!verify_token($_SERVER['PHP_SELF'] . 'envoi_client' . $_POST['id_utilisateur'])) {
83  $form_error_object->add('token', $GLOBALS['STR_INVALID_TOKEN']);
84  }
85  if (!$form_error_object->count()) {
86  if (empty($_REQUEST['code_promo_id'])) {
87  echo $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ADMIN_CODES_PROMOS_ERR_NO_CODE_SELECTED']))->fetch();
88  } elseif (empty($_REQUEST['id_utilisateur'])) {
89  echo $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ADMIN_CODES_PROMOS_ERR_NO_USER_SELECTED']))->fetch();
90  } else {
91  echo envoie_client_code_promo(intval($_REQUEST['id_utilisateur']), intval($_REQUEST['code_promo_id']));
92  }
94  } else {
95  if ($form_error_object->has_error('token')) {
96  echo $form_error_object->text('token');
97  }
98  affiche_liste_code_pour_client(intval($_REQUEST['id_utilisateur']));
99  }
100  break;
101 
102  default :
104  break;
105 }
106 
107 include($GLOBALS['repertoire_modele'] . "/admin_bas.php");
108 
120 {
121  /* Valeurs par défaut */
122  if(empty($frm)) {
123  $frm = array();
124  $frm["remise_percent"] = "";
125  $frm["remise_valeur"] = "";
126  $frm["montant_min"] = "";
127  $frm["etat"] = "";
128  $frm["on_type"] = vb($_GET['on_type']);
129  $frm["nom"] = "";
130  $frm["site_id"] = "";
131  $frm["cat_not_apply_code_promo"] = "";
132  }
133  $frm["nouveau_mode"] = "insere";
134  $frm["date_debut"] = get_formatted_date(time());
135  $frm["date_fin"] = get_formatted_date(time() + 7 * 24 * 3600);
136  $frm["titre_bouton"] = $GLOBALS['STR_ADMIN_CODES_PROMOS_CREATE'];
138 }
139 
148 {
149  if(empty($frm)){
150  // Pas de données venant de validation de formulaire, donc on charge le contenu de la base de données
151  // Charge les informations du code promo
152  $qid = query("SELECT *
153  FROM peel_codes_promos
154  WHERE id = '" . intval($id) . "' AND " . get_filter_site_cond('codes_promos', null, true) . "");
155  if ($frm = fetch_assoc($qid)) {
156  } else {
157  echo $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_ADMIN_CODES_PROMOS_ERR_NOT_FOUND']))->fetch();
158  return false;
159  }
160  }
161  $frm["nouveau_mode"] = "maj";
162  $frm["titre_bouton"] = $GLOBALS['STR_ADMIN_FORM_SAVE_CHANGES'];
163 
165 }
166 
174 {
175  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_formulaire_code_promo.tpl');
176  $tpl->assign('action', get_current_url(false) . '?start=0');
177  $tpl->assign('form_token', get_form_token_input($_SERVER['PHP_SELF'] . vb($frm['nouveau_mode']) . intval(vb($frm['id']))));
178  $tpl->assign('mode', $frm["nouveau_mode"]);
179  $tpl->assign('id', intval(vb($frm['id'])));
180  $tpl->assign('on_type', vn($frm['on_type']));
181  $tpl->assign('nom', vn($frm['nom']));
182  $tpl->assign('date_debut', get_formatted_date(vb($frm['date_debut'])));
183  $tpl->assign('date_fin', get_formatted_date(vb($frm['date_fin'])));
184  $tpl->assign('remise_percent', vn($frm['remise_percent']));
185  $tpl->assign('site_symbole', $GLOBALS['site_parameters']['symbole']);
186  $tpl->assign('remise_valeur', vn($frm['remise_valeur']));
187  $tpl->assign('montant_min', vn($frm['montant_min']));
188  $tpl->assign('categorie_options', get_categories_output(null, 'categories', vb($frm['id_categorie'])));
189  $tpl->assign('cat_not_apply_code_promo_options', get_categories_output(null, 'categories', get_array_from_string(vn($frm['cat_not_apply_code_promo']))));
190  $tpl->assign('nombre_prevue', vb($frm["nombre_prevue"]));
191  $tpl->assign('nb_used_per_client', vb($frm["nb_used_per_client"]));
192  $tpl->assign('product_filter', vb($frm['product_filter']));
193  $tpl->assign('etat', vn($frm['etat']));
194  $tpl->assign('site_id_select_options', get_site_id_select_options(vb($frm['site_id'])));
195  $tpl->assign('site_id_select_multiple', !empty($GLOBALS['site_parameters']['multisite_using_array_for_site_id']));
196  $tpl->assign('titre_bouton', vn($frm['titre_bouton']));
197  if($frm["nouveau_mode"] != "insere") {
198  $tpl->assign('STR_ADMIN_CODES_PROMOS_ALREADY_USED', sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_ALREADY_USED'], vn($frm['compteur_utilisation'])));
199  }
200  $tpl->assign('STR_ADMIN_WEBSITE', $GLOBALS['STR_ADMIN_WEBSITE']);
201  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
202  $tpl->assign('STR_ADMIN_ACTIVATED', $GLOBALS['STR_ADMIN_ACTIVATED']);
203  $tpl->assign('STR_ADMIN_DEACTIVATED', $GLOBALS['STR_ADMIN_DEACTIVATED']);
204  $tpl->assign('STR_ADMIN_CODES_PROMOS_NB_USED_PER_CLIENT', $GLOBALS['STR_ADMIN_CODES_PROMOS_NB_USED_PER_CLIENT']);
205  $tpl->assign('STR_ADMIN_CODES_PROMOS_NB_USED_PER_CLIENT_EXPLAIN', $GLOBALS['STR_ADMIN_CODES_PROMOS_NB_USED_PER_CLIENT_EXPLAIN']);
206  $tpl->assign('STR_ADMIN_CODES_PROMOS_NB_FORECASTED', $GLOBALS['STR_ADMIN_CODES_PROMOS_NB_FORECASTED']);
207  $tpl->assign('STR_ADMIN_CODES_PROMOS_NB_FORECASTED_EXPLAIN', $GLOBALS['STR_ADMIN_CODES_PROMOS_NB_FORECASTED_EXPLAIN']);
208  $tpl->assign('STR_ADMIN_ALL_CATEGORIES', $GLOBALS['STR_ADMIN_ALL_CATEGORIES']);
209  $tpl->assign('STR_CATEGORY', $GLOBALS['STR_CATEGORY']);
210  $tpl->assign('STR_ADMIN_CATEGORIES_TO_EXCLUDE', $GLOBALS['STR_ADMIN_CATEGORIES_TO_EXCLUDE']);
211  $tpl->assign('STR_ADMIN_CODES_PROMOS_MIN', sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_MIN'], $GLOBALS['site_parameters']['symbole']));
212  $tpl->assign('STR_ADMIN_CODES_PROMOS_MIN_EXPLAIN', $GLOBALS['STR_ADMIN_CODES_PROMOS_MIN_EXPLAIN']);
213  $tpl->assign('STR_ADMIN_CODES_PROMOS_PERCENT', $GLOBALS['STR_ADMIN_CODES_PROMOS_PERCENT']);
214  $tpl->assign('STR_ADMIN_CODES_PROMOS_VALUE', sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_VALUE'], $GLOBALS['site_parameters']['symbole']));
215  $tpl->assign('STR_ADMIN_BEGIN_DATE', $GLOBALS['STR_ADMIN_BEGIN_DATE']);
216  $tpl->assign('STR_ADMIN_END_DATE', $GLOBALS['STR_ADMIN_END_DATE']);
217  $tpl->assign('STR_CODE_PROMO', $GLOBALS['STR_CODE_PROMO']);
218  $tpl->assign('STR_ADMIN_CODES_PROMOS_ADD_CODE_PROMO_HEADER', $GLOBALS['STR_ADMIN_CODES_PROMOS_ADD_CODE_PROMO_HEADER']);
219  $tpl->assign('STR_ADMIN_CODES_PROMOS_STATUS', $GLOBALS['STR_ADMIN_CODES_PROMOS_STATUS']);
220  $tpl->assign('STR_ADMIN_PRODUCT_NAME', $GLOBALS['STR_ADMIN_PRODUCT_NAME']);
221  echo $tpl->fetch();
222 }
223 
231 {
232  $result = fetch_assoc(query("SELECT *
233  FROM peel_codes_promos
234  WHERE id=" . intval($id) . " AND " . get_filter_site_cond('codes_promos', null, true) . ""));
235  query("DELETE FROM peel_codes_promos
236  WHERE id=" . intval($id) . " AND " . get_filter_site_cond('codes_promos', null, true) . "");
237  echo $GLOBALS['tplEngine']->createTemplate('global_success.tpl', array('message' => sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_ERR_DELETED'], String::strtoupper($result['nom']))))->fetch();
238 }
239 
248 {
249  $sql = "UPDATE peel_codes_promos SET
250  nom = '" . nohtml_real_escape_string(String::strtoupper($frm['nom'])) . "'
251  , date_debut = '" . nohtml_real_escape_string(get_mysql_date_from_user_input($frm['date_debut'])) . "'
252  , date_fin = '" . nohtml_real_escape_string(get_mysql_date_from_user_input($frm['date_fin'])) . "'
253  , remise_percent = '" . floatval(get_float_from_user_input($frm['remise_percent'])) . "'
254  , remise_valeur = '" . floatval(get_float_from_user_input($frm['remise_valeur'])) . "'
255  , on_type = '" . intval($frm['on_type']) . "'
256  , montant_min = '" . floatval(get_float_from_user_input($frm['montant_min'])) . "'
257  , etat = '" . intval($frm['etat']) . "'
258  , site_id = '" . nohtml_real_escape_string(get_site_id_sql_set_value($frm['site_id'])) . "'
259  , id_site = '" . $GLOBALS['site_parameters']['id'] . "'
260  , id_categorie = '" . intval($frm['id_categorie']) . "'
261  , nombre_prevue = '" . intval($frm['nombre_prevue']) . "'
262  , nb_used_per_client = '" . intval($frm['nb_used_per_client']) . "'
263  , product_filter = '" . nohtml_real_escape_string($frm['product_filter']) . "'
264  , cat_not_apply_code_promo ='" . nohtml_real_escape_string(get_string_from_array(vn($frm['cat_not_apply_code_promo']), true), true) . "'
265  WHERE id='" . intval($id) . "'";
266  query($sql);
267 }
268 
275 {
276  $sql = "SELECT cp.*, nom_" . $_SESSION['session_langue'] . " AS category_name
277  FROM peel_codes_promos cp
278  LEFT JOIN peel_categories c ON c.id=cp.id_categorie AND " . get_filter_site_cond('categories', 'c') . "
279  WHERE " . get_filter_site_cond('codes_promos', 'cp', true) . "";
280  $Links = new Multipage($sql, 'codes_promos');
281  $HeaderTitlesArray = array($GLOBALS['STR_ADMIN_ACTION'], 'nom' => $GLOBALS['STR_ADMIN_CODE'], 'date_debut' => $GLOBALS['STR_ADMIN_BEGIN_DATE'], 'date_fin' => $GLOBALS['STR_ADMIN_END_DATE'], 'remise_percent,remise_valeur' => $GLOBALS['STR_ADMIN_DISCOUNT'], 'montant_min' => $GLOBALS['STR_ADMIN_DATE_STARTING'], 'category_name' => $GLOBALS['STR_CATEGORY'], 'etat' => $GLOBALS['STR_STATUS'], 'source' => $GLOBALS['STR_ADMIN_SOURCE'], 'site_id' => $GLOBALS['STR_ADMIN_WEBSITE']);
282  $Links->HeaderTitlesArray = $HeaderTitlesArray;
283  $Links->OrderDefault = "date_debut";
284  $Links->SortDefault = "ASC";
285  $results_array = $Links->Query();
286 
287  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_liste_code_promo.tpl');
288  $tpl->assign('add_src', $GLOBALS['administrer_url'] . '/images/add.png');
289  $tpl->assign('site_symbole', $GLOBALS['site_parameters']['symbole']);
290 
291  if (empty($results_array)) {
292  $tpl->assign('are_results', false);
293  } else {
294  $tpl->assign('are_results', true);
295  $tpl->assign('links_header_row', $Links->getHeaderRow());
296  $tpl->assign('drop_src', $GLOBALS['administrer_url'] . '/images/b_drop.png');
297  $tpl->assign('edit_src', $GLOBALS['administrer_url'] . '/images/b_edit.png');
298  $tpl_results = array();
299 
300  $i = 0;
301  foreach ($results_array as $ligne) {
302  $tpl_results[] = array('tr_rollover' => tr_rollover($i, true),
303  'nom' => $ligne['nom'],
304  'drop_href' => get_current_url(false) . '?mode=suppr&id=' . $ligne['id'],
305  'edit_href' => get_current_url(false) . '?mode=modif&id=' . $ligne['id'],
306  'date_debut' => get_formatted_date($ligne['date_debut']),
307  'date_fin' => get_formatted_date($ligne['date_fin']),
308  'on_type' => $ligne['on_type'],
309  'percent' => number_format($ligne['remise_percent'], 2, ',', ' '),
310  'valeur' => fprix($ligne['remise_valeur'], true, $GLOBALS['site_parameters']['code'], false),
311  'montant_min' => ($ligne['montant_min'] > 0 ? fprix($ligne['montant_min'], true, $GLOBALS['site_parameters']['code'], false) : "-"),
312  'category_name' => $ligne['category_name'],
313  'etat_onclick' => 'change_status("codes_promos", "' . $ligne['id'] . '", this, "'.$GLOBALS['administrer_url'] . '")',
314  'etat_src' => $GLOBALS['administrer_url'] . '/images/' . (empty($ligne['etat']) ? 'puce-blanche.gif' : 'puce-verte.gif'),
315  'source' => $ligne['source'],
316  'site_name' => get_site_name($ligne['site_id'])
317  );
318  $i++;
319  }
320  $tpl->assign('results', $tpl_results);
321  $tpl->assign('links_multipage', $Links->GetMultipage());
322  }
323  $tpl->assign('STR_ADMIN_CODES_PROMOS_LIST_TITLE', $GLOBALS['STR_ADMIN_CODES_PROMOS_LIST_TITLE']);
324  $tpl->assign('STR_ADMIN_CODES_PROMOS_CREATE_PERCENTAGE_REBATE', $GLOBALS['STR_ADMIN_CODES_PROMOS_CREATE_PERCENTAGE_REBATE']);
325  $tpl->assign('STR_ADMIN_CODES_PROMOS_CREATE_AMOUNT_REBATE', $GLOBALS['STR_ADMIN_CODES_PROMOS_CREATE_AMOUNT_REBATE']);
326  $tpl->assign('STR_ADMIN_DELETE_WARNING', $GLOBALS['STR_ADMIN_DELETE_WARNING']);
327  $tpl->assign('STR_DELETE', $GLOBALS['STR_DELETE']);
328  $tpl->assign('STR_MODIFY', $GLOBALS['STR_MODIFY']);
329  $tpl->assign('STR_ADMIN_ALL_CATEGORIES', $GLOBALS['STR_ADMIN_ALL_CATEGORIES']);
330  $tpl->assign('STR_ADMIN_CODES_PROMOS_NOT_FOUND', $GLOBALS['STR_ADMIN_CODES_PROMOS_NOT_FOUND']);
331  echo $tpl->fetch();
332 }
333 
341 {
342  $utilisateur = get_user_information($id_utilisateur);
343  $qcpromo = query("SELECT *
344  FROM peel_codes_promos
345  WHERE etat = '1' AND source != 'CHQ' AND " . get_filter_site_cond('codes_promos', null, true) . "");
346 
347  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_liste_code_pour_client.tpl');
348  $tpl_options = array();
349  while ($codespromos = fetch_assoc($qcpromo)) {
350  $tpl_options[] = array('value' => intval($codespromos['id']),
351  'nom' => $codespromos['nom'],
352  'on_type' => $codespromos['on_type'],
353  'percent' => number_format($codespromos['remise_percent'], 2, ',', ' '),
354  'valeur' => fprix($codespromos['remise_valeur'], true, $GLOBALS['site_parameters']['code'], false),
355  'montant_min' => fprix($codespromos['montant_min'], true, $GLOBALS['site_parameters']['code'], false)
356  );
357  }
358  $tpl->assign('options', $tpl_options);
359 
360  $tpl->assign('modif_util_href', $GLOBALS['administrer_url'] . '/utilisateurs.php?mode=modif&id_utilisateur=' . $id_utilisateur);
361  $tpl->assign('civilite', $utilisateur['civilite']);
362  $tpl->assign('prenom', $utilisateur['prenom']);
363  $tpl->assign('nom_famille', $utilisateur['nom_famille']);
364  $tpl->assign('email', $utilisateur['email']);
365  $tpl->assign('codes_promos_href', $GLOBALS['administrer_url'] . '/codes_promos.php');
366 
367  if (!empty($tpl_options)) {
368  $tpl->assign('action', get_current_url(false));
369  $tpl->assign('form_token', get_form_token_input($_SERVER['PHP_SELF'] . 'envoi_client' . $id_utilisateur));
370  $tpl->assign('id_utilisateur', intval($id_utilisateur));
371  $tpl->assign('cancel_href', $GLOBALS['administrer_url'] . '/utilisateurs.php');
372  }
373  $tpl->assign('STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL_TITLE', $GLOBALS['STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL_TITLE']);
374  $tpl->assign('STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL_SUBTITLE', $GLOBALS['STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL_SUBTITLE']);
375  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
376  $tpl->assign('STR_ADMIN_UTILISATEURS_UPDATE', $GLOBALS['STR_ADMIN_UTILISATEURS_UPDATE']);
377  $tpl->assign('STR_ADMIN_CODES_PROMOS_SELECT_TO_SEND', $GLOBALS['STR_ADMIN_CODES_PROMOS_SELECT_TO_SEND']);
378  $tpl->assign('STR_NAME', $GLOBALS['STR_NAME']);
379  $tpl->assign('STR_ADMIN_DISCOUNT', $GLOBALS['STR_ADMIN_DISCOUNT']);
380  $tpl->assign('STR_VALUE', $GLOBALS['STR_VALUE']);
381  $tpl->assign('STR_ADMIN_DATE_STARTING', $GLOBALS['STR_ADMIN_DATE_STARTING']);
382  $tpl->assign('STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL', $GLOBALS['STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL']);
383  $tpl->assign('STR_CANCEL', $GLOBALS['STR_CANCEL']);
384  $tpl->assign('STR_ADMIN_CODES_PROMOS_ERR_FIRST_CREATE_CODE_PROMO', $GLOBALS['STR_ADMIN_CODES_PROMOS_ERR_FIRST_CREATE_CODE_PROMO']);
385  $tpl->assign('STR_ADMIN_CODES_PROMOS_MIN', sprintf($GLOBALS['STR_ADMIN_CODES_PROMOS_MIN'], $GLOBALS['site_parameters']['code']));
386  echo $tpl->fetch();
387 }
388 
affiche_formulaire_code_promo(&$frm)
affiche_formulaire_code_promo()
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
Definition: String.php:154
get_site_name($site_ids, $skip_rights_check=false)
Retourne le nom d'un ou de plusieurs sites à partir de l'id.
Definition: fonctions.php:4763
supprime_code_promo($id)
Supprime le code promo spécifié par $id.
$result
get_user_information($user_id=null, $get_full_infos=false)
Chargement des détails de l'utilisateur.
Definition: user.php:906
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
Definition: fonctions.php:1743
get_string_from_array($array, $disable_ad_quote=false)
Convertit un tableau en chaine de caractère simple à gérer par un utilisateur.
Definition: format.php:973
get_site_id_select_options($selected_site_id=null, $selected_site_name=null, $display_first_option=null, $select_current_site_id_by_default=false)
Créer les options pour le select qui liste les noms de sites configurés en back office.
$frm
$mode
$GLOBALS['DOC_TITLE']
maj_code_promo($id, $frm)
maj_code_promo()
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
Definition: database.php:400
$results_array
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
affiche_formulaire_modif_code_promo($id, &$frm)
affiche_formulaire_modif_code_promo()
affiche_liste_code_pour_client($id_utilisateur)
affiche_liste_code_pour_client()
get_float_from_user_input($string, $from_currency_rate=1)
Transforme tout nombre formaté en un float au format PHP Exemples : 12 004,34 ou 12,324.50.
Definition: format.php:196
$tpl_options
necessite_priv($priv, $demo_allowed=true, $configuration_modification=false)
Cette fonction vérifie si l'utilisateur a les privilèges de $priv.
Definition: fonctions.php:1575
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.
Definition: fonctions.php:4643
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.
Definition: database.php:158
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
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))
Definition: chart-data.php:160
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
Definition: fonctions.php:1596
fetch_assoc($query_result)
fetch_assoc()
Definition: database.php:283
get_array_from_string($string)
Convertit une chaine de caractère simple à gérer par un utilisateur en un tableau PHP...
Definition: format.php:1011
get_formatted_date($datetime_or_timestamp=null, $mode= 'short', $hour_minute=false)
Afficher une date formatée, en évitant les problèmes liés aux noms de mois sur les serveurs qui ne so...
Definition: format.php:440
$id_utilisateur
Definition: rpc.php:32
insere_code_promo($frm)
Créer un code promo pour l'administration et la création de chèque cadeaux lors du paiement d'une com...
Definition: fonctions.php:5049
get_mysql_date_from_user_input($string, $use_current_hour_min_sec_if_missing=false)
Transforme une date formattée par get_formatted_date() en date MySQL Si la date est vide...
Definition: format.php:496
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
Definition: fonctions.php:94
affiche_liste_code_promo()
affiche_liste_code_promo()
$form_error_object
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
get_site_id_sql_set_value($site_ids)
Retourne la valeur SQL d'un champ INT ou SET suivant que ce soit un entier ou un tableau.
Definition: fonctions.php:4747
verify_token($name= 'general', $delay_in_minutes=60, $check_referer_if_set_by_server=true, $cancel_token=true, $minimum_wait_in_seconds_before_use=0)
Vérification de la validité d'un token Par défaut, un token est valide 1h, et utilisable 1 seule fois...
Definition: fonctions.php:118
$id
Definition: articles.php:22
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
Definition: fonctions.php:242
envoie_client_code_promo($id_utilisateur, $id_codepromo)
Envoi d'un code promo déjà existant à un utilisateur.
affiche_formulaire_ajout_code_promo(&$frm)
FONCTIONS.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:29:02 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.