Ontdek al de opkomende fuiven in jouw regioBekijk de laatste nieuwe foto'sSubscribe to the mailing-listView and sign the guestbookCheck out our links to other mediaVisit our partners

ADMIN


admin
Informatie
Paswoord:
 
Links
Paswoord:
 
Partners
Paswoord:
 
Nieuws
Poll

getPoll(); # Split options $options = explode(",", $data['poll_keuzes']); # Count options for loop $aant = count($options)-1; $poll .= "" . $data['poll_stelling'] . "
"; $poll .= "
"; # Loop and make input radios for($i = 0; $i <= $aant; $i++) { $j = $i+1; $poll .= "" . $options[$i] . "
"; } # End form $poll .= ""; $poll .= "
"; # Show pollid no. and poll date $poll .= "

PollID: " . $data['poll_id'] . " - PollDatum: " . date("j-n-Y", $data['poll_datum']); # Show link to archives return $poll; } function updateVotes($vote) { # Get newest poll $data = $this->getPoll(); # Split the vote scores $stemmen = explode(",", $data['poll_scores']); # add one to the selected option $vote--; (int) $stemmen[$vote]++; # Remake the data $stem = implode(",", $stemmen); # Add to database $sql1 = "UPDATE `poll` SET `poll_scores` = '" . $stem . "' WHERE `poll_id` = '" . $data['poll_id'] . "'"; $ip = $_SERVER['REMOTE_ADDR']; $sql2 = "INSERT INTO `votes` SET `vote_ip` = '" . $ip . "', `vote_datum` = '" . time() . "'"; # Run db class $db = new database; $res1 = $db->execute($sql1); $res2 = $db->execute($sql2); } function getPoll() { # Select the newest poll $sql = "SELECT * FROM `poll` ORDER BY `poll_id` DESC LIMIT 1"; # Run db class $db = new database; # Get array $data = $db->get_single($sql); return $data; } function showResults() { # Get data $data = $this->getPoll(); # Split options and scores $options = explode(",", $data['poll_keuzes']); $scores = explode(",", $data['poll_scores']); $option = count($options)-1; # Count the votes $votes = array_sum($scores); # Show total votes $results .= "" . $data['poll_stelling'] . "
"; $results .= "Totaal aantal stemmen: " . $votes . "
"; $results .= "

"; # Loop through results for($i = 0;$i <= $option; $i++) { $results .= $options[$i] . "
"; $results .= "imgPXL($votes, $scores[$i]) . "\" height=\"10\" />" . $this->imgPXL($votes, $scores[$i]) . "%"; $results .= "
"; } $results .= "

"; # Show pollid no. and poll date $results .= "

PollID: " . $data['poll_id'] . " - PollDatum: " . date("j-n-Y", $data['poll_datum']); # Show link to archives return $results; } function archResults($id) { # Get data $data = $this->archPoll($id); # Split options and scores $options = explode(",", $data['poll_keuzes']); $scores = explode(",", $data['poll_scores']); $option = count($options)-1; # Count the votes $votes = array_sum($scores); # Show total votes $results .= "" . $data['poll_stelling'] . "
"; $results .= "Totaal aantal stemmen: " . $votes . "
"; $results .= "

"; # Loop through results for($i = 0;$i <= $option; $i++) { $results .= $options[$i] . "
"; $results .= "imgPXL($votes, $scores[$i]) . "\" height=\"10\" />" . $this->imgPXL($votes, $scores[$i]) . "%"; $results .= "
"; } $results .= "

"; # Show pollid no. and poll date $results .= "

PollID: " . $data['poll_id'] . " - PollDatum: " . date("j-n-Y", $data['poll_datum']); # Show link to archives $results .= "

Terug!"; return $results; } function archPoll($id) { # Select the newest poll $sql = "SELECT * FROM `poll` WHERE `poll_id` = '" . $id . "' ORDER BY `poll_id` DESC LIMIT 1"; # Run db class $db = new database; # Get array $data = $db->get_single($sql); return $data; } # Calculate indicator size function imgPXL($tot, $opt) { $pro = $tot / 100; if($pro==0){$pro=1 ;} $num = $opt / $pro; return (int) $num; } } ?>


     
belgian print company
 


       breakloose