1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
<?php
session_start();
require ('conx.php');
require ('session.php');
function enleveaccents_2($str, $charset='utf-8')
{
$url = $str;
$url = preg_replace('#Ç#', 'C', $url);
$url = preg_replace('#ç#', 'c', $url);
$url = preg_replace('#è|é|ê|ë#', 'e', $url);
$url = preg_replace('#È|É|Ê|Ë#', 'E', $url);
$url = preg_replace('#à|á|â|ã|ä|å#', 'a', $url);
$url = preg_replace('#@|À|Á|Â|Ã|Ä|Å#', 'A', $url);
$url = preg_replace('#ì|í|î|ï#', 'i', $url);
$url = preg_replace('#Ì|Í|Î|Ï#', 'I', $url);
$url = preg_replace('#ð|ò|ó|ô|õ|ö#', 'o', $url);
$url = preg_replace('#Ò|Ó|Ô|Õ|Ö#', 'O', $url);
$url = preg_replace('#ù|ú|û|ü#', 'u', $url);
$url = preg_replace('#Ù|Ú|Û|Ü#', 'U', $url);
$url = preg_replace('#ý|ÿ#', 'y', $url);
$url = preg_replace('#Ý#', 'Y', $url);
return ($url);
}
header('Content-Type: application/json');
$email="";
$mestest="";
$txt_ok="1";
$sms = @$_GET["sms"];
$liste=json_decode(@$_GET['liste']);
foreach ($liste as $key => $value)
{
$client=$liste[$key];
// $civ_e="1";
// $nom_e="Dupont";
// $prenom_e="Durand";
// $port_e="0601020304";
// $urlindex="www.toto.com"; $ent_site="www.toto.com";
// $smspass="tata";
// $MB_idUT="1";
if ($civ_e=="1"){$civ="Monsieur";}
if ($civ_e=="0"){$civ="Madame, Mademoiselle";}
if ($txt_ok>0)
{
$url = enleveaccents_2('http://'.$urlindex.'/'.$rep_extranet.'/sms/add/'.$smspass.'/'.$port_e.'/'.$MB_idUT.'/'.$client.'/'.$sms.' M. '.$MB_prenom.' '.$MB_nom.' ('.$MB_port.') - '.$ent_site);
$mestest .="url : $url";
header('Content-Type: text/html; charset=UTF-8');
echo '<iframe src="'.$url.'" width="1" height="1" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>';
}
}
// ceci est un mail de test qui me permet de savoir si ce script est appelé uniquement.
$boundary = '-----=' . md5( uniqid ( rand() ) );
$file_id = md5( uniqid ( rand() ) ) . $_SERVER['SERVER_NAME'];
$content_encode = chunk_split(base64_encode($content));
$headers = "From: \"toto\"<direction@iobnet.com>\n";
$headers .= "Return-Path: \"toto\"<$email>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/related; boundary=\"$boundary\"";
$message = "Ceci est un message au format MIME 1.0 multipart/mixed.\n\n";
$message .= "--" . $boundary . "\n";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "$liste";
$message .= "\n\n";
$message .= "$sms";
$message .= "\n\n";
$message .= $mestest;
$message .= "\n\n";
$message .= "--" . $boundary . "\n";
$message .= "Content-Type: image/jpg; name=\"\"\n";
$message .= "Content-Transfer-Encoding: base64\n";
$message .= "Content-ID: <$file_id>\n\n";
$message .= $content_encode . "\n";
$message .= "\n\n";
$message .= "--" . $boundary . "--\n";
mail($email, "test relance SMS", stripslashes($message), $headers); |
Partager