PEEL Shopping
Open source ecommerce : PEEL Shopping
livraisons.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: livraisons.php 46935 2015-09-18 08:49:48Z gboussin $
14 define('IN_PEEL_ADMIN', true);
15 include("../configuration.inc.php");
17 necessite_priv("admin_sales");
18 
19 $GLOBALS['DOC_TITLE'] = "";
20 include($GLOBALS['repertoire_modele'] . "/admin_haut.php");
21 
22 $tpl = $GLOBALS['tplEngine']->createTemplate('admin_livraisons_information_select.tpl');
23 $tpl->assign('delivery_status_options', get_delivery_status_options(vb($_GET['statut'])));
24 $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
25 $tpl->assign('STR_ORDER_STATUT_LIVRAISON', $GLOBALS['STR_ORDER_STATUT_LIVRAISON']);
26 $tpl->assign('STR_ADMIN_ALL_ORDERS', $GLOBALS['STR_ADMIN_ALL_ORDERS']);
28 
29 echo get_admin_date_filter_form($GLOBALS['STR_ADMIN_LIVRAISONS_SALES_HEADER'], $information_select_html);
30 // /////////// PROCESS /////////////
31 if (isset($_GET['jour1']) or isset($dateAdded1)) {
32  $check_admin_date_data = check_admin_date_data($_GET);
33  if (empty($check_admin_date_data)) {
34  $dateAdded1 = $_GET['an1'] . '-' . str_pad($_GET['mois1'], 2, 0, STR_PAD_LEFT) . '-' . str_pad($_GET['jour1'], 2, 0, STR_PAD_LEFT) . " 00:00:00";
35  $dateAdded2 = $_GET['an2'] . '-' . str_pad($_GET['mois2'], 2, 0, STR_PAD_LEFT) . '-' . str_pad($_GET['jour2'], 2, 0, STR_PAD_LEFT) . " 23:59:59";
36  if (vb($_GET['order_date_field_filter']) == 'a_timestamp') {
37  $date_field = "a_timestamp";
38  } elseif (vb($_GET['order_date_field_filter']) == 'e_datetime') {
39  $date_field = "e_datetime";
40  } elseif (vb($_GET['order_date_field_filter']) == 'f_datetime') {
41  $date_field = "f_datetime";
42  } else {
43  $date_field = "o_timestamp";
44  }
45  $sql = "SELECT *
46  FROM peel_commandes pc
47  LEFT JOIN peel_utilisateurs pu ON pc.id_utilisateur = pu.id_utilisateur AND " . get_filter_site_cond('utilisateurs', 'pu') . "
48  WHERE " . get_filter_site_cond('commandes', 'pc', true) . " AND pc." . word_real_escape_string($date_field) . " >= '" . nohtml_real_escape_string($dateAdded1) . "' AND pc." . word_real_escape_string($date_field) . " <= '" . nohtml_real_escape_string($dateAdded2) . "' " . (isset($_GET['statut']) && is_numeric($_GET['statut'])? "AND id_statut_livraison = '" . intval($_GET['statut']) . "'" : "") . "
49  ORDER BY pc." . word_real_escape_string($date_field);
50  if (isset($_GET['statut']) && is_numeric($_GET['statut'])) {
51  $extra_csv_param = "&id_statut_livraison=" . intval($_GET['statut']);
52  } else {
53  $extra_csv_param = '';
54  }
55  $query = query($sql);
56 
57  $tpl = $GLOBALS['tplEngine']->createTemplate('admin_livraisons.tpl');
58  $tpl->assign('period_text', ucfirst($GLOBALS['strStartingOn']) . ' ' . get_formatted_date($dateAdded1) . ' ' . $GLOBALS['strTillDay'] . ' ' . get_formatted_date($dateAdded2));
59  $tpl->assign('update_src', $GLOBALS['wwwroot_in_admin'] . '/images/update-on.png');
60  $tpl->assign('ttc_ht', (display_prices_with_taxes_in_admin() ? $GLOBALS['STR_TTC'] : $GLOBALS['STR_HT']));
61  if (num_rows($query) > 0) {
62  $tpl_results = array();
63 
64  $i = 0;
65  while ($result = fetch_assoc($query)) {
67  $montant_displayed = $result['montant'];
68  } else {
69  $montant_displayed = $result['montant_ht'];
70  }
71  $tpl_results[] = array('tr_rollover' => tr_rollover($i, true, 'height:30px;'),
72  'date' => get_formatted_date($result[$date_field]),
73  'notcheckUserInfo' => !checkUserInfo($result, $result),
74  'id' => $result['id'],
75  'commande_edit_href' => $GLOBALS['administrer_url'] . '/commander.php?commandeid=' . $result['id'] . '&mode=modif',
76  'prix' => fprix($montant_displayed, true, $result['devise'], true, $result['currency_rate']),
77  'prenom_bill' => $result['prenom_bill'],
78  'nom_bill' => $result['nom_bill'],
79  'adresse_bill' => $result['adresse_bill'],
80  'zip_bill' => $result['zip_bill'],
81  'ville_bill' => $result['ville_bill'],
82  'telephone_bill' => $result['telephone_bill'],
83  'email' => $result['email'],
84  'util_edit_href' => $GLOBALS['administrer_url'] . '/utilisateurs.php?mode=modif&id_utilisateur=' . $result['id_utilisateur']
85  );
86  $i++;
87  }
88  $tpl->assign('results', $tpl_results);
89  $tpl->assign('excel_src', $GLOBALS['administrer_url'] . '/images/excel.jpg');
90  if (check_if_module_active('export', '/administrer/export_livraisons.php')) {
91  $tpl->assign('export_encoding', $GLOBALS['site_parameters']['export_encoding']);
92  $tpl->assign('export_href', $GLOBALS['wwwroot_in_admin'] . '/modules/export/administrer/export_livraisons.php?dateadded1=' . $dateAdded1 . '&dateadded2=' . $dateAdded2 . $extra_csv_param);
93  }
94  if (!empty($_GET['statut'])) {
95  $tpl->assign('delivery_status', get_delivery_status_name($_GET['statut']));
96  }
97  }
98  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
99  $tpl->assign('STR_ADMIN_LIVRAISONS_EXPLAIN', sprintf($GLOBALS['STR_ADMIN_LIVRAISONS_EXPLAIN'], '<img src="'.$GLOBALS['wwwroot_in_admin'] . '/images/update-on.png" alt="update-on.png" />'));
100  $tpl->assign('STR_DATE', $GLOBALS['STR_DATE']);
101  $tpl->assign('STR_ORDER_NAME', $GLOBALS['STR_ORDER_NAME']);
102  $tpl->assign('STR_AMOUNT', $GLOBALS['STR_AMOUNT']);
103  $tpl->assign('STR_FIRST_NAME', $GLOBALS['STR_FIRST_NAME']);
104  $tpl->assign('STR_LAST_NAME', $GLOBALS['STR_LAST_NAME']);
105  $tpl->assign('STR_SHIP_ADDRESS', $GLOBALS['STR_SHIP_ADDRESS']);
106  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
107  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
108  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
109  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
110  $tpl->assign('STR_ADMIN_ALL_ORDERS', $GLOBALS['STR_ADMIN_ALL_ORDERS']);
111  $tpl->assign('STR_ADMIN_LIVRAISONS_NO_ORDER_FOUND', $GLOBALS['STR_ADMIN_LIVRAISONS_NO_ORDER_FOUND']);
112  $tpl->assign('STR_ADMIN_ASKED_STATUS', $GLOBALS['STR_ADMIN_ASKED_STATUS']);
113  $tpl->assign('STR_DATE', $GLOBALS['STR_DATE']);
114  $tpl->assign('STR_EXPEDITION_DATE', $GLOBALS['STR_EXPEDITION_DATE']);
115  $tpl->assign('STR_ORDER_NAME', $GLOBALS['STR_ORDER_NAME']);
116  $tpl->assign('STR_AMOUNT', $GLOBALS['STR_AMOUNT']);
117  $tpl->assign('STR_FIRST_NAME', $GLOBALS['STR_FIRST_NAME']);
118  $tpl->assign('STR_LAST_NAME', $GLOBALS['STR_LAST_NAME']);
119  $tpl->assign('STR_SHIP_ADDRESS', $GLOBALS['STR_SHIP_ADDRESS']);
120  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
121  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
122  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
123  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
124  $tpl->assign('STR_ADMIN_LIVRAISONS_EXCEL_EXPORT', $GLOBALS['STR_ADMIN_LIVRAISONS_EXCEL_EXPORT']);
125  $tpl->assign('STR_ADMIN_SEE', $GLOBALS['STR_ADMIN_SEE']);
126  $tpl->assign('STR_ADMIN_ASKED_STATUS', $GLOBALS['STR_ADMIN_ASKED_STATUS']);
127  $tpl->assign('STR_ADMIN_ALL_ORDERS', $GLOBALS['STR_ADMIN_ALL_ORDERS']);
128  $tpl->assign('STR_ADMIN_LIVRAISONS_NO_ORDER_FOUND', $GLOBALS['STR_ADMIN_LIVRAISONS_NO_ORDER_FOUND']);
129  $tpl->assign('export_encoding_explain', sprintf($GLOBALS['STR_ADMIN_LIVRAISONS_FORMAT_EXPLAIN'], $GLOBALS['site_parameters']['export_encoding']));
130  echo $tpl->fetch();
131  } else {
132  echo $check_admin_date_data;
133  }
134 }
135 
136 include($GLOBALS['repertoire_modele'] . "/admin_bas.php");
137 
get_delivery_status_options($selected_status_id=null)
get_delivery_status_options()
$result
checkUserInfo($array_order_infos, $array_user_infos)
Vérification s'il y a eu une mise à jour des données de l'acheteur.
get_delivery_status_name($id)
get_delivery_status_name()
Definition: order.php:1088
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...
Definition: database.php:424
if(!defined('IN_PEEL')) display_prices_with_taxes_in_admin()
display_prices_with_taxes_in_admin()
$tpl
Definition: livraisons.php:22
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
Definition: database.php:400
$information_select_html
Definition: livraisons.php:27
necessite_priv($priv, $demo_allowed=true, $configuration_modification=false)
Cette fonction vérifie si l'utilisateur a les privilèges de $priv.
Definition: fonctions.php:1575
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
Definition: fonctions.php:4643
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
Definition: database.php:158
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
Definition: fonctions.php:1596
num_rows($query_result)
num_rows()
Definition: database.php:321
fetch_assoc($query_result)
fetch_assoc()
Definition: database.php:283
get_formatted_date($datetime_or_timestamp=null, $mode= 'short', $hour_minute=false)
Afficher une date formatée, en évitant les problèmes liés aux noms de mois sur les serveurs qui ne so...
Definition: format.php:440
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
Definition: fonctions.php:242
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...
$GLOBALS['DOC_TITLE']
Definition: livraisons.php:19

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