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
|
<?
header("Content-type: image/jpeg");
echo "<body onLoad='window.print()' leftmargin='0' topmargin='0'>";
$n_ins = $_GET["n_ins"] ;
$nom = $_GET["nom"] ;
$prenom = $_GET["prenom"] ;
$an= $_GET["an"] ;
$moy_an = $_GET["moy_an"] ;
$crd_an= $_GET["crd_an"] ;
$anuni= $_GET["anuni"] ;
$lieun= $_GET["lieun"] ;
$daten= $_GET["daten"] ;
$fond="certif.jpg";
$image = imagecreatefromjpeg($fond);
$image=imagecreate(700,460);
$blanc = imagecolorallocate($image, 255, 255, 255);
$noir = imagecolorallocate($image, 0, 0, 0);
$bleu = imagecolorallocate($image, 0, 0, 255);
$data_fond=getimagesize($fond);
/* 0 pour la largeur
1 pour la hauteur
2 pour le type 1=gif 2=jpg 3=png
3 pour la chaine complete "height=xxx width=yyy" */
$fondtoload=imagecreatefromjpeg($fond);
$larg=$data_fond[0];
$haut=$data_fond[1];
$x=700;
$y=($x*$haut)/$larg;
if ($y>$x) { $y=$x; $x=($y*$larg)/$haut; }
$posx=(100-$x)/2;
$posy=(100-$y)/2;
imagecopyresized($image, $fondtoload, 0, 0, 0, 0, 700, 460, $data_fond[0], $data_fond[1]);
$texte=$nom;
$texte6=$prenom;
$lentexte=strlen($texte);
$hp=50;
$y0=235;
$x0=168;
$lentexte=$lentexte+$hp;
$lentexte=$lentexte+$x0;
if (((700-$texte)/2) < 0)
{ //$police=$police-1;
}
$taille=12;
//$date=date("d-m-Y");
$anuni2=$anuni+1;
imagestring( $image, $taille, 535, $y0-64, $anuni."/".$anuni2, $bleu ) ;
imagestring($image, $taille, $x0+22, $y0-29, $texte,$bleu);
imagestring($image, $taille, $lentexte+100, $y0-29, $texte6,$bleu);
$texte2=$daten;
$y1=252;
$x1=168;
imagestring($image, $taille, $x1+22, $y1-28, $texte2,$bleu);
imagestring( $image, $taille,$x1+162, $y1-28, $lieun, $bleu ) ;
imagestring($image, $taille, $x1+97, $y1-10, $n_ins,$bleu);
$texte3=$moy_an;
$y2=279;
$x2=143;
if ($an==1){$term="ére";}else{$term="éme";}
imagestring($image, $taille, $x2+137, $y2-19, $an.$term,$bleu);
$y2=295;
imagestring($image, $taille, $x2+95, $y2-17, $texte3,$bleu);
imagestring($image, $taille, $x2+314, $y2-17, $crd_an,$bleu);
line 64:imagejpeg($image, "certi" .$n_ins.".jpg");
echo "<table cellpadding='0' cellspacing='0' ><tr valign='top'><td valign='top'>
<img src='certi".$n_ins.".jpg'></td></tr></table>";
imagedestroy($image);
?> |
Partager