2 // imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
5 include_once('/var/www/secure.php');
7 $q = "select * from petitions where petition_id = '$id'";
8 $r = $petition->query($q);
9 $d = mysqli_fetch_array($r);
11 //Set the Content Type
12 header('Content-type: image/jpeg');
14 // Create Image From Existing File -- going to have to make this a reqired size??? 2550x3300
15 $JPG = $_COOKIE['pJPG'];
16 $jpg_image = imagecreatefromjpeg($JPG);
18 // Allocate A Color For The Text
19 $black = imagecolorallocate($jpg_image, 0, 0, 0);
21 // Set Path to Font File
22 $font_path = 'files/coolvetica rg.ttf';
23 $font_path_sig = 'files/Claston Script.ttf';
26 $DOB = $_COOKIE['pDOB'];
27 $SIGNED = date('Y-m-d');
29 if ( $_COOKIE['pCOUNTY'] == 'Baltimore City'){
31 $cord = $d['text_cord_cityX'];
32 $array = explode(",",$cord);
33 $debug = "$id : $cord : $array[0]";
34 imagettftext($jpg_image, $array[0], $array[1], $array[2], $array[3], $black, $font_path, 'X');
37 $cord = $d['text_cord_county'];
38 $array = explode(",",$cord);
39 imagettftext($jpg_image, $array[0], $array[1], $array[2], $array[3], $black, $font_path, str_replace('County','',$_COOKIE['pCOUNTY']) );
43 imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, $_COOKIE['pNAME']);
44 //imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, $debug);
47 imagettftext($jpg_image, 50, 0, 400, 1300, $black, $font_path, $_COOKIE['pADDRESS']);
50 imagettftext($jpg_image, 50, 0, 1900, 1070, $black, $font_path, date('m d Y',strtotime($DOB)));
53 //imagettftext($jpg_image, 50, 0, 1900, 1200, $black, $font_path, date('m d Y',strtotime($SIGNED)));
57 imagettftext($jpg_image, 40, 0, 100, 2880, $black, $font_path, $_COOKIE['pNAME']);
59 imagettftext($jpg_image, 40, 0, 100, 2975, $black, $font_path, $_COOKIE['pADDRESS1']);
61 imagettftext($jpg_image, 40, 0, 100, 3065, $black, $font_path, $_COOKIE['pADDRESS2']);
63 imagettftext($jpg_image, 40, 0, 100, 3160, $black, $font_path, $_COOKIE['pPHONE']);
66 //imagettftext($jpg_image, 40, 0, 2150, 3150, $black, $font_path, date('m / d / y',strtotime($SIGNED)));
69 // Send Image to Browser
70 imagejpeg($jpg_image);
73 imagedestroy($jpg_image);