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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
<?php session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Pragma" content="no-cache" />
<title>Création Signature Outlook ARS </title>
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine-fr.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<style type="text/css">
a:link{
text-decoration:none;
color:#014495;
}
a:visited{
text-decoration:none;
color:#014495;
}
a:hover{
text-decoration:underline;
color:#999;
}
</style>
</head>
<body>
</br><img src="images/traits.png" alt="" width="100%" height="30" hspace="0" vspace="0" /></p>
<div id="titre"><img src="images/logo_ars.png" alt="ARS Alsace" width="178" height="110" hspace="0" vspace="0" align="middle" />ignature personnalisée ARS<br />
<br />
<?php
//header ("Content-type: image/png");
//fichier sources image
//$fichier_source = "images/france.png";
$fichier_source="images/signature_optim.png";
//fichier sources polices
$police="polices/arial.ttf";
//récupration des variables entres dans le formulaire
//Nom,Prenom,Service,Tel,Fax,Email
$nom=$_POST[Nom];
$prenom=$_POST[Prenom];
$prenom_nom=$_POST[Prenom]." ".$_POST[Nom];
//encodage utf8
utf8_encode($prenom_nom);
//iconv_set_encoding("internal_encoding", "UTF-8");
//iconv_set_encoding("internal_encoding", "UTF-8");
//iconv_set_encoding("output_encoding", "ISO-8859-1");
//iconv_set_encoding("internal_encoding","UTF-8");
//iconv_set_encoding("output_encoding","ISO-8859-1//TRANSLIT");
//ob_start("ob_iconv_handler");
//var_dump(iconv_get_encoding('all'));
// Ouutf8_decode("Texte avec accents");
$service=$_POST[Service];
$fonction=$_POST[Fonction];
$tel="Tel : ".$_POST[Tel];
$adresse=$_POST[adresse];
// si ajout numro de tel mobile ajout "Mobile : "
if (!empty($_POST['Mobile']))
{ $mobile="Mobile : ".$_POST[Mobile];
}
else
{
$mobile=$_POST[Mobile];
}
if(!empty($_POST['Fax']))
{
$fax="Fax : ".$_POST[Fax];
}
if(!empty($_POST['Mobile'])&& !empty($_POST['Fax']))
{
echo ("<font face='arial' color='green'>Attention vous avez rempli les champs</br> fax et mobile veuillez choisir l'un ou l'autre svp ! </font>");
}
$email=$_POST[Email];
//creation d'une image PNG
$image = @imagecreatefrompng($fichier_source)or die("Création impossible");
//$image = @ImageCreate (200, 100) or die ("Erreur lors de la cration de l'image");
//couleur de fond blanc
$couleur_fond = ImageColorAllocate ($image, 255, 255, 255);
// couleurs Texte blanc, gris, noir
$white = imagecolorallocate($image, 255, 255, 255);
$grey = imagecolorallocate($image, 128, 128, 128);
$black = imagecolorallocate($image, 0, 0, 0);
$green=imagecolorallocate($image,119,139,59);
//taille de la police de caractre
$taille_police=8;
//angle de la police
$angle=0;
//position horizontale Nom
$pos_largeur_nom=65;
//longueur du nom
$longueur=strlen($prenom);
// choix multiple adresse
switch ($adresse){
/*case 68:
echo " </br>Avec Adresse du 68 -";
$adresse_postale="DTARS 3, rue fleichhauer - 68026 Colmar ";
break;
*/
case 67:
$adresse_postale="rue gaujot ,67000 Strasbourg ";
echo " Avec Adresse du 67 - ";
break;
case 0:
echo " Aucune adresse affichée - ";
break;
}
//ajout du texte sur l'image
//variable image, variable taille police,variable angle,position en largeur, position en hauteur
imagettftext($image, $taille_police, $angle,5 ,65 , $black, $police, stripslashes(utf8_decode($prenom_nom)));
imagettftext($image, $taille_police, $angle, 5, 80, $black, $police, stripslashes($service));
imagettftext($image, $taille_police, $angle, 5, 95, $black, $police, stripslashes($fonction));
imagettftext($image, $taille_police, $angle, 5, 110, $black, $police, stripslashes($tel));
imagettftext($image, $taille_police, $angle, 115, 110, $black, $police,stripslashes($mobile));
imagettftext($image, $taille_police, $angle, 115, 110, $black, $police,stripslashes($fax));
imagettftext($image, $taille_police, $angle, 25, 125, $black, $police, stripslashes($email));
imagettftext($image, $taille_police, $angle, 60, 30, $green, $police,$adresse_postale);
$temps=time();
$_SESSION['temps']=$temps;
echo ("Le nom de votre image sera ".$_SESSION['temps']=$temps);
imagepng ($image,"signatures/".$temps.'.png');
$_SESSION['path']="signatures/".$temps.".png";
//print_r($_SESSION);
?>
<br />
</div>
<form action="upload.php" method="post" enctype="multipart/form-data" id="sendfile">
<input type="hidden" name="MAX_FILE_SIZE" value="300000" />
<table width="444" border="2" align="center" cellpadding="2" cellspacing="2" id="tableau">
<tr>
<td colspan="2" bgcolor="#98BF0E">Aperçu Image</td>
</tr>
<tr>
<td colspan="2" ><img src="<?php echo $_SESSION['path']; ?>" alt="Votre Signature" /></td>
</tr>
<tr>
<td height="43"><br/>
<input type="submit" value="Télécharger IMAGE" name="send_image" id="bonton2" />
<br />
<br /></td>
<td><br /><input type="submit" value="Télécharger HTML" name="send_html" id="bonton2" />
</td>
</tr>
</table>
<br />
</form>
<div id="collage">
<table width="1076" align="center" cellpadding="2" cellspacing="2" id="tableau">
<tr>
<td width="67" height="57" align="center" bgcolor="#FFFFFF"><img src="images/nombre1.png" alt="" width="49" height="49" vspace="5" border="0" align="middle" /></td>
<td width="997" align="center" valign="middle"><p>Télécharger l'image l'enregistrer dans
C:\Documents and Settings\votre login\Application Data\Microsoft\Signatures<br />
( <a href="invisible.php" title="Fichiers cachès" id="lien">Ce dossier n'est pas visible ! cliquer ici ! </a>)</p></td>
</tr>
<tr>
<td height="59" align="center" valign="middle" bgcolor="#FFFFFF"><img src="images/nombre2.png" alt="" width="49" height="49" vspace="5" border="0" align="middle" /></td>
<td align="center" valign="middle"><p>Télécharger le fichier HTML puis le coller au même endroit </p>
<p>! Attention ne pas renommer les fichiers ! <br />
</p></td>
</tr>
<tr>
<td height="64" align="center" valign="middle" bgcolor="#FFFFFF"><img src="images/nombre3.png" alt="" width="49" vspace="5" border="0" align="absmiddle" /></td>
<td align="center" valign="baseline">>> <a href="aide.php" title="Aide et explications" id="lien">Configurer Outlook</a> <<<br />
<br /></td>
</tr>
</table>
</div>
<div id="pied" height="50"><br />
| <a href="mailto:jean-marc.caspar@ars.sante.fr">Contact</a> | <a href="aide.php" title="Aide">Aide</a> |
</p>
</div>
</div>
</body>
<?php
//génération du fichier Html
$nom_file=$_SESSION['temps'].'.html';
$texte="<html><head>
<title>Signature ARS</title>
</head><body><img src='";
$image=$_SESSION['temps'].'.png';
$suite="'</body></html>";
chdir(signatures);
$f=fopen($nom_file,"x+");
fputs($f,$texte);
fputs($f,$image);
fputs($f,$spc);
fputs($f,$suite);
fclose($f);
?>
</html> |
Partager