25 if($show_poll->anonymous ==
true){
26 print_info(
"Diese Umfrage wird anonym ausgewertet! <br/> Es werden also keine Benutzerdaten gespeichert, die auf die Herkunft (username, voller Name) hinweisen könnten.");
28 echo
'<form method="POST" action="">';
29 $show_poll->display();
30 echo
"<p style='margin-top:2em;'>Die Felder, die mit <span class='required_asterisk'>*</span> markiert sind, sind Plichtfelder.</p>";
32 echo
'<br/><input type="submit" value="Senden" name="poll_submit"/>';
40 require_once(
"inc/user.class.php");
41 if( !(isset($_SESSION)) ){
45 session_regenerate_id();
48 require_once(
"config.php");
49 require_once(
"inc/tools.php");
51 require_once(
"inc/db.class.php");
52 require_once(
"inc/config.class.php");
53 require_once(
"inc/poll.class.php");
54 require_once(
"inc/html.class.php");
55 require_once(
"inc/messages.class.php");
56 require_once(
"inc/chart.class.php");
57 $db=
new db( DB_USER, DB_PASS, DB_DATABASE, DB_HOST );
68 if( $pps[
"anonymous"] ==
"2"){
70 $p->load_from_id(
$db,$pps[
"ID"]);
73 ($p->get_timeout_timestamp() >=
$now) ){
84 if( (isset($_GET[
"h"])) AND (strlen($_GET[
"h"]) == 32) ){
87 if( $p->hashID === $_GET[
"h"] ){
96 if( (isset($_POST[
"poll_submit"])) AND (isset($poll)) ){
97 $poll->load_from_id(
$db,$poll->ID);
98 $page =
"handle poll";
102 if( (
$page ==
"show poll") OR (
$page ==
"handle poll") ){
103 $poll->load_widget_result_count(
$db);
110 if( (
$page ==
"show poll") OR (
$page ==
"handle poll") ){
111 if( $poll->theme !==
"" ){
112 HTML::head(
'<link href="'.APP_ROOT.
'/CSS/Themes/'.$poll->theme.
'" rel="stylesheet" type="text/css">' );
122 if (
$page ==
"index"){
126 }
else if (
$page ==
"show poll"){
128 echo
"<p id='poll_title'> <span id='umfrage'>Umfrage</span> «<i>{$poll->name}</i>»</p>";
133 }
else if(
$page ==
"handle poll"){
135 $errors = $poll->handle_inpt();
138 if(
sizeof($errors) != 0){
139 foreach($errors as $e){
143 echo
"<p id='poll_title'> <span id='umfrage'>Umfrage</span> «<i>{$poll->name}</i>»</p>";
149 $ret =
$db->insert_poll_result($poll);
151 $email_stack = array(
"pollID" => $poll->ID ,
"type" => $ret[
"action"] ,
"fullName" =>
"Unbekannt",
"uname" =>
"" ,
"timestamp" =>
"NOW()" );
152 if ( $ret[
"value"] !==
false ){
153 $notif_events = $poll->get_config(
"email_notif");
154 if( in_array($ret[
"action"],$notif_events) ){
155 $db->email_stack_add($email_stack);
159 $messages->add_message(
new errorMessage(
"Fehler in der Datenbank! Deine Daten wurden <b>nicht</b> gespeichert") );
162 echo
"<a href='public.php'>Zurück</a>";
164 echo
"<p>Vielen Dank, dass du an dieser Umfrage Teilgenommen hast.</p>";
166 $aktuelle_statistik =
false;
167 foreach( $poll->widget_list as
$widget ){
168 if( $widget->get_config(
"showCharts") ){
169 $aktuelle_statistik =
true;
173 if( $aktuelle_statistik ){
174 echo
"<h2>Aktuelle Statistik</h2>";
175 echo
'<script src="JS/Chart.js"></script>';
176 $poll->load_widget_result_count(
$db);
177 foreach( $poll->widget_list as $widget ){
178 $c = $widget->get_config(
"showCharts");
181 $widget->chart_display();
196 exec(
"cd backend && php email-bg.php");