2 include_once('/var/www/secure.php');
5 $q = "select * from signatures where id = '$id' ";
6 $r = $petition->query($q);
7 $d = mysqli_fetch_array($r);
9 $DOB = $d['date_of_birth'];
10 $SIGNED = $d['date_time_signed'];
11 $PETITION_ID = $d['petition_id'];
12 $signed_name_as = $d['signed_name_as'];
14 if ($_COOKIE['pVTRID'] != $d['VTRID']){
18 $q2 = "select * from VoterList where VTRID = '$d[VTRID]' ";
19 $r2 = $petition->query($q2);
20 $d2 = mysqli_fetch_array($r2);
21 $FIRSTNAME = $d2['FIRSTNAME'];
22 $MIDDLENAME = $d2['MIDDLENAME'];
23 $LASTNAME = $d2['LASTNAME'];
24 $ADDRESS = $d2['ADDRESS'];
25 $RESIDENTIALCITY = $d2['RESIDENTIALCITY'];
26 $COUNTY = $d2['COUNTY'];
27 $RESIDENTIALZIP5 = $d2['RESIDENTIALZIP5'];
28 $full_name = "$FIRSTNAME $MIDDLENAME $LASTNAME";
29 $address = "$ADDRESS $RESIDENTIALCITY $RESIDENTIALZIP5";
33 // imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
34 // x how far from left
38 //Set the Content Type
39 header('Content-type: image/jpeg');
41 // Create Image From Existing File -- going to have to make this a reqired size??? 2550x3300
42 $jpg_image = imagecreatefromjpeg('files/Green-Party-petition-1-page-001.jpg');
44 // Allocate A Color For The Text
45 $black = imagecolorallocate($jpg_image, 0, 0, 0);
47 // Set Path to Font File
48 $font_path = 'files/coolvetica rg.ttf';
49 $font_path_sig = 'files/Claston Script.ttf';
51 if ( $COUNTY == 'Baltimore City'){
53 imagettftext($jpg_image, 50, 0, 115, 365, $black, $font_path, 'X');
56 imagettftext($jpg_image, 50, 0, 220, 260, $black, $font_path, str_replace('County','',$COUNTY) );
60 imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, $full_name);
62 imagettftext($jpg_image, 60, 0, 400, 1180, $black, $font_path_sig, $signed_name_as);
64 imagettftext($jpg_image, 50, 0, 400, 1300, $black, $font_path, $address);
68 imagettftext($jpg_image, 50, 0, 1900, 1070, $black, $font_path, date('m d Y',strtotime($DOB)));
71 imagettftext($jpg_image, 50, 0, 1900, 1200, $black, $font_path, date('m d Y',strtotime($SIGNED)));
75 imagettftext($jpg_image, 40, 0, 50, 3050, $black, $font_path_sig, $signed_name_as);
77 imagettftext($jpg_image, 40, 0, 50, 3100, $black, $font_path_sig, $ADDRESS);
79 imagettftext($jpg_image, 40, 0, 50, 3120, $black, $font_path_sig, "$RESIDENTIALCITY MD $RESIDENTIALZIP5");
81 imagettftext($jpg_image, 40, 0, 50, 3150, $black, $font_path_sig, '111-222-3333');
83 imagettftext($jpg_image, 40, 0, 1290, 3150, $black, $font_path_sig, $signed_name_as);
85 imagettftext($jpg_image, 40, 0, 2150, 3150, $black, $font_path, date('m / d / y',strtotime($SIGNED)));
89 // Send Image to Browser
90 imagejpeg($jpg_image);
93 imagedestroy($jpg_image);