X-Git-Url: http://git.hcoop.net/clinton/MarylandElectronicPetitionSignature.git/blobdiff_plain/1029664cdb750dc8d88cd2668d5606d86f30088e..defa1cf8f303437931cdddc61d5c595f87df3c1e:/eligible.php diff --git a/eligible.php b/eligible.php index 4a8a1e3..70dd7c2 100644 --- a/eligible.php +++ b/eligible.php @@ -2,6 +2,7 @@ ob_start(); include_once('header.php'); $head = ob_get_clean(); +$VoterList_table = $_COOKIE['VoterList_table']; $web_first_name = $_COOKIE['web_first_name']; $web_last_name = $_COOKIE['web_last_name']; $web_house_number = $_COOKIE['web_house_number']; @@ -18,7 +19,7 @@ if ($web_first_name != '' && $web_last_name != '' && $web_house_number != '' && // we should NEVER hit this page anymore header('Location: warning_incomplete.php'); } -$q = "select * from VoterList where LASTNAME = '$web_last_name' and FIRSTNAME = '$web_first_name' and HOUSE_NUMBER = '$web_house_number' and RESIDENTIALZIP5 = '$web_zip_code'"; +$q = "select * from $VoterList_table where LASTNAME = '$web_last_name' and FIRSTNAME = '$web_first_name' and HOUSE_NUMBER = '$web_house_number' and RESIDENTIALZIP5 = '$web_zip_code'"; $r = $petition->query($q); $d = mysqli_fetch_array($r); if ($d['VTRID'] != ''){ @@ -48,28 +49,17 @@ echo $head; $available=''; -$q2 = "SELECT * FROM petitions"; +$q2 = "SELECT * FROM petitions where admin_status = 'approved'"; $r2 = $petition->query($q2); while($d2 = mysqli_fetch_array($r2)){ $checked = ''; $field = $d2['eligibleVoterListField']; $pass = $d2['eligibleVoterListEquals']; - $q4 = "select * from signatures where VTRID = '$VTRID' and petition_id = '$d2[petition_id]' and signature_status <> 'removed' "; - $r4 = $petition->query($q4); - $d4 = mysqli_fetch_array($r4); - if ($d4['id'] > 0){ - slack_general($VTRID.' Already Signed '.$d2[petition_id].' ('.$_COOKIE['invite'].')','md-petition'); - } - /* -if ($d4['id'] > 0){ - $available .= "
-
Already Signed, View or Remove
-
$d2[petition_name]
-
$field == $pass
-
"; - }else */ + +$my_test = $d[$field]; - if($d[$field] == $pass){ + if($my_test == $pass){ + // good to go $checked = ''; if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ $checked = 'checked'; @@ -77,15 +67,16 @@ if ($d4['id'] > 0){ $checked = ''; } $available .= "
-
-

$d2[petition_name]
$field == $pass

-

$d2[eligibleVoterListEnforce]

+
+

$d2[petition_name]
$field == $pass

+

$d2[eligibleVoterListEnforce]

"; if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ $available .= ''; } }else{ + // not a eligable voter $checked = ''; if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ $checked = 'checked'; @@ -93,12 +84,17 @@ if ($d4['id'] > 0){ $checked = ''; } $available .= "
-
"; if ($d2['eligibleVoterListEnforce'] == 'NO'){ $available .=""; }else{ $available .= "

Constituents Only

"; } $available .= "
-

$d2[petition_name]
$field != $pass

-

$d2[eligibleVoterListEnforce]

+
"; if ($d2['eligibleVoterListEnforce'] == 'NO'){ $available .="→←"; }else{ $available .= "

Constituents Only

"; } $available .= "
+

$d2[petition_name]
$field != $pass ($my_test)

+

$d2[eligibleVoterListEnforce]

"; - if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ + if($d2['eligibleVoterListEnforce'] == 'NO' && $_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name']) ){ $available .= ''; + }elseif($d2['eligibleVoterListEnforce'] == 'YES' && $_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name']) ){ + setcookie("invite", ""); // clear invite + $error = "$field is not $pass it is $my_test"; + setcookie("invite_error", $error); // record error + $available .= ''; } } } @@ -117,7 +113,7 @@ if ($d4['id'] > 0){
-

+

@@ -129,13 +125,11 @@ if ($d4['id'] > 0){
-
-
- +
+
-
- +