14 if (!defined(
'IN_PEEL')) {
24 if (
vn(
$GLOBALS[
'site_parameters'][
'display_prices_with_taxes_in_admin']) ==
'0') {
39 $GLOBALS[
'main_menu_items'][
'install'] = array(
$GLOBALS[
'wwwroot'] .
'/installation/' =>
$GLOBALS[
'STR_INSTALLATION']);
40 $GLOBALS[
'menu_items'][
'install'][get_url(
'/installation/index.php')] =
$GLOBALS[
'STR_ADMIN_INSTALL_STEP1_TITLE'];
41 $GLOBALS[
'menu_items'][
'install'][get_url(
'/installation/bdd.php')] =
$GLOBALS[
'STR_ADMIN_INSTALL_STEP2_TITLE'];
42 $GLOBALS[
'menu_items'][
'install'][get_url(
'/installation/choixbase.php')] =
$GLOBALS[
'STR_ADMIN_INSTALL_STEP3_TITLE'];
43 $GLOBALS[
'menu_items'][
'install'][get_url(
'/installation/verifdroits.php')] =
$GLOBALS[
'STR_ADMIN_INSTALL_STEP4_TITLE'];
44 $GLOBALS[
'menu_items'][
'install'][get_url(
'/installation/configuration.php')] =
$GLOBALS[
'STR_ADMIN_INSTALL_STEP5_TITLE'];
45 $GLOBALS[
'menu_items'][
'install'][get_url(
'/installation/fin.php')] =
$GLOBALS[
'STR_ADMIN_INSTALL_STEP6_TITLE'];
47 $GLOBALS[
'main_menu_items'][
'home'] = array(
$GLOBALS[
'administrer_url'] .
'/' =>
$GLOBALS[
"STR_ADMIN_MENU_HOME_TITLE"]);
48 $GLOBALS[
'menu_items'][
'home'][
$GLOBALS[
'administrer_url'] .
'/'] = $GLOBALS[
"STR_ADMIN_MENU_HOME_BACK"];
49 $GLOBALS[
'menu_items'][
'home'][$GLOBALS[
'wwwroot'] .
'/'] = $GLOBALS[
"STR_ADMIN_MENU_HOME_FRONT"];
50 if (
a_priv(
'admin_manage',
true)) {
51 $GLOBALS[
'main_menu_items'][
'manage'] = array($GLOBALS[
'administrer_url'] .
'/sites.php' => $GLOBALS[
"STR_ADMIN_MENU_MANAGE_TITLE"]);
52 $GLOBALS[
'menu_items'][
'manage'][
'manage_general'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_TITLE"];
53 $GLOBALS[
'menu_items'][
'manage_general'][$GLOBALS[
'administrer_url'] .
'/sites.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_SITES"];
54 $GLOBALS[
'menu_items'][
'manage_general'][$GLOBALS[
'administrer_url'] .
'/configuration.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_CONFIGURATION"];
55 $GLOBALS[
'menu_items'][
'manage_general'][$GLOBALS[
'administrer_url'] .
'/societe.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_SOCIETE"];
56 $GLOBALS[
'menu_items'][
'manage_general'][$GLOBALS[
'administrer_url'] .
'/langues.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_LANGUES"];
57 $GLOBALS[
'menu_items'][
'manage_general'][$GLOBALS[
'administrer_url'] .
'/clean_folders.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_CLEAN_FOLDERS"];
58 $GLOBALS[
'menu_items'][
'manage'][
'manage_payments'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_PAYMENT_AND_TAXES"];
59 $GLOBALS[
'menu_items'][
'manage_payments'][$GLOBALS[
'administrer_url'] .
'/paiement.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_PAYMENT"];
60 $GLOBALS[
'menu_items'][
'manage_payments'][$GLOBALS[
'administrer_url'] .
'/tva.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_TVA"];
61 $GLOBALS[
'menu_items'][
'manage_payments'][$GLOBALS[
'administrer_url'] .
'/statut_paiement.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_PAYMENT_STATUS"];
62 $GLOBALS[
'menu_items'][
'manage'][
'manage_delivery'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_DELIVERY_HEADER"];
63 $GLOBALS[
'menu_items'][
'manage_delivery'][$GLOBALS[
'administrer_url'] .
'/pays.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_COUNTRIES"];
64 $GLOBALS[
'menu_items'][
'manage_delivery'][$GLOBALS[
'administrer_url'] .
'/zones.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_ZONES"];
65 $GLOBALS[
'menu_items'][
'manage_delivery'][$GLOBALS[
'administrer_url'] .
'/types.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_DELIVERY"];
66 $GLOBALS[
'menu_items'][
'manage_delivery'][$GLOBALS[
'administrer_url'] .
'/tarifs.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_DELIVERY_COST"];
67 $GLOBALS[
'menu_items'][
'manage_delivery'][$GLOBALS[
'administrer_url'] .
'/statut_livraison.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_DELIVERY_STATUS"];
68 $GLOBALS[
'menu_items'][
'manage'][
'manage_emails'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_EMAILS_HEADER"];
69 $GLOBALS[
'menu_items'][
'manage_emails'][$GLOBALS[
'administrer_url'] .
'/email-templates.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_EMAIL"];
71 $GLOBALS[
'menu_items'][
'manage_emails'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/bounces/administrer/bad_mails.php'] = $GLOBALS[
"STR_ADMIN_MENU_MANAGE_BOUNCE"];
74 if (
a_priv(
'admin_users',
true)) {
76 $GLOBALS[
'main_menu_items'][
'users'] = array($GLOBALS[
'administrer_url'] .
'/utilisateurs.php' => $GLOBALS[
"STR_ADMIN_MENU_USERS_USERS"]);
77 $GLOBALS[
'menu_items'][
'users'][
'users_general'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_USERS"];
78 $GLOBALS[
'menu_items'][
'users_general'][$GLOBALS[
'administrer_url'] .
'/utilisateurs.php'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_USERS_LIST"];
79 $GLOBALS[
'menu_items'][
'users_general'][$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=ajout'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_USER_CREATE"];
80 $GLOBALS[
'menu_items'][
'users_general'][$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=liste&priv=supplier'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_SUPPLIERS_LIST"];
81 $GLOBALS[
'menu_items'][
'users'][
'users_retaining'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_RETAINING"];
82 $GLOBALS[
'menu_items'][
'users_retaining'][$GLOBALS[
'administrer_url'] .
'/newsletter.php'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_NEWSLETTER"];
83 $GLOBALS[
'menu_items'][
'users_retaining'][$GLOBALS[
'administrer_url'] .
'/codes_promos.php'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_CODE_PROMO"];
85 $GLOBALS[
'menu_items'][
'users_retaining'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/good_clients/administrer/bons_clients.php'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_BEST_CLIENTS"];
88 $GLOBALS[
'menu_items'][
'users_retaining'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/birthday/administrer/bons_anniversaires.php'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_BIRTHDAY"];
91 $GLOBALS[
'menu_items'][
'users'][
'users_sales'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_SALES_MANAGEMENT"];
92 if (file_exists($GLOBALS[
'dirroot'] .
'/modules/maps_users/administrer/map_google_search.php')) {
93 $GLOBALS[
'menu_items'][
'users_sales'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/maps_users/administrer/map_google_search.php'] = $GLOBALS[
"STR_ADMIN_MENU_USERS_USERS_MAP"];
96 $GLOBALS[
'menu_items'][
'users'][
'users_offre'] = $GLOBALS[
"STR_ADMIN_OFFRES"];
97 $GLOBALS[
'menu_items'][
'users_offre'][get_url(
'/modules/offres/administrer/offres.php')] = $GLOBALS[
"STR_ADMIN_ADMIN_OFFRES_ALL_LIST"];
98 $GLOBALS[
'menu_items'][
'users_offre'][get_url(
'/modules/offres/administrer/list_utilisateurs_offres.php')] = $GLOBALS[
"STR_ADMIN_LIST_UTILISATEURS_TITLE"];
101 if (
a_priv(
'admin_products',
true)) {
102 $GLOBALS[
'main_menu_items'][
'products'] = array($GLOBALS[
'administrer_url'] .
'/produits.php' => $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRODUCTS"]);
103 $GLOBALS[
'menu_items'][
'products'][
'products_general'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRODUCTS"];
104 $GLOBALS[
'menu_items'][
'products_general'][$GLOBALS[
'administrer_url'] .
'/produits.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRODUCTS_LIST"];
105 $GLOBALS[
'menu_items'][
'products_general'][$GLOBALS[
'administrer_url'] .
'/produits.php?mode=ajout'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRODUCT_ADD"];
106 $GLOBALS[
'menu_items'][
'products_general'][$GLOBALS[
'administrer_url'] .
'/positions.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRODUCTS_ORDER"];
107 $GLOBALS[
'menu_items'][
'products_general'][$GLOBALS[
'administrer_url'] .
'/prix.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRICE_UPDATE"];
108 $GLOBALS[
'menu_items'][
'products_general'][$GLOBALS[
'administrer_url'] .
'/prix_pourcentage.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_PRICE_UPDATE_BY_PERCENTAGES"];
109 $GLOBALS[
'menu_items'][
'products'][
'products_categories'] = $GLOBALS[
"STR_ADMIN_CATEGORIES"];
110 $GLOBALS[
'menu_items'][
'products_categories'][$GLOBALS[
'administrer_url'] .
'/categories.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_CATEGORIES_LIST"];
111 $GLOBALS[
'menu_items'][
'products_categories'][$GLOBALS[
'administrer_url'] .
'/categories.php?mode=ajout'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_CATEGORY_ADD"];
112 $GLOBALS[
'menu_items'][
'products_categories'][$GLOBALS[
'administrer_url'] .
'/marques.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_BRAND_LIST"];
113 $GLOBALS[
'menu_items'][
'products'][
'products_attributes'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_ATTRIBUTES_HEADER"];
114 $GLOBALS[
'menu_items'][
'products_attributes'][$GLOBALS[
'administrer_url'] .
'/couleurs.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_COLORS"];
115 $GLOBALS[
'menu_items'][
'products_attributes'][$GLOBALS[
'administrer_url'] .
'/tailles.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_SIZES"];
117 if (
a_priv(
'admin_sales',
true)) {
119 $GLOBALS[
'main_menu_items'][
'sales'] = array($GLOBALS[
'administrer_url'] .
'/commander.php' => $GLOBALS[
"STR_ADMIN_MENU_SALES_SALES_TITLE"]);
120 $GLOBALS[
'menu_items'][
'sales'][
'sales_general'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_SALES_HEADER"];
121 $GLOBALS[
'menu_items'][
'sales_general'][$GLOBALS[
'administrer_url'] .
'/commander.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_ORDERS"];
122 $GLOBALS[
'menu_items'][
'sales_general'][$GLOBALS[
'administrer_url'] .
'/commander.php?mode=ajout'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_ORDER_CREATION"];
124 $GLOBALS[
'menu_items'][
'sales_general'][$GLOBALS[
'administrer_url'] .
'/ventes.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_SALES_REPORT_HEADER"];
126 $GLOBALS[
'menu_items'][
'sales_general'][$GLOBALS[
'administrer_url'] .
'/ventes.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_SALES_REPORT"];
128 if (file_exists($GLOBALS[
'dirroot'] .
'/modules/hosting/administrer/hosting.php')) {
129 $GLOBALS[
'menu_items'][
'sales'][
'sales_hosting'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_HOSTING_HEADER"];
130 $GLOBALS[
'menu_items'][
'sales_hosting'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/hosting/administrer/hosting.php'] = $GLOBALS[
"STR_ADMIN_MENU_PRODUCTS_HOSTING"];
133 $GLOBALS[
'menu_items'][
'sales'][
'sales_accounting'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_ACCOUNTING_HEADER"];
135 $GLOBALS[
'menu_items'][
'sales_accounting'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/statistiques/administrer/statcommande.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_SALES_STAT"];
138 $GLOBALS[
'menu_items'][
'sales_accounting'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/marges/administrer/marges.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_MARGINS"];
141 $GLOBALS[
'menu_items'][
'sales_accounting'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/facture_advanced/administrer/genere_pdf.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_PDF_BILLS"];
143 $GLOBALS[
'menu_items'][
'sales'][
'sales_delivery'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_DELIVERY_HEADER"];
145 $GLOBALS[
'menu_items'][
'sales_delivery'][$GLOBALS[
'administrer_url'] .
'/livraisons.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_DELIVERY_EXPORT"];
147 $GLOBALS[
'menu_items'][
'sales_delivery'][$GLOBALS[
'administrer_url'] .
'/livraisons.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_DELIVERY_REPORT"];
150 $GLOBALS[
'menu_items'][
'sales_delivery'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/picking/administrer/picking.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_PICKING_LIST"];
153 $GLOBALS[
'menu_items'][
'sales_delivery'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/exaprint/administrer/exaprint.php'] = $GLOBALS[
"STR_ADMIN_MENU_SALES_EXAPRINT"];
156 if (
a_priv(
'admin_content',
true)) {
157 $GLOBALS[
'main_menu_items'][
'content'] = array($GLOBALS[
'administrer_url'] .
'/articles.php' => $GLOBALS[
"STR_ADMIN_MENU_CONTENT_TITLE"]);
158 $GLOBALS[
'menu_items'][
'content'][
'content_articles'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_ARTICLES_HEADER"];
159 $GLOBALS[
'menu_items'][
'content_articles'][$GLOBALS[
'administrer_url'] .
'/articles.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_ARTICLES_LIST"];
160 $GLOBALS[
'menu_items'][
'content_articles'][$GLOBALS[
'administrer_url'] .
'/articles.php?mode=ajout'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_ARTICLE_ADD"];
161 $GLOBALS[
'menu_items'][
'content_articles'][$GLOBALS[
'administrer_url'] .
'/rubriques.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_CATEGORIES_LIST"];
162 $GLOBALS[
'menu_items'][
'content_articles'][$GLOBALS[
'administrer_url'] .
'/rubriques.php?mode=ajout'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_CATEGORY_ADD"];
164 $GLOBALS[
'menu_items'][
'content'][
'content_general'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_HTML_HEADER"];
165 $url_cgv = get_cgv_url(
false);
166 $GLOBALS[
'menu_items'][
'content_general'][$GLOBALS[
'administrer_url'] .
'/cgv.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_TERMS"];
167 if (file_exists($GLOBALS[
'dirroot'] .
'/modules/cgu-template/administrer/cgu-update.php')) {
168 $GLOBALS[
'menu_items'][
'content_general'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/cgu-template/administrer/cgu-update.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_TERMS_TEMPLATES"];
170 if (file_exists($GLOBALS[
'dirroot'] .
'/modules/cgu-template/administrer/cgu.php')) {
171 $GLOBALS[
'menu_items'][
'content_general'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/cgu-template/administrer/cgu.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_TERMS_GENERATE"];
173 $GLOBALS[
'menu_items'][
'content_general'][$GLOBALS[
'administrer_url'] .
'/legal.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_LEGAL"];
174 $GLOBALS[
'menu_items'][
'content_general'][$GLOBALS[
'administrer_url'] .
'/plan.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_GOOGLEMAP"];
175 $GLOBALS[
'menu_items'][
'content_general'][$GLOBALS[
'administrer_url'] .
'/contacts.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_CONTACTS"];
176 $GLOBALS[
'menu_items'][
'content'][
'content_various'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_VARIOUS_HEADER"];
177 $GLOBALS[
'menu_items'][
'content_various'][$GLOBALS[
'administrer_url'] .
'/html.php'] = $GLOBALS[
"STR_ADMIN_MENU_CONTENT_HTML"];
179 if (
a_priv(
'admin_moderation',
true) ||
a_priv(
'admin_webmastering',
true)) {
180 $GLOBALS[
'main_menu_items'][
'webmastering'] = array($GLOBALS[
'administrer_url'] .
'/produits_achetes.php' => $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_TITLE"]);
182 if (
a_priv(
'admin_moderation',
true)) {
183 $GLOBALS[
'menu_items'][
'webmastering'][
'moderation_various'] = $GLOBALS[
"STR_ADMIN_MENU_MODERATION_TITLE"];
184 $GLOBALS[
'menu_items'][
'moderation_various'][$GLOBALS[
'administrer_url'] .
'/list_admin_actions.php?action_cat=PHONE'] = $GLOBALS[
"STR_ADMIN_MENU_MODERATION_PHONE_CALLS"];
185 $GLOBALS[
'menu_items'][
'moderation_various'][$GLOBALS[
'administrer_url'] .
'/list_admin_actions.php'] = $GLOBALS[
"STR_ADMIN_MENU_MODERATION_ADMIN_ACTIONS"];
186 $GLOBALS[
'menu_items'][
'moderation_various'][$GLOBALS[
'administrer_url'] .
'/connexion_user.php'] = $GLOBALS[
"STR_ADMIN_MENU_MODERATION_USER_CONNEXIONS"];
188 if (
a_priv(
'admin_webmastering',
true)) {
190 $GLOBALS[
'menu_items'][
'webmastering'][
'webmastering_marketing'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_MARKETING"];
191 $GLOBALS[
'menu_items'][
'webmastering_marketing'][$GLOBALS[
'administrer_url'] .
'/produits_achetes.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_BEST_PRODUCTS"];
192 $GLOBALS[
'menu_items'][
'webmastering_marketing'][$GLOBALS[
'administrer_url'] .
'/import_produits.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_IMPORT_PRODUCTS"];
193 $GLOBALS[
'menu_items'][
'webmastering_marketing'][$GLOBALS[
'administrer_url'] .
'/export_produits.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_EXPORT_PRODUCTS"];
194 if (file_exists($GLOBALS[
'dirroot'] .
'/modules/import/administrer/import_clients.php')) {
195 $GLOBALS[
'menu_items'][
'webmastering_marketing'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/import/administrer/import_clients.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_CLIENTS_IMPORT"];
198 $GLOBALS[
'menu_items'][
'webmastering_marketing'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/export/administrer/export_clients.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_CLIENTS_EXPORT"];
201 $GLOBALS[
'menu_items'][
'webmastering_marketing'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/expeditor/administrer/expeditor.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_EXPEDITOR"];
203 $GLOBALS[
'menu_items'][
'webmastering'][
'webmastering_seo'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_SEO_HEADER"];
205 $GLOBALS[
'menu_items'][
'webmastering_seo'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/comparateur/administrer/mysql2comparateur.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_COMPARATORS"];
207 if (empty(
$_SESSION[
'session_admin_multisite']) ||
$_SESSION[
'session_admin_multisite']==$GLOBALS[
'site_id']) {
209 $GLOBALS[
'menu_items'][
'webmastering_seo'][$GLOBALS[
'administrer_url'] .
'/sitemap.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_SITEMAP"];
210 $GLOBALS[
'menu_items'][
'webmastering_seo'][$GLOBALS[
'administrer_url'] .
'/urllist.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_SITEMAP_URLLIST"];
212 $GLOBALS[
'menu_items'][
'webmastering_seo'][$GLOBALS[
'administrer_url'] .
'/meta.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_META"];
213 if (file_exists($GLOBALS[
'dirroot'] .
'/modules/projects_management/administrer/projects.php')) {
214 $GLOBALS[
'menu_items'][
'webmastering'][
'webmastering_projects'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_PROJECT_MANAGEMENT"];
215 $GLOBALS[
'menu_items'][
'webmastering_projects'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/projects_management/administrer/projects.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_PROJECT_TASKS"];
216 $GLOBALS[
'menu_items'][
'webmastering_projects'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/projects_management/administrer/project-custom-orders.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_PROJECT_SOLD"];
217 $GLOBALS[
'menu_items'][
'webmastering_projects'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/projects_management/administrer/project-events.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_PROJECT_CONTENT"];
220 $GLOBALS[
'menu_items'][
'webmastering'][
'webmastering_various'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_VARIOUS_HEADER"];
221 $GLOBALS[
'menu_items'][
'webmastering_various'][$GLOBALS[
'wwwroot_in_admin'] .
'/modules/calc/calc.php'] = $GLOBALS[
"STR_ADMIN_MENU_WEBMASTERING_CALC"];
224 if(!empty($GLOBALS[
'site_parameters'][
'admin_menu_items_additional_menus_array']) && !empty($GLOBALS[
'site_parameters'][
'admin_menu_items_additional_titles_array'])) {
225 foreach($GLOBALS[
'site_parameters'][
'admin_menu_items_additional_menus_array'] as $this_type => $this_url_list) {
226 foreach(explode(
',', str_replace(
' ',
'', $this_url_list)) as $this_url) {
227 if(!empty($GLOBALS[
'site_parameters'][
'admin_menu_items_additional_titles_array'][$this_url])) {
228 if(!empty($GLOBALS[
'menu_items'][$this_type])) {
229 $this_title = $GLOBALS[
'site_parameters'][
'admin_menu_items_additional_titles_array'][$this_url];
231 $this_url = $GLOBALS[
'wwwroot_in_admin'] . $this_url;
234 $GLOBALS[
'menu_items'][$this_type][$this_url] = $this_title;
241 $GLOBALS[
'main_menu_items'] = array_merge_recursive($GLOBALS[
'main_menu_items'],
vb(
$hook_result[
'main_menu_items'], array()));
242 $GLOBALS[
'menu_items'] = array_merge_recursive($GLOBALS[
'menu_items'],
vb(
$hook_result[
'menu_items'], array()));
243 if (empty($GLOBALS[
'menu_items'][
'users_sales'])) {
245 unset($GLOBALS[
'menu_items'][
'users'][
'users_sales']);
247 if (empty($GLOBALS[
'menu_items'][
'sales_accounting'])) {
249 unset($GLOBALS[
'menu_items'][
'sales'][
'sales_accounting']);
258 foreach (
$GLOBALS[
'main_menu_items'] as $this_main_item => $this_main_array) {
259 if (!empty(
$GLOBALS[
'menu_items'][$this_main_item]) && is_array(
$GLOBALS[
'menu_items'][$this_main_item])) {
260 foreach(array_keys(
$GLOBALS[
'menu_items'][$this_main_item]) as $this_key) {
261 $current_menu = (!empty(
$GLOBALS[
'menu_items'][$this_key][$current_url_full]));
263 if ($current_menu ===
false && !empty(
$GLOBALS[
'menu_items'][$this_key])) {
264 $current_menu = (!empty(
$GLOBALS[
'menu_items'][$this_key][$current_url]));
267 if(!empty($current_menu)) {
272 $current_menu = (!empty(
$GLOBALS[
'menu_items'][$this_main_item][$current_url_full]));
274 if ($current_menu ===
false && !empty(
$GLOBALS[
'menu_items'][$this_main_item])) {
275 $current_menu = (!empty(
$GLOBALS[
'menu_items'][$this_main_item][$current_url]));
279 foreach ($this_main_array as $this_main_url => $this_main_title) {
280 $main_class = array();
281 $main_attributes = array();
282 if ($current_menu !==
false || !empty($this_main_array[$current_url]) || !empty($this_main_array[$current_url_full])) {
283 $main_class[] =
'active';
285 if (!empty(
$GLOBALS[
'menu_items'][$this_main_item])) {
286 $main_class[] =
'dropdown-toggle';
287 $main_attributes[] =
'role="button" data-toggle="dropdown"';
288 $this_main_url =
'#';
290 if ($this_main_item ==
'home') {
291 $this_main_text =
'<a id="menu_label_'.$this_main_item.
'" title="' .
$GLOBALS[
'STR_HOME'] .
'" href="' . htmlspecialchars($this_main_url) .
'" class="' . implode(
' ', $main_class) .
'" ' . implode(
' ', $main_attributes) .
'><span class="glyphicon glyphicon-home"></span></a>';
293 if (!empty($this_main_url) && !is_numeric($this_main_url)) {
294 $this_main_text =
'<a id="menu_label_'.$this_main_item.
'" href="' . htmlspecialchars($this_main_url) .
'" class="' . implode(
' ', $main_class) .
'" ' . implode(
' ', $main_attributes) .
'>' . $this_main_title . (!empty(
$GLOBALS[
'menu_items'][$this_main_item])?
'<b class="caret"></b>':
'') .
'</a>';
296 $this_main_text =
'<a id="menu_label_'.$this_main_item.
'" href="#">' . $this_main_title .
'</a>';
299 if (!empty(
$GLOBALS[
'menu_items'][$this_main_item])) {
300 $this_main_text .=
'<ul class="sousMenu dropdown-menu" role="menu" aria-labelledby="menu_label_'.$this_main_item.
'">
302 foreach (
$GLOBALS[
'menu_items'][$this_main_item] as $this_url => $this_submenu) {
303 if (!empty(
$GLOBALS[
'menu_items'][$this_url]) && is_array(
$GLOBALS[
'menu_items'][$this_url])) {
304 $this_main_text .=
'<li class="dropdown-submenu">
305 <a id="menu_'.substr(md5($this_url . $this_submenu),0,8).
'" href="#" class="dropdown-toggle">' .
String::strtoupper($this_submenu) .
'</a>
306 <ul class="sousMenu dropdown-menu" role="menu" aria-labelledby="menu_'.substr(md5($this_url . $this_submenu),0,8).
'">
308 foreach (
$GLOBALS[
'menu_items'][$this_url] as $this_url => $this_title) {
309 if (($current_url == $this_url && !$full_match) || $current_url_full == $this_url) {
310 $class =
' class="active"';
311 }
elseif ($this_url ==
$GLOBALS[
'wwwroot_in_admin'] .
'/modules/calc/calc.php') {
312 $class =
' onclick="return(window.open(this.href)?false:true);"';
316 if (!empty($this_url) && !is_numeric($this_url)) {
318 $this_text =
'<a title="' .
String::str_form_value($this_title) .
'" href="' . htmlspecialchars($this_url) .
'"' .
$class .
'>' . $this_title .
'</a>';
320 $this_text =
'<a href="#"' . $main_class .
'>' . $this_title .
'</a>';
322 $this_main_text .=
'<li>' . $this_text .
'</li>';
328 $this_title = $this_submenu;
329 if (($current_url == $this_url && !$full_match) || $current_url_full == $this_url) {
330 $class =
' class="active"';
331 }
elseif ($this_url ==
$GLOBALS[
'wwwroot_in_admin'] .
'/modules/calc/calc.php') {
332 $class =
' onclick="return(window.open(this.href)?false:true);"';
336 if (!empty($this_url) && !is_numeric($this_url)) {
337 $this_text =
'<a title="' . $this_title .
'" href="' . htmlspecialchars($this_url) .
'"' .
$class .
'>' . $this_title .
'</a>';
339 $this_text =
'<a href="#"' . $main_class .
'>' . $this_title .
'</a>';
341 $this_main_text .=
'<li>' . $this_text .
'</li>';
348 <li class="menu_main_item menu_' . $this_main_item .
' dropdown">' . $this_main_text .
'</li>
369 $ladate = $annee .
'-' . $mois .
'-' . $jour;
370 $sql =
"SELECT SUM(nb) AS nbp
371 FROM peel_nb_connexions_lien
375 $rep =
$GLOBALS[
'STR_ADMIN_VISITS_TODAY'].
" : <span class='stat_data'>" . $select[
'nbp'] .
"</span>";
376 $s =
query(
"SELECT SUM(nb) AS nbp
377 FROM peel_nb_connexions_lien
380 $nb = $nb + $select[
'nbp'];
382 $rep .=
", ".$GLOBALS[
'STR_ADMIN_VISITS_THIS_MONTH'].
" : <span class='stat_data'>" . $nb .
"</span>";
384 $s =
query(
"SELECT SUM(nb) AS nbp
385 FROM peel_nb_connexions_lien
388 $nb = $nb + $select[
'nbp'];
390 $rep .=
", ".$GLOBALS[
'STR_ADMIN_VISITS_THIS_YEAR'].
" : <span class='stat_data'>" . $nb .
"</span>.";
402 if (!empty(
$req[
'p1'])) {
403 $max_size = count(
$req[
'p1']);
404 for (
$i = 1;
$i <= $max_size;
$i++) {
405 if (
$req[
'l' .
$i] != null &&
$req[
'l' .
$i] !=
"" && floatval(
$req[
'q' .
$i]) > 0 && floatval(
$req[
'p' . $i]) > 0)
420 $max_size = count(
$req[
'produit']);
421 for (
$i = 0;
$i < $max_size;
$i++) {
422 if (
$req[
'produit'][
$i] != null &&
$req[
'produit'][
$i] !=
"" && floatval(
$req[
'quantite'][
$i]) > 0 && floatval(
$req[
'prix'][$i]) > 0) {
447 $custom_template_tags[
'MODE'] =
$mode;
449 if(!empty($partial)) {
450 $custom_template_tags[
'AMOUNT'] = $partial;
452 $custom_template_tags[
'AMOUNT'] =
fprix(
vn($commande[
'montant']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false,
false, null,
false,
true);
454 $template_technical_code =
'send_client_order_html';
455 $custom_template_tags[
'URL_FACTURE'] =
get_site_wwwroot($commande[
'site_id']) .
'/modules/factures/commande_html.php?currency_rate=' .
vn($commande[
'currency_rate']) .
'&code_facture=' . urlencode($commande[
'code_facture']) .
'&partial=' . urlencode($partial) .
'&mode=' .
$mode;
457 $template_technical_code =
'send_client_order_pdf';
458 $custom_template_tags[
'URL_FACTURE'] =
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' . urlencode($commande[
'code_facture']) .
'&mode=' .
$mode;
460 send_email($commande[
'email'],
'',
'', $template_technical_code, $custom_template_tags, null,
$GLOBALS[
'support_commande']);
472 $resCom =
query(
"SELECT c.*, sp.technical_code AS statut_paiement
473 FROM peel_commandes c
474 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
480 $custom_template_tags[
'TYPE'] = $commande->type;
481 $custom_template_tags[
'COLIS'] = $delivery_tracking;
482 $custom_template_tags[
'NOM_FAMILLE'] = $commande->nom_bill;
483 $custom_template_tags[
'PRENOM'] = $commande->prenom_bill;
484 $custom_template_tags[
'CLIENT_INFOS_SHIP'] = $order_infos[
'client_infos_ship'];
485 $custom_template_tags[
'COUT_TRANSPORT'] =
fprix($commande->cout_transport,
true) .
" " .
$GLOBALS[
'STR_TTC'];
487 $custom_template_tags[
'SHIPPED_ITEMS'] =
'';
489 foreach ($product_infos_array as $this_ordered_product) {
490 $custom_template_tags[
'SHIPPED_ITEMS'] .= $this_ordered_product[
"product_text"] .
"\n";
491 $custom_template_tags[
'SHIPPED_ITEMS'] .=
$GLOBALS[
'STR_QUANTITY'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " . $this_ordered_product[
"quantite"] .
"\n";
492 $custom_template_tags[
'SHIPPED_ITEMS'] .=
$GLOBALS[
'STR_PRICE'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
": " .
fprix($this_ordered_product[
"total_prix"],
true) .
' ' .
$GLOBALS[
'STR_TTC'] .
"\n\n";
494 send_email($commande->email,
'',
'',
'send_avis_expedition', $custom_template_tags, null,
$GLOBALS[
'support_commande']);
508 function ftp_download($host, $user, $password, $directory, $remote_filename, $local_filename)
510 if (empty($host) || empty($user)) {
511 return $GLOBALS[
'STR_FTP_CONNECT_FAILED'];
514 $connection = ftp_connect($host, 0, 20);
516 return $GLOBALS[
'STR_FTP_CONNECT_FAILED'];
519 if (!ftp_login($connection, $user, $password)) {
520 return $GLOBALS[
'STR_FTP_AUTHENTIFICATION_FAILED'];
523 ftp_pasv($connection,
true);
525 if (!ftp_chdir($connection, $directory)) {
526 return $GLOBALS[
'STR_FTP_CHDIR_FAILED'];
530 return $GLOBALS[
'STR_FOPEN_FAILED'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' .
$GLOBALS[
'uploaddir'] .
'/' . $local_filename;
533 if (!ftp_fget($connection, $handle, $remote_filename, FTP_BINARY, 0)) {
534 return $GLOBALS[
'STR_FTP_GET_FAILED'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' . $remote_filename;
538 ftp_close($connection);
553 if (!$zp = gzopen(
$GLOBALS[
'uploaddir'] .
'/' . $source_filename,
'r')) {
554 return $GLOBALS[
'STR_GZOPEN_FAILED'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' .
$GLOBALS[
'uploaddir'] .
'/' . $source_filename;
558 return $GLOBALS[
'STR_FOPEN_FAILED'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' .
$GLOBALS[
'uploaddir'] .
'/' . $destination_filename;
561 if (!fwrite($handle2, gzread($zp, 9999999))) {
562 return $GLOBALS[
'STR_FWRITE_FAILED'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' .
$GLOBALS[
'uploaddir'] .
'/' . $destination_filename;
585 ORDER BY etat DESC, date_maj DESC
616 return (($array_user_infos[
'nom_famille'] == $array_order_infos[
'nom_bill']) &&
617 ($array_user_infos[
'prenom'] == $array_order_infos[
'prenom_bill']) &&
618 ($array_user_infos[
'code_postal'] == $array_order_infos[
'zip_bill']) &&
619 ($array_user_infos[
'ville'] == $array_order_infos[
'ville_bill']) &&
620 ($array_user_infos[
'telephone'] == $array_order_infos[
'telephone_bill']));
635 function execute_sql(
$file_path, $max_sql_lines_at_once = 10000, $disable_echo =
false, $site_id = 0, $regular_display = 100,
$sql = null, $replace_tags =
true)
639 $custom_template_tags[
"SITE_ID"] = $site_id;
640 if($max_sql_lines_at_once === null) {
645 $sql = str_replace(
"\r",
"\n",
$sql);
648 $sql = str_replace(
"; ",
";",
$sql);
650 $sql = str_replace(
";\r",
";\n",
$sql);
652 $tab = explode(
"\n",
$sql);
654 for (
$i = 0;
$i < $n;
$i++) {
660 $sql = implode(
"\n", $tab);
662 $tab = explode(
";\n",
$sql);
664 for (
$i = 0;
$i < count($tab);
$i++) {
671 $silent_if_error =
true;
673 $silent_if_error =
false;
675 query($tab[$i],
false, null, $silent_if_error);
684 ob_implicit_flush(
true);
687 if (!empty(
$_SESSION[
'session_sql_filepos']) && !isset($_GET[
'init'])) {
690 fseek($handle,
$_SESSION[
'session_sql_filepos']);
691 $output .=
'<p>OK : ' .
$_SESSION[
'session_sql_ok'] .
' - NOK : ' .
$_SESSION[
'session_sql_nok'] .
' - DROP TABLE : ' .
$_SESSION[
'session_sql_drop'] .
' - CREATE TABLE : ' .
$_SESSION[
'session_sql_create'] .
'</p>';
702 $row = fgets($handle, 4096);
714 $_SESSION[
'session_sql_output'] .= ob_get_contents();
723 if (!$disable_echo && empty($no_output)) {
724 echo
'NOT OK : ' . $sql_query .
'<br />';
728 $_SESSION[
'session_sql_filepos'] = ftell($handle);
733 $_SESSION[
'session_sql_filepos'] = ftell($handle);
741 if (!$disable_echo &&
$_SESSION[
'session_sql_ok'] % $regular_display == 0 &&
$_SESSION[
'session_sql_ok'] > 0) {
742 $output .=
'Processing... OK : ' .
$_SESSION[
'session_sql_ok'] .
' SQL position : ' .
vn(
$_SESSION[
'session_sql_filepos']) .
'<br />';
743 if (empty($no_output)) {
751 if (
$_SESSION[
'session_sql_ok'] % $regular_display != 0) {
752 $output .=
'Processing... OK : ' .
$_SESSION[
'session_sql_ok'] .
' SQL position : ' .
vn(
$_SESSION[
'session_sql_filepos']) .
'<br />';
754 if (!$disable_echo && empty($no_output)) {
760 if(
$i == $max_sql_lines_at_once){
761 $_SESSION[
'session_sql_output'] .=
'<meta http-equiv="refresh" content="1; url=' .
get_current_url(
false).
'?confirm=ok&lines_per_page='.vb($_GET[
'lines_per_page'], 10000).
'"></meta>';
762 }
elseif (!$disable_echo) {
763 $_SESSION[
'session_sql_output'] .=
'<div class="alert alert-success">FINISHED</div>';
765 $_SESSION[
'session_sql_output'] .=
'<p>Affichage des erreurs éventuelles lors de l\'exécution de toutes les pages : '.vb(
$_SESSION[
'session_sql_output']).
'</p>';
779 foreach ($_GET as $this_item => $this_value) {
780 if($this_item !=
'langue') {
781 $get_options .=
'<input type="hidden" name="' . $this_item .
'" value="' .
String::str_form_value($this_value) .
'" />';
786 <div>'.$GLOBALS[
"STR_ADMIN_LANGUAGE"].$GLOBALS[
"STR_BEFORE_TWO_POINTS"].
':
787 ' . $get_options .
'<select name="langue" class="form-control" onchange="document.getElementById(\'langue\').submit()" style="width:200px;">
788 <option value="">' .
$GLOBALS[
'STR_CHOOSE'] .
'...</option>
790 foreach (
$GLOBALS[
'lang_names'] as $this_lang => $this_lang_name) {
791 $lang_select .=
'<option value="' . $this_lang .
'" ' .
frmvalide(
$_SESSION[
'session_langue'] == $this_lang,
' selected="selected"') .
'>' . $this_lang_name .
'</option>';
815 $sql =
"SELECT pcp.*, pc.nom_" .
$_SESSION[
'session_langue'] .
" AS nom_cat, DATE_FORMAT(date_fin, '%d/%m/%Y') AS date_fin, nombre_prevue, nb_used_per_client
816 FROM peel_codes_promos pcp
817 LEFT JOIN peel_categories pc ON pc.id=pcp.id_categorie AND " .
get_filter_site_cond(
'categories',
'pc') .
"
818 WHERE pcp.id = '" . intval($id_codepromo) .
"' AND " .
get_filter_site_cond(
'codes_promos',
'pcp') .
"";
821 $la_date = date(
"Y-m-d");
826 $email = $user_infos[
'email'];
828 $requete =
query(
"SELECT 1
829 FROM peel_utilisateurs_codes_promos
830 WHERE id_utilisateur = '" . intval(
$id_utilisateur) .
"' AND id_code_promo = '" . intval($id_codepromo) .
"'");
831 if ((
num_rows($requete) == 0) || (
num_rows($requete) > 0 && !empty(
$GLOBALS[
'site_parameters'][
'disable_limitation_promotional_code_sending']))) {
834 query(
"INSERT INTO peel_utilisateurs_codes_promos (id_utilisateur, id_code_promo, nom_code, la_date, utilise, valeur)
837 unset($custom_template_tags);
838 $custom_template_tags[
'CIVILITE'] = $user_infos[
'civilite'];
839 $custom_template_tags[
'PRENOM'] = $user_infos[
'prenom'];
840 $custom_template_tags[
'NOM_FAMILLE'] = $user_infos[
'nom_famille'];
841 $custom_template_tags[
'CIVILITE'] = $user_infos[
'civilite'];
842 $custom_template_tags[
'NOM_CODE_PROMO'] = $cp[
'nom'];
843 $custom_template_tags[
'REMISE'] = $remise;
845 if ($cp[
'nb_used_per_client'] > 0 && $cp[
'nombre_prevue'] > 0) {
846 $nb_used_possible = min($cp[
'nb_used_per_client'], $cp[
'nombre_prevue']);
847 }
elseif ($cp[
'nb_used_per_client'] > 0) {
848 $nb_used_possible = $cp[
'nb_used_per_client'];
849 }
elseif ($cp[
'nb_used_per_client'] > 0) {
850 $nb_used_possible = $cp[
'nombre_prevue'];
852 $nb_used_possible =
'-';
854 $custom_template_tags[
'NB_USED_POSSIBLE'] = $nb_used_possible;
855 if (!empty($cp[
'nom_cat'])) {
856 $custom_template_tags[
'REMISE'] .=
$GLOBALS[
'STR_ON_CATEGORY'] .
' ' . $cp[
'nom_cat'];
858 $custom_template_tags[
'DATE_FIN'] = $cp[
'date_fin'];
859 send_email($email,
'',
'',
'envoie_client_code_promo', $custom_template_tags, null,
$GLOBALS[
'support_sav_client']);
860 return $GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
"STR_ADMIN_CODES_PROMOS_MSG_SENT_OK"], $cp[
'nom'], $user_infos[
'civilite'] .
' ' . $user_infos[
'prenom'] .
' ' . $user_infos[
'nom_famille'], $email)))->fetch();
862 return $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
$GLOBALS[
"STR_ADMIN_CODES_PROMOS_ERR_ALREADY_SENT"], $email .
' (' . $user_infos[
'prenom'] .
' ' . $user_infos[
'nom_famille'] .
')', $cp[
'nom'])))->fetch();
882 if (!empty(
$frm[
'client_info'])) {
888 foreach(array(
'_bill',
'_ship') as $this_item) {
895 $sql_inner .=
' INNER JOIN peel_utilisateurs u ON c.id_utilisateur=u.id_utilisateur AND ' .
get_filter_site_cond(
'utilisateurs',
'u') .
'';
897 if (!empty(
$frm[
'searchProd'])) {
899 $sql_inner .=
' INNER JOIN peel_commandes_articles ca ON ca.commande_id=c.id AND ' .
get_filter_site_cond(
'commandes_articles',
'ca',
true);
901 if (isset(
$frm[
'statut_paiement']) && is_numeric(
$frm[
'statut_paiement'])) {
904 if (isset(
$frm[
'statut_livraison']) && is_numeric(
$frm[
'statut_livraison'])) {
907 if (!empty(
$frm[
'id'])) {
910 if (!empty(
$frm[
'affi'])) {
911 $sql_cond .=
' AND affilie = "1"';
915 FROM peel_commandes c " . $sql_inner .
"
917 if(!empty($sql_inner)){
922 $HeaderTitlesArray = array(
$GLOBALS[
'STR_ADMIN_ACTION'],
'id' =>
$GLOBALS[
'STR_ADMIN_ID'],
'numero' =>
$GLOBALS[
"STR_ADMIN_COMMANDER_BILL_NUMBER"],
'o_timestamp' =>
$GLOBALS[
'STR_DATE'],
'montant' =>
$GLOBALS[
'STR_TOTAL'] .
' ' . (
display_prices_with_taxes_in_admin() ?
$GLOBALS[
'STR_TTC'] :
$GLOBALS[
'STR_HT']), $GLOBALS[
'STR_AVOIR'],
'id_utilisateur' => $GLOBALS[
'STR_CUSTOMER'], $GLOBALS[
'STR_PAYMENT'], $GLOBALS[
'STR_PAYMENT'],
'id_statut_paiement' => $GLOBALS[
'STR_PAYMENT'],
'id_statut_livraison' => $GLOBALS[
'STR_DELIVERY'],
'site_id' => $GLOBALS[
'STR_ADMIN_WEBSITE']);
923 if(!empty($GLOBALS[
'site_parameters'][
'admin_order_list_display_delivery_mode_column'])) {
924 $HeaderTitlesArray[
'type'] = $GLOBALS[
'STR_ADMIN_MENU_MANAGE_DELIVERY'];
926 $Links->HeaderTitlesArray = $HeaderTitlesArray;
927 $Links->OrderDefault =
vb($GLOBALS[
'site_parameters'][
'liste_commandes_admin_order_default'],
'o_timestamp');
928 $Links->SortDefault =
'DESC';
931 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $GLOBALS[
'STR_ADMIN_NO_RESULT']))->fetch();
934 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'admin_commande_liste.tpl');
937 $tpl->assign(
'id',
vb($_GET[
'id']));
938 $tpl->assign(
'client_info',
vb($_GET[
'client_info']));
939 $tpl->assign(
'searchProd',
vb($_GET[
'searchProd']));
949 $tpl_results = array();
951 $tpl->assign(
'update_src', $GLOBALS[
'wwwroot_in_admin'] .
'/images/update-on.png');
952 $tpl->assign(
'links_header_row',
$Links->getHeaderRow());
956 $this_sac_status = null;
961 $get_sac_status = get_sac_status($order[
'id'],
vb($_POST[
'fianet_sac_update_status']));
962 $this_sac_status = $get_sac_status[$order[
'id']];
965 $modifUser = $affiliated_user[
'civilite'] .
' ' . $affiliated_user[
'prenom'] .
' ' . $affiliated_user[
'nom_famille'] .
' <br />' . $affiliated_user[
'societe'];
966 if(trim(strip_tags($modifUser)) ==
'') {
967 $modifUser = $order[
'email'];
969 $modifUser = (!
checkUserInfo($order, $affiliated_user) ?
'<img src="' . $GLOBALS[
'wwwroot_in_admin'] .
'/images/update-on.png" alt="update-on.png" />' :
'') .
'<a href="utilisateurs.php?mode=modif&id_utilisateur=' . $affiliated_user[
'id_utilisateur'] .
'">' . $modifUser .
'</a>';
971 $modifUser = $order[
'prenom_bill'] .
' ' . $order[
'nom_bill'] .
' ' . $order[
'societe_bill'];
972 if(trim(strip_tags($modifUser)) ==
'') {
973 $modifUser = $order[
'email'];
975 if (!
a_priv(
'demo') && !empty($order[
'id_utilisateur'])) {
977 $modifUser .=
'<br />(supprimé depuis)';
981 $montant_displayed = $order[
'montant'];
983 $montant_displayed = $order[
'montant_ht'];
986 $picto_delivery_status_array = array();
987 if (!empty($GLOBALS[
'site_parameters'][
'statut_livraison_picto'])) {
988 foreach ($GLOBALS[
'site_parameters'][
'statut_livraison_picto'] as $this_status_id => $this_picto) {
989 if ($this_status_id == $order[
'id_statut_livraison']) {
990 $etat_src = $GLOBALS[
'administrer_url'] .
'/images/' . $this_picto;
992 $etat_src = $GLOBALS[
'administrer_url'] .
'/images/puce-blanche.gif';
994 $picto_delivery_status_array[$this_status_id] = array(
"etat_src" => $etat_src,
'etat_onclick' =>
'change_status("delivery_status", "' . $order[
'id'] .
'", this, "' . $GLOBALS[
'administrer_url'] .
'", "'. $this_status_id .
'")');
997 $tpl_array= array(
'tr_rollover' => tr_rollover(
$i,
true),
998 'id' => $order[
'id'],
999 'order_id' => $order[
'order_id'],
1000 'numero' => $order[
'numero'],
1002 'montant_prix' =>
fprix($montant_displayed,
true, $order[
'devise'],
true, $order[
'currency_rate']),
1003 'avoir_prix' =>
fprix($order[
'avoir'],
true, $order[
'devise'],
true, $order[
'currency_rate']),
1004 'modifUser' => $modifUser,
1008 'dup_href' =>
get_current_url(
false) .
'?mode=duplicate&id=' . $order[
'id'] .
'&page=' . (!empty($_GET[
'page']) ? $_GET[
'page'] : 1),
1009 'dup_src' => $GLOBALS[
'administrer_url'] .
'/images/duplicate.png',
1010 'this_sac_status' => $this_sac_status,
1011 'picto_delivery_status_array'=> $picto_delivery_status_array,
1014 if(!empty($GLOBALS[
'site_parameters'][
'admin_order_list_display_delivery_mode_column'])) {
1015 $tpl_array[
'type'] = $order[
'type'];
1017 $tpl_results[] = $tpl_array;
1020 $tpl->assign(
'results', $tpl_results);
1024 $tpl->assign(
'links_multipage',
$Links->GetMultipage());
1026 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
1027 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
1028 $tpl->assign(
'STR_ADMIN_CHECK_ALL', $GLOBALS[
'STR_ADMIN_CHECK_ALL']);
1029 $tpl->assign(
'STR_ADMIN_UNCHECK_ALL', $GLOBALS[
'STR_ADMIN_UNCHECK_ALL']);
1030 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDERS_FOUND_COUNT', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDERS_FOUND_COUNT']);
1031 $tpl->assign(
'STR_ORDER_NUMBER', $GLOBALS[
'STR_ORDER_NUMBER']);
1032 $tpl->assign(
'STR_EMAIL', $GLOBALS[
'STR_EMAIL']);
1033 $tpl->assign(
'STR_LAST_NAME', $GLOBALS[
'STR_LAST_NAME']);
1034 $tpl->assign(
'STR_FIRST_NAME', $GLOBALS[
'STR_FIRST_NAME']);
1035 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDERED_PRODUCT', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDERED_PRODUCT']);
1036 $tpl->assign(
'STR_ORDER_STATUT_PAIEMENT', $GLOBALS[
'STR_ORDER_STATUT_PAIEMENT']);
1037 $tpl->assign(
'STR_ORDER_STATUT_LIVRAISON', $GLOBALS[
'STR_ORDER_STATUT_LIVRAISON']);
1038 $tpl->assign(
'STR_ADMIN_ALL_ORDERS', $GLOBALS[
'STR_ADMIN_ALL_ORDERS']);
1039 $tpl->assign(
'STR_SEARCH', $GLOBALS[
'STR_SEARCH']);
1040 $tpl->assign(
'STR_ADMIN_COMMANDER_FIANET_UPDATE', $GLOBALS[
'STR_ADMIN_COMMANDER_FIANET_UPDATE']);
1041 $tpl->assign(
'STR_ADMIN_ORDER_DUPLICATE', $GLOBALS[
'STR_ADMIN_ORDER_DUPLICATE']);
1042 $tpl->assign(
'STR_ADMIN_ORDER_DUPLICATE_WARNING', $GLOBALS[
'STR_ADMIN_ORDER_DUPLICATE_WARNING']);
1043 $tpl->assign(
'STR_ADMIN_COMMANDER_CLIENT_UPDATED_ICON_EXPLAIN', $GLOBALS[
'STR_ADMIN_COMMANDER_CLIENT_UPDATED_ICON_EXPLAIN']);
1044 $tpl->assign(
'STR_MODIFY', $GLOBALS[
'STR_MODIFY']);
1045 $tpl->assign(
'STR_ADMIN_CHECK_ALL', $GLOBALS[
'STR_ADMIN_CHECK_ALL']);
1046 $tpl->assign(
'STR_ADMIN_UNCHECK_ALL', $GLOBALS[
'STR_ADMIN_UNCHECK_ALL']);
1047 $tpl->assign(
'STR_ADMIN_COMMANDER_UPDATED_STATUS_FOR_SELECTION', $GLOBALS[
'STR_ADMIN_COMMANDER_UPDATED_STATUS_FOR_SELECTION']);
1048 $tpl->assign(
'STR_ADMIN_COMMANDER_NO_ORDER_FOUND', $GLOBALS[
'STR_ADMIN_COMMANDER_NO_ORDER_FOUND']);
1049 $tpl->assign(
'STR_NOTA_BENE', $GLOBALS[
'STR_NOTA_BENE']);
1050 $tpl->assign(
'STR_MODULE_FACTURES_ADMIN_TITLE', $GLOBALS[
'STR_MODULE_FACTURES_ADMIN_TITLE']);
1071 if (!empty($commande) ||
$action ==
'insere' ||
$action ==
'ajout') {
1081 $montant_displayed = $commande[
'montant'];
1083 $montant_displayed = $commande[
'montant_ht'];
1088 $montant_displayed = 0;
1093 if (!empty($user_id)) {
1097 for(
$i = 0;
$i < 2;
$i++) {
1103 $commande[
'societe_' . $state] =
vb($user_array[
'societe']);
1104 $commande[
'nom_' . $state] =
vb($user_array[
'nom_famille']);
1105 $commande[
'prenom_' . $state] =
vb($user_array[
'prenom']);
1106 $commande[
'email_' . $state] =
vb($user_array[
'email']);
1107 $commande[
'telephone_' . $state] =
vb($user_array[
'telephone']);
1108 $commande[
'adresse_' . $state] =
vb($user_array[
'adresse']);
1109 $commande[
'zip_' . $state] =
vb($user_array[
'code_postal']);
1110 $commande[
'ville_' . $state] =
vb($user_array[
'ville']);
1112 if (!empty(
$GLOBALS[
'site_parameters'][
'user_specific_field_titles'])) {
1115 foreach(
$GLOBALS[
'site_parameters'][
'user_specific_field_titles'] as $this_field => $this_title) {
1116 if (((
String::substr($this_field, -5) ==
'_bill') || (
String::substr($this_field, -5) ==
'_ship')) && in_array($this_field, $user_table_fields_names) && in_array($this_field, $order_table_fields_names)) {
1118 $commande[$this_field] =
vb($user_array[$this_field]);
1123 $commande[
'id_utilisateur'] =
vn($user_id);
1124 $commande[
'intracom_for_billing'] =
vb($user_array[
'intracom_for_billing']);
1127 $sqlPays =
'SELECT p.id, p.pays_' .
$_SESSION[
'session_langue'] .
' as pays, p.zone, z.tva, z.on_franco
1141 $commande[
'payment_technical_code'] =
vb($commande[
'paiement']);
1142 if (strpos($commande[
'paiement'],
' ') !==
false) {
1144 $sql =
'SELECT technical_code
1150 $commande[
'payment_technical_code'] =
$result[
'technical_code'];
1153 if ($commande[
'cout_transport_ht'] > 0) {
1154 $commande[
'tva_transport'] =
vn(round(($commande[
'tva_cout_transport'] / $commande[
'cout_transport_ht'] * 100), 2));
1156 $commande[
'tva_transport'] = null;
1162 $commande[
'zone_tva'] = 1;
1164 if (!empty($commande[
'numero'])) {
1166 $numero = $commande[
'numero'];
1167 }
elseif (!empty(
$GLOBALS[
'site_parameters'][
'admin_fill_empty_bill_number_by_number_format'])) {
1168 $numero =
vb(
$GLOBALS[
'site_parameters'][
'format_numero_facture']);
1172 if (empty($commande[
'devise'])) {
1173 $commande[
'devise'] =
$GLOBALS[
'site_parameters'][
'code'];
1175 if (!empty($commande[
'zone_tva'])) {
1181 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_commande_details.tpl');
1184 $tpl->assign(
'order_id',
vn($commande[
'order_id']));
1186 $tpl->assign(
'site_id_select_multiple', !empty(
$GLOBALS[
'site_parameters'][
'multisite_using_array_for_site_id']));
1187 $tpl->assign(
'internal_order_enable',
vn(
$GLOBALS[
'site_parameters'][
'internal_order_enable']));
1188 $tpl->assign(
'is_order_modification_allowed', $is_order_modification_allowed);
1190 $tpl->assign(
'pdf_src',
$GLOBALS[
'wwwroot_in_admin'] .
'/images/view_pdf.gif');
1192 $tpl->assign(
'allow_display_invoice_link', !empty($commande[
'numero']));
1193 $tpl->assign(
'facture_pdf_href',
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=facture');
1194 $tpl->assign(
'sendfacture_pdf_href',
$GLOBALS[
'administrer_url'] .
'/commander.php?mode=sendfacturepdf&id=' .
vn($commande[
'id']) .
'&code_facture=' .
vb($commande[
'code_facture']) .
'&bill_type=facture');
1195 $tpl->assign(
'proforma_pdf_href',
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=proforma');
1196 $tpl->assign(
'sendproforma_pdf_href',
$GLOBALS[
'administrer_url'] .
'/commander.php?mode=sendfacturepdf&id=' .
vn($commande[
'id']) .
'&code_facture=' .
vb($commande[
'code_facture']) .
'&bill_type=proforma');
1197 $tpl->assign(
'devis_pdf_href',
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=devis');
1198 $tpl->assign(
'senddevis_pdf_href',
$GLOBALS[
'administrer_url'] .
'/commander.php?mode=sendfacturepdf&id=' .
vn($commande[
'id']) .
'&code_facture=' .
vb($commande[
'code_facture']) .
'&bill_type=devis');
1199 $tpl->assign(
'bdc_pdf_href',
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=bdc');
1200 $tpl->assign(
'duplicate',
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=bdc');
1201 $tpl->assign(
'bdc_pdf_href',
get_site_wwwroot($commande[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=bdc');
1204 $tpl->assign(
'dup_href',
get_current_url(
false) .
'?mode=duplicate&id=' . $commande[
'id']);
1205 $tpl->assign(
'dup_src',
$GLOBALS[
'administrer_url'] .
'/images/duplicate.png');
1206 $tpl->assign(
'STR_ADMIN_ORDER_DUPLICATE',
$GLOBALS[
'STR_ADMIN_ORDER_DUPLICATE']);
1207 $tpl->assign(
'STR_ADMIN_ORDER_DUPLICATE_WARNING',
$GLOBALS[
'STR_ADMIN_ORDER_DUPLICATE_WARNING']);
1211 $tpl->assign(
'facture_html_href',
get_site_wwwroot($commande[
'site_id']) .
'/modules/factures/commande_html.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=facture');
1212 $tpl->assign(
'bdc_action',
$GLOBALS[
'administrer_url'] .
'/commander.php?mode=modif&commandeid=' .
vn($commande[
'id']));
1213 $tpl->assign(
'bdc_code_facture',
vb($commande[
'code_facture']));
1214 $tpl->assign(
'bdc_id',
vn($commande[
'id']));
1215 $tpl->assign(
'bdc_partial',
fprix(
vn($commande[
'montant']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false,
false, null,
false,
true));
1216 $tpl->assign(
'bdc_devise',
vb($commande[
'devise']));
1217 $tpl->assign(
'partial_amount_link_js',
get_site_wwwroot($commande[
'site_id']) .
'/modules/factures/commande_html.php?currency_rate=' .
vn($commande[
'currency_rate']) .
'&code_facture=' .
vb($commande[
'code_facture']) .
'&mode=bdc&partial=');
1218 $tpl->assign(
'partial_amount_link_href',
get_site_wwwroot($commande[
'site_id']) .
'/modules/factures/commande_html.php?code_facture=' .
vb($commande[
'code_facture']) .
'&mode=bdc&partial=' .
get_float_from_user_input(
fprix(
vn($commande[
'montant']),
false,
$GLOBALS[
'site_parameters'][
'code'],
false, $commande[
'currency_rate'],
false,
false)));
1219 $tpl->assign(
'partial_amount_link_target',
'facture' . $commande[
'code_facture']);
1222 $q_type =
query(
'SELECT *
1227 $tpl->assign(
'etiquette_tnt',
'<b>ETIQUETTE TNT : </b><a target="_blank" href="' .
$GLOBALS[
'wwwroot'] .
'/modules/tnt/administrer/etiquette.php?order_id='.$commande[
'id'] .
'">Imprimer l\'étiquette tnt (ouvre une nouvelle fenêtre)</a>');
1231 $tpl->assign(
'date_facture', (empty($date_facture) ?
"" :
vb($date_facture)));
1232 $tpl->assign(
'e_datetime', (empty($e_datetime) ?
"" :
vb($e_datetime)));
1233 $tpl->assign(
'f_datetime', (empty($f_datetime) ?
"" :
vb($f_datetime)));
1234 $tpl->assign(
'intracom_for_billing',
vb($commande[
'intracom_for_billing']));
1236 $tpl->assign(
'email_href',
$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' .
vn($commande[
'id_utilisateur']));
1237 $tpl->assign(
'email',
vb($commande[
'email']));
1242 $tpl->assign(
'numero', $numero);
1243 $tpl->assign(
'delivery_tracking',
vb($commande[
'delivery_tracking']));
1245 $tpl->assign(
'delivery_locationid',
vb($commande[
'delivery_locationid']));
1248 $tpl->assign(
'icirelais', array(
1249 'src' => get_url(
'/modules/icirelais/js/icirelais.js'),
1250 'value' =>
vb($commande[
'delivery_tracking'])
1252 $tpl->assign(
'STR_MODULE_ICIRELAIS_CONFIGURATION_TRACKING_URL_TITLE',
$GLOBALS[
'STR_MODULE_ICIRELAIS_CONFIGURATION_TRACKING_URL_TITLE']);
1253 $tpl->assign(
'MODULE_ICIRELAIS_SETUP_TRACKING_URL', MODULE_ICIRELAIS_SETUP_TRACKING_URL);
1254 $tpl->assign(
'STR_MODULE_ICIRELAIS_COMMENT_TRACKING',
$GLOBALS[
'STR_MODULE_ICIRELAIS_COMMENT_TRACKING']);
1255 $tpl->assign(
'STR_MODULE_ICIRELAIS_ERROR_TRACKING',
$GLOBALS[
'STR_MODULE_ICIRELAIS_ERROR_TRACKING']);
1256 $tpl->assign(
'STR_MODULE_ICIRELAIS_CREATE_TRACKING',
$GLOBALS[
'STR_MODULE_ICIRELAIS_CREATE_TRACKING']);
1259 if((!empty(
$id) && $commande[
'montant'] > 0) || empty(
$id)) {
1266 $tpl->assign(
'devise',
vb($commande[
'devise']));
1267 $tpl->assign(
'mode_transport',
vn(
$GLOBALS[
'site_parameters'][
'mode_transport']));
1268 if (!empty(
$GLOBALS[
'site_parameters'][
'mode_transport'])) {
1272 $tpl->assign(
'tva_transport',
vb($commande[
'tva_transport']));
1273 $tpl->assign(
'type_transport',
vb($commande[
'type_transport']));
1275 if(isset($commande[
'cout_transport'])) {
1278 $tpl->assign(
'cout_transport',
fprix(
vn($commande[
'cout_transport']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false));
1280 $tpl->assign(
'cout_transport',
'');
1282 $tpl->assign(
'tva_transport',
fprix(
vn($commande[
'tva_transport']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false));
1283 $tpl->assign(
'transport',
vb($commande[
'transport']));
1287 $tpl_devises_options = array();
1288 $res_devise =
query(
"SELECT p.code
1292 $tpl_devises_options[] = array(
'value' => $tab_devise[
'code'],
1293 'issel' => $tab_devise[
'code'] ==
vb($commande[
'devise']),
1294 'name' => $tab_devise[
'code']
1297 $tpl->assign(
'devises_options', $tpl_devises_options);
1300 $tpl->assign(
'small_order_overcost_amount',
fprix(
vn($commande[
'small_order_overcost_amount']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false));
1301 $tpl->assign(
'tva_small_order_overcost',
fprix(
vn($commande[
'tva_small_order_overcost']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false));
1302 $tpl->assign(
'site_symbole',
$GLOBALS[
'site_parameters'][
'symbole']);
1303 $tpl->assign(
'currency_rate',
vn($commande[
'currency_rate']));
1304 $tpl->assign(
'montant_displayed_prix',
fprix($montant_displayed,
true,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate'])));
1307 if (!empty($commande[
'total_remise']) && $commande[
'total_remise'] > 0) {
1310 $tpl->assign(
'avoir_prix',
fprix(
vn($commande[
'avoir']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate'])));
1312 if (!empty($commande[
'affilie']) && $commande[
'affilie'] == 1) {
1314 $tpl->assign(
'is_affilie',
true);
1315 $tpl->assign(
'affilie_prix',
fprix($commande[
'montant_affilie'],
true,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate'])));
1316 $tpl->assign(
'statut_affilie', $commande[
'statut_affilie']);
1317 $tpl->assign(
'affilie_href', $GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . $affiliated_user[
'id_utilisateur']);
1318 $tpl->assign(
'affilie_email', $affiliated_user[
'email']);
1320 $tpl->assign(
'is_affilie',
false);
1326 $tpl->assign(
'total_points',
vn($commande[
'total_points']));
1327 $tpl->assign(
'points_etat',
vn($commande[
'points_etat']));
1329 $tpl->assign(
'commande_interne',
vb($commande[
'commande_interne']));
1330 $tpl->assign(
'commentaires',
vb($commande[
'commentaires']));
1331 $tpl->assign(
'commentaires_admin',
vb($commande[
'commentaires_admin']));
1334 $tpl_client_infos = array();
1335 for (
$i = 1;
$i < 3;
$i++) {
1341 $tpl_client_infos[] = array(
'value' => $value,
1343 'societe' =>
vb($commande[
'societe_' . $value]),
1344 'nom' =>
vb($commande[
'nom_' . $value]),
1345 'prenom' =>
vb($commande[
'prenom_' . $value]),
1346 'email' =>
vb($commande[
'email_' . $value]),
1347 'telephone' =>
vb($commande[
'telephone_' . $value]),
1348 'adresse' =>
vb($commande[
'adresse_' . $value]),
1349 'zip' =>
vb($commande[
'zip_' . $value]),
1350 'ville' =>
vb($commande[
'ville_' . $value]),
1354 $tpl->assign(
'client_infos', $tpl_client_infos);
1356 $tpl_order_lines = array();
1358 if(!empty($GLOBALS[
'site_parameters'][
'order_article_order_by']) && $GLOBALS[
'site_parameters'][
'order_article_order_by'] ==
'name') {
1359 $order_by =
'oi.nom_produit ASC';
1360 }
elseif(!empty($GLOBALS[
'site_parameters'][
'order_article_order_by']) && $GLOBALS[
'site_parameters'][
'order_article_order_by'] ==
'reference') {
1361 $order_by =
'oi.reference ASC';
1363 $order_by =
'oi.id ASC';
1367 , oi.nom_produit AS nom
1368 , oi.prix AS purchase_prix
1369 , oi.prix_ht AS purchase_prix_ht
1375 , oi.produit_id AS id
1377 , oi.total_prix_attribut
1384 , oi.percent_remise_produit AS percent
1387 $sql .=
", oi.listcadeaux_owner ";
1390 $sql .=
", oi.tnt_parcel_number ";
1392 $sql .=
"FROM peel_commandes_articles oi
1394 ORDER BY ".$order_by;
1396 $nb_produits =
num_rows($result_requete);
1401 if (!empty($result_requete)) {
1402 while ($line_data =
fetch_assoc($result_requete)) {
1409 $line_data[
'prix_cat'] = round($line_data[
'prix_cat'] *
vn($commande[
'currency_rate']), 5);
1410 $line_data[
'prix_cat_ht'] = round($line_data[
'prix_cat_ht'] *
vn($commande[
'currency_rate']), 5);
1411 $line_data[
'purchase_prix'] = round($line_data[
'purchase_prix'] *
vn($commande[
'currency_rate']), 5);
1412 $line_data[
'purchase_prix_ht'] = round($line_data[
'purchase_prix_ht'] *
vn($commande[
'currency_rate']), 5);
1413 $line_data[
'remise'] = round($line_data[
'remise'] *
vn($commande[
'currency_rate']), 5);
1414 $line_data[
'remise_ht'] = round($line_data[
'remise_ht'] *
vn($commande[
'currency_rate']), 5);
1415 if (!empty($line_data[
'taille']) && !in_array($line_data[
'taille'], $possible_sizes)) {
1416 $possible_sizes[$line_data[
'taille_id']] = $line_data[
'taille'];
1418 $size_options_html =
'';
1419 if (!empty($possible_sizes)) {
1420 foreach ($possible_sizes as $this_size_id => $this_size_name) {
1421 $size_options_html .=
'<option value="' . intval($this_size_id) .
'" ' .
frmvalide($this_size_name == $line_data[
'taille'],
' selected="selected"') .
'>' . $this_size_name .
'</option>';
1425 if (!empty($line_data[
'couleur']) && !in_array($line_data[
'couleur'], $possible_colors)) {
1426 $possible_colors[$line_data[
'couleur_id']] = $line_data[
'couleur'];
1428 $color_options_html =
'';
1429 if (!empty($possible_colors)) {
1430 foreach ($possible_colors as $this_color_id => $this_color_name) {
1431 $color_options_html .=
'<option value="' . intval($this_color_id) .
'" ' .
frmvalide($this_color_name == $line_data[
'couleur'],
' selected="selected"') .
'>' . $this_color_name .
'</option>';
1436 $tpl_order_lines[] =
get_order_line($line_data, $color_options_html, $size_options_html, $tva_options_html,
$i);
1441 $tpl->assign(
'order_lines', $tpl_order_lines);
1443 $tpl->assign(
'avoir',
fprix(
vn($commande[
'avoir']),
false,
vb($commande[
'devise']),
true,
vn($commande[
'currency_rate']),
false));
1444 $tpl->assign(
'lang',
vb($commande[
'lang']));
1445 $tpl->assign(
'code_promo',
vb($commande[
'code_promo']));
1446 $tpl->assign(
'percent_code_promo',
vn($commande[
'percent_code_promo']));
1447 $tpl->assign(
'valeur_code_promo',
vn($commande[
'valeur_code_promo']));
1450 $tpl->assign(
'id_utilisateur',
vb($commande[
'id_utilisateur']));
1451 $tpl->assign(
'nb_produits', $nb_produits);
1453 $tpl->assign(
'get_mode', $_GET[
'mode']);
1455 $GLOBALS[
'js_content_array'][] =
"new_order_line_html='".filtre_javascript(
get_order_line(array(
'id' =>
'[id]',
'ref' =>
'[ref]',
'nom' =>
'[nom]',
'image_thumbs' =>
'[image_thumbs]',
'image' =>
'[image]',
'quantite' =>
'[quantite]',
'remise' =>
'[remise]',
'remise_ht' =>
'[remise_ht]',
'percent' =>
'[percent]',
'purchase_prix' =>
'[purchase_prix]',
'purchase_prix_ht' =>
'[purchase_prix_ht]',
'tva_percent' =>
'[tva_percent]',
'prix_cat' =>
'[prix_cat]',
'prix_cat_ht' =>
'[prix_cat_ht]'),
'[color_options_html]',
'[size_options_html]',
'[tva_options_html]',
'[i]'),
true,
true,
false,
true,
false).
"';";
1457 $tpl->assign(
'site_avoir', $GLOBALS[
'site_parameters'][
'avoir']);
1460 if (
vb($commande[
'parrain']) ==
"parrain") {
1463 'id' => intval($commande[
'id']),
1464 'id_parrain' => intval($commande[
'id_parrain']),
1465 'email' => $Client[
'email'],
1466 'href' => $GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . $commande[
'id_parrain']
1472 require_once($GLOBALS[
'fonctionsfianet_sac']);
1473 $tpl->assign(
'fianet_analyse_commandes', get_sac_order_link($id));
1475 $tpl->assign(
'is_order_modification_allowed', $is_order_modification_allowed);
1476 $tpl->assign(
'zone_tva',
vb($commande[
'zone_tva']));
1478 $tpl->assign(
'STR_IMAGE', $GLOBALS[
'STR_IMAGE']);
1479 $tpl->assign(
'STR_ADMIN_TECHNICAL_ORDER_NUMBER', $GLOBALS[
'STR_ADMIN_TECHNICAL_ORDER_NUMBER']);
1480 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
1481 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
1482 $tpl->assign(
'STR_ADMIN_AUTOCOMPLETE_ORDER_ADRESSES', $GLOBALS[
'STR_ADMIN_AUTOCOMPLETE_ORDER_ADRESSES']);
1483 $tpl->assign(
'STR_ADMIN_COMMANDER_WARNING_EDITION_NOT_ALLOWED', $GLOBALS[
'STR_ADMIN_COMMANDER_WARNING_EDITION_NOT_ALLOWED']);
1484 $tpl->assign(
'STR_ADMIN_COMMANDER_CREATE_OR_UPDATE_TITLE', $GLOBALS[
'STR_ADMIN_COMMANDER_CREATE_OR_UPDATE_TITLE']);
1485 $tpl->assign(
'STR_INVOICE', $GLOBALS[
'STR_INVOICE']);
1486 $tpl->assign(
'STR_ADMIN_CREATE_BILL_NUMBER_BEFORE', $GLOBALS[
'STR_ADMIN_CREATE_BILL_NUMBER_BEFORE']);
1487 $tpl->assign(
'STR_PROFORMA', $GLOBALS[
'STR_PROFORMA']);
1488 $tpl->assign(
'STR_QUOTATION', $GLOBALS[
'STR_QUOTATION']);
1489 $tpl->assign(
'STR_ORDER_FORM', $GLOBALS[
'STR_ORDER_FORM']);
1490 $tpl->assign(
'STR_ADMIN_SEND_TO_CLIENT_BY_EMAIL', $GLOBALS[
'STR_ADMIN_SEND_TO_CLIENT_BY_EMAIL']);
1491 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
1492 $tpl->assign(
'STR_BY', $GLOBALS[
'STR_BY']);
1493 $tpl->assign(
'STR_ORDER_STATUT_PAIEMENT', $GLOBALS[
'STR_ORDER_STATUT_PAIEMENT']);
1494 $tpl->assign(
'STR_ORDER_STATUT_LIVRAISON', $GLOBALS[
'STR_ORDER_STATUT_LIVRAISON']);
1495 $tpl->assign(
'STR_TTC', $GLOBALS[
'STR_TTC']);
1496 $tpl->assign(
'STR_ADMIN_INCLUDING_VAT', $GLOBALS[
'STR_ADMIN_INCLUDING_VAT']);
1497 $tpl->assign(
'STR_ADMIN_USED_CURRENCY', $GLOBALS[
'STR_ADMIN_USED_CURRENCY']);
1498 $tpl->assign(
'STR_ADMIN_COMMENTS', $GLOBALS[
'STR_ADMIN_COMMENTS']);
1499 $tpl->assign(
'STR_COMMENTS', $GLOBALS[
'STR_COMMENTS']);
1500 $tpl->assign(
'STR_REFERENCE_IF_KNOWN', $GLOBALS[
'STR_REFERENCE_IF_KNOWN']);
1501 $tpl->assign(
'STR_ADMIN_COMMANDER_OR_ADD_PRODUCT_WITH_FAST_SEARCH', $GLOBALS[
'STR_ADMIN_COMMANDER_OR_ADD_PRODUCT_WITH_FAST_SEARCH']);
1502 $tpl->assign(
'STR_STATUS', $GLOBALS[
'STR_STATUS']);
1503 $tpl->assign(
'STR_ADMIN_ADD_EMPTY_LINE', $GLOBALS[
'STR_ADMIN_ADD_EMPTY_LINE']);
1504 $tpl->assign(
'STR_PAYMENT_MEAN', $GLOBALS[
'STR_PAYMENT_MEAN']);
1505 $tpl->assign(
'STR_SHIPPING_TYPE', $GLOBALS[
'STR_SHIPPING_TYPE']);
1506 $tpl->assign(
'STR_SHIPPING_COST', $GLOBALS[
'STR_SHIPPING_COST']);
1507 $tpl->assign(
'STR_GIFT_POINTS', $GLOBALS[
'STR_GIFT_POINTS']);
1508 $tpl->assign(
'STR_INVOICE_ADDRESS', $GLOBALS[
'STR_INVOICE_ADDRESS']);
1509 $tpl->assign(
'STR_FIRST_NAME', $GLOBALS[
'STR_FIRST_NAME']);
1510 $tpl->assign(
'STR_LAST_NAME', $GLOBALS[
'STR_LAST_NAME']);
1511 $tpl->assign(
'STR_SOCIETE', $GLOBALS[
'STR_SOCIETE']);
1512 $tpl->assign(
'STR_EMAIL', $GLOBALS[
'STR_EMAIL']);
1513 $tpl->assign(
'STR_TELEPHONE', $GLOBALS[
'STR_TELEPHONE']);
1514 $tpl->assign(
'STR_ADDRESS', $GLOBALS[
'STR_ADDRESS']);
1515 $tpl->assign(
'STR_ZIP', $GLOBALS[
'STR_ZIP']);
1516 $tpl->assign(
'STR_TOWN', $GLOBALS[
'STR_TOWN']);
1517 $tpl->assign(
'STR_COUNTRY', $GLOBALS[
'STR_COUNTRY']);
1518 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDERED_PRODUCTS_LIST', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDERED_PRODUCTS_LIST']);
1519 $tpl->assign(
'STR_ADMIN_ID', $GLOBALS[
'STR_ADMIN_ID']);
1520 $tpl->assign(
'STR_REFERENCE', $GLOBALS[
'STR_REFERENCE']);
1521 $tpl->assign(
'STR_SIZE', $GLOBALS[
'STR_SIZE']);
1522 $tpl->assign(
'STR_COLOR', $GLOBALS[
'STR_COLOR']);
1523 $tpl->assign(
'STR_QUANTITY_SHORT', $GLOBALS[
'STR_QUANTITY_SHORT']);
1524 $tpl->assign(
'STR_ADMIN_COMMANDER_PRODUCT_LISTED_PRICE', $GLOBALS[
'STR_ADMIN_COMMANDER_PRODUCT_LISTED_PRICE']);
1525 $tpl->assign(
'STR_REMISE', $GLOBALS[
'STR_REMISE']);
1526 $tpl->assign(
'STR_UNIT_PRICE', $GLOBALS[
'STR_UNIT_PRICE']);
1527 $tpl->assign(
'STR_ADMIN_CUSTOM_ATTRIBUTES', $GLOBALS[
'STR_ADMIN_CUSTOM_ATTRIBUTES']);
1528 $tpl->assign(
'STR_ADMIN_VAT_PERCENTAGE', $GLOBALS[
'STR_ADMIN_VAT_PERCENTAGE']);
1529 $tpl->assign(
'STR_ADMIN_COMMANDER_ADD_PRODUCTS_TO_ORDER', $GLOBALS[
'STR_ADMIN_COMMANDER_ADD_PRODUCTS_TO_ORDER']);
1530 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_EMITTED_BY_GODCHILD', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_EMITTED_BY_GODCHILD']);
1531 $tpl->assign(
'STR_ADMIN_COMMANDER_THANK_SPONSOR_WITH_CREDIT_OF', $GLOBALS[
'STR_ADMIN_COMMANDER_THANK_SPONSOR_WITH_CREDIT_OF']);
1532 $tpl->assign(
'STR_ADMIN_COMMANDER_THANK_SPONSOR_WITH_CREDIT_EXPLAIN', $GLOBALS[
'STR_ADMIN_COMMANDER_THANK_SPONSOR_WITH_CREDIT_EXPLAIN']);
1533 $tpl->assign(
'STR_ADMIN_COMMANDER_GIVE_CREDIT', $GLOBALS[
'STR_ADMIN_COMMANDER_GIVE_CREDIT']);
1534 $tpl->assign(
'STR_ADMIN_COMMANDER_SHIPPING_ADDRESS', $GLOBALS[
'STR_ADMIN_COMMANDER_SHIPPING_ADDRESS']);
1535 $tpl->assign(
'STR_ADMIN_COMMANDER_MSG_PURCHASE_ORDER_SENT_BY_EMAIL_OK', $GLOBALS[
'STR_ADMIN_COMMANDER_MSG_PURCHASE_ORDER_SENT_BY_EMAIL_OK']);
1536 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_UPDATED', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_UPDATED']);
1537 $tpl->assign(
'STR_ADMIN_COMMANDER_AND_STOCKS_UPDATED', $GLOBALS[
'STR_ADMIN_COMMANDER_AND_STOCKS_UPDATED']);
1538 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_CREATED', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_CREATED']);
1539 $tpl->assign(
'STR_ADMIN_COMMANDER_LINK_ORDER_SUMMARY', $GLOBALS[
'STR_ADMIN_COMMANDER_LINK_ORDER_SUMMARY']);
1540 $tpl->assign(
'STR_ADMIN_COMMANDER_AFFILIATION_MODULE_MISSING', $GLOBALS[
'STR_ADMIN_COMMANDER_AFFILIATION_MODULE_MISSING']);
1541 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_STATUS_UPDATED', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_STATUS_UPDATED']);
1542 $tpl->assign(
'STR_ADMIN_COMMANDER_MSG_AVOIR_SENT_BY_EMAIL_OK', $GLOBALS[
'STR_ADMIN_COMMANDER_MSG_AVOIR_SENT_BY_EMAIL_OK']);
1543 $tpl->assign(
'STR_ADMIN_COMMANDER_WARNING_EDITION_NOT_ALLOWED', $GLOBALS[
'STR_ADMIN_COMMANDER_WARNING_EDITION_NOT_ALLOWED']);
1544 $tpl->assign(
'STR_ADMIN_COMMANDER_OPEN_IN_BROWSER', $GLOBALS[
'STR_ADMIN_COMMANDER_OPEN_IN_BROWSER']);
1545 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_BY_EMAIL_CONFIRM', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_BY_EMAIL_CONFIRM']);
1546 $tpl->assign(
'STR_ADMIN_COMMANDER_CREATE_OR_UPDATE_TITLE', $GLOBALS[
'STR_ADMIN_COMMANDER_CREATE_OR_UPDATE_TITLE']);
1547 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_PDF_BILL_BY_EMAIL', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_PDF_BILL_BY_EMAIL']);
1548 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_PDF_BILL_BY_EMAIL_CONFIRM', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_PDF_BILL_BY_EMAIL_CONFIRM']);
1549 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_PDF_PROFORMA_BY_EMAIL', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_PDF_PROFORMA_BY_EMAIL']);
1550 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_PDF_PROFORMA_BY_EMAIL_CONFIRM', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_PDF_PROFORMA_BY_EMAIL_CONFIRM']);
1551 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_PDF_QUOTATION_BY_EMAIL', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_PDF_QUOTATION_BY_EMAIL']);
1552 $tpl->assign(
'STR_ADMIN_COMMANDER_SEND_PDF_QUOTATION_BY_EMAIL_CONFIRM', $GLOBALS[
'STR_ADMIN_COMMANDER_SEND_PDF_QUOTATION_BY_EMAIL_CONFIRM']);
1553 $tpl->assign(
'STR_ADMIN_COMMANDER_WITH_PARTIAL_AMOUNT', $GLOBALS[
'STR_ADMIN_COMMANDER_WITH_PARTIAL_AMOUNT']);
1554 $tpl->assign(
'STR_ADMIN_COMMANDER_FIANET_FUNCTIONS', $GLOBALS[
'STR_ADMIN_COMMANDER_FIANET_FUNCTIONS']);
1555 $tpl->assign(
'STR_ADMIN_COMMANDER_INFORMATION_ON_THIS_ORDER', $GLOBALS[
'STR_ADMIN_COMMANDER_INFORMATION_ON_THIS_ORDER']);
1556 $tpl->assign(
'STR_ORDER_NUMBER', $GLOBALS[
'STR_ORDER_NUMBER']);
1557 $tpl->assign(
'STR_ADMIN_COMMANDER_PAYMENT_DATE', $GLOBALS[
'STR_ADMIN_COMMANDER_PAYMENT_DATE']);
1558 $tpl->assign(
'STR_ADMIN_COMMANDER_DELIVERY_DATE', $GLOBALS[
'STR_ADMIN_COMMANDER_DELIVERY_DATE']);
1559 $tpl->assign(
'STR_ADMIN_COMMANDER_INVOICE_DATE', $GLOBALS[
'STR_ADMIN_COMMANDER_INVOICE_DATE']);
1560 $tpl->assign(
'STR_ADMIN_COMMANDER_VAT_INTRACOM', $GLOBALS[
'STR_ADMIN_COMMANDER_VAT_INTRACOM']);
1561 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_DATE', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_DATE']);
1562 $tpl->assign(
'STR_ADMIN_COMMANDER_BILL_NUMBER', $GLOBALS[
'STR_ADMIN_COMMANDER_BILL_NUMBER']);
1563 $tpl->assign(
'STR_ADMIN_COMMANDER_BILL_NUMBER_EXPLAIN', $GLOBALS[
'STR_ADMIN_COMMANDER_BILL_NUMBER_EXPLAIN']);
1564 $tpl->assign(
'STR_ADMIN_COMMANDER_TRACKING_NUMBER', $GLOBALS[
'STR_ADMIN_COMMANDER_TRACKING_NUMBER']);
1565 $tpl->assign(
'STR_ADMIN_COMMANDER_PAYMENT_MEAN_EXPLAIN', $GLOBALS[
'STR_ADMIN_COMMANDER_PAYMENT_MEAN_EXPLAIN']);
1566 $tpl->assign(
'STR_ADMIN_COMMANDER_SHIPPING_COST_EXPLAIN', $GLOBALS[
'STR_ADMIN_COMMANDER_SHIPPING_COST_EXPLAIN']);
1567 $tpl->assign(
'STR_ADMIN_COMMANDER_SMALL_ORDERS_OVERCOST', $GLOBALS[
'STR_ADMIN_COMMANDER_SMALL_ORDERS_OVERCOST']);
1568 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_TOTAL', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_TOTAL']);
1569 $tpl->assign(
'STR_ADMIN_COMMANDER_INCLUDING_DISCOUNT', $GLOBALS[
'STR_ADMIN_COMMANDER_INCLUDING_DISCOUNT']);
1570 $tpl->assign(
'STR_ADMIN_COMMANDER_COUPON_USED', $GLOBALS[
'STR_ADMIN_COMMANDER_COUPON_USED']);
1571 $tpl->assign(
'STR_ADMIN_COMMANDER_INCLUDING_CREDIT_NOTE', $GLOBALS[
'STR_ADMIN_COMMANDER_INCLUDING_CREDIT_NOTE']);
1572 $tpl->assign(
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION', $GLOBALS[
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION']);
1573 $tpl->assign(
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION_PAYMENT_STATUS', $GLOBALS[
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION_PAYMENT_STATUS']);
1574 $tpl->assign(
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION_PAYMENT_STATUS_TO_COME', $GLOBALS[
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION_PAYMENT_STATUS_TO_COME']);
1575 $tpl->assign(
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION_PAYMENT_STATUS_DONE', $GLOBALS[
'STR_ADMIN_COMMANDER_AFFILIATE_COMMISSION_PAYMENT_STATUS_DONE']);
1576 $tpl->assign(
'STR_ADMIN_COMMANDER_AFFILIATE_RELATED_TO_ORDER', $GLOBALS[
'STR_ADMIN_COMMANDER_AFFILIATE_RELATED_TO_ORDER']);
1577 $tpl->assign(
'STR_ADMIN_COMMANDER_GIFT_POINTS', $GLOBALS[
'STR_ADMIN_COMMANDER_GIFT_POINTS']);
1578 $tpl->assign(
'STR_ADMIN_COMMANDER_NOT_ATTRIBUTED', $GLOBALS[
'STR_ADMIN_COMMANDER_NOT_ATTRIBUTED']);
1579 $tpl->assign(
'STR_ADMIN_COMMANDER_ATTRIBUTED', $GLOBALS[
'STR_ADMIN_COMMANDER_ATTRIBUTED']);
1580 $tpl->assign(
'STR_ADMIN_COMMANDER_CANCELED', $GLOBALS[
'STR_ADMIN_COMMANDER_CANCELED']);
1581 $tpl->assign(
'STR_ADMIN_COMMANDER_CLIENT_INFORMATION', $GLOBALS[
'STR_ADMIN_COMMANDER_CLIENT_INFORMATION']);
1582 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDER_AUTHOR_EMAIL', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDER_AUTHOR_EMAIL']);
1583 $tpl->assign(
'STR_ADMIN_COMMANDER_BILL_ADDRESS_EXPLAIN', $GLOBALS[
'STR_ADMIN_COMMANDER_BILL_ADDRESS_EXPLAIN']);
1584 $tpl->assign(
'STR_ADMIN_COMMANDER_SHIPPING_ADDRESS', $GLOBALS[
'STR_ADMIN_COMMANDER_SHIPPING_ADDRESS']);
1585 $tpl->assign(
'STR_ADMIN_COMMANDER_ORDERED_PRODUCTS_LIST', $GLOBALS[
'STR_ADMIN_COMMANDER_ORDERED_PRODUCTS_LIST']);
1586 $tpl->assign(
'STR_ADMIN_COMMANDER_PRICES_MUST_BE_IN_ORDER_CURRENCY', $GLOBALS[
'STR_ADMIN_COMMANDER_PRICES_MUST_BE_IN_ORDER_CURRENCY']);
1587 $tpl->assign(
'STR_ADMIN_COMMANDER_PRODUCT_NAME', $GLOBALS[
'STR_ADMIN_COMMANDER_PRODUCT_NAME']);
1588 $tpl->assign(
'STR_ADMIN_COMMANDER_CURRENCY_EXCHANGE_USED', sprintf($GLOBALS[
'STR_ADMIN_COMMANDER_CURRENCY_EXCHANGE_USED'], $GLOBALS[
'site_parameters'][
'symbole']));
1589 $tpl->assign(
'STR_ADMIN_COMMANDER_ADD_LINE_TO_ORDER', $GLOBALS[
"STR_ADMIN_COMMANDER_ADD_LINE_TO_ORDER"]);
1590 $tpl->assign(
'STR_ADMIN_UTILISATEURS_CREATE_ORDER', $GLOBALS[
"STR_ADMIN_UTILISATEURS_CREATE_ORDER"]);
1591 $tpl->assign(
'STR_ADMIN_FORM_SAVE_CHANGES', $GLOBALS[
"STR_ADMIN_FORM_SAVE_CHANGES"]);
1593 return $tpl->fetch();
1595 return $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
$GLOBALS[
"STR_ADMIN_COMMANDER_NO_ORDER_WITH_ID_FOUND"],
$id)))->fetch();
1610 $sql =
"SELECT email
1615 if (!empty(
$result[
'email'])) {
1616 if (
vb($_REQUEST[
'mode']) !=
'sendfacturepdf') {
1621 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_MSG_ORDER_SENT_OK'], intval(
$frm[
'id']),
$result[
'email'])))->fetch();
1623 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_ERR_NO_EMAIL_KNOWN_FOR_ORDER'], intval(
$frm[
'id']))))->fetch();
1626 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_ERR_NO_EMAIL_KNOWN_FOR_ORDER'], intval(
$frm[
'id']))))->fetch();
1642 $total_produit_ht = 0;
1644 $total_remise_ht = 0;
1645 $frm[
'total_ecotaxe_ttc'] = 0;
1646 $frm[
'total_ecotaxe_ht'] = 0;
1647 $frm[
'total_poids'] = 0;
1648 $frm[
'total_points'] = 0;
1649 if (!isset(
$frm[
'delivery_tracking'])) {
1650 $frm[
'delivery_tracking'] = null;
1652 if (empty(
$frm[
'societe2']) && empty(
$frm[
'nom2']) && empty(
$frm[
'prenom2'])) {
1663 if(!empty(
$frm[
'adresses_fields_array'])) {
1665 foreach (
$frm[
'adresses_fields_array'] as $this_item) {
1666 if (empty(
$frm[$this_item .
'2'])) {
1667 $frm[$this_item .
'2'] =
vb(
$frm[$this_item .
'1']);
1672 if (empty(
$frm[
'nb_produits'])) {
1673 $frm[
'nb_produits'] = 5;
1675 if (empty(
$frm[
'lang'])) {
1678 if (empty(
$frm[
'site_id'])) {
1680 if (!empty(
$_SESSION[
'session_admin_multisite'])) {
1689 if (empty(
$frm[
'commandeid'])) {
1690 if (!empty(
$frm[
'email1'])) {
1692 $sql =
"SELECT id_utilisateur, email
1693 FROM peel_utilisateurs
1698 $frm[
'email'] = $u->email;
1699 $frm[
'id_utilisateur'] = $u->id_utilisateur;
1703 $new_user_infos = array(
'priv' =>
'util',
1704 'email' =>
vb(
$frm[
'email1']),
1705 'mot_passe' =>
vb(
$frm[
'mot_passe']),
1706 'prenom' =>
vb(
$frm[
'prenom1']),
1707 'nom' =>
vb(
$frm[
'nom1']),
1708 'societe' =>
vb(
$frm[
'societe1']),
1709 'telephone' =>
vb(
$frm[
'contact1']),
1710 'adresse' =>
vb(
$frm[
'adresse1']),
1711 'code_postal' =>
vb(
$frm[
'code_postal1']),
1712 'ville' =>
vb(
$frm[
'ville1']),
1713 'pays' =>
vb(
$frm[
'pays1']),
1719 $frm[
'id_utilisateur'] = 0;
1727 if((!empty(
$frm[
'autocomplete_order_adresses_with_account_info_if_order_email_change']) &&
$result[
'email'] !=
$frm[
'email']) || !empty(
$frm[
'autocomplete_order_adresses_with_account_info'])) {
1730 $query =
query(
'SELECT societe, prenom, nom_famille AS nom, adresse, code_postal, ville, pays, email, telephone AS contact
1731 FROM peel_utilisateurs
1734 if (!empty(
$frm[
'adresses_fields_array'])) {
1736 foreach(
$frm[
'adresses_fields_array'] as $this_item) {
1745 if ((empty(
$frm[
'currency_rate']) || empty(
$frm[
'devise']))) {
1746 if (isset(
$frm[
'devise']) &&
$frm[
'devise'] !=
$GLOBALS[
'site_parameters'][
'code']) {
1748 $res =
query(
"SELECT p.conversion
1753 $frm[
'currency_rate'] = $tab[
'conversion'];
1757 $frm[
'currency_rate'] =
$GLOBALS[
'site_parameters'][
'conversion'];
1761 $sqlPays =
'SELECT p.id, p.pays_' .
$frm[
'lang'] .
' as pays, p.zone, z.tva, z.on_franco
1770 if(!isset(
$frm[
'apply_vat'])){
1776 $frm[
'zoneId'] =
false;
1778 if(!isset(
$frm[
'apply_vat'])){
1780 $frm[
'apply_vat'] =
false;
1782 $frm[
'zoneFranco'] =
'';
1785 $product_order_array = array();
1792 foreach ($product_order_array as
$i) {
1793 if (isset(
$frm[
"p" . $i]) && isset(
$frm[
"q" . $i]) && isset(
$frm[
"t" . $i])) {
1800 $real_stock_used = intval(
$frm[
"q" . $i]);
1815 if(!
$frm[
'apply_vat']){
1817 $total_produit = $total_produit_ht;
1818 $total_remise = $total_remise_ht;
1825 foreach ($product_order_array as $i) {
1826 if (!isset(
$frm[
"l" . $i]) || empty(
$frm[
"q" . $i])) {
1832 if (empty($quantite)) {
1837 $prix_cat_ht = $prix_cat / (1 +
vn(
$frm[
"t" . $i]) / 100);
1840 $remise_ht = $remise / (1 +
$frm[
"t" .
$i] / 100);
1846 $prix_cat = $prix_cat_ht * (1 +
vn(
$frm[
"t" . $i]) / 100);
1849 $remise = $remise_ht * (1 +
vn(
$frm[
"t" . $i]) / 100);
1852 $prix = $prix_ht * (1 +
vn(
$frm[
"t" . $i]) / 100);
1854 if(!
$frm[
'apply_vat']){
1857 $prix_cat = $prix_cat_ht;
1859 $remise = $remise_ht;
1869 $real_stock_used = $quantite;
1871 $total_prix =
$prix * $real_stock_used;
1872 $total_prix_ht = $prix_ht * $real_stock_used;
1873 $tva = $total_prix - $total_prix_ht;
1875 if(!empty(
$frm[
"id" . $i])) {
1876 $this_article[
'product_id'] =
$frm[
"id" .
$i];
1881 $this_article[
'product_name'] = $nom;
1882 $this_article[
'quantite'] = $quantite;
1883 if (!empty(
$frm[
'color_' . $i]) && !is_numeric(
$frm[
'color_' . $i])) {
1884 $this_article[
'couleurId'] = 0;
1885 $this_article[
'couleur'] =
vn(
$frm[
'color_' . $i]);
1887 $this_article[
'couleurId'] =
vn(
$frm[
'color_' . $i]);
1889 if (!empty(
$frm[
'size_' . $i]) && !is_numeric(
$frm[
'size_' . $i])) {
1890 $this_article[
'tailleId'] = 0;
1891 $this_article[
'taille'] =
vn(
$frm[
'size_' . $i]);
1893 $this_article[
'tailleId'] =
vn(
$frm[
'size_' . $i]);
1895 $this_article[
'giftlist_owners'] =
vn(
$frm[
'giftlist_owners_' . $i]);
1896 $this_article[
'prix'] =
$prix;
1897 $this_article[
'prix_ht'] = $prix_ht;
1898 $this_article[
'prix_cat'] = $prix_cat;
1899 $this_article[
'prix_cat_ht'] = $prix_cat_ht;
1900 $this_article[
'total_prix'] = $total_prix;
1901 $this_article[
'total_prix_ht'] = $total_prix_ht;
1902 $this_article[
'tva_percent'] =
$frm[
"t" .
$i];
1903 $this_article[
'tva'] = $tva;
1904 $this_article[
'reference'] =
vb(
$frm[
"ref" . $i]);
1905 $this_article[
'percent_remise_produit'] =
vn($remise_percent);
1906 $this_article[
'remise'] = $remise * $quantite;
1907 $this_article[
'remise_ht'] = $remise_ht * $quantite;
1909 $product_ecotaxe_infos_query =
query(
"SELECT e.*
1910 FROM peel_ecotaxes e
1911 INNER JOIN peel_produits p ON e.id = p.id_ecotaxe AND " .
get_filter_site_cond(
'produits',
'p') .
"
1912 WHERE p.id='" . intval($this_article[
'product_id']) .
"' AND " .
get_filter_site_cond(
'ecotaxes',
'e') .
"");
1913 if ($product_ecotaxe_infos =
fetch_assoc($product_ecotaxe_infos_query)) {
1914 if (!empty($product_ecotaxe_infos[
'id'])) {
1915 $this_article[
'ecotaxe_ttc'] = $product_ecotaxe_infos[
'prix_ttc'];
1916 $this_article[
'ecotaxe_ht'] = $product_ecotaxe_infos[
'prix_ht'];
1918 $this_article[
'ecotaxe_ttc'] = 0;
1919 $this_article[
'ecotaxe_ht'] = 0;
1922 $frm[
'total_ecotaxe_ht'] += $this_article[
'ecotaxe_ht'];
1923 $frm[
'total_ecotaxe_ttc'] += $this_article[
'ecotaxe_ttc'];
1929 $this_article[
'tnt_parcel_number'] =
vn(
$frm[
'tnt_parcel_number_' . $i]);
1931 $this_article[
'nom_attribut'] =
vn(
$frm[
'nom_attribut_' . $i]);
1932 $this_article[
'total_prix_attribut'] =
vn(
$frm[
'total_prix_attribut_' . $i]);
1934 $total_prix_attribut_ht = $this_article[
'total_prix_attribut'] / (1 + $tva / 100);
1940 $frm[
'total_poids'] += $this_article[
'poids'];
1941 $this_article[
'option'] =
$product_object->format_prices(
$product_object->configuration_size_price_ht +
$product_object->configuration_total_original_price_attributs_ht,
$frm[
'apply_vat'],
false,
false,
false) + $this_article[
'total_prix_attribut'];
1942 $this_article[
'option_ht'] =
$product_object->format_prices(
$product_object->configuration_size_price_ht +
$product_object->configuration_total_original_price_attributs_ht,
false,
false,
false,
false) + $total_prix_attribut_ht;
1944 $this_article[
'option'] = round($this_article[
'option'], 2);
1945 $this_article[
'option_ht'] = round($this_article[
'option_ht'], 2);
1946 $this_article[
'points'] =
$product_object->points * $this_article[
'quantite'];
1947 $frm[
'total_points'] += $this_article[
'points'];
1954 if (!empty($this_article[
'product_id']) || !empty($this_article[
'product_name']) || !empty($this_article[
'reference']) || !empty($this_article[
'prix'])) {
1956 $articles[
$i] = $this_article;
1960 if (!empty(
$GLOBALS[
'site_parameters'][
'mode_transport']) && (!isset(
$frm[
'cout_transport']) ||
$frm[
'cout_transport'] ==
'')) {
1963 if ($delivery_cost_infos !==
false) {
1964 $shipping_costs[
'tva_percent'] = (
$frm[
'apply_vat'] ? $delivery_cost_infos[
'tva'] : 0);
1965 $cout_transport_ht = $delivery_cost_infos[
'cost_ht'];
1968 $shipping_costs[
'tva_percent'] = 0;
1969 $cout_transport_ht = 0;
1971 $cout_transport =
vn($cout_transport_ht) * (1 +
vn($shipping_costs[
'tva_percent']) / 100);
1978 if (!empty(
$frm[
'type_transport'])) {
1980 $frm[
'typeId'] =
$frm[
'type_transport'];
1983 $treshold_to_use =
$GLOBALS[
'site_parameters'][
'minimal_amount_to_order_reve'];
1985 $treshold_to_use =
$GLOBALS[
'site_parameters'][
'minimal_amount_to_order'];
1987 if (
$frm[
'small_order_overcost_amount'] ==
'') {
1988 if($total_produit <
$GLOBALS[
'site_parameters'][
'small_order_overcost_limit'] && $total_produit >= $treshold_to_use) {
1989 $small_order_overcost_amount =
$GLOBALS[
'site_parameters'][
'small_order_overcost_amount'];
1991 $small_order_overcost_amount = 0;
1997 if (!empty(
$frm[
'avoir'])) {
2005 $frm[
'sub_total'] =
vn($total_produit) -
vn($avoir) +
vn($cout_transport) +
vn($small_order_overcost_amount);
2006 $frm[
'sub_total_ht'] =
vn($total_produit_ht) +
vn($cout_transport_ht) + (
vn($small_order_overcost_amount) -
vn($tva_small_order_overcost));
2009 $montant =
$frm[
'sub_total'] +
vn(
$frm[
'tarif_paiement']);
2010 $montant_ht =
$frm[
'sub_total_ht'] +
vn(
$frm[
'tarif_paiement_ht']);
2014 $frm[
'small_order_overcost_amount'] = $small_order_overcost_amount;
2015 $frm[
'tva_small_order_overcost'] = $tva_small_order_overcost;
2016 $frm[
'montant'] = $montant;
2017 $frm[
'montant_ht'] = $montant_ht;
2019 $frm[
'total_produit'] = $total_produit;
2020 $frm[
'total_produit_ht'] = $total_produit_ht;
2021 $frm[
'tva_total_produit'] = $total_produit - $total_produit_ht;
2022 $frm[
'total_remise'] = $total_remise;
2023 $frm[
'total_remise_ht'] = $total_remise_ht;
2024 $frm[
'tva_total_remise'] = $total_remise - $total_remise_ht;
2025 $frm[
'cout_transport'] =
vn($cout_transport);
2026 $frm[
'cout_transport_ht'] =
vn($cout_transport_ht);
2027 $frm[
'tva_cout_transport'] =
vn($cout_transport) -
vn($cout_transport_ht);
2028 $frm[
'avoir'] = $avoir;
2044 function get_order_line($line_data, $color_options_html, $size_options_html, $tva_options_html,
$i)
2046 if (empty($size_options_html)) {
2047 $size_options_html =
'<option value="">-</option>';
2049 if (empty($color_options_html)) {
2050 $color_options_html =
'<option value="">-</option>';
2052 if (empty($tva_options_html)) {
2053 $tva_options_html =
'<option value="">-</option>';
2057 $prix_cat_displayed = $line_data[
'prix_cat'];
2058 $purchase_prix_displayed = $line_data[
'purchase_prix'];
2059 $unit_fixed_remise_displayed = $line_data[
'remise'];
2061 $prix_cat_displayed = $line_data[
'prix_cat_ht'];
2062 $purchase_prix_displayed = $line_data[
'purchase_prix_ht'];
2063 $unit_fixed_remise_displayed = $line_data[
'remise_ht'];
2066 if (is_numeric($purchase_prix_displayed)) {
2069 $unit_fixed_remise_displayed = round($unit_fixed_remise_displayed / $line_data[
'quantite'],2);
2072 $attribute_display = str_replace(
"\n",
'<br />',
display_option_image(
vb($line_data[
'nom_attribut']),
true));
2075 $output = tr_rollover(
$i,
true, null, null,
'sortable_'.
$i) .
'
2077 <img src="' .
$GLOBALS[
'administrer_url'] .
'/images/b_drop.png" alt="'.String::str_form_value(
$GLOBALS[
'STR_DELETE']) .
'" onclick="bootbox.confirm(\''.filtre_javascript(
$GLOBALS[
"STR_ADMIN_PRODUCT_ORDERED_DELETE_CONFIRM"],
true,
true,
true) .
'\',
function(result) {
if(result) {delete_products_list_line(
' . $i . ', \
'order\');}}); return false;" title="' .
String::str_form_value(
$GLOBALS[
"STR_ADMIN_PRODUCT_ORDERED_DELETE"]) .
'" style="cursor:pointer" />
2078 <input name="giftlist_owners_' .
$i .
'" type="hidden" value="' .
String::str_form_value(
vb($line_data[
'listcadeaux_owner'])) .
'" />
2079 <input name="nom_attribut_' .
$i .
'" type="hidden" value="' .
String::str_form_value(
vb($line_data[
'nom_attribut'])) .
'" />';
2082 <input name="tnt_parcel_number_' .
$i .
'" type="hidden" value="' .
String::str_form_value(
vb($line_data[
'tnt_parcel_number'])) .
'" />';
2087 <input class="form-control" name="id' .
$i .
'" style="width:100%" type="number" value="' .
String::str_form_value(
vb($line_data[
'id'])) .
'" />
2090 <input class="form-control" id="ref' .
$i .
'" name="ref' .
$i .
'" style="width:100%" type="text" value="' .
String::str_form_value(
vb($line_data[
'ref'])) .
'" />
2093 <input class="form-control" type="text" id="l' .
$i .
'" name="l' .
$i .
'" style="width:100%" value="' .
String::str_form_value($line_data[
'nom']) .
'" />' . (isset($line_data[
'on_download'])?($line_data[
'on_download'] == 1?
'<br /><a href="' .
get_current_url(
false) .
'?mode=download">'.$GLOBALS[
"STR_ADMIN_PRODUITS_NUMERIC_PRODUCT_SEND"].
'</a>':
''):
'') .
'
2095 <td id="s' .
$i .
'" class="center"><select style="width:64px" name="size_' .
$i .
'" class="form-control">' . $size_options_html .
'</select></td>
2096 <td id="c' .
$i .
'" class="center"><select style="width:64px" name="color_' .
$i .
'" class="form-control">' . $color_options_html .
'</select></td>
2097 <td><input class="form-control" type="number" name="q' .
$i .
'" style="width:100%" value="' .
String::str_form_value($line_data[
'quantite']) .
'" id="q' .
$i .
'" /></td>
2098 <td><input class="form-control" type="text" name="p_cat' .
$i .
'" style="width:100%" value="' .
String::str_form_value($prix_cat_displayed) .
'" id="p_cat' .
$i .
'" onkeyup="order_line_calculate(' .
$i .
', \'percentage\');" /></td>
2099 <td><input class="form-control" type="text" name="remis' .
$i .
'" style="width:100%" value="' .
String::str_form_value($unit_fixed_remise_displayed) .
'" id="remis' .
$i .
'" onkeyup="order_line_calculate(' .
$i .
', \'amount\');" /></td>
2100 <td><input class="form-control" type="text" name="perc' .
$i .
'" style="width:100%" value="' .
String::str_form_value($line_data[
'percent']) .
'" id="perc' .
$i .
'" onkeyup="order_line_calculate(' .
$i .
', \'percentage\');" /></td>
2101 <td><input class="form-control" type="text" name="p' .
$i .
'" style="width:100%" value="' .
String::str_form_value($purchase_prix_displayed) .
'" id="p' .
$i .
'" onkeyup="order_line_calculate(' .
$i .
', \'final\');" /></td>
2102 <td id="t' .
$i .
'">
2103 <select name="t' .
$i .
'" class="form-control">' . $tva_options_html .
'</select>
2105 <td> ' .
vb($attribute_display) .
' </td>';
2108 if (!empty($line_data[
'image'])) {
2110 <a target="_image" href="' .
String::str_form_value(
$GLOBALS[
'repertoire_upload'].
'/'.$line_data[
'image']) .
'"><img src="' . $line_data[
'image_thumbs'] .
'" alt="'.String::str_form_value($line_data[
'nom']) .
'" /></a>';
2129 $countResultats = 0;
2131 $width[
'date'] = 12;
2132 $width[
'login'] = 8;
2133 $width[
'action'] = 10;
2134 $width[
'raison'] = 5;
2135 $width[
'remarque'] = 25;
2136 $width[
'data'] = 25;
2138 $q =
query(
'SELECT a.id_user, a.id_membre, a.action, a.data, a.raison, a.remarque, a.date, u.id_utilisateur, u.pseudo, u.email
2139 FROM peel_admins_actions a
2140 LEFT JOIN peel_utilisateurs u ON u.id_utilisateur=a.id_user AND ' .
get_filter_site_cond(
'utilisateurs',
'u') .
'
2141 WHERE a.id_membre="' . intval($user_id) .
'" AND ' .
get_filter_site_cond(
'admins_actions',
'a') .
'
2142 ORDER BY a.date DESC
2145 if ($countResultats == 0) {
2147 <table style="background-color:#FFFFFF; border:1px; width:100%">
2149 <th class="menu" style="width:' . $width[
'date'] .
'%;">'.$GLOBALS[
'STR_DATE'].
'</th>
2150 <th class="menu" style="width:' . $width[
'login'] .
'%;">'.$GLOBALS[
'STR_BY'].
'</th>
2151 <th class="menu" style="width:' . $width[
'action'] .
'%;">'.$GLOBALS[
'STR_ADMIN_ACTION'].
'</th>
2152 <th class="menu" style="width:' . $width[
'data'] .
'%;">'.$GLOBALS[
'STR_ADMIN_ADMIN_ACTIONS_DATA'].
'</th>
2153 <th class="menu" style="width:' . $width[
'raison'] .
'%;">'.$GLOBALS[
'STR_ADMIN_REASON'].
'</th>
2154 <th class="menu" style="width:' . $width[
'remarque'] .
'%;">'.$GLOBALS[
'STR_COMMENTS'].
'</th>
2158 $texte = nl2br($res[
'remarque']);
2160 if ($res[
'data'] !=
"" && $res[
'action'] ==
'SEND_EMAIL') {
2162 $data = explode(
'_', $res[
'data']);
2163 if (count(
$data) == 2) {
2164 $template_id =
$data[1];
2165 if (is_numeric($template_id)) {
2166 $result_template =
query(
'SELECT name
2167 FROM peel_email_template
2168 WHERE id="' . intval($template_id) .
'" AND ' .
get_filter_site_cond(
'email_template', null) .
'
2171 $res[
'data'] =
'<b>'.$GLOBALS[
'STR_ADMIN_EMAIL_TEMPLATE'].
'</b> : <br />' . (strpos($res[
'remarque'],
$GLOBALS[
'STR_ADMIN_MUTIPLE_SENDING']) !==
false?
'<i style="color:red;">'.$GLOBALS[
'STR_ADMIN_MUTIPLE_SENDING'].
'</i><br />':
'') . $template_text[
"name"];
2177 <tr' . (($countResultats % 2) ?
'' :
' class="line"') .
'>
2178 <td class="center">' . strftime(
'%d/%m/%Y %H:%M:%S', strtotime($res[
'date'])) .
'</td>
2179 <td class="center">' . (!empty($res[
'pseudo'])?$res[
'pseudo']:$res[
'email']) .
'</td>
2180 <td class="center">' . $res[
'action'] .
'</td>
2181 <td class="center">' . $res[
'data'] .
'</td>
2182 <td class="center">' . $res[
'raison'] .
'</td>
2183 <td class="justify">' . htmlspecialchars($res[
'remarque']) .
'</td>
2187 if ($countResultats > 0) {
2190 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_NO_ADMIN_ACTION_FOUND_FOR_THIS_USER']))->fetch();
2211 query(
'INSERT INTO peel_admins_actions(id_user, action, id_membre, data, remarque, raison, date, site_id)
2226 if (!empty(
$frm[
'client_info'])) {
2228 $sql_inner .=
' INNER JOIN peel_utilisateurs u ON c.user_id=u.id_utilisateur AND ' .
get_filter_site_cond(
'utilisateurs',
'u') .
'';
2230 if (!empty(
$frm[
'user_ip'])) {
2231 $sql_cond .=
' AND CONCAT(FLOOR(c.user_ip/(256*256*256)), ".", (FLOOR(c.user_ip/(256*256)))%256, ".", (FLOOR(c.user_ip/256))%256, ".", c.user_ip%256) LIKE "%' .
nohtml_real_escape_string(
$frm[
'user_ip']) .
'%"';
2233 if (!empty(
$frm[
'user_id'])) {
2236 if (!empty(
$frm[
'date'])) {
2241 FROM peel_utilisateur_connexions c
2246 $HeaderTitlesArray = array(
'id' =>
$GLOBALS[
"STR_ADMIN_ID"],
'date' =>
$GLOBALS[
'STR_DATE'],
'user_ip' =>
$GLOBALS[
"STR_ADMIN_REMOTE_ADDR"]);
2248 if (!class_exists(
'geoIP')) {
2249 include_once(
$GLOBALS[
'dirroot'] .
'/modules/geoip/class/geoIP.php');
2251 $geoIP =
new geoIP();
2252 $HeaderTitlesArray[] =
$GLOBALS[
'STR_COUNTRY'].
'-IP';
2253 $HeaderTitlesArray[] =
$GLOBALS[
'STR_COUNTRY'];
2256 $HeaderTitlesArray[] =
$GLOBALS[
"STR_MODULE_ANNONCES_ADS"];
2258 $HeaderTitlesArray[
'user_login'] =
$GLOBALS[
"STR_ADMIN_LOGIN"];
2259 $HeaderTitlesArray[
'user_id'] =
$GLOBALS[
"STR_ADMIN_USER"];
2260 $Links->HeaderTitlesArray = $HeaderTitlesArray;
2261 $Links->OrderDefault =
'id';
2262 $Links->SortDefault =
'DESC';
2266 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_connexion_user_liste.tpl');
2268 $tpl->assign(
'date',
vb($_GET[
'date']));
2269 $tpl->assign(
'user_ip',
vb($_GET[
'user_ip']));
2270 if (empty(
$GLOBALS[
'site_parameters'][
'pseudo_is_not_used'])) {
2271 $tpl->assign(
'client_info',
vb($_GET[
'client_info']));
2274 $tpl->assign(
'user_id',
vb($_GET[
'user_id']));
2277 $tpl->assign(
'display_search_form', $display_search_form);
2280 $tpl_results = array();
2281 $tpl->assign(
'links_header_row',
$Links->getHeaderRow());
2286 $tpl_result = array(
'id' => $connexion[
'id'],
2288 'ip' => (!
a_priv(
'demo') ? long2ip($connexion[
'user_ip']):
'0.0.0.0 [demo]'),
2289 'user_id' => (!
a_priv(
'demo')?
'<a href="' .
$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . intval($connexion[
'user_id']) .
'">'.$connexion[
'user_id'].
'</a>':
'private [demo]'),
2290 'prenom' =>
vb($current_user[
'prenom']),
2291 'nom_famille' =>
vb($current_user[
'nom_famille']),
2292 'user_login_displayed' => (!
a_priv(
'demo')?(
vb($current_user[
'etat'])?
'<a href="' .
$GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . intval($connexion[
'user_id']) .
'">'.$connexion[
'user_login'].
'</a>':
'<span style="color:#AAAAAA">'.$connexion[
'user_login'].
'</span>'):
'private [demo]')
2294 $rollover_style = null;
2295 if(!empty($geoIP)) {
2296 $country_id = $geoIP->geoIPCountryIDByAddr(long2ip($connexion[
'user_ip']));
2297 foreach(array(
'country_ip' => $country_id,
'country_account' =>
vn($current_user[
'pays'])) as $this_key => $this_value) {
2298 $sql =
'SELECT iso, pays_' .
$_SESSION[
'session_langue'] .
'
2306 $tpl_result[$this_key] =
'?';
2309 if($country_id != $current_user[
'pays']) {
2310 $rollover_style =
'background-color:#FFAAAA';
2314 $tpl_result[
'active_ads_count'] = $current_user[
'active_ads_count'];
2316 $tpl_result[
'tr_rollover'] = tr_rollover(
$i,
true, $rollover_style);
2317 $tpl_results[] = $tpl_result;
2320 if (!empty($geoIP)) {
2321 $geoIP->geoIPClose();
2323 $tpl->assign(
'results', $tpl_results);
2324 $tpl->assign(
'links_multipage',
$Links->GetMultipage());
2326 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
2327 $tpl->assign(
'STR_ADMIN_CONNEXION_USER_TITLE',
$GLOBALS[
'STR_ADMIN_CONNEXION_USER_TITLE']);
2328 $tpl->assign(
'STR_ADMIN_DATE',
$GLOBALS[
'STR_ADMIN_DATE']);
2329 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
2330 $tpl->assign(
'STR_ADMIN_REMOTE_ADDR',
$GLOBALS[
'STR_ADMIN_REMOTE_ADDR']);
2331 $tpl->assign(
'STR_ADMIN_USER',
$GLOBALS[
'STR_ADMIN_USER']);
2333 $tpl->assign(
'STR_ADMIN_CONNEXION_NOTHING_FOUND',
$GLOBALS[
'STR_ADMIN_CONNEXION_NOTHING_FOUND']);
2334 return $tpl->fetch();
2336 return $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_ADMIN_NO_RESULT']))->fetch();
2347 $countResultats = 0;
2349 $width[
'date'] = 12;
2350 $width[
'login'] = 8;
2351 $width[
'action'] = 10;
2352 $width[
'raison'] = 5;
2353 $width[
'remarque'] = 25;
2354 $width[
'data'] = 25;
2356 $q =
query(
'SELECT paa.*,u.pseudo AS pseudo_membre
2357 FROM peel_admins_actions paa
2358 LEFT JOIN peel_utilisateurs u ON u.id_utilisateur= ' . intval($user_id) .
' AND ' .
get_filter_site_cond(
'utilisateurs',
'u') .
'
2359 WHERE paa.id_user= ' . intval(
$_SESSION[
'session_utilisateur'][
'id_utilisateur']) .
' AND paa.id_membre = ' . intval($user_id) .
' AND ((paa.action = "PHONE_EMITTED") OR (paa.action = "PHONE_RECEIVED")) AND paa.data="NOT_ENDED_CALL" AND ' .
get_filter_site_cond(
'admins_actions',
'paa') .
'
2360 ORDER BY paa.date DESC
2364 <form class="entryform form-inline" method="post" id="phone" action="' .
get_current_url(
false) .
'#phone_section" >
2365 <input type="hidden" name="mode" value="phone_call" />
2366 <input type="hidden" name="id_utilisateur" value="' . intval($user_id) .
'" />';
2370 <hr /><h2 id="phone_section" style="color:green">' . sprintf(($res[
'action'] ==
'PHONE_EMITTED'?
$GLOBALS[
"STR_ADMIN_UTILISATEURS_CALL_STARTED_EMITTED"]:
$GLOBALS[
"STR_ADMIN_UTILISATEURS_CALL_STARTED_RECEIVED"]),
vb($res[
'pseudo_membre'])) .
' : '.$GLOBALS[
"STR_ADMIN_UTILISATEURS_CALL_STARTED_ON"].
' ' .
get_formatted_date($res[
'date']) .
'</h2>
2373 <table class="full_width">
2375 <th>'.$GLOBALS[
"STR_COMMENTS"].
'</th>
2377 <textarea class="form-control" name="form_phone_comment" rows="5" cols="50" id="phone_comment" >' . (!empty($res[
'remarque'])?
vb($res[
'remarque']):
'') .
'</textarea>
2382 <td class="center"><input name="turn_off_phone" type="submit" value="'.$GLOBALS[
"STR_ADMIN_UTILISATEURS_CALL_CLOSE"].
'" class="btn btn-primary" /></td>
2388 <h2 id="phone_section">'.$GLOBALS[
"STR_ADMIN_UTILISATEURS_MANAGE_CALLS"].
'</h2>
2392 <th>'.
$GLOBALS[
"STR_COMMENTS"].
'</th>
2396 <textarea class="form-control" name="form_phone_comment" rows="5" cols="50" id="phone_comment" >' . (!empty($_POST[
'phone_comment'])?$_POST[
'phone_comment']:
'') .
'</textarea>
2402 <td class="center" style="width:50%;">
2403 <table class="full_width">
2405 <td class="center"><input name="phone_emitted_submit" type="submit" value="'.
$GLOBALS[
"STR_ADMIN_UTILISATEURS_CALL_INITIATE"].
'" class="btn btn-primary" /></td>
2409 <td class="center" style="width:50%;">
2410 <table class="full_width">
2412 <td class="center"><input name="phone_received_submit" type="submit" value="'.
$GLOBALS[
"STR_ADMIN_UTILISATEURS_CALL_RECEIVED_INITIATE"].
'" class="btn btn-primary" /></td>
2440 foreach(array(
'seg_buy',
'seg_want',
'seg_think',
'seg_followed',
'seg_who') as $this_field) {
2441 if (!isset($user_infos[$this_field]) || !isset($tabSeg[$this_field][$user_infos[$this_field]])) {
2443 }
elseif ($tabSeg[$this_field][$user_infos[$this_field]] == 0) {
2447 $points += $tabSeg[$this_field][$user_infos[$this_field]];
2459 return array(
'independant' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_INDEPENDANT"],
2460 'partner' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_PARTNER"],
2461 'company_small' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_COMPANY_SMALL"],
2462 'company_medium' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_COMPANY_MEDIUM"],
2463 'company_big' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_COMPANY_BIG"],
2464 'person' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_PERSON"],
2465 'no_info' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WHO_NO_INFO"]);
2474 return array(
'independant' => 2,
2476 'company_small' => 4,
2477 'company_medium' => 5,
2488 return array(
'one_old' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_BUY_ONE_OLD"],
2489 'one_recent' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_BUY_ONE_RECENT"],
2490 'multi_old' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_BUY_MULTI_OLD"],
2491 'multi_recent' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_BUY_MULTI_RECENT"],
2492 'no_info' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_BUY_NO_INFO"]);
2501 return array(
'no' => 16,
2505 'multi_recent' => 18,
2515 return array(
'min_contact' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WANTS_MIN_CONTACT"],
2516 'max_contact' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WANTS_MAX_CONTACT"],
2517 'no_matter' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WANTS_NO_MATTER"],
2518 'no_info' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_WANTS_NO_INFO"]);
2527 return array(
'min_contact' => 0,
2528 'max_contact' => 25,
2539 return array(
'never_budget' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_NEVER_BUDGET"],
2540 'no_budget' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_NO_BUDGET"],
2541 'unsatisfied' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_UNSATISFIED"],
2542 'satisfied' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_SATISFIED"],
2543 'not_interested' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_NOT_INTERESTED"],
2544 'interested' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_INTERESTED"],
2545 'newbie' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_NEWBIE"],
2546 'no_matter' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_NO_MATTER"],
2547 'no_info' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_THINKS_NO_INFO"]
2557 return array(
'never_budget' => 4,
2561 'not_interested' => 0,
2574 return array(
'no' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_NO"],
2575 'poor' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_POOR"],
2576 'correct' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_CORRECT"],
2577 'no_info' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_NO_INFO"]
2587 return array(
'no' => 6,
2599 return array(
'1' =>
$GLOBALS[
"STR_YES"],
2609 return array(
'YES' =>
'Compte normal YES',
2610 'PROSP' =>
'Compte PROSPECT',
2611 'AGENT' =>
'Compte AGENT',
2612 'NO' =>
'Compte non valide NO');
2621 return array(
'never' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_NEVER"],
2622 'no' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_NOT_NOW"],
2623 'earlier' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_NOT_NOW_BUT_EARLIER"],
2624 'any' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_ALL"],
2625 'platinum_until' =>
$GLOBALS[
"STR_MODULE_ABONNEMENT_PLATINUM"],
2626 'diamond_until' =>
$GLOBALS[
"STR_MODULE_ABONNEMENT_DIAMOND"]);
2635 $result = array(
'-1' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_PRODUCTS_NEVER_BOUGHT"]);
2636 for(
$i=1;
$i<=12;
$i++) {
2648 return array(
'' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_REASON_INDIFFERENT"],
2649 'interesting_profile' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_REASON_INTERESTING_PROFILE"],
2650 'interested_by_product' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_REASON_INTERESTED_BY_PRODUCT"],
2651 'payment_expected' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_REASON_PAYMENT_EXPECTED"],
2652 'follow_up' =>
$GLOBALS[
"STR_ADMIN_UTILISATEURS_FOLLOWED_REASON_FOLLOW_UP"]);
2663 function insere_langue(
$frm, $try_alter_table_even_if_modules_not_active =
true, $force_update_database_lang_content =
false)
2668 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
"STR_ADMIN_LANGUES_ERR_LANGUAGE_TWO_CHARS"]))->fetch();
2682 unset($query_alter_table);
2685 $query_alter_table[] =
'ALTER TABLE `peel_access_map` ADD `text_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2687 $query_alter_table[] =
'ALTER TABLE `peel_affiliation` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2688 $query_alter_table[] =
'ALTER TABLE `peel_affiliation` ADD `texte_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2691 $query_alter_table[] =
'ALTER TABLE `peel_attributs` ADD `descriptif_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2693 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `surtitre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2694 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2695 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `texte_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2696 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `chapo_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2697 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2698 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2699 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2700 if(!in_array(
'titre_'.$new_lang,
get_table_index(
'peel_articles', null,
true))) {
2701 $query_alter_table[] =
'ALTER TABLE `peel_articles` ADD INDEX (`titre_' .
word_real_escape_string($new_lang) .
'`)';
2703 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2704 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2705 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2706 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2707 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2708 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `header_html_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2709 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `image_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2710 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `alpha_' .
word_real_escape_string($new_lang) .
'` CHAR( 1 ) NOT NULL DEFAULT ""';
2711 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD `sentence_displayed_on_product_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2712 if(!in_array(
'nom_'.$new_lang,
get_table_index(
'peel_categories', null,
true))) {
2713 $query_alter_table[] =
'ALTER TABLE `peel_categories` ADD INDEX (`nom_' .
word_real_escape_string($new_lang) .
'`)';
2716 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `alpha_' .
word_real_escape_string($new_lang) .
'` CHAR( 1 ) NOT NULL DEFAULT ""';
2717 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 100 ) NOT NULL DEFAULT ""';
2718 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2719 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `image_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2720 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2721 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2722 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2723 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `header_html_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2724 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `presentation_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2725 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD `presentation2_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2726 if(!in_array(
'nom_'.$new_lang,
get_table_index(
'peel_categories_annonces', null,
true))) {
2727 $query_alter_table[] =
'ALTER TABLE `peel_categories_annonces` ADD INDEX (`nom_' .
word_real_escape_string($new_lang) .
'`)';
2730 $query_alter_table[] =
'ALTER TABLE `peel_cgv` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2731 $query_alter_table[] =
'ALTER TABLE `peel_cgv` ADD `texte_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2732 $query_alter_table[] =
'ALTER TABLE `peel_contacts` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2733 $query_alter_table[] =
'ALTER TABLE `peel_contacts` ADD `texte_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2734 $query_alter_table[] =
'ALTER TABLE `peel_couleurs` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2735 $query_alter_table[] =
'ALTER TABLE `peel_continents` ADD `name_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2736 $query_alter_table[] =
'ALTER TABLE `peel_ecotaxes` ADD `nom_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2737 $query_alter_table[] =
'ALTER TABLE `peel_email_template_cat` ADD `name_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2739 $query_alter_table[] =
'ALTER TABLE `peel_etatstock` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2742 $query_alter_table[] =
'ALTER TABLE `peel_faq` ADD `question_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2743 $query_alter_table[] =
'ALTER TABLE `peel_faq` ADD `answer_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2746 $query_alter_table[] =
'ALTER TABLE `peel_gold_ads` ADD `text_intro_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 80 ) NOT NULL DEFAULT ""';
2748 $query_alter_table[] =
'ALTER TABLE `peel_import_field` ADD `texte_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2749 $query_alter_table[] =
'ALTER TABLE `peel_langues` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2750 $query_alter_table[] =
'ALTER TABLE `peel_legal` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2751 $query_alter_table[] =
'ALTER TABLE `peel_legal` ADD `texte_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2753 $query_alter_table[] =
'ALTER TABLE `peel_lexique` ADD `word_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2754 $query_alter_table[] =
'ALTER TABLE `peel_lexique` ADD `definition_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2755 $query_alter_table[] =
'ALTER TABLE `peel_lexique` ADD `meta_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2756 $query_alter_table[] =
'ALTER TABLE `peel_lexique` ADD `meta_definition_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2759 $query_alter_table[] =
'ALTER TABLE `peel_lot_vente` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2760 $query_alter_table[] =
'ALTER TABLE `peel_lot_vente` ADD `description_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2761 if(in_array(
'search_fulltext',
get_table_index(
'peel_lot_vente', null,
true))) {
2764 $query_alter_table[] =
'DROP INDEX `search_fulltext` ON peel_lot_vente';
2766 unset($index_array);
2767 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
2768 $index_array[]=
'titre_'.$lng;
2769 $index_array[]=
'description_'.$lng;
2771 $query_alter_table[] =
'ALTER TABLE `peel_lot_vente` ADD FULLTEXT KEY `search_fulltext` ('.implode(
',',
real_escape_string($index_array)).
')';
2773 $query_alter_table[] =
'ALTER TABLE `peel_marques` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2774 $query_alter_table[] =
'ALTER TABLE `peel_marques` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2775 $query_alter_table[] =
'ALTER TABLE `peel_marques` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2776 $query_alter_table[] =
'ALTER TABLE `peel_marques` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2777 $query_alter_table[] =
'ALTER TABLE `peel_marques` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2778 $query_alter_table[] =
'ALTER TABLE `peel_meta` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2779 $query_alter_table[] =
'ALTER TABLE `peel_meta` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2780 $query_alter_table[] =
'ALTER TABLE `peel_meta` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2781 $query_alter_table[] =
'ALTER TABLE `peel_modules` ADD `title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2783 $query_alter_table[] =
'ALTER TABLE `peel_nom_attributs` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2785 $query_alter_table[] =
'ALTER TABLE `peel_paiement` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2787 $query_alter_table[] =
'ALTER TABLE `peel_parrain` ADD `titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2788 $query_alter_table[] =
'ALTER TABLE `peel_parrain` ADD `texte_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2790 $query_alter_table[] =
'ALTER TABLE `peel_pays` ADD `pays_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2791 if(!in_array(
'pays_'.$new_lang,
get_table_index(
'peel_pays', null,
true))) {
2792 $query_alter_table[] =
'ALTER TABLE `peel_pays` ADD INDEX (`pays_' .
word_real_escape_string($new_lang) .
'`)';
2794 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2795 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `descriptif_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2796 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2797 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2798 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2799 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2800 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab1_html_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2801 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab2_html_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2802 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab3_html_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2803 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab4_html_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2804 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab5_html_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2805 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab6_html_' .
word_real_escape_string($new_lang) .
'` mediumtext NOT NULL';
2806 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab1_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2807 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab2_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2808 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab3_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2809 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab4_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2810 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab5_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2811 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD `tab6_title_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2812 if(!in_array(
'nom_'.$new_lang,
get_table_index(
'peel_produits', null,
true))) {
2814 $query_alter_table[] =
'ALTER TABLE `peel_produits` ADD INDEX (`nom_' .
word_real_escape_string($new_lang) .
'` (2))';
2816 $query_alter_table[] =
'ALTER TABLE `peel_profil` ADD `name_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 100 ) NOT NULL DEFAULT ""';
2817 $query_alter_table[] =
'ALTER TABLE `peel_profil` ADD `description_document_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2818 $query_alter_table[] =
'ALTER TABLE `peel_profil` ADD `document_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2819 $query_alter_table[] =
'ALTER TABLE `peel_rubriques` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2820 $query_alter_table[] =
'ALTER TABLE `peel_rubriques` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2821 $query_alter_table[] =
'ALTER TABLE `peel_rubriques` ADD `meta_titre_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2822 $query_alter_table[] =
'ALTER TABLE `peel_rubriques` ADD `meta_key_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2823 $query_alter_table[] =
'ALTER TABLE `peel_rubriques` ADD `meta_desc_' .
word_real_escape_string($new_lang) .
'` TEXT NOT NULL';
2824 if(!in_array(
'nom_'.$new_lang,
get_table_index(
'peel_rubriques', null,
true))) {
2825 $query_alter_table[] =
'ALTER TABLE `peel_rubriques` ADD INDEX (`nom_' .
word_real_escape_string($new_lang) .
'`)';
2830 $query_alter_table[] =
'ALTER TABLE `peel_statut_paiement` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2831 $query_alter_table[] =
'ALTER TABLE `peel_statut_livraison` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2832 $query_alter_table[] =
'ALTER TABLE `peel_tailles` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2833 $query_alter_table[] =
'ALTER TABLE `peel_types` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2834 $query_alter_table[] =
'ALTER TABLE `peel_zones` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2836 $query_alter_table[] =
'ALTER TABLE `peel_newsletter` ADD `sujet_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2837 $query_alter_table[] =
'ALTER TABLE `peel_newsletter` ADD `message_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2840 $query_alter_table[] =
'ALTER TABLE `peel_references_categories` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2841 $query_alter_table[] =
'ALTER TABLE `peel_references_categories` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2842 $query_alter_table[] =
'ALTER TABLE `peel_references` ADD `descriptif_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2845 $query_alter_table[] =
'ALTER TABLE `peel_partenaires_categories` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2846 $query_alter_table[] =
'ALTER TABLE `peel_partenaires_categories` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2850 $query_alter_table[] =
'ALTER TABLE `peel_vitrine_grossiste` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2851 $query_alter_table[] =
'ALTER TABLE `peel_vitrine_grossiste` ADD `presentation_' .
word_real_escape_string($new_lang) .
'` text NOT NULL';
2855 $query_alter_table[] =
'ALTER TABLE `peel_agenda` ADD `title_event_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2856 $query_alter_table[] =
'ALTER TABLE `peel_agenda` ADD `description_' .
word_real_escape_string($new_lang) .
'` text NOT NULL';
2860 $query_alter_table[] =
'ALTER TABLE `peel_carrousels` ADD `langue_' .
word_real_escape_string($new_lang) .
'` tinyint(1) NOT NULL DEFAULT "0"';
2861 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `nom_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2862 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `descriptif_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2863 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `description_' .
word_real_escape_string($new_lang) .
'` MEDIUMTEXT NOT NULL';
2864 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `image1_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2865 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `image2_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2866 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `image3_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2867 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `lien1_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2868 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `lien2_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2869 $query_alter_table[] =
'ALTER TABLE `peel_vignettes_carrousels` ADD `lien3_' .
word_real_escape_string($new_lang) .
'` VARCHAR( 255 ) NOT NULL DEFAULT ""';
2872 foreach ($query_alter_table as $this_alter_table) {
2886 if(empty(
$frm[
'flag'])) {
2887 if(!empty(
$GLOBALS[
'langs_flags_correspondance'][$new_lang])){
2888 $frm[
'flag'] =
$GLOBALS[
'langs_flags_correspondance'][$new_lang];
2890 $frm[
'flag'] =
'/images/'.$new_lang.
'.png';
2893 if(!isset(
$frm[
'etat'])) {
2896 $sql =
"INSERT INTO peel_langues (
2903 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
2904 if(!empty(
$frm[
'nom_' . $lng])) {
2905 $sql .=
", nom_" . $lng;
2913 , '" . intval(
vb(
$frm[
'etat'])) .
"'
2915 , '" . intval(
vb(
$frm[
'position'])) .
"'";
2916 foreach (
$GLOBALS[
'admin_lang_codes'] as $lng) {
2917 if(!empty(
$frm[
'nom_' . $lng])) {
2925 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' => sprintf(
$GLOBALS[
'STR_ADMIN_LANGUES_MSG_LANGUAGE_CREATED'], (!empty(
$GLOBALS[
'lang_names'][$new_lang])?
'"' .
$GLOBALS[
'lang_names'][$new_lang] .
'"':
'"' . $new_lang .
'"'))))->fetch();
2927 if(!$repair || $force_update_database_lang_content) {
2929 $database_import_content = array(array(
'continents' =>
'name'), array(
'pays' =>
'pays'), array(
'ecotaxes' =>
'nom'), array(
'email_template_cat' =>
'name'), array(
'email_template' =>
'name'), array(
'email_template' =>
'subject'), array(
'email_template' =>
'text'), array(
'etatstock' =>
'nom'), array(
'langues' =>
'nom'), array(
'import_field' =>
'texte'), array(
'modules' =>
'title'), array(
'paiement' =>
'nom'), array(
'profil' =>
'name'), array(
'statut_livraison' =>
'nom'), array(
'statut_paiement' =>
'nom'), array(
'types' =>
'nom'), array(
'zones' =>
'nom'));
2930 if(!is_bool($force_update_database_lang_content) && !is_array($force_update_database_lang_content) &&
String::strlen($force_update_database_lang_content)>1) {
2931 $force_update_database_lang_content = array($force_update_database_lang_content);
2935 $database_import_content = array(array(
'langues' =>
'nom'));
2937 if(!empty($database_import_content)) {
2938 foreach($database_import_content as $this_field_prefix_array) {
2939 foreach($this_field_prefix_array as $this_table_short_name => $this_field_prefix) {
2940 if(is_array($force_update_database_lang_content) && !in_array($this_table_short_name, $force_update_database_lang_content)) {
2945 if(!empty($table_field_names)) {
2947 $languages_for_files_tried = array($new_lang,
'en',
'fr');
2948 foreach($languages_for_files_tried as $tried_file_lang) {
2949 $database_file_name =
$GLOBALS[
'dirroot'] .
'/lib/lang/database_'.$this_table_short_name.
'_'.$this_field_prefix.
'_'.$tried_file_lang.
'.php';
2950 if(file_exists($database_file_name)){
2953 $database_file_name =
$GLOBALS[
'dirroot'] .
'/lib/lang/database_'.$this_table_short_name.
'_'.$tried_file_lang.
'.php';
2954 if(file_exists($database_file_name)){
2959 if(file_exists($database_file_name)) {
2960 include ($database_file_name);
2961 $array_name =
'peel_'.$this_table_short_name;
2963 if(isset($$array_name)){
2964 $this_array = $$array_name;
2966 if(!empty($this_array) && !empty($this_array[$this_field_prefix])){
2967 foreach($this_array[$this_field_prefix] as $this_reference => $this_value) {
2968 unset($sql_set_array);
2969 unset($sql_line_array);
2970 if(in_array($this_table_short_name, array(
'langues'))) {
2971 $reference_column =
'lang';
2972 }
elseif(in_array($this_table_short_name, array(
'import_field'))) {
2973 $reference_column =
'champs';
2974 }
elseif(in_array($this_table_short_name, array(
'pays'))) {
2975 $reference_column =
'iso3';
2976 }
elseif(in_array($this_table_short_name, array(
'profil'))) {
2977 $reference_column =
'priv';
2978 }
elseif(in_array($this_table_short_name, array(
'etatstock'))) {
2979 $reference_column =
'valeur';
2980 }
elseif(in_array($this_table_short_name, array(
'ecotaxes'))) {
2981 $reference_column =
'code';
2982 }
elseif(is_numeric($this_reference)) {
2984 $reference_column =
'id';
2986 $reference_column =
'technical_code';
2988 if(in_array(
'lang', $table_field_names) && !in_array($this_table_short_name, array(
'langues',
'pays'))){
2990 $column_name = $this_field_prefix;
2991 $sql_line_array[] =
"lang='".real_escape_string($new_lang).
"'";
2994 $column_name = $this_field_prefix.
"_".$new_lang;
2996 if(in_array($this_table_short_name, array(
'langues'))) {
3002 if(in_array(
'position', $table_field_names) && $reference_column ==
'id' && !in_array($this_table_short_name, array(
'pays',
'modules'))){
3004 $sql_set_array[] =
"position=id";
3008 FROM peel_".word_real_escape_string($this_table_short_name).
"
3012 $sql =
"UPDATE peel_".word_real_escape_string($this_table_short_name).
"
3013 SET ".implode(
', ', $sql_set_array).
"
3016 }
elseif(!in_array($this_table_short_name, array(
'langues')) && !empty($this_value)){
3017 if(in_array(
'etat', $table_field_names)){
3019 $sql_line_array[] =
"etat='1'";
3021 if($column_name == $this_field_prefix) {
3022 unset($sql_line_array[
'id']);
3026 $sql =
"INSERT INTO peel_".word_real_escape_string($this_table_short_name).
"
3027 SET ".implode(
', ', $sql_set_array);
3028 if(!empty($sql_line_array)){
3029 $sql .=
", ".implode(
', ', $sql_line_array);
3034 $imported_texts[] = $this_table_short_name .
' ('.$this_field_prefix.
')';
3036 $not_imported_texts[] = $this_table_short_name .
' ('.$this_field_prefix.
')';
3039 $not_imported_texts[] = $this_table_short_name .
' ('.$this_field_prefix.
')';
3044 $sql =
"SELECT url_rewriting
3051 $sql =
"UPDATE peel_langues
3052 SET url_rewriting='".real_escape_string($new_lang).
"/'
3056 if(!empty($imported_texts)){
3057 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_success.tpl', array(
'message' =>
String::strtoupper($new_lang) .
' - ' .
$GLOBALS[
"STR_ADMIN_LANGUES_MSG_CONTENT_IMPORTED"] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': '.implode(
', ', $imported_texts)))->fetch();
3059 if(!empty($not_imported_texts)){
3060 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
String::strtoupper($new_lang) .
' - ' .
$GLOBALS[
"STR_ADMIN_LANGUES_ERR_CONTENT_NOT_IMPORTED"] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': ' . implode(
', ', $not_imported_texts)))->fetch();
3063 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf(
$GLOBALS[
"STR_ADMIN_LANGUES_ERR_LANGUAGE_ALREADY_INSTALLED"], $new_lang, $created)))->fetch();
3068 if (!function_exists(
'get_admin_date_filter_form')) {
3077 function get_admin_date_filter_form($form_title,
$information_select_html, $submit_html=null, $only_information_select_html_displayed =
false)
3080 $nowDay = date(
'd');
3081 $nowMonth = date(
'm');
3082 $nowYear = date(
'Y');
3085 for (
$i = 2004;
$i <= date(
'Y');
$i++) {
3088 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'admin_date_filter_form.tpl');
3089 $tpl->assign(
'only_information_select_html_displayed', $only_information_select_html_displayed);
3091 $tpl->assign(
'form_title', $form_title);
3094 if($submit_html !== null) {
3095 $tpl->assign(
'submit_html', $submit_html);
3097 $days_options = array();
3098 for ($c = 1; $c <= 31; $c++) {
3099 $days_options[] = array(
3102 'issel' => ((isset($_GET[
'jour1']) && $c == $_GET[
'jour1']) || (!isset($_GET[
'jour1']) && $c == $nowDay))
3105 $tpl->assign(
'days_options', $days_options);
3107 $months_options = array();
3108 foreach (
$GLOBALS[
'months_names'] as $this_month_number => $this_month) {
3109 if(!empty($this_month)) {
3110 $months_options[] = array(
3111 'value' => $this_month_number,
3113 'issel' => ((isset($_GET[
'mois1']) && $this_month_number == $_GET[
'mois1']) || (!isset($_GET[
'mois1']) && $this_month_number == $nowMonth))
3117 $tpl->assign(
'months_options', $months_options);
3119 $years_options = array();
3120 for ($x3 = 0; $x3 <= count($years1) - 1; $x3++) {
3121 $years_options[] = array(
3122 'value' => $years1[$x3],
3123 'name' => $years1[$x3],
3124 'issel' => ((isset($_GET[
'an1']) && $years1[$x3] == $_GET[
'an1']) || (!isset($_GET[
'an1']) && $years1[$x3] == $nowYear))
3127 $tpl->assign(
'years_options', $years_options);
3129 $days2_options = array();
3130 for ($c = 1; $c <= 31; $c++) {
3131 $days2_options[] = array(
3134 'issel' => ((isset($_GET[
'jour2']) && $c == $_GET[
'jour2']) || (!isset($_GET[
'jour2']) && $c == $nowDay))
3137 $tpl->assign(
'days2_options', $days2_options);
3139 $months2_options = array();
3140 foreach (
$GLOBALS[
'months_names'] as $this_month_number => $this_month) {
3141 if(!empty($this_month)) {
3142 $months2_options[] = array(
3143 'value' => $this_month_number,
3145 'issel' => ((isset($_GET[
'mois2']) && $this_month_number == $_GET[
'mois2']) || (!isset($_GET[
'mois2']) && $this_month_number == $nowMonth))
3149 $tpl->assign(
'months2_options', $months2_options);
3151 $years2_options = array();
3152 for ($x = 0; $x <= count($years1) - 1; $x++) {
3153 $years2_options[] = array(
3154 'value' => $years1[$x],
3155 'name' => $years1[$x],
3156 'issel' => ((isset($_GET[
'an2']) && $years1[$x] == $_GET[
'an2']) || (!isset($_GET[
'an2']) && $years1[$x] == $nowYear))
3159 $order_date_field_array = array(
$GLOBALS[
'STR_ADMIN_PAIEMENT_DATE']=>
'a_timestamp',
$GLOBALS[
'STR_ADMIN_ORDER_CREATION_DATE']=>
'o_timestamp',
$GLOBALS[
'STR_ADMIN_COMMANDER_INVOICE_DATE']=>
'f_datetime',
$GLOBALS[
'STR_EXPEDITION_DATE']=>
'e_datetime');
3160 foreach($order_date_field_array as $name => $this_field) {
3161 $order_date_field_options[] = array(
3162 'value' => $this_field,
3164 'issel' => ((isset($_GET[
'order_date_field_filter']) && $this_field == $_GET[
'order_date_field_filter']))
3167 $tpl->assign(
'order_date_field_options', $order_date_field_options);
3168 $tpl->assign(
'years2_options', $years2_options);
3169 $tpl->assign(
'from_date_txt',
$GLOBALS[
'strStartingOn']);
3170 $tpl->assign(
'until_date_txt',
$GLOBALS[
'strTillDay']);
3171 $tpl->assign(
'STR_ADMIN_ORDER_DATE_FIELD_FILTER',
$GLOBALS[
'STR_ADMIN_ORDER_DATE_FIELD_FILTER']);
3172 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
3173 $tpl->assign(
'STR_ADMIN_TODAY_DATE',
$GLOBALS[
'STR_ADMIN_TODAY_DATE']);
3174 $tpl->assign(
'STR_ADMIN_DISPLAY_RESULTS',
$GLOBALS[
'STR_ADMIN_DISPLAY_RESULTS']);
3180 if (!function_exists(
'check_admin_date_data')) {
3187 function check_admin_date_data(&$form_data)
3190 if (!checkdate($_GET[
'mois1'], $_GET[
'jour1'], $_GET[
'an1'])) {
3191 $output .=
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $_GET[
'jour1'] .
'-' . $_GET[
'mois1'] .
'-' . $_GET[
'aa1'] .
' => '.
$GLOBALS[
"STR_ERR_DATE_BAD"]))->fetch();
3192 }
elseif (!checkdate($_GET[
'mois2'], $_GET[
'jour2'], $_GET[
'an2'])) {
3193 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $_GET[
'jour2'] .
'-' . $_GET[
'mois2'] .
'-' . $_GET[
'an2'] .
' => '.$GLOBALS[
"STR_ERR_DATE_BAD"]))->fetch();
3195 $dateAdded1 = $_GET[
'an1'] .
'-' . str_pad($_GET[
'mois1'], 2, 0, STR_PAD_LEFT) .
'-' . str_pad($_GET[
'jour1'], 2, 0, STR_PAD_LEFT) .
" 00:00:00";
3196 $dateAdded2 = $_GET[
'an2'] .
'-' . str_pad($_GET[
'mois2'], 2, 0, STR_PAD_LEFT) .
'-' . str_pad($_GET[
'jour2'], 2, 0, STR_PAD_LEFT) .
" 23:59:59";
3197 if ($dateAdded2 < $dateAdded1) {
3198 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $GLOBALS[
'strStartingOn'] .
' ' .
get_formatted_date($dateAdded1) .
' ' . $GLOBALS[
'strTillDay'] .
' ' .
get_formatted_date($dateAdded2) .
' => ' . $GLOBALS[
"STR_ADMIN_DATE1_DATE2_INCOHERENT"]))->fetch();
3209 if (!function_exists(
'affiche_liste_produits')) {
3216 function affiche_liste_produits(
$frm)
3218 $categorie_options = get_categories_output(null,
'categories',
vb($_GET[
'cat_search']));
3219 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'admin_liste_produits.tpl');
3220 if (empty($categorie_options)) {
3221 $tpl->assign(
'is_empty',
true);
3222 $tpl->assign(
'href', $GLOBALS[
'administrer_url'] .
'/categories.php?mode=ajout');
3224 $tpl->assign(
'is_empty',
false);
3225 $tpl->assign(
'site_parameters_prices',
vb($GLOBALS[
'site_parameters'][
'edit_prices_on_products_list']));
3226 $tpl->assign(
'administrer_url', $GLOBALS[
'administrer_url']);
3228 $tpl->assign(
'categorie_options', $categorie_options);
3229 $tpl->assign(
'cat_search_zero_issel', (
vb($frm[
'cat_search']) ==
'0'));
3230 $tpl->assign(
'home_search_one_issel', (
vb($frm[
'home_search']) == 1));
3231 $tpl->assign(
'home_search_zero_issel', (
vb($frm[
'home_search']) ===
"0"));
3232 $tpl->assign(
'new_search_one_issel', (
vb($frm[
'new_search']) == 1));
3233 $tpl->assign(
'new_search_zero_issel', (
vb($frm[
'new_search']) ===
"0"));
3234 $tpl->assign(
'promo_search_one_issel', (
vb($frm[
'promo_search']) == 1));
3235 $tpl->assign(
'promo_search_zero_issel', (
vb($frm[
'promo_search']) ===
"0"));
3238 $tpl->assign(
'top_search_one_issel', (
vb($frm[
'top_search']) == 1));
3239 $tpl->assign(
'top_search_zero_issel', (
vb($frm[
'top_search']) ===
"0"));
3242 $tpl->assign(
'on_gift_one_issel', (
vb($frm[
'on_gift']) == 1));
3243 $tpl->assign(
'on_gift_zero_issel', (
vb($frm[
'on_gift']) ===
"0"));
3245 $tpl->assign(
'blank_src', get_url(
'/images/blank.gif'));
3246 $tpl->assign(
'STR_PHOTO_NOT_AVAILABLE_ALT', $GLOBALS[
'STR_PHOTO_NOT_AVAILABLE_ALT']);
3247 if(!empty($GLOBALS[
'site_parameters'][
'default_picture'])) {
3248 $tpl->assign(
'photo_not_available_src', $GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($GLOBALS[
'site_parameters'][
'default_picture'], 80, 50,
'fit'));
3252 $HeaderTitlesArray = array($GLOBALS[
'STR_ADMIN_ACTION'],
'reference' => $GLOBALS[
'STR_REFERENCE'], $GLOBALS[
'STR_CATEGORY'], $GLOBALS[
'STR_WEBSITE'], (
'nom_' .
$_SESSION[
'session_langue']) => $GLOBALS[
'STR_ADMIN_NAME'],
'prix' => $GLOBALS[
'STR_PRICE'] .
' ' . $GLOBALS[
'site_parameters'][
'symbole'] .
' ' . (
display_prices_with_taxes_in_admin() ? $GLOBALS[
'STR_TTC'] : $GLOBALS[
'STR_HT']),
'etat' => $GLOBALS[
'STR_STATUS']);
3254 $HeaderTitlesArray[
'on_stock'] = $GLOBALS[
'STR_STOCK'];
3257 $HeaderTitlesArray[
'points'] = $GLOBALS[
'STR_GIFT_POINTS'];
3258 $tpl->assign(
'STR_MODULE_GIFTS_ADMIN_GIFT', $GLOBALS[
'STR_MODULE_GIFTS_ADMIN_GIFT']);
3260 $HeaderTitlesArray[
'date_maj'] = $GLOBALS[
'STR_ADMIN_UPDATED_DATE'];
3261 $HeaderTitlesArray[] = $GLOBALS[
'STR_ADMIN_SUPPLIER'];
3262 $HeaderTitlesArray[] = $GLOBALS[
'STR_PHOTO'];
3263 $HeaderTitlesArray[
'nb_view'] = $GLOBALS[
'STR_ADMIN_PRODUITS_VIEWS_COUNT'];
3264 $Links->HeaderTitlesArray = $HeaderTitlesArray;
3265 $Links->OrderDefault =
vb($GLOBALS[
'site_parameters'][
'liste_produits_order_default'],
"position, nom_".(!empty($GLOBALS[
'site_parameters'][
'product_name_forced_lang'])?$GLOBALS[
'site_parameters'][
'product_name_forced_lang']:
$_SESSION[
'session_langue']).
", prix");
3266 $Links->SortDefault =
vb($GLOBALS[
'site_parameters'][
'liste_produits_sort_default'],
"ASC");
3269 $tpl->assign(
'nombre_produits',
$Links->nbRecord);
3270 $tpl->assign(
'ajout_produits_href', $GLOBALS[
'administrer_url'] .
'/produits.php?mode=ajout');
3278 $tpl->assign(
'HeaderRow',
$Links->getHeaderRow());
3281 $drop_href =
get_current_url(
true,
false, array(
'nombre',
'multipage',
'mode',
'id',
'page'));
3282 if (strpos($_SERVER[
'REQUEST_URI'],
'?') ===
false) {
3287 $drop_href .=
'mode=suppr&id=' . $ligne[
'id'] .
'&page=' . (!empty($_GET[
'page']) ? $_GET[
'page'] : 1);
3290 $tmpLigne = array(
'tr_rollover' => tr_rollover(
$i,
true),
3291 'drop_confirm' => $GLOBALS[
"STR_ADMIN_DELETE_WARNING"],
3292 'id' => $ligne[
'id'],
3294 'drop_href' => $drop_href,
3295 'drop_src' => $GLOBALS[
'administrer_url'] .
'/images/b_drop.png',
3296 'edit_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $ligne[
'id'] .
'&page=' . (!empty($frm[
'page']) ? $frm[
'page'] : 1),
3297 'edit_src' => $GLOBALS[
'administrer_url'] .
'/images/b_edit.png',
3298 'dup_href' =>
get_current_url(
false) .
'?mode=duplicate&id=' . $ligne[
'id'] .
'&page=' . (!empty($frm[
'page']) ? $frm[
'page'] : 1),
3299 'dup_src' => $GLOBALS[
'administrer_url'] .
'/images/duplicate.png',
3300 'reference' => $ligne[
'reference'],
3303 'modify_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $ligne[
'id'] .
'&page=' . (!empty($frm[
'page']) ? $frm[
'page'] : 1),
3304 'modify_label' =>
$product_object->name . ($ligne[
'on_gift'] == 1 ?
" (cadeau)" :
""),
3307 'etat_onclick' =>
'change_status("produits", "' . $ligne[
'id'] .
'", this, "'.$GLOBALS[
'administrer_url'] .
'")',
3308 'etat_src' => $GLOBALS[
'administrer_url'] .
'/images/' . (empty($ligne[
'etat']) ?
'puce-blanche.gif' :
'puce-verte.gif'),
3311 'nb_view' => $ligne[
'nb_view'],
3313 if(!empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
3316 $sqlCAT =
"SELECT c.id, c.nom_" .
$_SESSION[
'session_langue'] .
", c2.nom_" .
$_SESSION[
'session_langue'] .
" AS parent_nom_" .
$_SESSION[
'session_langue'] .
"
3317 FROM peel_produits_categories pc
3318 INNER JOIN peel_categories c ON c.id = pc.categorie_id AND " .
get_filter_site_cond(
'categories',
'c') .
"
3319 LEFT JOIN peel_categories c2 ON c2.id=c.parent_id AND " .
get_filter_site_cond(
'categories',
'c2') .
"
3320 WHERE pc.produit_id = " . intval($ligne[
'id']);
3321 $resCAT =
query($sqlCAT);
3324 $tmpLigne[
'cats'][] = array(
3325 'parent_nom' => $cat[
'parent_nom_' .
$_SESSION[
'session_langue']],
3326 'nom' => $cat[
'nom_' . $_SESSION[
'session_langue']]
3330 $tmpLigne[
'site_id'] = $ligne[
'site_id'];
3332 if ($ligne[
'on_stock'] == 1) {
3333 $tmpLigne[
'stock_href'] =
get_current_url(
false) .
'?mode=stock&id=' . $ligne[
'id'];
3334 $tmpLigne[
'stock_src'] = $GLOBALS[
'administrer_url'] .
'/images/stock.gif';
3338 $tmpLigne[
'points'] = $ligne[
'points'];
3340 if (!empty($ligne[
'id_utilisateur']) && $user_infos =
get_user_information($ligne[
'id_utilisateur'])) {
3341 $tmpLigne[
'utilisateur_href'] = $GLOBALS[
'administrer_url'] .
"/utilisateurs.php?mode=modif&id_utilisateur=" . $user_infos[
'id_utilisateur'];
3342 $tmpLigne[
'societe'] = $user_infos[
'societe'];
3347 if (!empty($main_product_picture)) {
3348 $this_thumbs =
thumbs($main_product_picture, 80, 50,
'fit');
3349 $tmpLigne[
'product_src'] = $GLOBALS[
'repertoire_upload'] .
'/thumbs/' . $this_thumbs;
3352 $lignes[] = $tmpLigne;
3355 $tpl->assign(
'lignes', $lignes);
3356 $tpl->assign(
'Multipage',
$Links->GetMultipage());
3358 $tpl_marques_options = array();
3359 $select =
query(
"SELECT id, nom_" .
$_SESSION[
'session_langue'] .
", etat
3362 ORDER BY position, nom_" .
$_SESSION[
'session_langue'] .
" ASC");
3364 $tpl_marques_options[] = array(
'value' => intval($nom[
'id']),
3365 'issel' => $nom[
'id'] ==
vb($frm[
'brand_search']),
3366 'name' => $nom[
'nom_' .
$_SESSION[
'session_langue']] . (empty($nom[
'etat'])?
' ('.$GLOBALS[
"STR_ADMIN_DEACTIVATED"].
')':
'')
3369 $tpl->assign(
'marques_options', $tpl_marques_options);
3371 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
3372 if(!empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
3373 $tpl->assign(
'STR_ADMIN_SITE_COUNTRY', $GLOBALS[
'STR_ADMIN_SITE_COUNTRY']);
3375 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
3376 $tpl->assign(
'STR_ADMIN_PRODUITS_CREATE_CATEGORY_FIRST', $GLOBALS[
'STR_ADMIN_PRODUITS_CREATE_CATEGORY_FIRST']);
3377 $tpl->assign(
'STR_ADMIN_SEARCH_CRITERIA', $GLOBALS[
'STR_ADMIN_SEARCH_CRITERIA']);
3378 $tpl->assign(
'STR_CATEGORY', $GLOBALS[
'STR_CATEGORY']);
3379 $tpl->assign(
'STR_ADMIN_ALL_CATEGORIES', $GLOBALS[
'STR_ADMIN_ALL_CATEGORIES']);
3380 $tpl->assign(
'STR_ADMIN_PRODUITS_NO_CATEGORY_RELATED', $GLOBALS[
'STR_ADMIN_PRODUITS_NO_CATEGORY_RELATED']);
3381 $tpl->assign(
'STR_ADMIN_PRODUITS_IS_PRODUCT_IN', $GLOBALS[
'STR_ADMIN_PRODUITS_IS_PRODUCT_IN']);
3382 $tpl->assign(
'STR_ADMIN_OUR_SELECTION', $GLOBALS[
'STR_ADMIN_OUR_SELECTION']);
3383 $tpl->assign(
'STR_ADMIN_ANY', $GLOBALS[
'STR_ADMIN_ANY']);
3384 $tpl->assign(
'STR_NOUVEAUTES', $GLOBALS[
'STR_NOUVEAUTES']);
3385 $tpl->assign(
'STR_YES', $GLOBALS[
'STR_YES']);
3386 $tpl->assign(
'STR_NO', $GLOBALS[
'STR_NO']);
3387 $tpl->assign(
'STR_PROMOTION', $GLOBALS[
'STR_PROMOTION']);
3388 $tpl->assign(
'STR_TOP', $GLOBALS[
'STR_TOP']);
3389 $tpl->assign(
'STR_ADMIN_PRODUITS_IS_PRODUCT', $GLOBALS[
'STR_ADMIN_PRODUITS_IS_PRODUCT']);
3390 $tpl->assign(
'STR_REFERENCE', $GLOBALS[
'STR_REFERENCE']);
3391 $tpl->assign(
'STR_ADMIN_PRODUCT_NAME', $GLOBALS[
'STR_ADMIN_PRODUCT_NAME']);
3392 $tpl->assign(
'STR_SEARCH', $GLOBALS[
'STR_SEARCH']);
3393 $tpl->assign(
'STR_ADMIN_PRODUITS_PRODUCTS_LIST', $GLOBALS[
'STR_ADMIN_PRODUITS_PRODUCTS_LIST']);
3394 $tpl->assign(
'STR_ADMIN_PRODUITS_PRODUCTS_COUNT', $GLOBALS[
'STR_ADMIN_PRODUITS_PRODUCTS_COUNT']);
3395 $tpl->assign(
'STR_ADMIN_CATEGORIES_ADD_PRODUCT', $GLOBALS[
'STR_ADMIN_CATEGORIES_ADD_PRODUCT']);
3396 $tpl->assign(
'STR_NOTA_BENE', $GLOBALS[
'STR_NOTA_BENE']);
3397 $tpl->assign(
'STR_ADMIN_PRODUITS_DUPLICATE_WARNING', $GLOBALS[
'STR_ADMIN_PRODUITS_DUPLICATE_WARNING']);
3398 $tpl->assign(
'STR_ADMIN_PRODUITS_NOTHING_FOUND', $GLOBALS[
'STR_ADMIN_PRODUITS_NOTHING_FOUND']);
3399 $tpl->assign(
'STR_DELETE', $GLOBALS[
'STR_DELETE']);
3400 $tpl->assign(
'STR_MODIFY', $GLOBALS[
'STR_MODIFY']);
3401 $tpl->assign(
'STR_ADMIN_PRODUITS_DUPLICATE', $GLOBALS[
'STR_ADMIN_PRODUITS_DUPLICATE']);
3402 $tpl->assign(
'STR_ADMIN_PRODUITS_UPDATE', $GLOBALS[
'STR_ADMIN_PRODUITS_UPDATE']);
3403 $tpl->assign(
'STR_PHOTO_NOT_AVAILABLE_ALT', $GLOBALS[
'STR_PHOTO_NOT_AVAILABLE_ALT']);
3404 $tpl->assign(
'STR_ADMIN_PRODUITS_MANAGE_STOCKS', $GLOBALS[
'STR_ADMIN_PRODUITS_MANAGE_STOCKS']);
3405 $tpl->assign(
'STR_ADMIN_DELETE_ALL_RESULTS', sprintf($GLOBALS[
'STR_ADMIN_DELETE_ALL_RESULTS'],
vn(
$Links->nbRecord)));
3407 $tpl->assign(
'delete_all_href', $delete_all_href.(strpos($delete_all_href,
'?')!==
false?
'&':
'?') .
'mode=delete_results');
3408 $tpl->assign(
'STR_ADMIN_DELETE_WARNING', $GLOBALS[
'STR_ADMIN_DELETE_WARNING']);
3409 $tpl->assign(
'STR_BRAND', $GLOBALS[
'STR_BRAND']);
3410 $tpl->assign(
'STR_CHOOSE', $GLOBALS[
'STR_CHOOSE']);
3411 return $tpl->fetch();
3425 $table =
"peel_produits AS p";
3428 if((!empty($frm[
'mode']) && $frm[
'mode'] !=
"maj") || empty($frm[
'mode'])) {
3430 if($get_only_product_with_images) {
3431 $where .=
" AND (image1!='' OR image2!='' OR image3!='' OR image4!='' OR image5!='' OR image6!='' OR image7!='' OR image8!='' OR image9!='' OR image10!='')";
3433 if (isset($frm[
'reference_search']) && !empty($frm[
'reference_search'])) {
3436 if (isset($frm[
'name_search']) && !empty($frm[
'name_search'])) {
3439 if (!empty($frm[
'brand_search'])) {
3442 if (isset($frm[
'home_search']) && $frm[
'home_search'] !=
"null") {
3445 if (isset($frm[
'new_search']) && $frm[
'new_search'] !=
"null") {
3448 if (isset($frm[
'promo_search']) && $frm[
'promo_search'] !=
"null") {
3451 if (isset($frm[
'top_search']) && $frm[
'top_search'] !=
"null" &&
check_if_module_active(
'best_seller')) {
3457 if (isset($frm[
'cat_search']) && is_numeric($frm[
'cat_search'])) {
3459 $where .=
" AND pc.categorie_id IN (" . implode(
',', $children_cat_list) .
")";
3461 if (isset($frm[
'product_site_id']) && is_numeric($frm[
'product_site_id'])) {
3464 if (isset($frm[
'cat_search']) && is_numeric($frm[
'cat_search']) || !empty($delete)) {
3467 LEFT JOIN peel_produits_categories AS pc ON p.id = pc.produit_id";
3469 if(!empty($delete)) {
3470 $alias =
"p,pc,pr,pco,pt";
3474 LEFT JOIN peel_produits_references AS pr ON p.id = pr.produit_id";
3477 LEFT JOIN peel_produits_couleurs AS pco ON p.id = pco.produit_id";
3480 LEFT JOIN peel_produits_tailles AS pt ON p.id = pt.produit_id";
3485 LEFT JOIN peel_stocks AS ps ON p.id = ps.produit_id";
3489 $sql = ($delete ?
"DELETE " . $alias :
"SELECT p.*") .
"
3492 $sql .= ($delete ?
"":
" GROUP BY p.id");
3496 if (!function_exists(
'affiche_liste_produits_acommander')) {
3502 function affiche_liste_produits_acommander()
3504 $preselectionne = null;
3506 $sql =
"SELECT p.id, oi.nom_produit as nom, oi.couleur, oi.taille, oi.delai_stock, oi.commande_id, oi.order_stock
3507 FROM peel_commandes_articles oi
3508 INNER JOIN peel_produits p ON oi.produit_id = p.id AND " .
get_filter_site_cond(
'produits',
'p') .
"
3511 $Links->OrderDefault =
"position, nom_" .
$_SESSION[
'session_langue'] .
", prix";
3512 $Links->SortDefault =
"ASC";
3515 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'admin_liste_produits_acommander.tpl');
3517 $tpl->assign(
'is_empty',
true);
3519 $tpl->assign(
'is_empty',
false);
3520 $products = array();
3522 $products[] = array(
3523 'stock_href' => $GLOBALS[
'administrer_url'] .
'/produits.php?mode=stock&id=' . $this_product[
'id'],
3524 'stock_src' => $GLOBALS[
'administrer_url'] .
'/images/stock.gif',
3525 'modif_href' => $GLOBALS[
'administrer_url'] .
'/produits.php?mode=modif&id=' . $this_product[
'id'],
3526 'nom' => $this_product[
'nom'],
3527 'couleur' =>
vb($this_product[
'couleur']),
3528 'taille' =>
vb($this_product[
'taille']),
3529 'delai_stock' =>
get_formatted_duration((intval($this_product[
'delai_stock']) * 24 * 3600),
false,
'month'),
3530 'order_stock' => $this_product[
'order_stock'],
3531 'commander_href' =>
'commander.php?mode=modif&id=' . $this_product[
'commande_id'],
3532 'commande_id' => $this_product[
'commande_id'],
3535 $tpl->assign(
'products', $products);
3536 $tpl->assign(
'Multipage',
$Links->GetMultipage());
3538 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
3539 $tpl->assign(
'STR_ADMIN_PRODUITS_NO_PRODUCT_TO_ORDER', $GLOBALS[
'STR_ADMIN_PRODUITS_NO_PRODUCT_TO_ORDER']);
3540 $tpl->assign(
'STR_ADMIN_PRODUITS_LIST_TO_ORDER_TITLE', $GLOBALS[
'STR_ADMIN_PRODUITS_LIST_TO_ORDER_TITLE']);
3541 $tpl->assign(
'STR_ADMIN_PRODUITS_TO_ORDER', $GLOBALS[
'STR_ADMIN_PRODUITS_TO_ORDER']);
3542 $tpl->assign(
'STR_ADMIN_ACTION', $GLOBALS[
'STR_ADMIN_ACTION']);
3543 $tpl->assign(
'STR_PRODUCT', $GLOBALS[
'STR_PRODUCT']);
3544 $tpl->assign(
'STR_ADMIN_PRODUITS_TO_ORDER', $GLOBALS[
'STR_ADMIN_PRODUITS_TO_ORDER']);
3545 $tpl->assign(
'STR_ADMIN_PRODUITS_ORDER_DETAIL', $GLOBALS[
'STR_ADMIN_PRODUITS_ORDER_DETAIL']);
3546 $tpl->assign(
'STR_COLOR', $GLOBALS[
'STR_COLOR']);
3547 $tpl->assign(
'STR_SIZE', $GLOBALS[
'STR_SIZE']);
3548 $tpl->assign(
'STR_ADMIN_PRODUITS_SUPPLY_FORECASTED', $GLOBALS[
'STR_ADMIN_PRODUITS_SUPPLY_FORECASTED']);
3549 $tpl->assign(
'STR_ORDER_NAME', $GLOBALS[
'STR_ORDER_NAME']);
3550 return $tpl->fetch();
3554 if (!function_exists(
'affiche_liste_articles')) {
3561 function affiche_liste_articles($frm)
3563 if (isset($_POST[
'cat_search'])) {
3564 $rubrique_id = $_POST[
'cat_search'];
3566 $rubrique_id =
'null';
3568 $frm[
'rubriques'] = array($rubrique_id);
3574 if (isset($frm[
'etat'])) {
3575 if ($frm[
'etat'] !=
"null") {
3576 $where .=
" AND a.etat = '" . intval($frm[
'etat']) .
"'";
3579 if (!empty($frm[
'text_in_title'])) {
3582 if (!empty($frm[
'text_in_article'])) {
3585 if (isset($frm[
'homepage'])) {
3586 if ($frm[
'homepage'] !=
"null") {
3590 if (isset($frm[
'cat_search']) || isset($_GET[
'catid'])) {
3591 if (
vn($frm[
'cat_search']) !=
"null") {
3593 LEFT JOIN peel_articles_rubriques ar ON ar.article_id = a.id
3594 LEFT JOIN peel_rubriques r ON ar.rubrique_id = r.id AND " .
get_filter_site_cond(
'rubriques',
'r') .
"";
3595 if ($frm[
'cat_search'] ===
'0') {
3597 $rubrique_condition =
' ar.rubrique_id IS NULL OR ar.rubrique_id=0';
3599 $rubrique_condition =
' ar.rubrique_id IN (' . implode(
',',
get_children_cat_list(
vn($frm[
'cat_search']), array(),
'rubriques')) .
')';
3601 $where .=
' AND '.$rubrique_condition;
3604 $sql =
"SELECT a.id, a.titre_" .
$_SESSION[
'session_langue'] .
", a.etat, a.site_id";
3605 if(!empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
3606 $sql .=
", a.site_country";
3608 $sql .=
" FROM peel_articles a " . $table .
"
3611 ORDER BY a.id DESC";
3615 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'liste_articles.tpl');
3617 $tpl->assign(
'rubrique_options', get_categories_output(null,
'rubriques',
vb($frm[
'rubriques'])));
3618 $tpl->assign(
'text_in_title',
vb($_POST[
'text_in_title']));
3619 $tpl->assign(
'text_in_article',
vb($_POST[
'text_in_article']));
3620 $tpl->assign(
'cat_search',
vb($_GET[
'cat_search']));
3622 $tpl->assign(
'Multipage',
$Links->GetMultipage());
3624 $tpl->assign(
'is_empty',
true);
3627 $tpl->assign(
'is_empty',
false);
3632 'tr_rollover' => tr_rollover(
$i,
true),
3634 'drop_href' =>
get_current_url(
false) .
'?mode=suppr&id=' . $ligne[
'id'] .
'&page=' . (!empty($_GET[
'page']) ? $_GET[
'page'] : 1),
3635 'drop_src' => $GLOBALS[
'administrer_url'] .
'/images/b_drop.png',
3637 'modif_href' =>
get_current_url(
false) .
'?mode=modif&id=' . $ligne[
'id'],
3639 'etat_onclick' =>
'change_status("articles", "' . $ligne[
'id'] .
'", this, "'.$GLOBALS[
'administrer_url'] .
'")',
3640 'modif_etat_src' => $GLOBALS[
'administrer_url'] .
'/images/' . (empty($ligne[
'etat']) ?
'puce-blanche.gif' :
'puce-verte.gif'),
3642 if(!empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
3645 $sql =
"SELECT r.id, r.nom_" . $_SESSION[
'session_langue'] .
", r2.nom_" . $_SESSION[
'session_langue'] .
" AS parent_nom_" . $_SESSION[
'session_langue'] .
"
3646 FROM peel_articles_rubriques pr
3647 LEFT JOIN peel_rubriques r ON r.id = pr.rubrique_id AND " .
get_filter_site_cond(
'rubriques',
'r') .
"
3648 LEFT JOIN peel_rubriques r2 ON r2.id=r.parent_id AND " .
get_filter_site_cond(
'rubriques',
'r2') .
"
3649 WHERE pr.article_id = " . intval($ligne[
'id']);
3653 if (!empty($this_rub[
'id'])) {
3654 $tmpLigne[
'rubs'][] = array(
3655 'parent_nom' => $this_rub[
'parent_nom_' . $_SESSION[
'session_langue']],
3656 'nom' => $this_rub[
'nom_' . $_SESSION[
'session_langue']]
3659 $tmpLigne[
'rubs'][] = null;
3663 $tmpLigne[
'site_id'] = $ligne[
'site_id'];
3665 $lignes[] = $tmpLigne;
3667 $tpl->assign(
'lignes', $lignes);
3669 $tpl->assign(
'STR_ADMIN_CHOOSE_SEARCH_CRITERIA', $GLOBALS[
'STR_ADMIN_CHOOSE_SEARCH_CRITERIA']);
3670 $tpl->assign(
'STR_ADMIN_SEARCH_CRITERIA', $GLOBALS[
'STR_ADMIN_SEARCH_CRITERIA']);
3671 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
3672 $tpl->assign(
'STR_ADMIN_RUBRIQUE', $GLOBALS[
'STR_ADMIN_RUBRIQUE']);
3673 $tpl->assign(
'STR_ADMIN_RUBRIQUES_ALL', $GLOBALS[
'STR_ADMIN_RUBRIQUES_ALL']);
3674 $tpl->assign(
'STR_ADMIN_RUBRIQUES_NONE_RELATED', $GLOBALS[
'STR_ADMIN_RUBRIQUES_NONE_RELATED']);
3675 $tpl->assign(
'STR_STATUS', $GLOBALS[
'STR_STATUS']);
3676 $tpl->assign(
'STR_ADMIN_ARTICLES_ALL', $GLOBALS[
'STR_ADMIN_ARTICLES_ALL']);
3677 $tpl->assign(
'STR_ADMIN_ONLINE', $GLOBALS[
'STR_ADMIN_ONLINE']);
3678 $tpl->assign(
'STR_ADMIN_OFFLINE', $GLOBALS[
'STR_ADMIN_OFFLINE']);
3679 $tpl->assign(
'STR_ADMIN_SEARCH_IN_TITLE', $GLOBALS[
'STR_ADMIN_SEARCH_IN_TITLE']);
3680 $tpl->assign(
'STR_ADMIN_SEARCH_IN_ARTICLE', $GLOBALS[
'STR_ADMIN_SEARCH_IN_ARTICLE']);
3681 $tpl->assign(
'STR_SEARCH', $GLOBALS[
'STR_SEARCH']);
3682 $tpl->assign(
'STR_ADMIN_ARTICLES_ARTICLES_LIST', $GLOBALS[
'STR_ADMIN_ARTICLES_ARTICLES_LIST']);
3683 $tpl->assign(
'STR_ADMIN_ARTICLES_FORM_ADD', $GLOBALS[
'STR_ADMIN_ARTICLES_FORM_ADD']);
3684 $tpl->assign(
'STR_ADMIN_ARTICLES_NOTHING_FOUND_FOR_LANG', $GLOBALS[
'STR_ADMIN_ARTICLES_NOTHING_FOUND_FOR_LANG']);
3685 $tpl->assign(
'STR_ADMIN_ACTION', $GLOBALS[
'STR_ADMIN_ACTION']);
3686 $tpl->assign(
'STR_ADMIN_RUBRIQUE', $GLOBALS[
'STR_ADMIN_RUBRIQUE']);
3687 $tpl->assign(
'STR_ADMIN_TITLE', $GLOBALS[
'STR_ADMIN_TITLE']);
3688 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
3689 if(!empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
3690 $tpl->assign(
'STR_ADMIN_SITE_COUNTRY', $GLOBALS[
'STR_ADMIN_SITE_COUNTRY']);
3692 $tpl->assign(
'STR_WEBSITE', $GLOBALS[
'STR_WEBSITE']);
3693 $tpl->assign(
'STR_STATUS', $GLOBALS[
'STR_STATUS']);
3694 $tpl->assign(
'STR_ADMIN_DELETE_WARNING', $GLOBALS[
'STR_ADMIN_DELETE_WARNING']);
3695 $tpl->assign(
'STR_DELETE', $GLOBALS[
'STR_DELETE']);
3696 $tpl->assign(
'STR_ADMIN_ARTICLES_FORM_MODIFY', $GLOBALS[
'STR_ADMIN_ARTICLES_FORM_MODIFY']);
3709 <option value="">'.$GLOBALS[
'STR_CHOOSE'].
'...</option>';
3711 $result =
query(
'SELECT id, technical_code, name, lang, site_id
3712 FROM peel_email_template
3713 WHERE active = "TRUE" AND ' .
get_filter_site_cond(
'email_template', null) .
' ' . (!empty($get_signature)?
' AND technical_code LIKE "signature%"':
'') . (!empty($category_id)?
' AND id_cat="' . intval($category_id) .
'"':
'') . (!empty(
$lang)?
' AND (lang="' .
vb(
$lang) .
'" OR lang="")':
'') .
'
3714 ORDER BY technical_code, lang, name');
3716 if ($option_id_nature ==
'id') {
3717 $this_value =
vn($row_template[
'id']);
3718 if (!empty($value_select)) {
3719 $this_select =
frmvalide(
vn($value_select) == $this_value,
'selected="selected"');
3721 }
elseif ($option_id_nature ==
'technical_code') {
3722 $this_value =
vb($row_template[
'technical_code']);
3723 if (!empty($value_select)) {
3724 $this_select =
frmvalide(
vb($value_select) == $this_value,
'selected="selected"');
3741 function get_site_id_select_options($selected_site_id = null, $selected_site_name = null, $display_first_option = null, $select_current_site_id_by_default =
false) {
3742 if(!empty($GLOBALS[
'site_parameters'][
'multisite_disable'])) {
3744 return '<input name="site_id" type="hidden" value="1" />';
3747 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'select_options.tpl');
3750 if(is_array($selected_site_id) && count($selected_site_id) == 1) {
3751 $selected_site_id = current($selected_site_id);
3753 if(empty($display_first_option)) {
3754 $display_first_option = (empty($_SESSION[
'session_utilisateur'][
'site_id']) && count($all_sites_name_array)>1?
'STR_ADMIN_ALL_SITES':
false);
3756 if ($selected_site_id ===
'' || $selected_site_id === null) {
3758 if($select_current_site_id_by_default && empty($_SESSION[
'session_admin_multisite'])) {
3760 $selected_site_id = $GLOBALS[
'site_id'];
3761 }
elseif (isset($_SESSION[
'session_admin_multisite'])) {
3763 $selected_site_id = $_SESSION[
'session_admin_multisite'];
3766 if(!is_array($selected_site_name)) {
3767 $selected_site_name = explode(
',', $selected_site_name);
3769 if(!is_array($selected_site_id)) {
3770 $selected_site_id = explode(
',', $selected_site_id);
3772 if (!empty($display_first_option) && (
String::substr($display_first_option, 0, 4) ==
'STR_') && !empty($GLOBALS[$display_first_option])) {
3774 if ($display_first_option ==
'STR_ADMIN_ALL_SITES') {
3780 $all_sites_name_array = array($value=>$GLOBALS[$display_first_option]) + $all_sites_name_array;
3782 foreach($all_sites_name_array as $site_id=>$site_name) {
3784 $site_selected = (($selected_site_name != array(null) && in_array($site_name, $selected_site_name)) || ($selected_site_id != array(null) && in_array($site_id, $selected_site_id)));
3786 'value' => $site_id,
3787 'name' => $site_name,
3788 'issel' => $site_selected
3809 return implode(
',', array_keys($result_array));
3811 return implode(
',', $result_array);
3831 $site_id_array = array();
3832 $q =
query(
'SELECT site_id, string
3833 FROM peel_configuration
3835 ORDER BY string ASC');
3837 $site_id_array[
$result[
'site_id']] = $result[
'string'];
3839 return $site_id_array;
3850 if(empty($GLOBALS[
'site_parameters'][
'site_country_allowed_array'])) {
3854 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'checkboxes.tpl');
3856 if ($selected_site_country_array === null) {
3857 $selected_site_country_array = $GLOBALS[
'site_parameters'][
'site_country_allowed_array'];
3859 foreach($GLOBALS[
'site_parameters'][
'site_country_allowed_array'] as $site_country_id) {
3862 'name' => $field_name,
3863 'value' => $site_country_id,
3865 'issel' => in_array($site_country_id, $selected_site_country_array)
3884 if(!empty($GLOBALS[
'site_parameters'][
'field_auto_complete_with_main_content_lang']) && is_array($GLOBALS[
'site_parameters'][
'field_auto_complete_with_main_content_lang'])) {
3885 foreach ($GLOBALS[
'site_parameters'][
'field_auto_complete_with_main_content_lang'] as $this_field) {
3887 if(!empty($frm[$this_field .
'_' . $GLOBALS[
'site_parameters'][
'main_content_lang']])) {
3889 $main_content = $GLOBALS[
'site_parameters'][
'main_content_lang'];
3891 if (empty($main_content)) {
3893 foreach ($GLOBALS[
'admin_lang_codes'] as $lng) {
3894 if(!empty($frm[$this_field .
'_' . $lng])) {
3896 $main_content = $lng;
3902 if (!empty($main_content)) {
3904 foreach ($GLOBALS[
'admin_lang_codes'] as $lng) {
3905 if (empty($frm[$this_field .
'_' . $lng])) {
3906 $frm[$this_field .
'_' . $lng] =
vb($frm[$this_field .
'_' . $main_content]);
3924 $sql_statut =
"SELECT id, nom_" . $_SESSION[
'session_langue'] .
", site_id
3925 FROM peel_statut_livraison
3927 ORDER BY position ASC, nom_" . $_SESSION[
'session_langue'] .
" ASC";
3928 $res_statut =
query($sql_statut);
3945 $sql_statut =
"SELECT id, nom_" . $_SESSION[
'session_langue'] .
", site_id
3946 FROM peel_statut_paiement
3948 ORDER BY position ASC, nom_" . $_SESSION[
'session_langue'] .
" ASC";
3949 $res_statut =
query($sql_statut);
3951 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'payment_status_options.tpl');
3955 'value' => intval($s[
'id']),
3956 'name' =>
get_site_info($s).$s[
'nom_' . $_SESSION[
'session_langue']],
3957 'issel' => ($s[
'id'] == $selected_status_id)
3975 $sql_paiement =
'SELECT id, tva, site_id
3979 $res_paiement =
query($sql_paiement);
3981 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'select_options.tpl');
3983 while ($tab_paiement =
fetch_assoc($res_paiement)) {
3984 if ($approximative_amount_selected) {
3986 $is_selected = (abs(floatval($selected_vat) - floatval($tab_paiement[
'tva'])) * 1000 <= abs($tab_paiement[
'tva']));
3988 $is_selected = (floatval($selected_vat) == floatval($tab_paiement[
'tva']));
3992 $selected_vat_found =
true;
3995 'value' => $tab_paiement[
'tva'],
3996 'name' =>
get_site_info($tab_paiement).$tab_paiement[
'tva'],
3997 'issel' => $is_selected
4000 if(!empty($selected_vat) && empty($selected_vat_found)) {
4003 'value' => $selected_vat,
4004 'name' => $selected_vat .
' [' . $GLOBALS[
"STR_ADMIN_DEACTIVATED"] .
']',
4022 $preselectionne = array();
4023 if (!in_array(
$catid, $preselectionne)) {
4024 $preselectionne[] =
$catid;
4027 if ($destination ==
'categories') {
4028 $table =
'peel_categories';
4030 }
elseif($destination ==
'rubriques') {
4031 $table =
'peel_rubriques';
4036 $sql =
'SELECT t.id, t.nom_' . $_SESSION[
'session_langue'] .
', t.parent_id
4037 FROM '.word_real_escape_string($table).
' t
4038 WHERE t.parent_id = "' . intval(
$catid) .
'" ' . $site_cond .
'
4039 ORDER BY t.position';
4042 if (is_array($preselectionne) && !in_array($cat[
'id'], $preselectionne)) {
4043 $preselectionne[] = $cat[
'id'];
4046 return $preselectionne;
4060 if (isset($frm[
'site_id'])) {
4062 $site_id = $frm[
'site_id'];
4068 if (
$mode ==
'insere') {
4070 $output .=
execute_sql($GLOBALS[
'dirroot'] .
"/lib/sql/create_new_site.sql", null,
true, $site_id);
4072 if(!empty($frm[
'wwwroot']) &&
String::substr($frm[
'wwwroot'], -1) ===
'/') {
4075 if (intval(
vn($frm[
'keep_old_orders_intact']))>1 && empty($frm[
'keep_old_orders_intact_date'])) {
4078 $frm[
'keep_old_orders_intact'] = (intval(
vn($frm[
'keep_old_orders_intact']))>1? strtotime(
get_mysql_date_from_user_input($frm[
'keep_old_orders_intact_date'])) : intval(
vn($frm[
'keep_old_orders_intact'])));
4080 if(isset($frm[
'template_directory']) && !file_exists($GLOBALS[
'dirroot'] .
"/modeles/" .
vb($frm[
'template_directory']))) {
4081 unset($frm[
'template_directory']);
4084 foreach(array(
'enable_prototype',
'enable_jquery') as $this_key) {
4085 $frm[$this_key] =
vn($frm[$this_key]);
4089 foreach($frm as $this_key => $this_value) {
4090 if(!in_array($this_key, array(
'token',
'keep_old_orders_intact_date',
'site_id'))) {
4091 foreach(array(
'module_',
'display_mode_',
'etat_',
'position_',
'home_') as $this_begin) {
4099 set_configuration_variable(array(
'technical_code' => $this_key,
'string' => $this_value,
'site_id' => $site_id,
'origin' =>
'sites.php'),
true,
true);
4105 if (!empty($update_module)) {
4108 foreach(array_keys($modules) as $key) {
4109 $sql =
"UPDATE peel_modules
4112 , position='" . intval($frm[
'position_' . $key]) .
"'
4113 , etat='" . (empty($frm[
'etat_' . $key]) ? 0 : 1) .
"'
4114 , in_home='" . (empty($frm[
'home_' . $key]) ? 0 : 1) .
"'
4123 if (
$mode ==
'insere') {
4150 if(!empty($available_langs_array)) {
4152 if(in_array($_SESSION[
'session_langue'], $available_langs_array)) {
4155 $temp[] = $_SESSION[
'session_langue'];
4156 foreach($available_langs_array as $this_lang) {
4157 if($this_lang != $_SESSION[
'session_langue']) {
4158 $temp[] = $this_lang;
4161 $available_langs_array = $temp;
4164 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message_to_escape' =>
$error_msg))->fetch();
4166 foreach($available_langs_array as $this_lang){
4175 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message_to_escape' =>
$error_msg))->fetch();
4178 if(count($available_langs_array)>1) {
4179 foreach($available_langs_array as $this_lang) {
4186 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message_to_escape' =>
$error_msg))->fetch();
4193 $zone_to_coutry = array(
'france_mainland' => array(
'FRA'),
'europe'=> array(
'DEU',
'AUT',
'BEL',
'BGR',
'DNK',
'ESP',
'FIN',
'GRC',
'HUN',
'IRL',
'ITA',
'NLD',
'POL',
'PRT',
'CZE',
'ROU',
'GBR',
'SWE',
'CYP',
'EST',
'LVA',
'LTU',
'LUX',
'MLT',
'SVK',
'SVN'),
'france_and_overseas' => array(
'GUF',
'PYF',
'ATF',
'GLP',
'MTQ',
'MYT',
'NCL',
'REU',
'SPM',
'WLF'),
'world'=>array(
'AFG',
'ZAF',
'ALB',
'DZA',
'SAU',
'ARG',
'AUS',
'BRA',
'CAN',
'CHL',
'CHN',
'COL',
'KOR',
'CRI',
'HRV',
'EGY',
'ARE',
'ECU',
'USA',
'SLV',
'HKG',
'IND',
'IDN',
'ISR',
'JPN',
'JOR',
'LBN',
'MYS',
'MAR',
'MEX',
'NOK',
'NZL',
'PER',
'PAK',
'PHL',
'PRI',
'RUS',
'SGP',
'CHE',
'TWN',
'THA',
'TUR',
'UKR',
'VEN',
'SRB',
'WSM',
'AND',
'AGO',
'AIA',
'ATA',
'ATG',
'ARM',
'ABW',
'AZE',
'BHS',
'BHR',
'BGD',
'BLR',
'BLZ',
'BEN',
'BMU',
'BTN',
'BOL',
'BIH',
'BWA',
'BVT',
'IOT',
'VGB',
'BRN',
'BFA',
'BDI',
'KHM',
'CMR',
'CPV',
'CYM',
'CAF',
'TCD',
'CXR',
'CCK',
'COM',
'COG',
'COK',
'CUB',
'DJI',
'DMA',
'DOM',
'TLS',
'GNQ',
'ERI',
'ETH',
'FLK',
'FRO',
'FJI',
'GAB',
'GMB',
'GEO',
'GHA',
'GIB',
'GRL',
'GRD',
'GUM',
'GTM',
'GIN',
'GNB',
'HTI',
'HMD',
'HND',
'ISL',
'IRN',
'IRQ',
'CIV',
'JAM',
'KAZ',
'KEN',
'KIR',
'KOR',
'KWT',
'KGZ',
'LAO',
'LSO',
'LBR',
'LBY',
'LIE',
'MAC',
'MKD',
'MDG',
'MWI',
'MDV',
'MLI',
'MHL',
'MRT',
'MUS',
'FSM',
'MDA',
'MCO',
'MNG',
'MSR',
'MOZ',
'MMR',
'NAM',
'NRU',
'NPL',
'NIC',
'NER',
'NGA',
'NIU',
'NFK',
'MNP',
'OMN',
'PLW',
'PAN',
'PNG',
'PRY',
'PCN',
'QAT',
'RWA',
'SGS',
'KNA',
'LCA',
'VCT',
'WSM',
'SMR',
'STP',
'SEN',
'SYC',
'SLE',
'SOM',
'LKA',
'SHN',
'SDN',
'SUR',
'SJM',
'SWZ',
'SYR',
'TJK',
'TZA',
'TGO',
'TKL',
'TON',
'TTO',
'TUN',
'TKM',
'TCA',
'TUV',
'UMI',
'UGA',
'URY',
'UZB',
'VUT',
'VAT',
'VNM',
'VIR',
'ESH',
'YEM',
'COD',
'ZMB',
'ZWE',
'BRB',
'MNE'));
4197 $zones_availables = array();
4199 $zones_availables[
$result[
'id']] = $zone_to_coutry[$result[
'technical_code']];
4200 if ($result[
'technical_code'] ==
'france_mainland') {
4202 $france_zone_id = $result[
'id'];
4205 foreach ($zones_availables as $this_zone_id => $this_zone_country_array_by_technical_code) {
4206 query(
'UPDATE peel_pays
4207 SET zone='.intval($this_zone_id).
'
4210 if ($france_zone_id == $this_zone_id) {
4215 WHERE (technical_code="colissimo_without_signature" OR technical_code="pickup") AND ' .
get_filter_site_cond(
'types', null,
false, $site_id));
4217 query(
'UPDATE peel_tarifs
4219 WHERE ' . (
$result[
'technical_code'] ==
"pickup"?
'tarif = 0.00':
'tarif > 0') .
' AND ' .
get_filter_site_cond(
'tarifs', null,
false, $site_id));
4225 FROM peel_email_template_cat
4226 WHERE technical_code="automatic_sending" AND ' .
get_filter_site_cond(
'email_template_cat', null,
false, $site_id));
4228 query(
'UPDATE peel_email_template
4229 SET `id_cat`=' . intval(
$result[
'id']) .
'
4244 if (isset($_SESSION[
'session_admin_multisite']) && $_SESSION[
'session_admin_multisite'] === 0) {
4248 if(!empty($array[
'site_id']) && count($all_sites_name_array) > 1) {
4249 $output .=
'[' .
vb($all_sites_name_array[$array[
'site_id']]) .
'] ';
4263 include($GLOBALS[
'dirroot'].
"/lib/class/ProductsBought.php");
4265 if (!empty($produit)) {
4266 $clients_array = array();
4269 foreach ($produit->clients() as $client) {
4270 if ($c ==
"#E8E8E8") {
4275 $clients_array[] = array(
'tr_rollover' => tr_rollover(
$i,
true),
4276 'href' => $GLOBALS[
'administrer_url'] .
'/utilisateurs.php?mode=modif&id_utilisateur=' . $client->id_utilisateur,
4277 'nom_famille' => $client->nom_famille,
4278 'prenom' => $client->prenom,
4279 'adresse' => $client->adresse,
4280 'code_postal' => $client->code_postal,
4281 'ville' => $client->ville,
4282 'email' => $client->email,
4283 'telephone' => $client->telephone,
4284 'total_quantite' => $client->total_quantite,
4285 'prix' =>
fprix($client->total_paye,
true, $GLOBALS[
'site_parameters'][
'code'],
false)
4289 if (!empty($array_output_mode)) {
4290 return $clients_array;
4292 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'admin_liste_clients_par_produit.tpl');
4293 $tpl->assign(
'nom', $produit->nom);
4295 $tpl->assign(
'export_href', $GLOBALS[
'wwwroot_in_admin'] .
'/modules/export/administrer/export_ventes.php?mode=affiche_liste_clients_par_produit&id=' .
$id);
4296 $tpl->assign(
'excel_src', $GLOBALS[
'administrer_url'] .
'/images/excel.jpg');
4297 $tpl->assign(
'clients', $clients_array);
4298 $tpl->assign(
'STR_LAST_NAME', $GLOBALS[
'STR_LAST_NAME']);
4299 $tpl->assign(
'STR_FIRST_NAME', $GLOBALS[
'STR_FIRST_NAME']);
4300 $tpl->assign(
'STR_ADDRESS', $GLOBALS[
'STR_ADDRESS']);
4301 $tpl->assign(
'STR_ADMIN_MENU_WEBMASTERING_CLIENTS_EXPORT', $GLOBALS[
'STR_ADMIN_MENU_WEBMASTERING_CLIENTS_EXPORT']);
4302 $tpl->assign(
'STR_EMAIL', $GLOBALS[
'STR_EMAIL']);
4303 $tpl->assign(
'STR_TELEPHONE', $GLOBALS[
'STR_TELEPHONE']);
4304 $tpl->assign(
'STR_QUANTITY_SHORT', $GLOBALS[
'STR_QUANTITY_SHORT']);
4305 $tpl->assign(
'STR_TOTAL_AMOUNT', $GLOBALS[
'STR_TOTAL_AMOUNT']);
4306 $tpl->assign(
'STR_ADMIN_PRODUITS_ACHETES_LIST_TITLE', $GLOBALS[
'STR_ADMIN_PRODUITS_ACHETES_LIST_TITLE']);
4310 echo $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $GLOBALS[
'STR_ADMIN_PRODUITS_ACHETES_ERR_ID_NOT_FOUND']))->fetch();
4330 $sql_inner_array = array();
4331 $sql_having_array = array();
4332 $sql_columns_array = array(
'u.*');
4338 if (!empty($frm[
'client_info'])) {
4341 if (!empty($frm[
'email']) && is_numeric(trim($frm[
'email']))) {
4343 $sql_where_array[] =
'u.id_utilisateur = "' . intval($frm[
'email']) .
'"';
4344 }
elseif (!empty($frm[
'email'])) {
4347 if (!empty($frm[
'societe'])) {
4348 $sql_where_array[] =
'(u.societe LIKE "%' .
nohtml_real_escape_string(trim($frm[
'societe'])) .
'%" OR REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(u.siret,")",""),"(",""), ".",""), "-",""), " ","") LIKE "%' .
nohtml_real_escape_string(str_replace(array(
'(',
')',
'.',
'-',
' '),
'', trim($frm[
'societe']))) .
'%" OR u.url LIKE "%' .
nohtml_real_escape_string(trim($frm[
'societe'])) .
'%")';
4350 if (!empty($frm[
'ville_cp'])) {
4355 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $GLOBALS[
'STR_ADMIN_UTILISATEURS_NO_ADMIN_RIGHT_TO_LIST']))->fetch();
4357 $basic_search_where_count = count($sql_where_array);
4359 if (!empty($frm[
'type'])) {
4362 if (isset($frm[
'control_plus']) && $frm[
'control_plus'] !=
'') {
4363 $sql_where_array[] =
'u.control_plus = "' . intval($frm[
'control_plus']) .
'"';
4365 if (!empty($frm[
'fonction'])) {
4368 if (isset($frm[
'site_on']) && $frm[
'site_on'] !=
'') {
4369 $sql_where_array[] =
'u.url ' . (!empty($frm[
'site_on'])?
' <> ""':
' = ""');
4371 if (!empty($frm[
'id_cat'])) {
4374 if (!empty($frm[
'id_categories'])) {
4375 $this_categories_where_array = array();
4376 foreach($frm[
'id_categories'] as $this_categories) {
4377 $this_categories_where_array[] =
'CONCAT(",",u.id_categories,",") LIKE "%,'.$this_categories.
',%"';
4379 $sql_where_array[] =
'('.implode(
' OR ', $this_categories_where_array).
')';
4382 if (!empty($frm[
'tel'])) {
4384 $frm[
'tel'] = str_replace(array(
'(',
')',
'.',
'-',
' '),
'', trim($frm[
'tel']));
4385 $sql_where_array[] =
'(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(u.telephone,")",""),"(",""), ".",""), "-",""), " ","") LIKE "%' .
nohtml_real_escape_string($frm[
'tel']) .
'%" OR REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(u.portable,")",""),"(",""), ".",""), "-",""), " ","") LIKE "%' .
nohtml_real_escape_string($frm[
'tel']) .
'%" OR REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(u.fax,")",""),"(",""), ".",""), "-",""), " ","") LIKE "%' .
nohtml_real_escape_string($frm[
'tel']) .
'%")';
4387 if (!empty($frm[
'origin'])) {
4388 $sql_where_array[] =
'u.origin="' . intval($frm[
'origin']) .
'"';
4390 if (!empty($frm[
'commercial'])) {
4391 $sql_where_array[] =
'u.commercial_contact_id = "' . intval($frm[
'commercial']) .
'"';
4393 if (!empty($frm[
'pays'])) {
4396 if (!empty($frm[
'continent']) && is_array($frm[
'continent'])) {
4397 if (in_array(5, $frm[
'continent'])) {
4399 $frm[
'continent'][] = 6;
4402 $sql_inner_array[
'peel_pays'] =
'INNER JOIN peel_pays pays ON pays.id=u.pays AND ' .
get_filter_site_cond(
'pays',
'pays');
4404 if (!empty($frm[
'seg_who']) && $frm[
'seg_who'] !=
'0') {
4407 if (!empty($frm[
'seg_buy'])) {
4410 if (!empty($frm[
'seg_want'])) {
4413 if (!empty($frm[
'seg_think'])) {
4416 if (!empty($frm[
'seg_followed'])) {
4419 if (!empty($frm[
'raison'])) {
4420 $sql_inner_array[
'peel_admins_contacts_planified'] =
'INNER JOIN peel_admins_contacts_planified pacp ON pacp.user_id=u.id_utilisateur';
4423 if (isset($frm[
'etat']) && $frm[
'etat'] !=
'') {
4426 if (isset($frm[
'newsletter']) && $frm[
'newsletter'] !=
'') {
4429 if (isset($frm[
'offre_commercial']) && $frm[
'offre_commercial'] !=
'') {
4432 if (!empty($frm[
'group'])) {
4435 if (!empty($frm[
'valid'])) {
4438 if (!empty($frm[
'activity'])) {
4441 if (!empty($frm[
'user_lang'])) {
4444 if (!empty($frm[
'list_produit'])) {
4448 $sql_inner_array[
'peel_commandes_articles'] =
'INNER JOIN peel_commandes_articles pca ON pca.commande_id= c.id AND ' .
get_filter_site_cond(
'commandes_articles',
'pca',
true);
4450 $sql_columns_array[] =
'SUM(pca.quantite) AS this_quantite_sum';
4451 if (!empty($frm[
'nombre_produit']) && $frm[
'nombre_produit'] !=
"no_info") {
4452 if ($frm[
'nombre_produit'] == -1) {
4453 $sql_having_array[] =
'this_quantite_sum=0';
4455 $sql_having_array[] =
'this_quantite_sum>="' . intval($frm[
'nombre_produit']) .
'"';
4459 $sql_having_array[] =
'this_quantite_sum>0';
4462 $sql_where_array[] =
'0';
4466 if (!empty($frm[
'abonne'])) {
4467 if (in_array($frm[
'abonne'], array(
'any',
'no',
'never',
'earlier'))) {
4468 if ($frm[
'abonne'] ==
'any') {
4469 $sql_where_array[] =
'(u.platinum_status="YES" OR u.diamond_status="YES")';
4470 }
elseif ($frm[
'abonne'] ==
'no') {
4471 $sql_where_array[] =
'u.platinum_until<"' . time() .
'" AND u.diamond_until<"' . time() .
'"';
4472 }
elseif ($frm[
'abonne'] ==
'never') {
4473 $sql_where_array[] =
'u.platinum_status="NO" AND u.diamond_status="NO"';
4474 }
elseif ($frm[
'abonne'] ==
'earlier') {
4475 $sql_where_array[] =
'(u.platinum_until BETWEEN 1 AND "' . time() .
'" OR u.diamond_until BETWEEN 1 AND "' . time() .
'")';
4478 if ($frm[
'abonne'] ==
'platinum_until') {
4479 $sql_where_array[] =
'u.platinum_status="YES" AND u.platinum_until!=0';
4480 }
elseif ($frm[
'abonne'] ==
'diamond_until') {
4481 $sql_where_array[] =
'u.diamond_until!=0 AND u.diamond_status="YES" ';
4485 if (!empty($frm[
'list_annonce']) && $frm[
'list_annonce'] !=
'0') {
4486 $sql_inner_array[
'peel_lot_vente'] =
'INNER JOIN peel_lot_vente plv ON plv.id_personne=u.id_utilisateur';
4487 $sql_inner_array[
'peel_categories_annonces'] =
'INNER JOIN peel_categories_annonces pcan ON pcan.id=plv.id_categorie';
4490 if (!empty($frm[
'annonces_contiennent'])) {
4491 $sql_inner_array[
'peel_lot_vente'] =
'INNER JOIN peel_lot_vente plv ON plv.id_personne=u.id_utilisateur';
4492 foreach ($GLOBALS[
'admin_lang_codes'] as $lng) {
4496 if (!empty($frm[
'with_gold_ad'])) {
4497 $sql_inner_array[
'peel_gold_ads'] =
'INNER JOIN peel_gold_ads pga ON pga.user_id=u.id_utilisateur';
4501 foreach(array(
'ads_count' =>
'ads_count',
'date_last_paiement' =>
'date_last_paiement',
'date_derniere_connexion' =>
'date',
'date_insert' =>
'u.date_insert',
'date_statut_commande' =>
'c.o_timestamp',
'date_contact_prevu' =>
'pacp.timestamp') as $this_get => $this_sql_field) {
4502 if (!empty($frm[$this_get])) {
4503 if (substr($this_get, 0, 5) ==
'date_') {
4504 if(
vb($frm[$this_get .
'_input1'])==
'') {
4507 if(
vb($frm[$this_get .
'_input1'])==
'') {
4511 if ($frm[$this_get] ==
'1') {
4513 $last_value = $first_value .
' 23:59:59';
4514 }
elseif ($frm[$this_get] ==
'2') {
4516 $last_value =
'2030-12-31 23:59:59';
4517 }
elseif ($frm[$this_get] ==
'3' || $frm[$this_get] ==
'5' || $frm[$this_get] ==
'6' || $frm[$this_get] ==
'7') {
4520 if ((!empty($frm[
'actual_time'])) && ($frm[
'actual_time'] == 1)) {
4521 $last_value .=
' ' . date(
'H:i:s', (time()));
4524 $last_value .=
' 23:59:59';
4526 }
elseif ($frm[$this_get] ==
'4') {
4528 $last_value = str_replace(
'0000-00-00',
'2030-12-31', $first_value);
4529 $first_value =
'0000-00-00 00:00:00';
4531 $output .=$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => sprintf($GLOBALS[
'STR_ADMIN_CASE_NOT_FORECASTED'] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': %s', $frm[$this_get])))->fetch();
4534 $first_value =
vb($frm[$this_get .
'_input1']);
4535 $last_value =
vb($frm[$this_get .
'_input2']);
4538 if ($last_value !=
'2030-12-31 23:59:59') {
4544 if ($this_get ==
'date_derniere_connexion') {
4548 if ($frm[$this_get] ==
'2') {
4552 $sql_inner_array[
'peel_utilisateur_connexions'] =
'INNER JOIN (SELECT user_id, user_login, user_ip, MAX(date) AS date FROM peel_utilisateur_connexions WHERE ' . $this_cond_temp_expression .
' AND ' .
get_filter_site_cond(
'utilisateur_connexions', null,
true) .
' GROUP BY user_id) uc ON uc.user_id=u.id_utilisateur
4556 $sql_inner_array[
'peel_utilisateur_connexions'] =
'INNER JOIN (SELECT * FROM peel_utilisateur_connexions WHERE ' . $this_cond_temp_expression .
' AND ' .
get_filter_site_cond(
'utilisateur_connexions', null,
true) .
' GROUP BY user_id) uc ON uc.user_id=u.id_utilisateur
4559 $sql_where_array[] =
'uc2.date IS NULL';
4563 }
elseif ($this_get ==
'date_last_paiement') {
4565 $sql_columns_array[] =
'MAX(c.a_timestamp) AS date_last_paiement';
4566 $sql_inner_array[
'peel_statut_paiement'] =
'LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND ' .
get_filter_site_cond(
'statut_paiement',
'sp') .
' AND sp.technical_code IN ("being_checked","completed") AND sp.technical_code NOT IN ("cancelled")
4568 $sql_having_array[] = $this_cond_temp_expression;
4569 }
elseif ($this_get ==
'date_statut_commande') {
4570 if ($frm[
'date_statut_commande'] ==
'5') {
4572 $sql_where_array[] =
'u.id_utilisateur NOT IN (
4573 SELECT c2.id_utilisateur
4574 FROM peel_commandes c2
4575 WHERE ' .
get_filter_site_cond(
'commandes',
'c2',
true) .
' AND ' . str_replace(
'c.',
'c2.', $this_cond_temp_expression) .
')';
4576 }
elseif ($frm[
'date_statut_commande'] ==
'6') {
4578 $sql_where_array[] = $this_cond_temp_expression;
4581 $sql_where_array[] = str_replace(
'o_timestamp',
'a_timestamp', $this_cond_temp_expression);
4583 }
elseif ($this_get ==
'date_contact_prevu') {
4584 $sql_inner_array[
'peel_admins_contacts_planified'] =
'INNER JOIN peel_admins_contacts_planified pacp ON pacp.user_id=u.id_utilisateur';
4586 $timestamp_planified_contact_1 = mktime(0, 0, 0, date(
'm', $timestamp1), date(
'd', $timestamp1), date(
'Y', $timestamp1));
4588 $timestamp_planified_contact_2 = mktime(0, 0, 0, date(
'm', $timestamp2), date(
'd', $timestamp2), date(
'Y', $timestamp2));
4590 if ($frm[$this_get] == 1) {
4593 }
elseif ($frm[$this_get] == 2) {
4596 }
elseif ($frm[$this_get] == 3) {
4599 }
elseif ($frm[$this_get] == 4) {
4602 }
elseif (!empty($frm[
'ads_count'])) {
4603 $sql_inner_array[
'peel_lot_vente'] =
'INNER JOIN peel_lot_vente plv ON plv.id_personne=u.id_utilisateur';
4604 $sql_columns_array[] =
'COUNT(plv.ref) AS ads_count';
4606 if (intval($frm[
'ads_count']) == 1) {
4609 }
elseif (intval($frm[
'ads_count']) == 2) {
4612 }
elseif (intval($frm[
'ads_count']) == 3) {
4615 }
elseif (intval($frm[
'ads_count']) == 4) {
4619 $sql_where_array[] = $this_cond_temp_expression;
4626 if (!empty(
$priv) &&
$priv ==
"newsletter") {
4631 $sql =
"SELECT " . implode(
', ', $sql_columns_array) .
", p.name_".$_SESSION[
'session_langue'].
" AS profil_name, SUM(".(
display_prices_with_taxes_active()?
'montant':
'montant_ht').
") AS total_ordered, COUNT(c.id) AS count_ordered
4632 FROM peel_utilisateurs u
4634 LEFT JOIN peel_commandes c ON c.id_utilisateur=u.id_utilisateur AND " .
get_filter_site_cond(
'commandes',
'c',
true) .
"
4635 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
4636 " . implode(
' ', $sql_inner_array) .
"
4637 WHERE " . implode(
' AND ', $sql_where_array) .
'
4638 GROUP BY u.id_utilisateur';
4640 if (!empty($sql_having_array)) {
4642 HAVING (' . implode(
') AND (', $sql_having_array) .
') ';
4644 if (!empty($return_sql_request_without_display)) {
4648 $HeaderTitlesArray = array($GLOBALS[
"STR_ADMIN_ADMIN_ACTIONS_ACTIONS"],
'code_client' => $GLOBALS[
"STR_ADMIN_PRIVILEGE"].
' / '.$GLOBALS[
"STR_ADMIN_UTILISATEURS_CLIENT_CODE"],
'nom_famille' => $GLOBALS[
"STR_FIRST_NAME"].
' / '.$GLOBALS[
"STR_LAST_NAME"].
'<br />'.$GLOBALS[
"STR_EMAIL"]);
4649 $HeaderTitlesArray[] = $GLOBALS[
"STR_TELEPHONE"];
4651 $HeaderTitlesArray[] = $GLOBALS[
"STR_ADMIN_GROUP"];
4653 $HeaderTitlesArray[
'date_insert'] = $GLOBALS[
"STR_ADMIN_UTILISATEURS_REGISTRATION_DATE"];
4654 $HeaderTitlesArray[
'total_ordered'] = $GLOBALS[
"STR_ADMIN_INDEX_ORDERS_LIST"];
4655 $HeaderTitlesArray[
'remise_percent'] = $GLOBALS[
"STR_ADMIN_DISCOUNT"];
4656 $HeaderTitlesArray[] = $GLOBALS[
"STR_ADMIN_UTILISATEURS_WAITING_CREDIT"];
4657 $HeaderTitlesArray[
'points'] = $GLOBALS[
'STR_GIFT_POINTS'];
4659 $HeaderTitlesArray[] = $GLOBALS[
"STR_ADMIN_UTILISATEURS_HAS_SPONSOR"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':';
4661 $HeaderTitlesArray[
'site_id'] = $GLOBALS[
'STR_ADMIN_SITES_SITE_NAME'];
4662 $Links->HeaderTitlesArray = $HeaderTitlesArray;
4663 $Links->OrderDefault = $order;
4664 $Links->SortDefault =
'DESC';
4667 $output .= $GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' => $GLOBALS[
'STR_SEARCH_NO_RESULT']))->fetch();
4669 $select_search_array[
'date_insert'] = array(1 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SUBSCRIBED"].
' ' . $GLOBALS[
"STR_ADMIN_DATE_ON"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 2 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SUBSCRIBED"].
' '.$GLOBALS[
"STR_ADMIN_DATE_AFTER"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 3 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SUBSCRIBED"].
' ' . $GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 4 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SUBSCRIBED"] .
' '.$GLOBALS[
"STR_ADMIN_DATE_BEFORE"]. $GLOBALS[
'STR_BEFORE_TWO_POINTS'].
':');
4670 $select_search_array[
'date_last_paiement'] = array(1 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_PAYMENT"].
' ' . $GLOBALS[
"STR_ADMIN_DATE_ON"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 2 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_PAYMENT"].
' '.$GLOBALS[
"STR_ADMIN_DATE_AFTER"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 3 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_PAYMENT"].
' '.$GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 4 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_PAYMENT"].
' '.$GLOBALS[
"STR_ADMIN_DATE_BEFORE"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':');
4671 $select_search_array[
'date_statut_commande'] = array(5 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_NO_ORDER"].
' ' . $GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"]. $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 6 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_ORDER_NOT_PAID"] .
' ' . $GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 7 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_ORDER_PAID"].
' ' . $GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':');
4672 $select_search_array[
'date_derniere_connexion'] = array(1 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_LOGIN"] .
' ' . $GLOBALS[
"STR_ADMIN_DATE_ON"]. $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 2 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_LOGIN"] .
' ' .$GLOBALS[
"STR_ADMIN_DATE_AFTER"]. $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 3 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_LOGIN"] .
' ' . $GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 4 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_LAST_LOGIN"] .
' '.$GLOBALS[
"STR_ADMIN_DATE_BEFORE"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':');
4673 $select_search_array[
'date_contact_prevu'] = array(1 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_CONTACT_FORECASTED"] .
' ' . $GLOBALS[
"STR_ADMIN_DATE_ON"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 2 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_CONTACT_FORECASTED"] .
' ' .$GLOBALS[
"STR_ADMIN_DATE_AFTER"]. $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 3 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_CONTACT_FORECASTED"] .
' ' . $GLOBALS[
"STR_ADMIN_DATE_BETWEEN_START"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 4 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_CONTACT_FORECASTED"] .
' '.$GLOBALS[
"STR_ADMIN_DATE_BEFORE"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':');
4674 $select_search_array[
'ads_count'] = array(1 => $GLOBALS[
"STR_ADMIN_COMPARE_EQUALS"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 2 => $GLOBALS[
"STR_ADMIN_MORE_THAN"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 3 => $GLOBALS[
"STR_ADMIN_COMPARE_BETWEEN"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':' , 4 => $GLOBALS[
"STR_ADMIN_LESS_THAN"] . $GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':');
4675 $select_search_array[
'abonne'] = array(1 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_NEVER"], 2 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_NOT_NOW"], 3 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_NOT_NOW_BUT_EARLIER"], 4 => $GLOBALS[
"STR_ADMIN_UTILISATEURS_SEARCH_SUBSCRIPTION_ALL"]);
4678 $tpl = $GLOBALS[
'tplEngine']->createTemplate(
'admin_utilisateur_liste.tpl');
4679 $GLOBALS[
'js_ready_content_array'][] =
'
4680 display_input2_element("search_date_insert");
4681 display_input2_element("search_date_last_paiement");
4682 display_input2_element("search_date_statut_commande");
4683 display_input2_element("search_date_contact_prevu");
4684 display_input2_element("search_date_derniere_connexion");
4685 display_input2_element("search_ads_count");
4687 $("#search_details").on("hide.bs.collapse", function () {
4688 $("#search_icon").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-right");
4689 // $("#search_col").removeClass("col-md-12").removeClass("col-sm-12").addClass("col-md-9").addClass("col-sm-4");
4691 $("#search_details").on("show.bs.collapse", function () {
4692 $("#search_icon").removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-down");
4693 // $("#search_col").removeClass("col-md-9").removeClass("col-sm-4").addClass("col-md-12").addClass("col-sm-12");
4701 $tpl->assign(
'is_advanced_search', (count($sql_where_array) - $basic_search_where_count) > 0);
4704 $comm_query =
query(
'SELECT u.id_utilisateur, u.prenom, u.nom_famille
4705 FROM peel_utilisateurs u2
4706 INNER JOIN peel_utilisateurs u ON u.id_utilisateur = u2.commercial_contact_id AND ' .
get_filter_site_cond(
'utilisateurs',
'u',
true) .
'
4707 WHERE u2.commercial_contact_id != 0 AND ' .
get_filter_site_cond(
'utilisateurs',
'u2',
true) .
'
4708 GROUP BY u2.commercial_contact_id');
4709 $tpl_comm_opts = array();
4711 $tpl_comm_opts[] = array(
'value' => $commercial[
"id_utilisateur"],
4713 'prenom' =>
vb($commercial[
"prenom"]),
4714 'nom_famille' =>
vb($commercial[
"nom_famille"])
4717 $tpl->assign(
'commercial_options', $tpl_comm_opts);
4722 foreach ($GLOBALS[
'admin_lang_codes'] as $lng) {
4724 'issel' => (
vb($_GET[
'user_lang']) == $lng),
4731 $query_continent =
query(
"SELECT id, name_" . $_SESSION[
'session_langue'] .
" AS name
4732 FROM peel_continents
4734 ORDER BY name_".$_SESSION[
'session_langue']);
4735 $tpl_continent_inps = array();
4736 while ($continent =
fetch_assoc($query_continent)) {
4737 $tpl_continent_inps[] = array(
'value' => $continent[
'id'],
4738 'issel' => !empty($_GET[
'continent']) && is_array($_GET[
'continent']) && in_array($continent[
'id'], $_GET[
'continent']),
4739 'name' => $continent[
'name']
4742 $tpl->assign(
'continent_inputs', $tpl_continent_inps);
4744 $tpl_date_insert_opts = array();
4745 foreach ($select_search_array[
'date_insert'] as $index => $item) {
4746 $tpl_date_insert_opts[] = array(
'value' => $index,
4751 $tpl->assign(
'date_insert_options', $tpl_date_insert_opts);
4753 $tpl_date_last_paiement_opts = array();
4754 foreach ($select_search_array[
'date_last_paiement'] as $index => $item) {
4755 $tpl_date_last_paiement_opts[] = array(
'value' => $index,
4760 $tpl->assign(
'date_last_paiement_options', $tpl_date_last_paiement_opts);
4762 $tpl_date_statut_commande_opts = array();
4763 foreach ($select_search_array[
'date_statut_commande'] as $index => $item) {
4764 $tpl_date_statut_commande_opts[] = array(
'value' => $index,
4769 $tpl->assign(
'date_statut_commande_options', $tpl_date_statut_commande_opts);
4771 $tpl_user_origin_opts = array();
4773 while (isset($GLOBALS[
'STR_USER_ORIGIN_OPTIONS_' .
$i])) {
4774 $tpl_user_origin_opts[] = array(
'value' => $i,
4776 'name' => $GLOBALS[
'STR_USER_ORIGIN_OPTIONS_' . $i]
4780 $tpl->assign(
'user_origin_options', $tpl_user_origin_opts);
4784 $resGroupe =
query(
"SELECT *
4789 $tpl_groupes_options = array();
4791 $tpl_groupes_options[] = array(
'value' => $Groupe[
'id'],
4792 'issel' =>
vb($frm[
'id_groupe']) == $Groupe[
'id'],
4793 'name' => $Groupe[
'nom']
4796 $tpl->assign(
'groupes_options', $tpl_groupes_options);
4798 $tpl->assign(
'STR_ADMIN_GROUP', $GLOBALS[
'STR_ADMIN_GROUP']);
4799 $tpl->assign(
'STR_ADMIN_UTILISATEURS_NO_GROUP_DEFINED', $GLOBALS[
'STR_ADMIN_UTILISATEURS_NO_GROUP_DEFINED']);
4802 $tpl->assign(
'ville_cp',
vb($_GET[
'ville_cp']));
4809 $tpl->assign(
'add_b2b_form_inputs', !empty($GLOBALS[
'site_parameters'][
'add_b2b_form_inputs']));
4815 $tpl_produits_opts = array();
4816 $prod_query =
query(
"SELECT id, nom_".(!empty($GLOBALS[
'site_parameters'][
'product_name_forced_lang'])?$GLOBALS[
'site_parameters'][
'product_name_forced_lang']:$_SESSION[
'session_langue']).
" AS name
4821 while ($this_product =
fetch_assoc($prod_query)) {
4822 $tpl_produits_opts[] = array(
'value' => $this_product[
'id'],
4824 'name' => $this_product[
'name'],
4825 'id' => $this_product[
'id']
4828 $tpl->assign(
'produits_options', $tpl_produits_opts);
4832 $tpl_ads_opts = array();
4833 foreach ($select_search_array[
'ads_count'] as $index => $item) {
4834 $tpl_ads_opts[] = array(
'value' => $index,
4835 'issel' => (
vb($_GET[
'ads_count']) == $index),
4839 $tpl->assign(
'ads_options', $tpl_ads_opts);
4841 $tpl_annonces_opts = array();
4842 $ad_categories = get_ad_categories();
4843 foreach ($ad_categories as $this_category_id => $this_category_name) {
4844 $tpl_annonces_opts[] = array(
'value' => $this_category_id,
4845 'issel' => (
vb($_GET[
'list_annonce']) == $this_category_id),
4846 'name' => $this_category_name
4849 $tpl->assign(
'annonces_options', $tpl_annonces_opts);
4852 $tpl_date_contact_prevu_opts = array();
4853 foreach ($select_search_array[
'date_contact_prevu'] as $index => $item) {
4854 $tpl_date_contact_prevu_opts[] = array(
'value' => $index,
4855 'issel' => (
vn($_GET[
'date_contact_prevu']) == $index),
4859 $tpl->assign(
'date_contact_prevu_options', $tpl_date_contact_prevu_opts);
4862 $tpl_date_derniere_connexion_opts = array();
4863 foreach ($select_search_array[
'date_derniere_connexion'] as $index => $item) {
4864 $tpl_date_derniere_connexion_opts[] = array(
'value' => $index,
4865 'issel' => (
vb($_GET[
'date_derniere_connexion']) == $index),
4869 $tpl->assign(
'date_derniere_connexion_options', $tpl_date_derniere_connexion_opts);
4870 $tpl->assign(
'count_HeaderTitlesArray', count($HeaderTitlesArray));
4872 $tpl->assign(
'is_client_info', isset($_GET[
'client_info']));
4873 $tpl->assign(
'administrer_url', $GLOBALS[
'administrer_url']);
4874 $tpl->assign(
'wwwroot_in_admin', $GLOBALS[
'wwwroot_in_admin']);
4877 $tpl->assign(
'link_multipage',
$Links->GetMultipage());
4878 $tpl->assign(
'link_HeaderRow',
$Links->getHeaderRow());
4879 $tpl->assign(
'is_not_demo', !
a_priv(
'demo'));
4884 $tpl_results = array();
4887 $phone_output_array = array();
4889 $phone_output_array[] = getCallLink($user[
'id_utilisateur'],
String::str_shorten_words($user[
'telephone'], 16,
' '), $user[
'email'], $user[
'pays'],
true);
4890 }
elseif (!empty($user[
'telephone'])) {
4891 $phone_output_array[] = $user[
'telephone'];
4894 $phone_output_array[] = getCallLink($user[
'id_utilisateur'],
String::str_shorten_words($user[
'portable'], 16,
' '), $user[
'email'], $user[
'pays'],
true);
4895 }
elseif (!empty($user[
'portable'])) {
4896 $phone_output_array[] = $user[
'portable'];
4899 $tpl_annonces_count = null;
4901 $annonces_count =
query(
'SELECT count(*) AS nb
4903 WHERE id_personne = ' . intval($user[
'id_utilisateur']));
4905 $tpl_annonces_count =
vn($annonces_count[
"nb"]);
4908 $tpl_group_nom = null;
4909 $tpl_group_remise = null;
4914 $resG =
query($sqlG);
4916 $tpl_group_nom = $G->nom;
4917 $tpl_group_remise = $G->remise;
4921 $tpl_calculer_avoir_client_prix = null;
4922 $tpl_compter_nb_commandes_parrainees = null;
4923 $tpl_recuperer_parrain = null;
4925 $tpl_compter_nb_commandes_parrainees = compter_nb_commandes_parrainees($user[
'id_utilisateur']);
4926 $tpl_recuperer_parrain = recuperer_parrain($user[
'id_utilisateur']);
4930 $email_infos =
'<span style="color: red"><span class="glyphicon glyphicon-warning-sign"></span> ' .
"Emails rejected" .
'</span>';
4934 $tpl_results[] = array(
'tr_rollover' => tr_rollover($i,
true),
4935 'id_utilisateur' => $user[
'id_utilisateur'],
4936 'email' =>
vb($user[
'email']),
4937 'email_infos' =>
vb($email_infos),
4938 'drop_href' =>
get_current_url(
false) .
'?mode=suppr&id_utilisateur=' . $user[
'id_utilisateur'],
4939 'init_href' =>
get_current_url(
false) .
'?mode=init_mdp&email=' . $user[
'email'],
4940 'edit_href' =>
get_current_url(
false) .
'?mode=modif&id_utilisateur=' . $user[
'id_utilisateur'] .
'&start=' . (isset($_GET[
'start']) ? $_GET[
'start'] : 0),
4941 'etat' => $user[
'etat'],
4942 'modif_etat_href' =>
get_current_url(
false) .
'?mode=modif_etat&id=' . $user[
'id_utilisateur'] .
'&etat=' . $user[
'etat'],
4943 'etat_src' => $GLOBALS[
'administrer_url'] .
'/images/' . (empty($user[
'etat']) ?
'puce-blanche.gif' :
'puce-verte.gif'),
4944 'profil_name' => $user[
'profil_name'],
4945 'code_client' => $user[
'code_client'],
4946 'pseudo' => $user[
'pseudo'],
4947 'annonces_count' => $tpl_annonces_count,
4948 'prenom' => $user[
'prenom'],
4949 'nom_famille' => $user[
'nom_famille'],
4950 'societe' => $user[
'societe'],
4952 'siret' => $user[
'siret'],
4953 'code_postal' => $user[
'code_postal'],
4954 'ville' => $user[
'ville'],
4956 'phone_output' => implode(
' / ', $phone_output_array),
4957 'group_nom' => $tpl_group_nom,
4958 'group_remise' => $tpl_group_remise,
4960 'remise_percent' => round($user[
'remise_percent'], 2),
4961 'avoir_prix' =>
fprix($user[
'avoir'],
true, $GLOBALS[
'site_parameters'][
'code'],
false),
4962 'points' => $user[
'points'],
4963 'total_ordered' =>
fprix($user[
'total_ordered'],
true),
4964 'count_ordered' => $user[
'count_ordered'],
4965 'compter_nb_commandes_parrainees' => $tpl_compter_nb_commandes_parrainees,
4966 'recuperer_parrain' => $tpl_recuperer_parrain,
4972 $tpl->assign(
'results', $tpl_results);
4974 $export_client_href = $GLOBALS[
'wwwroot'] .
'/modules/export/administrer/export_clients.php?export=search_user';
4975 if (!empty($_GET[
'mode']) && $_GET[
'mode'] ==
'search') {
4976 foreach($_GET as $key => $value) {
4978 if (is_array($value)) {
4979 foreach($value as $this_value) {
4980 $export_client_href .=
"&".$key.
'[]='.$this_value;
4983 $export_client_href .=
"&".$key.
'='.$value;
4988 $tpl->assign(
'export_client_href', $export_client_href);
4989 $tpl->assign(
'email',
vb($_GET[
'email']));
4990 $tpl->assign(
'client_info',
vb($_GET[
'client_info']));
4991 $tpl->assign(
'societe',
vb($_GET[
'societe']));
4992 $tpl->assign(
'tel',
vb($_GET[
'tel']));
4993 $tpl->assign(
'date_insert_input1',
vb($_GET[
'date_insert_input1']));
4994 $tpl->assign(
'date_insert_input2',
vb($_GET[
'date_insert_input2']));
4995 $tpl->assign(
'date_last_paiement_input1',
vb($_GET[
'date_last_paiement_input1']));
4996 $tpl->assign(
'date_last_paiement_input2',
vb($_GET[
'date_last_paiement_input2']));
4997 $tpl->assign(
'date_statut_commande_input1',
vb($_GET[
'date_statut_commande_input1']));
4998 $tpl->assign(
'date_statut_commande_input2',
vb($_GET[
'date_statut_commande_input2']));
4999 $tpl->assign(
'list_produit',
vb($_GET[
'list_produit']));
5000 $tpl->assign(
'etat',
vb($_GET[
'etat']));
5001 $tpl->assign(
'ads_count_input1',
vb($_GET[
'ads_count_input1']));
5002 $tpl->assign(
'ads_count_input2',
vb($_GET[
'ads_count_input2']));
5003 $tpl->assign(
'annonces_contiennent',
vb($_GET[
'annonces_contiennent']));
5004 $tpl->assign(
'date_contact_prevu_input1',
vb($_GET[
'date_contact_prevu_input1']));
5005 $tpl->assign(
'date_contact_prevu_input2',
vb($_GET[
'date_contact_prevu_input2']));
5006 $tpl->assign(
'date_derniere_connexion_input1',
vb($_GET[
'date_derniere_connexion_input1']));
5007 $tpl->assign(
'date_derniere_connexion_input2',
vb($_GET[
'date_derniere_connexion_input2']));
5008 $tpl->assign(
'with_gold_ad',
vn($_GET[
'with_gold_ad']));
5009 $tpl->assign(
'type',
vb($_GET[
'type']));
5011 $tpl->assign(
'site_on',
vb($_GET[
'site_on']));
5013 $tpl->assign(
'pseudo_is_not_used', !empty($GLOBALS[
'site_parameters'][
'pseudo_is_not_used']));
5014 $tpl->assign(
'STR_BEFORE_TWO_POINTS', $GLOBALS[
'STR_BEFORE_TWO_POINTS']);
5015 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
5016 $tpl->assign(
'STR_AND', $GLOBALS[
'STR_AND']);
5017 $tpl->assign(
'STR_CHOOSE', $GLOBALS[
'STR_CHOOSE']);
5018 $tpl->assign(
'STR_BUYERS', $GLOBALS[
'STR_BUYERS']);
5019 $tpl->assign(
'STR_IMPORTERS_EXPORTERS', $GLOBALS[
'STR_IMPORTERS_EXPORTERS']);
5020 $tpl->assign(
'STR_COMMERCIAL_AGENT', $GLOBALS[
'STR_COMMERCIAL_AGENT']);
5021 $tpl->assign(
'STR_PURCHASING_MANAGER', $GLOBALS[
'STR_PURCHASING_MANAGER']);
5022 $tpl->assign(
'STR_WORD_SELLERS', $GLOBALS[
'STR_WORD_SELLERS']);
5023 $tpl->assign(
'STR_WHOLESALER', $GLOBALS[
'STR_WHOLESALER']);
5024 $tpl->assign(
'STR_HALF_WHOLESALER', $GLOBALS[
'STR_HALF_WHOLESALER']);
5025 $tpl->assign(
'STR_RETAILERS', $GLOBALS[
'STR_RETAILERS']);
5026 $tpl->assign(
'STR_ADMIN_CHOOSE_SEARCH_CRITERIA', $GLOBALS[
'STR_ADMIN_CHOOSE_SEARCH_CRITERIA']);
5027 $tpl->assign(
'STR_ADMIN_ID', $GLOBALS[
'STR_ADMIN_ID']);
5028 $tpl->assign(
'STR_EMAIL', $GLOBALS[
'STR_EMAIL']);
5029 $tpl->assign(
'STR_PSEUDO', $GLOBALS[
'STR_PSEUDO']);
5030 $tpl->assign(
'STR_FIRST_NAME', $GLOBALS[
'STR_FIRST_NAME']);
5031 $tpl->assign(
'STR_LAST_NAME', $GLOBALS[
'STR_LAST_NAME']);
5032 $tpl->assign(
'STR_COMPANY', $GLOBALS[
'STR_COMPANY']);
5033 $tpl->assign(
'STR_SIREN', $GLOBALS[
'STR_SIREN']);
5034 $tpl->assign(
'STR_WEBSITE', $GLOBALS[
'STR_WEBSITE']);
5035 $tpl->assign(
'STR_TELEPHONE', $GLOBALS[
'STR_TELEPHONE']);
5036 $tpl->assign(
'STR_FAX', $GLOBALS[
'STR_FAX']);
5037 $tpl->assign(
'STR_ADMIN_UTILISATEURS_PROFILE_TYPE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_PROFILE_TYPE']);
5038 $tpl->assign(
'STR_ADMIN_UTILISATEURS_NEWSLETTER_SUBSCRIBER', $GLOBALS[
'STR_ADMIN_UTILISATEURS_NEWSLETTER_SUBSCRIBER']);
5039 $tpl->assign(
'STR_ADMIN_UTILISATEURS_COMMERCIAL_OFFERS', $GLOBALS[
'STR_ADMIN_UTILISATEURS_COMMERCIAL_OFFERS']);
5040 $tpl->assign(
'STR_ADMIN_UTILISATEURS_MANAGED_BY', $GLOBALS[
'STR_ADMIN_UTILISATEURS_MANAGED_BY']);
5041 $tpl->assign(
'STR_STATUS', $GLOBALS[
'STR_STATUS']);
5042 $tpl->assign(
'STR_ADMIN_LANGUAGE', $GLOBALS[
'STR_ADMIN_LANGUAGE']);
5043 $tpl->assign(
'STR_ADMIN_UTILISATEURS_MANDATORY_FOR_MULTIPLE_SEND', $GLOBALS[
'STR_ADMIN_UTILISATEURS_MANDATORY_FOR_MULTIPLE_SEND']);
5044 $tpl->assign(
'STR_ADMIN_ACTIVATED', $GLOBALS[
'STR_ADMIN_ACTIVATED']);
5045 $tpl->assign(
'STR_ADMIN_DEACTIVATED', $GLOBALS[
'STR_ADMIN_DEACTIVATED']);
5046 $tpl->assign(
'STR_ADMIN_UTILISATEURS_WHO', $GLOBALS[
'STR_ADMIN_UTILISATEURS_WHO']);
5047 $tpl->assign(
'STR_TYPE', $GLOBALS[
'STR_TYPE']);
5048 $tpl->assign(
'STR_FONCTION', $GLOBALS[
'STR_FONCTION']);
5049 $tpl->assign(
'STR_ADMIN_WEBSITE', $GLOBALS[
'STR_ADMIN_WEBSITE']);
5050 $tpl->assign(
'STR_BUYERS', $GLOBALS[
'STR_BUYERS']);
5051 $tpl->assign(
'STR_IMPORTERS_EXPORTERS', $GLOBALS[
'STR_IMPORTERS_EXPORTERS']);
5052 $tpl->assign(
'STR_COMMERCIAL_AGENT', $GLOBALS[
'STR_COMMERCIAL_AGENT']);
5053 $tpl->assign(
'STR_PURCHASING_MANAGER', $GLOBALS[
'STR_PURCHASING_MANAGER']);
5054 $tpl->assign(
'STR_WORD_SELLERS', $GLOBALS[
'STR_WORD_SELLERS']);
5055 $tpl->assign(
'STR_WHOLESALER', $GLOBALS[
'STR_WHOLESALER']);
5056 $tpl->assign(
'STR_HALF_WHOLESALER', $GLOBALS[
'STR_HALF_WHOLESALER']);
5057 $tpl->assign(
'STR_RETAILERS', $GLOBALS[
'STR_RETAILERS']);
5058 $tpl->assign(
'STR_LEADER', $GLOBALS[
'STR_LEADER']);
5059 $tpl->assign(
'STR_MANAGER', $GLOBALS[
'STR_MANAGER']);
5060 $tpl->assign(
'STR_EMPLOYEE', $GLOBALS[
'STR_EMPLOYEE']);
5061 $tpl->assign(
'STR_YES', $GLOBALS[
'STR_YES']);
5062 $tpl->assign(
'STR_NO', $GLOBALS[
'STR_NO']);
5063 $tpl->assign(
'STR_ADMIN_UTILISATEURS_BUY', $GLOBALS[
'STR_ADMIN_UTILISATEURS_BUY']);
5064 $tpl->assign(
'STR_ADMIN_UTILISATEURS_WANTS', $GLOBALS[
'STR_ADMIN_UTILISATEURS_WANTS']);
5065 $tpl->assign(
'STR_ADMIN_UTILISATEURS_THINKS', $GLOBALS[
'STR_ADMIN_UTILISATEURS_THINKS']);
5066 $tpl->assign(
'STR_ADMIN_UTILISATEURS_FOLLOWED_BY', $GLOBALS[
'STR_ADMIN_UTILISATEURS_FOLLOWED_BY']);
5067 $tpl->assign(
'STR_TOWN', $GLOBALS[
'STR_TOWN']);
5068 $tpl->assign(
'STR_ZIP', $GLOBALS[
'STR_ZIP']);
5069 $tpl->assign(
'STR_COUNTRY', $GLOBALS[
'STR_COUNTRY']);
5070 $tpl->assign(
'STR_CONTINENT', $GLOBALS[
'STR_CONTINENT']);
5071 $tpl->assign(
'STR_ADMIN_UTILISATEURS_ORDER_STATUS_DATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_ORDER_STATUS_DATE']);
5072 $tpl->assign(
'STR_SEARCH', $GLOBALS[
'STR_SEARCH']);
5073 $tpl->assign(
'STR_ADMIN_CHECK_ALL', $GLOBALS[
'STR_ADMIN_CHECK_ALL']);
5074 $tpl->assign(
'STR_ADMIN_UNCHECK_ALL', $GLOBALS[
'STR_ADMIN_UNCHECK_ALL']);
5075 $tpl->assign(
'STR_ADMIN_UTILISATEURS_SEND_EMAIL_TO_SELECTED_USERS', $GLOBALS[
'STR_ADMIN_UTILISATEURS_SEND_EMAIL_TO_SELECTED_USERS']);
5076 $tpl->assign(
'STR_ADMIN_UTILISATEURS_REGISTRATION_DATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_REGISTRATION_DATE']);
5077 $tpl->assign(
'STR_ADMIN_UTILISATEURS_LAST_PAYMENT_DATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_LAST_PAYMENT_DATE']);
5078 $tpl->assign(
'STR_ADMIN_DATE_BETWEEN_AND', $GLOBALS[
'STR_ADMIN_DATE_BETWEEN_AND']);
5079 $tpl->assign(
'STR_ADMIN_UTILISATEURS_LAST_PAYMENT_DATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_LAST_PAYMENT_DATE']);
5080 $tpl->assign(
'STR_ORIGIN', $GLOBALS[
'STR_ORIGIN']);
5081 $tpl->assign(
'STR_ADMIN_UTILISATEURS_SUBSCRIBER', $GLOBALS[
'STR_ADMIN_UTILISATEURS_SUBSCRIBER']);
5082 $tpl->assign(
'STR_ADMIN_UTILISATEURS_PRODUCT_BOUGHT_AND_QUANTITY', $GLOBALS[
'STR_ADMIN_UTILISATEURS_PRODUCT_BOUGHT_AND_QUANTITY']);
5084 if (
vb($GLOBALS[
'site_parameters'][
'type_affichage_user_favorite_id_categories']) ==
'checkbox') {
5085 $tpl->assign(
'id_categories', get_ad_select_options(null,
vb($_GET[
'id_categories']),
'id',
false,
false,
'checkbox',
'id_categories'));
5086 }
elseif (
vb($GLOBALS[
'site_parameters'][
'type_affichage_user_favorite_id_categories']) ==
'select') {
5087 $tpl->assign(
'id_cat_1', get_ad_select_options(null,
vb($_GET[
'id_cat_1']),
'id'));
5088 $tpl->assign(
'id_cat_2', get_ad_select_options(null,
vb($_GET[
'id_cat_2']),
'id'));
5089 $tpl->assign(
'id_cat_3', get_ad_select_options(null,
vb($_GET[
'id_cat_3']),
'id'));
5091 $tpl->assign(
'STR_ADMIN_CHOOSE_FAVORITE_CATEGORIES', $GLOBALS[
'STR_ADMIN_CHOOSE_FAVORITE_CATEGORIES']);
5092 $tpl->assign(
'STR_FIRST_CHOICE', $GLOBALS[
'STR_FIRST_CHOICE']);
5093 $tpl->assign(
'STR_SECOND_CHOICE', $GLOBALS[
'STR_SECOND_CHOICE']);
5094 $tpl->assign(
'STR_THIRD_CHOICE', $GLOBALS[
'STR_THIRD_CHOICE']);
5095 $tpl->assign(
'STR_MODULE_ANNONCES_ADMIN_USER_WITH_GOLD', $GLOBALS[
'STR_MODULE_ANNONCES_ADMIN_USER_WITH_GOLD']);
5096 $tpl->assign(
'STR_MODULE_ANNONCES_ADMIN_USER_ADS_COUNT', $GLOBALS[
'STR_MODULE_ANNONCES_ADMIN_USER_ADS_COUNT']);
5097 $tpl->assign(
'STR_MODULE_ANNONCES_ADMIN_ADS_AVAILABLE', $GLOBALS[
'STR_MODULE_ANNONCES_ADMIN_ADS_AVAILABLE']);
5098 $tpl->assign(
'STR_MODULE_ANNONCES_ADMIN_ADS_CONTAIN', $GLOBALS[
'STR_MODULE_ANNONCES_ADMIN_ADS_CONTAIN']);
5099 $tpl->assign(
'STR_MODULE_ANNONCES_AD', $GLOBALS[
'STR_MODULE_ANNONCES_AD']);
5101 $tpl->assign(
'STR_ADMIN_UTILISATEURS_CONTACT_FORECASTED_DATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_CONTACT_FORECASTED_DATE']);
5102 $tpl->assign(
'STR_ADMIN_DATE_BETWEEN_AND', $GLOBALS[
'STR_ADMIN_DATE_BETWEEN_AND']);
5103 $tpl->assign(
'STR_ADMIN_REASON', $GLOBALS[
'STR_ADMIN_REASON']);
5104 $tpl->assign(
'STR_ADMIN_UTILISATEURS_LAST_LOGIN_DATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_LAST_LOGIN_DATE']);
5105 $tpl->assign(
'STR_ADMIN_UTILISATEURS_USERS_COUNT', $GLOBALS[
'STR_ADMIN_UTILISATEURS_USERS_COUNT']);
5106 $tpl->assign(
'STR_ADMIN_UTILISATEURS_ORDERS_LIST', $GLOBALS[
'STR_ADMIN_UTILISATEURS_ORDERS_LIST']);
5107 $tpl->assign(
'STR_ADMIN_UTILISATEURS_CREATE_ORDER', $GLOBALS[
'STR_ADMIN_UTILISATEURS_CREATE_ORDER']);
5108 $tpl->assign(
'STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL_SUBTITLE', $GLOBALS[
'STR_ADMIN_CODES_PROMOS_SEND_BY_EMAIL_SUBTITLE']);
5109 $tpl->assign(
'STR_ADMIN_UTILISATEURS_LIST_EXPLAIN', $GLOBALS[
'STR_ADMIN_UTILISATEURS_LIST_EXPLAIN']);
5110 $tpl->assign(
'STR_ADMIN_UTILISATEURS_SEND_NEW_PASSWORD', $GLOBALS[
'STR_ADMIN_UTILISATEURS_SEND_NEW_PASSWORD']);
5111 $tpl->assign(
'STR_ADMIN_UTILISATEURS_CREATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_CREATE']);
5112 $tpl->assign(
'STR_ADMIN_DELETE_WARNING', $GLOBALS[
'STR_ADMIN_DELETE_WARNING']);
5113 $tpl->assign(
'STR_ADMIN_UTILISATEURS_EXCEL_EXPORT', $GLOBALS[
'STR_ADMIN_UTILISATEURS_EXCEL_EXPORT']);
5114 $tpl->assign(
'STR_DELETE', $GLOBALS[
'STR_DELETE']);
5115 $tpl->assign(
'STR_ADMIN_UTILISATEURS_SEND_NEW_PASSWORD_CONFIRM', $GLOBALS[
'STR_ADMIN_UTILISATEURS_SEND_NEW_PASSWORD_CONFIRM']);
5116 $tpl->assign(
'STR_ADMIN_UTILISATEURS_UPDATE', $GLOBALS[
'STR_ADMIN_UTILISATEURS_UPDATE']);
5117 $tpl->assign(
'STR_ADMIN_UTILISATEURS_DEACTIVATE_USER', $GLOBALS[
'STR_ADMIN_UTILISATEURS_DEACTIVATE_USER']);
5118 $tpl->assign(
'STR_ADMIN_UTILISATEURS_UPDATE_STATUS', $GLOBALS[
'STR_ADMIN_UTILISATEURS_UPDATE_STATUS']);
5119 $tpl->assign(
'STR_NUMBER', $GLOBALS[
'STR_NUMBER']);
5120 $tpl->assign(
'STR_SIRET', $GLOBALS[
'STR_SIRET']);
5121 $tpl->assign(
'STR_NONE', $GLOBALS[
'STR_NONE']);
5122 $tpl->assign(
'STR_ADMIN_MENU_WEBMASTERING_CLIENTS_EXPORT', $GLOBALS[
'STR_ADMIN_MENU_WEBMASTERING_CLIENTS_EXPORT']);
5123 $tpl->assign(
'STR_ADMIN_UTILISATEURS_NO_SUPPLIER_FOUND', $GLOBALS[
'STR_ADMIN_UTILISATEURS_NO_SUPPLIER_FOUND']);
5124 $tpl->assign(
'STR_ADMIN_UTILISATEURS_FILER_EXPLAIN', $GLOBALS[
'STR_ADMIN_UTILISATEURS_FILER_EXPLAIN']);
5125 $tpl->assign(
'STR_ORDER_FORM', $GLOBALS[
'STR_ORDER_FORM']);
5126 $tpl->assign(
'STR_ADMIN_UTILISATEURS_GIFT_CHECK', $GLOBALS[
'STR_ADMIN_UTILISATEURS_GIFT_CHECK']);
5127 $tpl->assign(
'STR_MORE_DETAILS', $GLOBALS[
'STR_MORE_DETAILS']);
5130 $tpl->assign(
'send_email_all_form', get_send_email_all_form(
$Links,
$sql));
get_profil_select_options($selected_priv=null)
get_profil_select_options()
foreach(array('date1', 'date2', 'type', 'renewals', 'width') as $item) $data
static strtoupper($string)
Returns string with all alphabetic characters converted to uppercase.
get_delivery_cost_infos($total_weight, $total_price, $type_id=null, $zone_id=null, $nb_product=1)
Calcul des frais de livraison Si type_id est vide, on récupère les tarifs en excluant les tarifs=0 qu...
get_sites_wwwroot_array()
Retourne un tableau des urls des sites configurés en fonction des droits de l'administrateur.
get_site_name($site_ids, $skip_rights_check=false)
Retourne le nom d'un ou de plusieurs sites à partir de l'id.
get_payment_status_name($id)
get_payment_status_name()
if(isset($_GET['catid'])&&empty($_GET['catid'])) if(empty($_GET['catid'])&&!empty($GLOBALS['site_parameters']['disallow_main_category'])&&empty($_GET['convert_gift_points'])) $catid
get_delivery_status_options($selected_status_id=null)
get_delivery_status_options()
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
get_discount_text($remise_valeur, $remise_percent, $is_remise_valeur_including_taxe)
Retourne la remise d'un code promotionnel (en % dans le cas d'une remise en pourcentage ou dans le fo...
get_user_information($user_id=null, $get_full_infos=false)
Chargement des détails de l'utilisateur.
get_table_index($table_name, $link_identifier=null, $silent_if_error=false)
get_table_index()
afficher_liste_utilisateurs($priv, $cle, $frm=null, $order= 'date_insert', $allow_message_no_result=false, $return_sql_request_without_display=false)
Affiche la liste des utilisateurs en fonction des critères de recherche Un certain nombre de champs d...
checkUserInfo($array_order_infos, $array_user_infos)
Vérification s'il y a eu une mise à jour des données de l'acheteur.
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
get_delivery_type_name($id)
get_delivery_type_name()
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
affiche_actions_moderations_user($user_id)
Affichages des actions des modérateurs et administrateurs sur cet utilisateur.
get_product_infos_array_in_order($order_id, $devise=null, $currency_rate=null, $order_by=null, $add_total_prix_attribut=false)
get_product_infos_array_in_order()
is_user_tva_intracom_for_no_vat($user_id=null)
is_user_tva_intracom_for_no_vat()
get_tag_function_site_options_values_list($mode= 'id')
Fonction permettant de récupérer les noms des catégories d'annonces, sous forme de liste séparée par ...
if($rub=fetch_assoc($rub_query)) if(check_if_module_active('url_rewriting')) $class
insere_utilisateur(&$frm, $password_already_encoded=false, $send_user_confirmation=false, $warn_admin_if_template_active=true, $skip_existing_account_tests=false)
Ajout d'un utilisateur.
fill_other_language_content($frm)
Retourne les contenus remplis si vide.
get_delivery_status_name($id)
get_delivery_status_name()
get_admin_menu()
get_admin_menu()
static fopen_utf8($filename, $mode, $force_filename_in_iso_8859=false, $try_filename_in_iso_8859_if_file_not_found=true)
Ouvre un fichier.
formSelect($name, $tab, $preselected_value=null, $addOne=0, $get=0)
formSelect()
handle_specific_fields(&$frm, $form_usage= 'user')
Traite la réception de champs spécifiques venant d'un formulaire, et l'identification de tous les cha...
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.
static html_entity_decode_if_needed($string)
String::html_entity_decode_if_needed()
is_order_modification_allowed($order_datetime)
Renvoie si il est autorisé de modifier une commande.
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
get_payment_status_options($selected_status_id=null)
get_payment_status_options()
if(!defined('IN_PEEL')) display_prices_with_taxes_in_admin()
display_prices_with_taxes_in_admin()
create_or_update_site($frm, $update_module=true, $mode, $available_langs_array=null)
Créer ou mets à jour les paramètres du site $frm['site_id'].
static strtolower($string)
Returns string with all alphabetic characters converted to lowercase.
getClientNote(&$user_infos)
Renvoie la note d'un client en fonction de l'intérêt qu'on souhaite lui porter.
static file_get_contents_utf8($filename, $force_filename_in_iso_8859=false, $try_filename_in_iso_8859_if_file_not_found=true)
Renvoie le contenu d'un fichier.
get_site_country_checkboxes($selected_site_country_array=null, $field_name= 'site_country')
Créer les options pour le select qui liste les noms de pays de visiteurs configurés.
static strlen($string)
Returns the length of the given string.
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 ...
affiche_phone_event($user_id)
Affichages des actions des modérateurs et administrateurs sur cet utilisateur.
sendclient($commandeid, $prefered_mode= 'html', $mode= 'bdc', $partial= '')
sendclient()
is_one_product_valid($req)
is_one_product_valid()
get_default_vat()
Retourne le taux de TVA le plus élevé, que l'on considère comme le taux de tva par défaut...
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
file_uncompress($source_filename, $destination_filename)
file_uncompress()
get_tag_function_site_options_titles_list()
save_commande_in_database($frm)
Crée ou modifie en base de données une commande et les produits commandés qui y sont associés...
if(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
if(!defined('IN_PEEL')) thumbs($source_filename, $width, $height, $method= 'fit', $source_folder=null, $thumb_folder=null, $thumb_rename=true, $return_absolute_path=false)
Charge l'image dont le nom est $source_filename dans le répertoire d'upload, et crée une vignette pou...
real_escape_string($value)
real_escape_string()
get_vat_select_options($selected_vat=null, $approximative_amount_selected=false)
get_vat_select_options()
static feof($handle)
Tests for end-of-file on a file pointer In contrary of the default feof function, it returns true if ...
static str_shorten_words($string, $length_limit=100, $separator=" ", $force_shorten_if_special_content=false, $add_separator_instead_of_cutting=true)
On rajoute des espaces à l'intérieur des mots trop longs => à utiliser pour éviter de casser une mise...
get_user_job_options($selected_fonction_name=null)
affiche_liste_commandes_admin($frm=null)
Affiche la liste des commandes.
get_specific_field_infos($frm, $form_error_object=null, $form_usage="user", $step=null)
Permet de définir de nouveaux champs dans le formulaire d'inscription / modification d'utilisateur de...
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.
send_facture_pdf_commandes($frm)
Permet d'envoyer à l'utilisateur sa facture au format pdf par email.
if(!defined('IN_PEEL')) display_prices_with_taxes_active()
display_prices_with_taxes_active()
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.
create_or_update_order(&$order_infos, &$articles_array)
Crée ou modifie une commande en base de données, ainsi que les produits commandés.
execute_sql($file_path, $max_sql_lines_at_once=10000, $disable_echo=false, $site_id=0, $regular_display=100, $sql=null, $replace_tags=true)
execute_sql()
static str_form_value($value, $flags=ENT_COMPAT)
Encode une chaine de caractères pour affichage dans un value="".
get_country_select_options($selected_country_name=null, $selected_country_id=null, $option_value= 'name', $display_inactive_country=false, $allowed_zone_id=null, $preselect_shop_country_if_none_selected=true, $selected_country_lang=null, $allowed_ids=null)
get_country_select_options()
tab_followed_nombre_produit()
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))
num_rows($query_result)
num_rows()
if(!defined('IN_PEEL')) send_email($to, $mail_subject= '', $mail_content= '', $template_technical_code=null, $template_tags=null, $format=null, $sender=null, $html_add_structure=true, $html_correct_conformity=false, $html_convert_url_to_links=true, $reply_to=null, $attached_files_infos_array=null, $lang=null, $additional_infos_array=array(), $attachment_not_sent_by_email=false)
Envoi d'un email à un utilisateur.
get_modules_array($only_active=false, $location=null, $technical_code=null, $force_update_cache_information=false, $specific_site_id=null, $exclude_public_items=false)
Retourne les modules sous forme de tableau.
get_table_field_names($table_name, $link_identifier=null, $silent_if_error=false)
get_table_field_names()
display_option_image($str_image, $set=false)
Formatte l'attribut (de type upload) du produit.
fetch_object($query_result)
fetch_object()
tracert_history_admin($member_id, $action, $data, $remarque=null, $raison=null)
Inscrit les différentes actions administrateur Liste des $actions possibles : 'SEARCH_USER', 'ADD_FILTER', 'EDIT_FILTER', 'DEL_FILTER', 'EDIT_AD', 'SUP_AD', 'EDIT_VOTE', 'SUP_DETAILS', 'EDIT_PROFIL', 'SUP_FORUM', 'ACTIVATE_COMPTE', 'NOTES_RECUES', 'NOTES_DONNEES', 'NOTE_PROFIL', 'AUTRE', 'SEND_EMAIL', 'CREATE_ORDER', 'EDIT_ORDER', 'SUP_ORDER', 'PHONE_EMITTED', 'EVENT', 'PHONE_RECEIVED'.
fetch_assoc($query_result)
fetch_assoc()
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
get_children_cat_list($catid, $preselectionne=array(), $destination= 'categories')
get_children_cat_list()
insere_langue($frm, $try_alter_table_even_if_modules_not_active=true, $force_update_database_lang_content=false)
insere_langue()
is_delivery_address_necessary_for_delivery_type($selected_delivery_type_id=null)
is_delivery_address_necessary_for_delivery_type()
tab_followed_newsletter()
if(!function_exists('affiche_liste_produits_acommander')) if(!function_exists('affiche_liste_articles')) get_email_template_options($option_id_nature= 'id', $category_id=null, $lang=null, $value_select=null, $get_signature=null)
Fonction affichant la liste d'emails sur le compte utilisateur.
find($id)
ProductsBought::find()
affiche_recherche_connexion_user($frm=null, $display_search_form=true)
Affiche en liste les connexions.
affiche_liste_clients_par_produit($id, $array_output_mode=false)
affiche_liste_clients_par_produit()
$GLOBALS['page_columns_count']
get_all_sites_name_array($admin_force_multisite_if_allowed=false, $allow_null_site_id=false, $skip_rights_check=false)
Retourne un tableau des noms des sites configurés en fonction des droits de l'administrateur.
if(!function_exists('get_admin_date_filter_form')) if(!function_exists('check_admin_date_data')) if(!function_exists('affiche_liste_produits')) get_admin_products_search_sql($frm, $delete=false, $get_only_product_with_images=false)
get_admin_products_search_sql()
set_paiement(&$frm)
Traitement du moyen de paiement.
get_delivery_type_options($selected_delivery_type_id_or_name=null)
get_delivery_type_options()
get_form_token_input($name= 'general', $use_existing_token=true, $return_as_input_form=true)
get_form_token_input()
get_data_lang()
get_data_lang()
get_site_wwwroot($site_id, $lang=null)
Renvoie l'URL d'un site donné
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.
a_priv($requested_priv, $demo_allowed=false, $site_configuration_modification=false, $user_id=null)
Renvoie true si l'utilisateur de la session a le privilège $requested_priv ou un droit supérieur Des ...
get_order_line($line_data, $color_options_html, $size_options_html, $tva_options_html, $i)
Crée ou modifie en base de données une commande et les produits commandés qui y sont associés...
set_configuration_variable($frm, $update_if_technical_code_exists=false, $allow_create=true)
Ajoute la zone HTML dans la table peel_configuration.
ftp_download($host, $user, $password, $directory, $remote_filename, $local_filename)
ftp_download()
get_order_infos_array($order_object)
get_order_infos_array()
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...
get_product_id_by_name($name, $large_search=false)
Fonction permettant de connaitre l'id d'un produit.
get_payment_name($id_or_code)
get_payment_name()
affiche_details_commande($id, $action, $user_id=0)
Charge les détails d'une commande et les affiche.
get_payment_select($selected_payment_technical_code=null, $show_selected_even_if_not_available=false, $show_site_info_if_needed=false)
get_payment_select()
is_one_command_product_valid($req)
is_one_command_product_valid()
static substr($string, $start, $length=null)
Returns the portion of string specified by the start and length parameters.
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
affiche_nb_connexions()
Fonctions pour certains fichiers d'administration.
get_site_info($array)
get_site_info()
envoie_client_code_promo($id_utilisateur, $id_codepromo)
Envoi d'un code promo déjà existant à un utilisateur.
static ucfirst($string)
Returns string with first letter uppercase.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
get_country_name($id)
Renvoie le nom d'un pays.
send_avis_expedition($commandeid, $delivery_tracking)
send_avis_expedition()