Update soft_copy.php
authorPatrick McGuire <insidenothing@gmail.com>
Thu, 14 May 2020 17:41:52 +0000 (13:41 -0400)
committerGitHub <noreply@github.com>
Thu, 14 May 2020 17:41:52 +0000 (13:41 -0400)
soft_copy.php

index 8d099b0..1c1c1b5 100644 (file)
@@ -30,6 +30,11 @@ $d2 = mysqli_fetch_array($r2);
  
 $contact_phone            = $d2['contact_phone'];
 
+
+$qX = "select * from petitions where petition_id = '$PETITION_ID'";
+$rX = $petition->query($qX);
+$dX = mysqli_fetch_array($rX);
+
 // imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text ) 
 // x how far from left
 // y how far from top
@@ -39,7 +44,7 @@ $contact_phone            = $d2['contact_phone'];
 header('Content-type: image/jpeg');
 
 // Create Image From Existing File -- going to have to make this a reqired size??? 2550x3300
-$jpg_image = imagecreatefromjpeg('files/Green-Party-petition-1-page-001.jpg');
+$jpg_image = imagecreatefromjpeg($dX['petition_jpg']);
 
 // Allocate A Color For The Text
 $black = imagecolorallocate($jpg_image, 0, 0, 0);
@@ -48,12 +53,17 @@ $black = imagecolorallocate($jpg_image, 0, 0, 0);
 $font_path = 'files/coolvetica rg.ttf';
 $font_path_sig = 'files/Claston Script.ttf';
 
-if ( $COUNTY == 'Baltimore City'){
+if ( $_COOKIE['pCOUNTY'] == 'Baltimore City'){
   // City Checkbox
-  imagettftext($jpg_image, 50, 0, 115, 365, $black, $font_path, 'X');
+  $cord = $dX['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
-  imagettftext($jpg_image, 50, 0, 220, 260, $black, $font_path, str_replace('County','',$COUNTY) );
+  $cord = $dX['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