X-Git-Url: http://git.hcoop.net/clinton/MarylandElectronicPetitionSignature.git/blobdiff_plain/3ff659a504e6ab7f1c4dac56846ff4204e0db269..ca7db7a4132c16eba81d338f15f4a8607ec8e31c:/hard_copy.php diff --git a/hard_copy.php b/hard_copy.php index 0d70622..cecc4e4 100644 --- a/hard_copy.php +++ b/hard_copy.php @@ -4,9 +4,15 @@ // y how far from top include_once('/var/www/secure.php'); $id = $_COOKIE['pID']; -$q = "select * from petitions where id = '$id'"; +$q = "select * from petitions where petition_id = '$id'"; $r = $petition->query($q); $d = mysqli_fetch_array($r); +$hide_county = $d['hide_county_on_petition']; +$offset_x = $d['offset_x_cords']; +$offset_y = $d['offset_y_cords']; +$offset_x_circulator = $d['offset_x_cords_circulator']; +$offset_y_circulator = $d['offset_y_cords_circulator']; + //Set the Content Type header('Content-type: image/jpeg'); @@ -26,39 +32,42 @@ $font_path_sig = 'files/Claston Script.ttf'; $DOB = $_COOKIE['pDOB']; $SIGNED = date('Y-m-d'); -//if ( $_COOKIE['pCOUNTY'] == 'Baltimore City'){ - // City Checkbox - $cord = $d['text_cord_county']; - $array = explode(",",$cord); - imagettftext($jpg_image, $array[0], $array[1], $array[2], $array[3], $black, $font_path, 'X'); -//}else{ - // County on Petition - $cord = $d['text_cord_cityX']; - $array = explode(",",$cord); - imagettftext($jpg_image, $array[0], $array[1], $array[2], $array[3], $black, $font_path, str_replace('County','',$_COOKIE['pCOUNTY']) ); -//} - +if ($hide_county == 'NO'){ + if ( $_COOKIE['pCOUNTY'] == 'Baltimore City' || $_COOKIE['debug'] == 'on'){ + // City Checkbox + $cord = $d['text_cord_cityX']; + $array = explode(",",$cord); + $debug = "$id : $cord : $array[0]"; + imagettftext($jpg_image, $array[0], $array[1], $array[2], $array[3], $black, $font_path, 'X'); + }else{ + // County on Petition + $cord = $d['text_cord_county']; + $array = explode(",",$cord); + imagettftext($jpg_image, $array[0], $array[1], $array[2], $array[3], $black, $font_path, str_replace('County','',$_COOKIE['pCOUNTY']) ); + } +} // name -imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, $_COOKIE['pNAME']); +imagettftext($jpg_image, 50, 0, 350+$offset_x, 1070+$offset_y, $black, $font_path, $_COOKIE['pNAME']); +//imagettftext($jpg_image, 50, 0, 350, 1070, $black, $font_path, $debug); // address -imagettftext($jpg_image, 50, 0, 400, 1300, $black, $font_path, $_COOKIE['pADDRESS']); +imagettftext($jpg_image, 50, 0, 400+$offset_x, 1300+$offset_y, $black, $font_path, $_COOKIE['pADDRESS']); // date of birth if($DOB != ''){ - imagettftext($jpg_image, 50, 0, 1900, 1070, $black, $font_path, date('m d Y',strtotime($DOB))); + imagettftext($jpg_image, 50, 0, 1900+$offset_x, 1070+$offset_y, $black, $font_path, date('m d Y',strtotime($DOB))); } // date signed //imagettftext($jpg_image, 50, 0, 1900, 1200, $black, $font_path, date('m d Y',strtotime($SIGNED))); // name -imagettftext($jpg_image, 40, 0, 100, 2880, $black, $font_path, $_COOKIE['pNAME']); +imagettftext($jpg_image, 40, 0, 100+$offset_x_circulator, 2880+$offset_y_circulator, $black, $font_path, $_COOKIE['pNAME']); // address -imagettftext($jpg_image, 40, 0, 100, 2975, $black, $font_path, $_COOKIE['pADDRESS1']); +imagettftext($jpg_image, 40, 0, 100+$offset_x_circulator, 2975+$offset_y_circulator, $black, $font_path, $_COOKIE['pADDRESS1']); // city state zip -imagettftext($jpg_image, 40, 0, 100, 3065, $black, $font_path, $_COOKIE['pADDRESS2']); +imagettftext($jpg_image, 40, 0, 100+$offset_x_circulator, 3065+$offset_y_circulator, $black, $font_path, $_COOKIE['pADDRESS2']); // phone -imagettftext($jpg_image, 40, 0, 100, 3160, $black, $font_path, $_COOKIE['pPHONE']); +imagettftext($jpg_image, 40, 0, 100+$offset_x_circulator, 3160+$offset_y_circulator, $black, $font_path, $_COOKIE['pPHONE']); // date signed //imagettftext($jpg_image, 40, 0, 2150, 3150, $black, $font_path, date('m / d / y',strtotime($SIGNED)));