24 require_once(
"../config.php");
25 require_once(
"../inc/user.class.php");
26 require_once(
"../inc/tools.php");
27 require_once(
"../inc/check_login.php");
30 require_once(
"../inc/db.class.php");
31 require_once(
"../inc/config.class.php");
33 require_once(
"../inc/poll.class.php");
34 require_once(
"../inc/messages.class.php");
35 require_once(
"../inc/html.class.php");
36 $db=
new db( DB_USER, DB_PASS, DB_DATABASE, DB_HOST );
44 if ( (isset($_POST[
"pollID"])) AND
45 (is_numeric($_POST[
"pollID"])) AND
46 ($_POST[
"pollID"] !=
"")
50 if (!$poll->load_from_id(
$db, intval($_POST[
"pollID"]) ) ){
51 die(
"Umfrage existiert nicht.");
55 header(
"Location: index.php");
60 if( (intval($_SESSION[
"user"]->ID) !== intval($poll->owner) ) AND
61 ( !in_array(
"{$_SESSION["user"]->ID}",explode(
",",SUPER_ADMIN) )) ){
62 die(
"Umfrage Bearbeiten nicht erlaubt.");
66 if( (!isset($_POST[
"save_results"])) AND (isset($_POST[
"confirm_save_result"])) ){
67 $keys = array_keys($_POST[
"selection"]);
68 $db->delete_result_for_user_list($poll->ID,
$keys);
69 header(
"Location: results.show.php?pollID={$poll->ID}&edit_html");
72 if( (!isset($_POST[
"rm_all"])) AND (isset($_POST[
"confirm_rm_all"])) ){
73 $db->delete_all_result($poll->ID);
74 header(
"Location: results.show.php?pollID={$poll->ID}&edit_html");
83 if( (isset($_POST[
"selection"])) AND (is_array($_POST[
"selection"])) ){
84 if( (isset($_POST[
"save_results"])) AND (!isset($_POST[
"confirm_save_result"])) ){
85 echo
"<form action='results.show.handle.php' method='POST'>";
87 $w_text=$w_text.
"<p>Ergebnisse folgender Personen wirklich löschen?</p><ul>";
88 $keys = array_keys($_POST[
"selection"]);
90 $r =
$db->get_poll_result_for_user($poll->ID,$user);
91 $w_text =$w_text.
"<li>{$r["name
"]} ($user)</li>";
92 $w_text=$w_text.
"<input type='hidden' name='selection[$user]' value='on' />";
94 $w_text=$w_text.
"</ul>";
97 echo
"<input type='hidden' name='pollID' value='{$poll->ID}'/>";
98 echo
"<input type='submit' name='confirm_save_result' value='Ja, löschen'/>";
103 if( (isset($_POST[
"rm_all"])) AND (!isset($_POST[
"confirm_rm_all"])) ){
104 echo
"<form action='results.show.handle.php' method='POST'>";
107 print_warning(
"$count Ergebniss einträge unwiederruflich löschen?");
109 echo
"<input type='hidden' name='pollID' value='{$poll->ID}'/>";
110 echo
"<input type='submit' name='confirm_rm_all' value='Ja, löschen'/>";