Commit | Line | Data |
---|---|---|
2674a73b | 1 | <?php |
44ece581 PM |
2 | // imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text ) |
3 | // x how far from left | |
4 | // y how far from top | |
5 | ||
6 | ||
2674a73b PM |
7 | //Set the Content Type |
8 | header('Content-type: image/jpeg'); | |
9 | ||
44ece581 | 10 | // Create Image From Existing File -- going to have to make this a reqired size??? 2550x3300 |
2674a73b PM |
11 | $jpg_image = imagecreatefromjpeg('files/Green-Party-petition-1-page-001.jpg'); |
12 | ||
13 | // Allocate A Color For The Text | |
4e86c3a9 | 14 | $black = imagecolorallocate($jpg_image, 0, 0, 0); |
2674a73b PM |
15 | |
16 | // Set Path to Font File | |
cba2e1ee | 17 | $font_path = 'files/coolvetica rg.ttf'; |
79cda33c | 18 | $font_path_sig = 'files/Claston Script.ttf'; |
2674a73b | 19 | |
c4b2d2ae | 20 | |
28c1c116 | 21 | $DOB = $_COOKIE['pDOB']; |
c4b2d2ae PM |
22 | $SIGNED = date('Y-m-d'); |
23 | ||
b9943fb7 PM |
24 | if ( $_COOKIE['pCOUNTY'] == 'Baltimore City'){ |
25 | // City Checkbox | |
26 | imagettftext($jpg_image, 50, 0, 115, 365, $black, $font_path, 'X'); | |
27 | }else{ | |
28 | // County on Petition | |
be8ec17a | 29 | imagettftext($jpg_image, 50, 0, 220, 260, $black, $font_path, str_replace('County','',$_COOKIE['pCOUNTY']) ); |
b9943fb7 | 30 | } |
44ece581 | 31 | |
197e4a6c | 32 | // name |
b9943fb7 | 33 | imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, $_COOKIE['pNAME']); |
bbe86d85 | 34 | |
197e4a6c | 35 | // address |
b9943fb7 PM |
36 | imagettftext($jpg_image, 50, 0, 400, 1300, $black, $font_path, $_COOKIE['pADDRESS']); |
37 | // date of birth | |
bbe86d85 PM |
38 | if($DOB != ''){ |
39 | imagettftext($jpg_image, 50, 0, 1900, 1070, $black, $font_path, date('m d Y',strtotime($DOB))); | |
40 | } | |
41 | // date signed | |
4db02c88 | 42 | //imagettftext($jpg_image, 50, 0, 1900, 1200, $black, $font_path, date('m d Y',strtotime($SIGNED))); |
bbe86d85 PM |
43 | |
44 | ||
45 | // name | |
bab34e65 | 46 | imagettftext($jpg_image, 40, 0, 100, 2880, $black, $font_path, $_COOKIE['pNAME']); |
bbe86d85 | 47 | // address |
89d9aa01 | 48 | imagettftext($jpg_image, 40, 0, 100, 2975, $black, $font_path, $_COOKIE['pADDRESS1']); |
bbe86d85 | 49 | // city state zip |
89d9aa01 | 50 | imagettftext($jpg_image, 40, 0, 100, 3065, $black, $font_path, $_COOKIE['pADDRESS2']); |
bbe86d85 | 51 | // phone |
bab34e65 | 52 | imagettftext($jpg_image, 40, 0, 100, 3160, $black, $font_path, $_COOKIE['pPHONE']); |
2514ea32 | 53 | |
197e4a6c | 54 | // date signed |
4db02c88 | 55 | //imagettftext($jpg_image, 40, 0, 2150, 3150, $black, $font_path, date('m / d / y',strtotime($SIGNED))); |
bbe86d85 | 56 | |
44ece581 | 57 | |
2674a73b PM |
58 | // Send Image to Browser |
59 | imagejpeg($jpg_image); | |
60 | ||
61 | // Clear Memory | |
62 | imagedestroy($jpg_image); | |
63 | ?> |