14 include(
"../configuration.inc.php");
17 if (empty(
$GLOBALS[
'site_parameters'][
'unsubscribe_order_process'])) {
21 include(
"../lib/fonctions/display_caddie.php");
22 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
26 if (
check_if_module_active(
'socolissimo') && !empty($_REQUEST) && !empty($_REQUEST[
'PUDOFOID']) && !empty($_REQUEST[
'CEEMAIL']) && !empty($_REQUEST[
'SIGNATURE']) && !empty($_REQUEST[
'ORDERID'])) {
28 put_session_commande_from_so_page();
30 }
elseif (!empty($_POST)) {
32 if(empty(
$GLOBALS[
'site_parameters'][
'user_multiple_addresses_disable'])) {
34 if(
vb($_POST[
'personal_address_bill']) ==
'manage' ||
vb($_POST[
'personal_address_ship']) ==
'manage') {
38 if(!empty($_POST[
'personal_address_bill'])) {
39 $address_change_type =
'bill';
40 }
elseif(!empty($_POST[
'personal_address_ship'])) {
41 $address_change_type =
'ship';
44 if(empty($address_change_type)) {
49 $check_fields = array(
'nom1' =>
$GLOBALS[
'STR_ERR_NAME'],
50 'prenom1' =>
$GLOBALS[
'STR_ERR_FIRSTNAME'],
51 'contact1' =>
$GLOBALS[
'STR_ERR_TEL'],
52 'email1' =>
$GLOBALS[
'STR_ERR_EMAIL'],
53 'adresse1' =>
$GLOBALS[
'STR_ERR_ADDRESS'],
54 'code_postal1' =>
$GLOBALS[
'STR_ERR_ZIP'],
55 'ville1' =>
$GLOBALS[
'STR_ERR_TOWN'],
58 if (
$_SESSION[
'session_caddie']->total > 0) {
59 $check_fields[
'payment_technical_code'] =
$GLOBALS[
'STR_ERR_PAYMENT'];
63 $check_fields[
'nom2'] =
$GLOBALS[
'STR_ERR_NAME'];
64 $check_fields[
'prenom2'] =
$GLOBALS[
'STR_ERR_FIRSTNAME'];
65 $check_fields[
'contact2'] =
$GLOBALS[
'STR_ERR_TEL'];
66 $check_fields[
'email2'] =
$GLOBALS[
'STR_ERR_EMAIL'];
67 $check_fields[
'adresse2'] =
$GLOBALS[
'STR_ERR_ADDRESS'];
68 $check_fields[
'code_postal2'] =
$GLOBALS[
'STR_ERR_ZIP'];
69 $check_fields[
'ville2'] =
$GLOBALS[
'STR_ERR_TOWN'];
70 $q_check_country_to_zone =
query(
'SELECT zone
73 if ($r_check_country_to_zone =
fetch_assoc($q_check_country_to_zone)) {
74 if ($r_check_country_to_zone[
'zone'] !=
$_SESSION[
'session_caddie']->zoneId) {
78 if (!empty(
$GLOBALS[
'site_parameters'][
'order_mandatory_fields'])) {
79 $check_fields = array_merge($check_fields,
$GLOBALS[
'site_parameters'][
'order_mandatory_fields']);
83 $_SESSION[
'session_caddie']->set_paiement($_POST[
'payment_technical_code']);
88 if (!empty(
$GLOBALS[
'site_parameters'][
'register_during_order_process']) && !empty($_POST[
'register_during_order_process'])) {
96 $frm[
'code_postal'] =
vb(
$_SESSION[
'session_commande'][
'code_postal1']);
100 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
101 foreach(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'] as $this_field => $this_title) {
102 if ((
String::substr($this_field, -5) ==
'_bill') && !empty(
$_SESSION[
'session_commande'][$this_field]) && in_array($this_field, $order_table_fields_names)) {
113 define(
"IN_STEP2",
true);
118 $_SESSION[
'session_commande'][
'personal_address_'.$address_change_type] = $_POST[
'personal_address_'.$address_change_type];
121 if (!PEEL_SOCOLISSIMO_IFRAME && empty($_REQUEST[
'PUDOFOID']) && empty(
$_SESSION[
'session_commande'][
'client2'])) {
128 foreach(array(
'bill' => 1,
'ship' => 2) as $address_type => $session_commande_address_id) {
129 if(!empty($address_change_type) && $address_type == $address_change_type && !empty($_POST[
'personal_address_'.$address_change_type])) {
130 $this_new_address =
vb($_POST[
'personal_address_'.$address_change_type]);
131 }
elseif(empty(
$_SESSION[
'session_commande'][
'adresse' . $session_commande_address_id])) {
133 if (!empty($utilisateur[
'address_' . $address_type .
'_default'])) {
134 $this_new_address = $utilisateur[
'address_' . $address_type .
'_default'];
136 $this_new_address =
'original_address';
138 }
elseif(empty($_POST) && !empty(
$_SESSION[
'session_utilisateur'][
"address_" . $address_type .
"_default"])) {
140 $this_new_address =
vb(
$_SESSION[
'session_utilisateur'][
'address_' . $address_type .
"_default"]);
145 if($this_new_address ==
'original_address') {
147 $where =
'id_utilisateur = "'.intval(
$_SESSION[
'session_utilisateur'][
'id_utilisateur']).
'"';
148 $table_to_use =
'peel_utilisateurs';
151 $where =
'id="'.intval($this_new_address).
'"';
152 $table_to_use =
'peel_adresses';
155 $sql =
'SELECT civilite, prenom, nom_famille AS nom, societe, IF(portable!="", portable, telephone) AS contact, adresse, code_postal, ville, pays, email
160 foreach(
$result as $key => $value) {
161 if (!empty($value)) {
166 $value =
vn(
$GLOBALS[
'site_parameters'][
'default_country_id']);
170 $_SESSION[
'session_commande'][$key . $session_commande_address_id] = $value;
189 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
190 foreach(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'] as $this_field => $this_title) {
191 if ((
String::substr($this_field, -5) ==
'_bill') && !empty(
$_SESSION[
'session_commande'][$this_field]) && in_array($this_field, $order_table_fields_names)) {
212 $frm[
'code_postal2'] =
vb(
$_SESSION[
'session_commande'][
'code_postal2']);
217 if (!empty(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'])) {
218 foreach(
$GLOBALS[
'site_parameters'][
'order_specific_field_titles'] as $this_field => $this_title) {
219 if ((
String::substr($this_field, -5) ==
'_ship') && !empty(
$_SESSION[
'session_commande'][
String::substr($this_field, 0, -5).
'2']) && in_array($this_field, $order_table_fields_names)) {
230 $frm[
'commande_interne'] =
vb($_POST[
'commande_interne'],
vb(
$_SESSION[
'session_commande'][
'commande_interne']));
231 $frm[
'commentaires'] =
vb($_POST[
'commentaires'],
vb(
$_SESSION[
'session_commande'][
'commentaires']));
235 $GLOBALS[
'page_columns_count'] =
$GLOBALS[
'site_parameters'][
'achat_maintenant_page_columns_count'];
236 if (!empty(
$GLOBALS[
'site_parameters'][
'mode_transport']) && (empty(
$_SESSION[
'session_caddie']->zoneId) || empty(
$_SESSION[
'session_caddie']->typeId))) {
237 define(
'IN_CADDIE',
true);
239 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl');
240 $tpl->assign(
'message',
$GLOBALS[
'STR_ERR_INFO_NEEDED_TO_CADDIE']);
241 $tpl->assign(
'link', array(
'href' => get_url(
'/achat/'),
242 'value' =>
$GLOBALS[
'STR_ORDER_PROCESS_CONTINUE']
246 if (!defined(
'IN_STEP2')) {
247 define(
"IN_STEP1",
true);
250 if (!empty(
$GLOBALS[
'site_parameters'][
'short_order_process'])) {
251 if (
$_SESSION[
'session_caddie']->count_products() > 0) {
254 if (!empty(
$GLOBALS[
'site_parameters'][
'user_specific_field_titles'])) {
255 foreach(
$GLOBALS[
'site_parameters'][
'user_specific_field_titles'] as $this_field => $this_title) {
256 if ((
String::substr($this_field, -5) ==
'_bill') && !empty($utilisateur[$this_field]) && in_array($this_field, $user_table_fields_names)) {
260 $frm[$this_field] =
vb($utilisateur[$this_field]);
269 $output .= affiche_contenu_html(
'short_order_process',
true);
274 }
elseif (!defined(
'IN_STEP2')) {
275 if (
check_if_module_active(
'socolissimo') && !empty(
$_SESSION[
'session_commande'][
'is_socolissimo_order']) && PEEL_SOCOLISSIMO_IFRAME && empty($_REQUEST[
'PUDOFOID']) && empty(
$_SESSION[
'session_commande'][
'client2'])) {
278 $output .=
'<iframe id="SOLivraison" name="SOLivraison" width="100%" height="800" src="' .
$GLOBALS[
'wwwroot'] .
'/modules/socolissimo/iframe.php"></iframe>';
290 include(
$GLOBALS[
'repertoire_modele'] .
"/haut.php");
292 include(
$GLOBALS[
'repertoire_modele'] .
"/bas.php");
put_session_commande(&$frm)
Récupère les informations du tableau $frm pour les mettre de manière standardisée dans $_SESSION['ses...
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_user_information($user_id=null, $get_full_infos=false)
Chargement des détails de l'utilisateur.
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.
redirect_and_die($url, $permanent_redirection=false, $avoid_loop=false)
Redirige vers l'URL demandée et arrête le programme.
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...
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(isset($_POST['pays_zone'])) elseif(empty($_SESSION['session_caddie']->zoneId)&&!empty($GLOBALS['site_parameters']['default_delivery_zone_id'])) if(isset($_POST['type'])) elseif(empty($_SESSION['session_caddie']->typeId)&&!empty($GLOBALS['site_parameters']['default_delivery_type_id'])) if(!empty($_POST['code_promo'])) if(!empty($_GET['code_promo'])&&$_GET['code_promo']== 'delete') $form_error_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.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
necessite_identification()
Si l'utilisateur n'est pas connecté à un compte, on affiche une page d'identification et arrête le sc...
get_table_field_names($table_name, $link_identifier=null, $silent_if_error=false)
get_table_field_names()
fetch_assoc($query_result)
fetch_assoc()
is_delivery_address_necessary_for_delivery_type($selected_delivery_type_id=null)
is_delivery_address_necessary_for_delivery_type()
$GLOBALS['page_columns_count']
user_login_now($email_or_pseudo, $mot_passe, $check_password=true, $password_given_as_first_password_hash=false, $password_length_if_given_as_first_password_hash=null)
user_login_now()
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...
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']
get_country_name($id)
Renvoie le nom d'un pays.