X-Git-Url: http://git.hcoop.net/clinton/MarylandElectronicPetitionSignature.git/blobdiff_plain/66e03a53c06f00d843ae579441b7d19e1119c874..301ed9556f263ec0ab216bb22326ed1b06953c0c:/eligible.php diff --git a/eligible.php b/eligible.php index ebe4ba5..70dd7c2 100644 --- a/eligible.php +++ b/eligible.php @@ -2,16 +2,24 @@ 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']; $web_zip_code = $_COOKIE['web_zip_code']; if ($web_first_name != '' && $web_last_name != '' && $web_house_number != '' && $web_zip_code != ''){ - // ok to check for records + include_once('header.php'); + $web_first_name = $petition->real_escape_string($web_first_name); + $web_last_name = $petition->real_escape_string($web_last_name); + $web_house_number = $petition->real_escape_string($web_house_number); + $web_zip_code = $petition->real_escape_string($web_zip_code); + $DOB = $petition->real_escape_string($DOB); + $PHONE = $petition->real_escape_string($PHONE); }else{ + // 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'] != ''){ @@ -23,14 +31,17 @@ if ($d['VTRID'] != ''){ $RESIDENTIALCITY = $d['RESIDENTIALCITY']; $COUNTY = $d['COUNTY']; $RESIDENTIALZIP5 = $d['RESIDENTIALZIP5']; + slack_general('MATCH: eligible ('.$FIRSTNAME.' '.$LASTNAME.' '.$RESIDENTIALCITY.') ('.$_COOKIE['invite'].')','md-petition'); }else{ - header('Location: warning_not_found.php'); + slack_general('MISS: eligible ('.$web_first_name.' '.$web_last_name.' '.$PHONE.') ('.$_COOKIE['invite'].')','md-petition'); + header('Location: warning_not_found.php'); } if (isset($_GET['remove'])){ $id = $_GET['remove']; $q = "update signatures set signature_status = 'removed' where id = '$id'"; $petition->query($q); + slack_general('SQL: eligible ('.$q.') ('.$_COOKIE['invite'].')','md-petition'); header('Location: eligible.php'); } @@ -38,37 +49,34 @@ 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){ - $available .= "
-
Already Signed - View or Remove
-
$d2[petition_name]
-
$field == $pass
-
"; - }elseif($d[$field] == $pass){ - $checked = ''; - if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ + +$my_test = $d[$field]; + + if($my_test == $pass){ + // good to go + $checked = ''; + if($_COOKIE['invite'] != '' && strtoupper($_COOKIE['invite']) == strtoupper($d2['web_short_name'])){ $checked = 'checked'; }else{ $checked = ''; } $available .= "
-
-
$d2[petition_name]
-
$field == $pass
+
+

$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'; @@ -76,61 +84,52 @@ if ($d4['id'] > 0){ $checked = ''; } $available .= "
-
-
$d2[petition_name]
-
$field != $pass
+
"; 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 .= ''; } } } ?>
+ query($q); + $d = mysqli_fetch_array($r); + ?> +
-

Active Petitions and Eligiblity Requirements to Sign.

+

-

Pick One

-

Petition Name

-

Requirements

+

Pick One

+

Petition Name
Eligible

+

Locked

-
-
- - - +
+
-

Petition History

-
- - -
-

Date

-

Petition Name

-

Status

-
- - 'removed'"; - $r4 = $petition->query($q4); - while($d4 = mysqli_fetch_array($r4)){ - ?> - - - - +
+