PEEL Shopping
Open source ecommerce : PEEL Shopping
fonctions.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: fonctions.php 46935 2015-09-18 08:49:48Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
24 function getFAI($ip)
25 {
26  $host = @gethostbyaddr($ip);
27  if (String::strpos("aol", $host)) {
28  $fai = "AOL";
29  } elseif (String::strpos("bluewin", $host)) {
30  $fai = "Bluewin";
31  } elseif (String::strpos("cablecom", $host)) {
32  $fai = "Cablecom - swissonline";
33  } elseif (String::strpos("hispeed", $host)) {
34  $fai = "Cablecom - swissonline";
35  } elseif (String::strpos("coltfrance", $host)) {
36  $fai = "COLT France";
37  } elseif (String::strpos("club-internet", $host)) {
38  $fai = "Club Internet";
39  } elseif (String::strpos("proxad", $host)) {
40  $fai = "Free";
41  } elseif (String::strpos("intergga", $host)) {
42  $fai = "InterGGA";
43  } elseif (String::strpos("noos", $host)) {
44  $fai = "Noos";
45  } elseif (String::strpos("securepop", $host)) {
46  $fai = "SecurePoP";
47  } elseif (String::strpos("adslplus", $host)) {
48  $fai = "Sunrise";
49  } elseif (String::strpos("freesurf", $host)) {
50  $fai = "Sunrise";
51  } elseif (String::strpos("tiscali.fr", $host)) {
52  $fai = "Tiscali France";
53  } elseif (String::strpos("tiscali.ch", $host)) {
54  $fai = "Tiscali Suisse";
55  } elseif (String::strpos("tele2.fr", $host)) {
56  $fai = "Tele2 France";
57  } elseif (String::strpos("videotron", $host)) {
58  $fai = "Vidéotron";
59  } elseif (String::strpos("sympatico", $host)) {
60  $fai = "Sympatico";
61  } elseif (String::strpos("vtx", $host)) {
62  $fai = "VTX";
63  } elseif (String::strpos("wanadoo", $host)) {
64  $fai = "Wanadoo";
65  } elseif (String::strpos("proxad", $host)) {
66  $fai = "Free";
67  }
68  if(!empty($fai)) {
69  return $host . ' (' . $fai.')';
70  } else {
71  return $host;
72  }
73 }
74 
75 
82 function save_mail_db($frm)
83 {
84  $ip = ipGet();
85  $Ipclient = $ip . " / " . getFAI($ip);
86  $sql = 'INSERT INTO peel_webmail SET
87  Titre = "' . nohtml_real_escape_string(vb($frm['sujet'])) . '"
88  , Message = "' . nohtml_real_escape_string(vb($frm['texte']) . "\n" . vb($frm['adresse']) . ' ' . vb($frm['code_postal']) . ' ' . vb($frm['ville']) . ' ' . vb($frm['pays'])) . '"
89  , Nom = "' . nohtml_real_escape_string(vb($frm['nom']) . (!empty($frm['societe']) ? ' / ' . vb($frm['societe']) : '')) . '"
90  , Prenom = "' . nohtml_real_escape_string(vb($frm['prenom'])) . '"
91  , telephone = "' . nohtml_real_escape_string(vb($frm['telephone'])) . '"
92  , dispo = "' . nohtml_real_escape_string(vb($frm['dispo'])) . '"
93  , Ip = "' . nohtml_real_escape_string($Ipclient) . '"
94  , Email = "' . nohtml_real_escape_string(vb($frm['email'])) . '"
95  , Date = "' . nohtml_real_escape_string(date('Y-m-d')) . '"
96  , Heure = "' . nohtml_real_escape_string(date('H:i:s')) . '"
97  , site_id = "' . nohtml_real_escape_string(get_site_id_sql_set_value($GLOBALS['site_id'])) . '"';
98  if (!empty($_SESSION['session_utilisateur']['id_utilisateur'])) {
99  $sql .= "
100  , id_user = '" . intval($_SESSION['session_utilisateur']['id_utilisateur']) . "'";
101  }
102  if (!empty($frm['commande_id'])) {
103  $sql .= "
104  , commande_id = '" . intval($frm['commande_id']) . "'";
105  }
106  query($sql);
107 }
108 
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']
static strpos($haystack, $needle, $offset=0)
Returns the numeric position of the first occurrence of needle in the haystack string.
Definition: String.php:54
if(!defined('IN_PEEL')) getFAI($ip)
Cette fonction permet de retourner a partir de l'adresse IP, le Fournisseur d'Acces Internet apparten...
Definition: fonctions.php:24
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
if(!defined('IN_PEEL')) $GLOBALS['page_types_array']
Definition: fonctions.php:19
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
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.
Definition: fonctions.php:4747
save_mail_db($frm)
Cette fonction permet de sauvegarder les emails du formulaire de contact du site en base de données d...
Definition: fonctions.php:82
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

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