14 include(
"../configuration.inc.php");
17 include(
"../lib/fonctions/display_caddie.php");
21 define(
"IN_ORDER_HISTORY",
true);
22 $GLOBALS[
'page_name'] =
'historique_commandes';
25 switch (
vb($_REQUEST[
'mode'])) {
27 $sql =
"SELECT c.*, sp.technical_code AS statut_paiement
29 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
34 if(!empty(
$GLOBALS[
'site_parameters'][
'payment_status_forbid_payment'])) {
35 $payment_status_forbid_payment =
$GLOBALS[
'site_parameters'][
'payment_status_forbid_payment'];
37 $payment_status_forbid_payment = array(
'being_checked',
'completed',
'cancelled');
39 if(is_numeric(key($payment_status_forbid_payment))) {
40 $allow_status_change = !in_array($this_order[
'id_statut_paiement'], $payment_status_forbid_payment);
42 $allow_status_change = !in_array($this_order[
'statut_paiement'], $payment_status_forbid_payment);
44 $output .= affiche_resume_commande(intval($_GET[
'id']),
true,
true, $allow_status_change);
46 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl');
52 case "product_ordered_history" :
54 $sql =
"SELECT ca.nom_produit, ca.produit_id , ca.quantite, c.o_timestamp, c.numero, c.id
55 FROM peel_commandes_articles ca
56 INNER JOIN peel_commandes c ON ca.commande_id = c.id AND " .
get_filter_site_cond(
'commandes',
'c') .
"
57 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
58 WHERE id_utilisateur = '" . intval(
$_SESSION[
'session_utilisateur'][
'id_utilisateur']) .
"' AND sp.technical_code = 'completed' AND " .
get_filter_site_cond(
'commandes_articles',
'ca') .
"";
60 $Links->OrderDefault =
"o_timestamp";
61 $Links->SortDefault =
"DESC";
62 $HeaderTitlesArray = array(
'nom_produit' =>
$GLOBALS[
'STR_PRODUCT_NAME'],
'quantite' =>
$GLOBALS[
'STR_QUANTITY'],
'o_timestamp' =>
$GLOBALS[
'STR_DATE'],
'numero' =>
$GLOBALS[
'STR_ORDER_NUMBER']);
63 $Links->HeaderTitlesArray = $HeaderTitlesArray;
66 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'products_ordered_history.tpl');
73 'nom_produit' => $this_products_ordered_history[
'nom_produit'],
75 'quantite' => $this_products_ordered_history[
'quantite'],
76 'o_timestamp' => $this_products_ordered_history[
'o_timestamp'],
77 'numero' => $this_products_ordered_history[
'numero']
79 $products[] = $tmpProd;
81 $tpl->assign(
'products', $products);
83 $tpl->assign(
'links_header_row',
$Links->getHeaderRow());
84 $tpl->assign(
'links_multipage',
$Links->GetMultipage());
86 $tpl->assign(
'STR_PRODUCTS_PURCHASED_LIST',
$GLOBALS[
'STR_PRODUCTS_PURCHASED_LIST']);
91 $order =
"o_timestamp";
93 $output .= affiche_liste_commandes($order, $sort);
97 include(
$GLOBALS[
'repertoire_modele'] .
"/haut.php");
99 include(
$GLOBALS[
'repertoire_modele'] .
"/bas.php");
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
if(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
fetch_assoc($query_result)
fetch_assoc()
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']