14 define(
'IN_PEEL_ADMIN',
true);
15 include(
"../configuration.inc.php");
20 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_haut.php");
22 if (!empty($_POST[
'submit']) && !empty($_POST[
'operation']) && !empty($_POST[
'percent_prod']) && is_numeric($_POST[
'percent_prod']) && !empty($_POST[
'for_price'])) {
24 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_INVALID_TOKEN']))->fetch();
26 if ($_POST[
'operation'] ==
'minus') {
27 $operation_symbol =
'-';
29 $operation_symbol =
'+';
33 switch ($_POST[
'for_price']) {
35 $sql_set =
"prix = prix * (1 " . $operation_symbol .
" " . floatval($percent_prod_to_apply) .
"), prix_revendeur = prix_revendeur * (1 " . $operation_symbol .
" " . floatval($percent_prod_to_apply) .
")";
39 $sql_set =
"prix = prix * (1 " . $operation_symbol .
" " . floatval($percent_prod_to_apply) .
")";
43 $sql_set =
"prix_revendeur = prix_revendeur * (1 " . $operation_symbol .
" " . floatval($percent_prod_to_apply) .
")";
47 $sql_set =
"prix = prix * (1 " . $operation_symbol .
" " . floatval($percent_prod_to_apply) .
"), prix_revendeur = prix_revendeur * (1 " . $operation_symbol .
" " . floatval($percent_prod_to_apply) .
")";
50 if (!empty($_POST[
'categories'])) {
51 if (!in_array(
'all', $_POST[
'categories'])) {
56 query (
'UPDATE peel_produits
59 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_MSG_UPDATE_OK']))->fetch();
60 }
elseif (!empty($_POST[
'produits'])) {
61 if (!in_array(
'all', $_POST[
'produits'])) {
66 query(
'UPDATE peel_produits
69 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_MSG_UPDATE_OK']))->fetch();
71 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_CHOOSE_ITEM']))->fetch();
75 if (isset($_POST[
'submit'])) {
76 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ERR_FORM']))->fetch();
79 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_prix_pourcentage.tpl');
84 'issel' => !empty($_POST[
'categories']) && in_array(
'all',
vb($_POST[
'categories'])),
90 ORDER BY nom_' .
$_SESSION[
'session_langue'] .
'');
93 'issel' => !empty($_POST[
'categories']) && in_array($r_select_cats[
'id'],
vb($_POST[
'categories'])),
94 'name' => (!empty($r_select_cats[
'nom_' .
$_SESSION[
'session_langue']])?$r_select_cats[
'nom_' . $_SESSION[
'session_langue']]:
'['.$r_select_cats[
'id'].
']')
99 $tpl->assign(
'nb_produits', 0);
100 $tpl->assign(
'for_price',
vb($_POST[
'for_price']));
101 $tpl->assign(
'percent_prod',
vb($_POST[
'percent_prod']));
102 $tpl->assign(
'operation',
vb($_POST[
'operation']));
103 $tpl->assign(
'administrer_url',
$GLOBALS[
'administrer_url']);
108 $tpl->assign(
'STR_ADMIN_NAME',
$GLOBALS[
'STR_ADMIN_NAME']);
109 $tpl->assign(
'STR_REFERENCE',
$GLOBALS[
'STR_REFERENCE']);
110 $tpl->assign(
'STR_ADMIN_COMMANDER_OR_ADD_PRODUCT_WITH_FAST_SEARCH',
$GLOBALS[
'STR_ADMIN_COMMANDER_OR_ADD_PRODUCT_WITH_FAST_SEARCH']);
111 $tpl->assign(
'STR_ADMIN_PRODUCT_ORDERED_DELETE_CONFIRM',
$GLOBALS[
'STR_ADMIN_PRODUCT_ORDERED_DELETE_CONFIRM']);
112 $tpl->assign(
'STR_ADMIN_PRODUCT_ORDERED_DELETE',
$GLOBALS[
'STR_ADMIN_PRODUCT_ORDERED_DELETE']);
113 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_TITLE',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_TITLE']);
114 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_EXPLAIN',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_EXPLAIN']);
115 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_CHOOSE_CATEGORY',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_CHOOSE_CATEGORY']);
116 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_CHOOSE_PRODUCT',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_CHOOSE_PRODUCT']);
117 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_USERS_RELATED',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_USERS_RELATED']);
118 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_ENTER_PERCENTAGE',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_ENTER_PERCENTAGE']);
119 $tpl->assign(
'STR_ADMIN_ALL',
$GLOBALS[
'STR_ADMIN_ALL']);
120 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_CLIENTS_ONLY',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_CLIENTS_ONLY']);
121 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_RESELLERS_ONLY',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_RESELLERS_ONLY']);
122 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_LOWER',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_LOWER']);
123 $tpl->assign(
'STR_ADMIN_PRIX_POURCENTAGE_RAISE',
$GLOBALS[
'STR_ADMIN_PRIX_POURCENTAGE_RAISE']);
124 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
127 include(
$GLOBALS[
'repertoire_modele'] .
"/admin_bas.php");
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
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 ...
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
necessite_priv($priv, $demo_allowed=true, $configuration_modification=false)
Cette fonction vérifie si l'utilisateur a les privilèges de $priv.
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.
get_category_tree_and_itself($id_or_ids_array, $mode= 'sons', $table_to_use= 'categories')
get_category_tree_and_itself()
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))
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
fetch_assoc($query_result)
fetch_assoc()
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
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...
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']