29if (!defined(
'NOTOKENRENEWAL')) {
30 define(
'NOTOKENRENEWAL',
'1');
32if (!defined(
'NOREQUIREMENU')) {
33 define(
'NOREQUIREMENU',
'1');
35if (!defined(
'NOREQUIREHTML')) {
36 define(
'NOREQUIREHTML',
'1');
38if (!defined(
'NOREQUIREAJAX')) {
39 define(
'NOREQUIREAJAX',
'1');
41if (!defined(
'NOLOGIN')) {
42 define(
'NOLOGIN',
'1');
44if (!defined(
'NOIPCHECK')) {
45 define(
'NOIPCHECK',
'1');
49if (!defined(
'USESUFFIXINLOG')) {
50 define(
'USESUFFIXINLOG',
'_cidlookup');
53include
'../../main.inc.php';
56$securitykey =
GETPOST(
'securitykey');
58$notfound = $langs->trans(
"Unknown");
61if (empty($conf->clicktodial->enabled)) {
62 print
"Error: Module Click to dial is not enabled.\n";
71if (empty($securitykey)) {
72 echo
'Securitykey is required. Check setup of clicktodial module.';
76 echo
'Securitykey is wrong.';
82 print
"Error: Url must be called with parameter phone=phone to search\n";
87$sql =
"SELECT s.nom as name FROM ".MAIN_DB_PREFIX.
"societe as s";
88$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople as sp ON sp.fk_soc = s.rowid";
89$sql .=
" WHERE s.entity IN (".getEntity(
'societe').
")";
90$sql .=
" AND (s.phone='".$db->escape($phone).
"'";
91$sql .=
" OR sp.phone='".$db->escape($phone).
"'";
92$sql .=
" OR sp.phone_perso='".$db->escape($phone).
"'";
93$sql .=
" OR sp.phone_mobile='".$db->escape($phone).
"')";
94$sql .= $db->plimit(1);
96dol_syslog(
'cidlookup search information with phone '.$phone, LOG_DEBUG);
97$resql = $db->query($sql);
99 $obj = $db->fetch_object($resql);
111$greek = array(
'α',
'β',
'γ',
'δ',
'ε',
'ζ',
'η',
'θ',
'ι',
'κ',
'λ',
'μ',
'ν',
'ξ',
'ο',
'π',
'ρ',
'ς',
'σ',
'τ',
'υ',
'φ',
'χ',
'ψ',
'ω',
'Α',
'Β',
'Γ',
'Δ',
'Ε',
'Ζ',
'Η',
'Θ',
'Ι',
'Κ',
'Λ',
'Μ',
'Ν',
'Ξ',
'Ο',
'Π',
'Ρ',
'Σ',
'Τ',
'Υ',
'Φ',
'Χ',
'Ψ',
'Ω',
'ά',
'έ',
'ή',
'ί',
'ό',
'ύ',
'ώ',
'ϊ',
'ΐ',
'Ά',
'Έ',
'Ή',
'Ί',
'Ό',
'Ύ',
'Ώ',
'Ϊ');
113$latin = array(
'a',
'b',
'g',
'd',
'e',
'z',
'h',
'th',
'i',
'k',
'l',
'm',
'n',
'ks',
'o',
'p',
'r',
's',
's',
't',
'u',
'f',
'ch',
'ps',
'w',
'A',
'B',
'G',
'D',
'E',
'Z',
'H',
'TH',
'I',
'K',
'L',
'M',
'N',
'KS',
'O',
'P',
'R',
'S',
'T',
'U',
'F',
'CH',
'PS',
'W',
'a',
'e',
'h',
'i',
'o',
'u',
'w',
'i',
'i',
'A',
'E',
'H',
'I',
'O',
'U',
'W',
'I');
115print str_replace($greek, $latin, $found);
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.