Get Involved   >>"; $subtitle="Get Involved"; $headerimg="yellow_spider.jpg"; $headerimg=""; ##$debug=1; if (! $year ) { $year=date('Y'); } $year_result = $year + 1; # ballot closes after September 1st # using 3am on the 2nd to make it midnight on the west coast. $unix_time = time(); if (($unix_time >= mktime(0,0,0,2,1,$year) && $unix_time <= mktime(3,0,0,9,2,$year) ) ) { $voting_over = 0; } else { $voting_over = 1; } $style='newsite2_'; include_once($style.'header.php'); #$MakeBallot=1; include_once("Admin/dbopen.php"); $wherecond = "1"; ?> $value) { echo "$key -> $value
\n"; } } $submit = $_POST{'submit'}; /* if ($submit && $_POST{'Region'} == 13 && !$_POST{'Special'}) { $message = "Members from Region 13 must also choose their state to continue."; $submit=0; } else if ( $submit && $_POST{'Region'} != 13 && $_POST{'Special'} ) { $submit=0; $message = "Region and State are mismatched. ". "Did you mean to select Region 13?"; } else if ( $submit && $_POST{'Region'} == "NONE" ) { $submit=0; $message = "You must select a Region. "; } else { $message = 0; } */ if ( $submit && $_POST{'Region'} == "NONE" ) { $submit=0; $message = "You must select a Region. "; } else { $message = 0; } if ( $submit ) { switch ( $_POST{'action'} ) { case 'showballot': if ($debug) { echo "Show Ballor
\n"; } #### LA AND AR special cases.... if ($debug) { foreach ($_POST as $key => $value) { echo "$key -> $value
\n"; } } $region = $_POST{'Region'}; $special = $_POST{'Special'}; if ($db && $region >= 1 && $region <=15) { print_region_ballot( $region, $year, $special); } else { print_old_ballot( $region, $year); } break; # MOve this to admin pages # case 'makeballot': # echo "MAKE BALLOT"; # # make_region_ballot( $Region, $year); # break; case 'voteballot': if ($debug) { echo "Vote Ballot
\n"; } verify_region_ballot( $Region, $year); break; default: if ($debug) { echo "Submit Error
\n"; } break; } } else { if ($debug) { echo "no submission
\n"; } if ($debug) { foreach ($_POST as $key => $value) { echo "$key -> $value
\n"; } } # request region if ( $voting_over ) { echo "

Voting is over for $year.

\n"; # echo "

". # "Voting is over for $year. Click here for results.

\n"; } else { # echo "

Popularity Poll Ballot for $year

\n"; # echo "

Vote Now to Select the # Recommended Daylilies for $year_result

"; # echo "

Vote Now to Select the # Most Popular Daylilies for $year_result

"; } # include "changes.inc"; if ($message) { echo "

$message

\n"; } echo "

Please Select Your Region:"; # echo "
(If your region isn't listed, then your RPD has not confirmed their email address.)"; echo "

"; echo "
\n"; echo ""; /* echo "   Region 13 Members Only: "; */ echo "\n"; echo "\n"; echo "\n
\n"; include_once "rules.inc"; } include_once($style.'footer.php'); ###### function verify_region_ballot( ) { global $edit, $debug, $year; $errors = 0; $count=0; $wi=0; $editdata=''; $votedata=''; echo "

YOU AREN'T DONE YET!
Please Review Your Ballot

\n"; $region = $_POST{'Region'}; if ($region == 13) {$special = $_POST{'Special'};} $name = ($_POST{'realname'}); $addr = ($_POST{'Address'}); $email = ($_POST{'email'}); $local = ($_POST{'Local_Info'}); foreach ($_POST as $key => $value) { if ($debug) { echo urldecode($key)." -> $value
\n";} if ($key == "checkbox" ) { if ($debug) {echo urldecode($key)." -> ";} foreach ($value as $v){ if ($v) { $count++; if ($debug) {echo "$v, "; } $editdata .= "\n"; $v = urldecode($v); $votedata .= "\n"; $viewdata .= "
  • '$v' \n"; } } if ($debug) {echo "
    \n";} } if ($key == 'writein') { if ($debug) {echo ($key)." -> ";} foreach ($value as $v){ if ($v) { $v = htmlentities($v); if ($debug) {echo ($v).", "; } $count++; $wi++; $votedata .= "\n"; $editdata .= "\n"; $viewdata .= "
  • '$v' \n"; } } if ($debug) {echo "
    \n";} } } echo "

    "; if ($region) {echo "Region $region
    \n";} else {$errors++;} if ($name) {echo "Name: $name
    \n";} else {$errors++;} if ($email) {echo "Email: $email
    \n";} else {$errors++;} if ($addr) {echo "Address: $addr
    \n";} else {$errors++;} if ($local) {echo "local info: $local
    \n";} if ($errors) {echo "Member Information is Missing! Please EDIT your ballot.
    \n";} echo "

    \n"; echo "
    Your Votes:
    \n"; echo "
      $viewdata
    \n"; $daylily = ($count==1) ? 'daylily' : 'daylilies'; echo "

    You have marked the $count $daylily above on your ballot.\n"; if ($count < 10) { echo "This is fine, but you may vote for up to 10.\n"; echo "
    Use the EDIT button below to edit your ballot or"; echo "click the VOTE button below to submit your votes."; } else if ($count > 10) { $errors++; echo "YOU MAY ONLY VOTE FOR 10 DAYLILIES.\n"; echo "
    Please use the EDIT button below to modify your ballot."; } echo "

    "; echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo $editdata; echo "\n"; echo "\n"; echo "
    \n"; if ( ! $errors ) { echo "
    "; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " "; echo $votedata; echo "\n"; echo "
    \n"; } } function print_region_ballot( $region, $year, $special='' ) { global $edit, $voting_over, $debug; echo "

    Region $region Ballot for $year

    \n"; echo "

    Vote for up to 10 of your favorite daylilies.

    \n"; echo "
    \n"; echo "\n"; echo "\n"; if ($special) {echo "\n";} $yearnext= $year+1; $yearprev= $year-1; ## you can use this to display a preliminary ballot ## $table = 'PopPoll_reg_summary'.$yearprev; ## $sql = "select * from $table where ballot=1 and region=$region $orderby"; $table = 'PopPoll_ballot'.$year; $orderby = "order by cultivar"; $sql = "select distinct cultivar from $table where region=$region $orderby"; if ($debug) {printf("%s
    \n", $sql); }; $result = mysql_query($sql); if (!$result) { echo "

    No results were returned.
    "; echo "

    "; } else { $count = mysql_num_rows($result); if (!$count) { echo "

    No results were returned.
    "; echo "

    "; } else { $half = floor(($count+5) / 2) + (($count+5) % 2); echo "
    "; echo ""; echo "
    \n"; $row = 0; while ($record = mysql_fetch_array($result,MYSQL_ASSOC)) { $row++; $cultivar = $record{'cultivar'}; $cultivar = trim($cultivar); #beginning and end whitespace $cultivar = trim($cultivar,"\x7f..\xff\x0..\x1f"); #csv crap? $cultivar = preg_replace('/\s\s+/',' ',$cultivar); #duplicate spacess # remove any pesky quoted cultivar names that slipped through. $count=0; $cultivar = preg_replace("/^'/",'',$cultivar,1,$count); if ($count) { $cultivar = preg_replace("/'$/",'',$cultivar,1,$count2); } $cultivar = htmlentities($cultivar,ENT_QUOTES,'UTF-8'); $urlc = urlencode($cultivar); echo ""; echo "  '$cultivar'
    \n"; if ($row == $half) { echo "\n
    \n"; } } for ($i=1; $i <= 5; $i++) { echo "  write-in #$i:
    \n"; } echo "
    \n"; } } $name=htmlentities($_POST{"Name"}); $addr=htmlentities($_POST{"Address"}); $email=htmlentities($_POST{"Email"}); $local=htmlentities($_POST{"Local"}); echo "

    "; echo ("
    Member Name:
    Your Email Address:
    Your Mailing Address:
    * Please include club or other information collected by your region here:
    * optional

    "); # end result container echo "\n"; if (! $voting_over) { echo "\n"; } else { echo "

    Voting is over for $year.

    \n"; } echo "\n"; ### missing a line here! action? } function print_old_ballot( $region, $year ) { include_once "ballot_intl.html"; } ?>