mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Change spaces to tabs
This commit is contained in:
parent
00cbce20b0
commit
b22dc0014a
@ -26,26 +26,26 @@ function getColorByPercent($percent)
|
||||
}
|
||||
$number_of_rows = 0;
|
||||
$showed = false;
|
||||
$link = "polls"; // your link to polls in index.php
|
||||
$dark = $config['darkborder'];
|
||||
$light = $config['lightborder'];
|
||||
$time = time();
|
||||
$POLLS = $db->query('SELECT * FROM '.$db->tableName('z_polls').'');
|
||||
$level = 20; // need level to vote
|
||||
$link = "polls"; // your link to polls in index.php
|
||||
$dark = $config['darkborder'];
|
||||
$light = $config['lightborder'];
|
||||
$time = time();
|
||||
$POLLS = $db->query('SELECT * FROM '.$db->tableName('z_polls').'');
|
||||
$level = 20; // need level to vote
|
||||
|
||||
if(empty($_REQUEST['id']) and (!isset($_REQUEST['control']) || $_REQUEST['control'] != "true")) // list of polls
|
||||
{
|
||||
$active = $db->query('SELECT * FROM `z_polls` where `end` > '.$time.''); // active polls
|
||||
$closed = $db->query('SELECT * FROM `z_polls` where `end` < '.$time.' order by `end` desc'); // closed polls
|
||||
/* Active Polls */
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class=white><B>Active Polls</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><td width=75%><b>Topic</b></td><td><b>End</b></td></tr>';
|
||||
$bgcolor = getStyle($number_of_rows++);
|
||||
if(empty($_REQUEST['id']) and (!isset($_REQUEST['control']) || $_REQUEST['control'] != "true")) // list of polls
|
||||
{
|
||||
$active = $db->query('SELECT * FROM `z_polls` where `end` > '.$time.''); // active polls
|
||||
$closed = $db->query('SELECT * FROM `z_polls` where `end` < '.$time.' order by `end` desc'); // closed polls
|
||||
/* Active Polls */
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class=white><B>Active Polls</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><td width=75%><b>Topic</b></td><td><b>End</b></td></tr>';
|
||||
$bgcolor = getStyle($number_of_rows++);
|
||||
$empty_active = false;
|
||||
foreach($active as $poll)
|
||||
{
|
||||
echo '
|
||||
<tr BGCOLOR="'.$bgcolor.'">
|
||||
foreach($active as $poll)
|
||||
{
|
||||
echo '
|
||||
<tr BGCOLOR="'.$bgcolor.'">
|
||||
<td>
|
||||
<a href="';
|
||||
if($logged)
|
||||
@ -57,24 +57,24 @@ function getColorByPercent($percent)
|
||||
</td>
|
||||
<td>'.date("M j Y", $poll['end']).'</td>
|
||||
</tr>';
|
||||
$empty_active = true;
|
||||
}
|
||||
$empty_active = true;
|
||||
}
|
||||
|
||||
if(!$empty_active)
|
||||
{
|
||||
echo '<tr BGCOLOR="'.$bgcolor.'"><td colspan=2><div style="text-align:center"><i>There are no active polls.</i></div></td></tr>';
|
||||
}
|
||||
if(!$empty_active)
|
||||
{
|
||||
echo '<tr BGCOLOR="'.$bgcolor.'"><td colspan=2><div style="text-align:center"><i>There are no active polls.</i></div></td></tr>';
|
||||
}
|
||||
|
||||
echo "</table><br><br>";
|
||||
/* Closed Polls */
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class=white><B>Closed Polls</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><td width=75%><b>Topic</b></td><td><b>End</b></td></tr>';
|
||||
echo "</table><br><br>";
|
||||
/* Closed Polls */
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class=white><B>Closed Polls</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><td width=75%><b>Topic</b></td><td><b>End</b></td></tr>';
|
||||
$bgcolor = getStyle($number_of_rows++);
|
||||
$empty_closed = false;
|
||||
foreach($closed as $poll)
|
||||
{
|
||||
echo '
|
||||
<tr BGCOLOR="'.$bgcolor.'">
|
||||
foreach($closed as $poll)
|
||||
{
|
||||
echo '
|
||||
<tr BGCOLOR="'.$bgcolor.'">
|
||||
<td>
|
||||
<a href="';
|
||||
if($logged)
|
||||
@ -86,17 +86,17 @@ function getColorByPercent($percent)
|
||||
</td>
|
||||
<td>'.date("M j Y", $poll['end']).'</td>
|
||||
</tr>';
|
||||
$empty_closed = true;
|
||||
}
|
||||
$empty_closed = true;
|
||||
}
|
||||
|
||||
if(!$empty_closed)
|
||||
{
|
||||
echo '<tr BGCOLOR="'.$bgcolor.'"><td colspan=2><div style="text-align:center"><i>There are no closed polls.</i></div></td></tr>';
|
||||
}
|
||||
if(!$empty_closed)
|
||||
{
|
||||
echo '<tr BGCOLOR="'.$bgcolor.'"><td colspan=2><div style="text-align:center"><i>There are no closed polls.</i></div></td></tr>';
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
$showed=true;
|
||||
}
|
||||
echo "</table>";
|
||||
$showed=true;
|
||||
}
|
||||
|
||||
if(!$logged)
|
||||
{
|
||||
@ -104,43 +104,43 @@ function getColorByPercent($percent)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Checking Account */
|
||||
/* Checking Account */
|
||||
$allow = false;
|
||||
$account_players = $account_logged->getPlayers();
|
||||
foreach($account_players as $player)
|
||||
{
|
||||
$player = $player->getLevel();
|
||||
if($player >= $level)
|
||||
$allow=true;
|
||||
}
|
||||
$account_players = $account_logged->getPlayers();
|
||||
foreach($account_players as $player)
|
||||
{
|
||||
$player = $player->getLevel();
|
||||
if($player >= $level)
|
||||
$allow=true;
|
||||
}
|
||||
|
||||
if(!empty($_REQUEST['id']) and (!isset($_REQUEST['control']) || $_REQUEST['control'] != "true"))
|
||||
{
|
||||
foreach($POLLS as $POLL)
|
||||
{
|
||||
if($_REQUEST['id'] == $POLL['id'])
|
||||
{
|
||||
$ANSWERS = $db->query('SELECT * FROM '.$db->tableName('z_polls_answers').' where `poll_id` = '.addslashes(htmlspecialchars(trim($_REQUEST['id']))).' order by `answer_id`');
|
||||
$votes_all = $POLL['votes_all'];
|
||||
if(!empty($_REQUEST['id']) and (!isset($_REQUEST['control']) || $_REQUEST['control'] != "true"))
|
||||
{
|
||||
foreach($POLLS as $POLL)
|
||||
{
|
||||
if($_REQUEST['id'] == $POLL['id'])
|
||||
{
|
||||
$ANSWERS = $db->query('SELECT * FROM '.$db->tableName('z_polls_answers').' where `poll_id` = '.addslashes(htmlspecialchars(trim($_REQUEST['id']))).' order by `answer_id`');
|
||||
$votes_all = $POLL['votes_all'];
|
||||
|
||||
if($votes_all == 0)
|
||||
{
|
||||
$i=1;
|
||||
foreach($ANSWERS as $answer)
|
||||
{
|
||||
$percent[$i] = 0;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$i=1;
|
||||
foreach($ANSWERS as $answer)
|
||||
{
|
||||
$percent[$i] = round(((100*$answer['votes'])/$votes_all),2);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
if($votes_all == 0)
|
||||
{
|
||||
$i=1;
|
||||
foreach($ANSWERS as $answer)
|
||||
{
|
||||
$percent[$i] = 0;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$i=1;
|
||||
foreach($ANSWERS as $answer)
|
||||
{
|
||||
$percent[$i] = round(((100*$answer['votes'])/$votes_all),2);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<style type="text/css" media="screen">
|
||||
div.progress-container {
|
||||
@ -166,51 +166,51 @@ function getColorByPercent($percent)
|
||||
</div>';
|
||||
}
|
||||
|
||||
if($POLL['end'] > $time) // active poll
|
||||
{
|
||||
if(isset($_REQUEST['vote']) && $_REQUEST['vote'] == true and $allow == true)
|
||||
{
|
||||
if($account_logged->getCustomField('vote') < $_REQUEST['id'] and !empty($_POST['answer']))
|
||||
{
|
||||
if(isset($_POST['continue']))
|
||||
{
|
||||
$vote = addslashes(htmlspecialchars(trim($_REQUEST['id'])));
|
||||
$account_logged->setCustomField("vote", $vote);
|
||||
$UPDATE_poll = $db->query('UPDATE `z_polls` SET `votes_all` = `votes_all` + 1 where `id` = '.addslashes(htmlspecialchars(trim($_REQUEST['id']))).'');
|
||||
$UPDATE_answer = $db->query('UPDATE `z_polls_answers` SET `votes` = `votes` + 1 where `answer_id` = '.addslashes(htmlspecialchars($_POST['answer'])).' and`poll_id` = '.addslashes(htmlspecialchars(trim($_REQUEST['id']))).'');
|
||||
header('Location: ?subtopic='.$link.'&id='.$_REQUEST['id'].'');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Location: ?subtopic='.$link.'&id='.$_REQUEST['id'].'');
|
||||
}
|
||||
}
|
||||
if($POLL['end'] > $time) // active poll
|
||||
{
|
||||
if(isset($_REQUEST['vote']) && $_REQUEST['vote'] == true and $allow == true)
|
||||
{
|
||||
if($account_logged->getCustomField('vote') < $_REQUEST['id'] and !empty($_POST['answer']))
|
||||
{
|
||||
if(isset($_POST['continue']))
|
||||
{
|
||||
$vote = addslashes(htmlspecialchars(trim($_REQUEST['id'])));
|
||||
$account_logged->setCustomField("vote", $vote);
|
||||
$UPDATE_poll = $db->query('UPDATE `z_polls` SET `votes_all` = `votes_all` + 1 where `id` = '.addslashes(htmlspecialchars(trim($_REQUEST['id']))).'');
|
||||
$UPDATE_answer = $db->query('UPDATE `z_polls_answers` SET `votes` = `votes` + 1 where `answer_id` = '.addslashes(htmlspecialchars($_POST['answer'])).' and`poll_id` = '.addslashes(htmlspecialchars(trim($_REQUEST['id']))).'');
|
||||
header('Location: ?subtopic='.$link.'&id='.$_REQUEST['id'].'');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Location: ?subtopic='.$link.'&id='.$_REQUEST['id'].'');
|
||||
}
|
||||
}
|
||||
|
||||
if($account_logged->getCustomField('vote') < $_REQUEST['id'] and $allow == true)
|
||||
{
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class=white><B>Vote</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="'.$dark.'"><td COLSPAN=2><b>'.$POLL['question'].'</b><br/>' . $POLL['description'] . '</td></tr>
|
||||
<form action="?subtopic='.$link.'&id='.$_REQUEST['id'].'&vote=true" method="POST"> ';
|
||||
$ANSWERS_input = $db->query('SELECT * FROM '.$db->tableName('z_polls_answers').' where `poll_id` = '.$_REQUEST['id'].' order by `answer_id`');
|
||||
$i=1;
|
||||
foreach($ANSWERS_input as $answer)
|
||||
{
|
||||
if(is_int($i / 2)) {
|
||||
$bgcolor = $dark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bgcolor = $light;
|
||||
}
|
||||
echo '<tr BGCOLOR="'.$bgcolor.'"><td><input type=radio name=answer value="'.$i.'">'.$answer['answer'].'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
echo '</table><input type="submit" name="continue" value="Submit" class="input2" /></form><br><br>';
|
||||
}
|
||||
elseif($account_logged->getCustomField('vote') >= $_REQUEST['id'])
|
||||
{
|
||||
$result[] = '<br><b>You have already voted.</b><br>';
|
||||
if($account_logged->getCustomField('vote') < $_REQUEST['id'] and $allow == true)
|
||||
{
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class=white><B>Vote</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="'.$dark.'"><td COLSPAN=2><b>'.$POLL['question'].'</b><br/>' . $POLL['description'] . '</td></tr>
|
||||
<form action="?subtopic='.$link.'&id='.$_REQUEST['id'].'&vote=true" method="POST"> ';
|
||||
$ANSWERS_input = $db->query('SELECT * FROM '.$db->tableName('z_polls_answers').' where `poll_id` = '.$_REQUEST['id'].' order by `answer_id`');
|
||||
$i=1;
|
||||
foreach($ANSWERS_input as $answer)
|
||||
{
|
||||
if(is_int($i / 2)) {
|
||||
$bgcolor = $dark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bgcolor = $light;
|
||||
}
|
||||
echo '<tr BGCOLOR="'.$bgcolor.'"><td><input type=radio name=answer value="'.$i.'">'.$answer['answer'].'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
echo '</table><input type="submit" name="continue" value="Submit" class="input2" /></form><br><br>';
|
||||
}
|
||||
elseif($account_logged->getCustomField('vote') >= $_REQUEST['id'])
|
||||
{
|
||||
$result[] = '<br><b>You have already voted.</b><br>';
|
||||
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=3 class=white><B>Results</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="'.$dark.'"><td COLSPAN=3><b>'.$POLL['question'].'</b><br/>' . $POLL['description'] . '</td></tr>';
|
||||
@ -239,31 +239,31 @@ function getColorByPercent($percent)
|
||||
}
|
||||
|
||||
$result[] = '<br>All players with a character of at least level ' . $level . ' may vote.<br>';
|
||||
foreach($result as $error)
|
||||
{
|
||||
echo $error;
|
||||
}
|
||||
foreach($result as $error)
|
||||
{
|
||||
echo $error;
|
||||
}
|
||||
|
||||
echo '<br>The poll started at '.date("M j Y", $POLL['start']).'<br>';
|
||||
echo 'The poll will end at '.date("M j Y", $POLL['end']).'<br>';
|
||||
echo '<br>Total votes <b>'.$POLL['votes_all'].'</b><br>';
|
||||
echo '<br>The poll started at '.date("M j Y", $POLL['start']).'<br>';
|
||||
echo 'The poll will end at '.date("M j Y", $POLL['end']).'<br>';
|
||||
echo '<br>Total votes <b>'.$POLL['votes_all'].'</b><br>';
|
||||
|
||||
}
|
||||
else // closed poll
|
||||
{
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=3 class=white><B>Results</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="'.$dark.'"><td COLSPAN=3><b>'.$POLL['question'].'</b></td></tr>';
|
||||
$ANSWERS_show = $db->query('SELECT * FROM '.$db->tableName('z_polls_answers').' where `poll_id` = '.$_REQUEST['id'].' order by `answer_id`');
|
||||
$i=1;
|
||||
foreach($ANSWERS_show as $answer)
|
||||
{
|
||||
if(is_int($i / 2)) {
|
||||
$bgcolor = $dark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bgcolor = $light;
|
||||
}
|
||||
}
|
||||
else // closed poll
|
||||
{
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=3 class=white><B>Results</B></TD></TR>';
|
||||
echo '<TR BGCOLOR="'.$dark.'"><td COLSPAN=3><b>'.$POLL['question'].'</b></td></tr>';
|
||||
$ANSWERS_show = $db->query('SELECT * FROM '.$db->tableName('z_polls_answers').' where `poll_id` = '.$_REQUEST['id'].' order by `answer_id`');
|
||||
$i=1;
|
||||
foreach($ANSWERS_show as $answer)
|
||||
{
|
||||
if(is_int($i / 2)) {
|
||||
$bgcolor = $dark;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bgcolor = $light;
|
||||
}
|
||||
|
||||
echo '<TR BGCOLOR="'.$bgcolor.'">
|
||||
<td width=60%>'.$answer['answer'].'</td>
|
||||
@ -272,64 +272,64 @@ function getColorByPercent($percent)
|
||||
</td>
|
||||
<td>' . $answer['votes'] . '(<span style="color:' . getColorByPercent($percent[$i]) . '"><b>' . $percent[$i] . '%</b></span>)</td>
|
||||
</tr>';
|
||||
$i++;
|
||||
}
|
||||
echo '</table><br><br>';
|
||||
$i++;
|
||||
}
|
||||
echo '</table><br><br>';
|
||||
|
||||
echo '<br>The poll started at '.date("M j Y", $POLL['start']).'<br>';
|
||||
echo 'The poll ended at '.date("M j Y", $POLL['end']).'<br>';
|
||||
echo '<br>Total votes <b>'.$POLL['votes_all'].'</b><br>';
|
||||
echo '<br>The poll started at '.date("M j Y", $POLL['start']).'<br>';
|
||||
echo 'The poll ended at '.date("M j Y", $POLL['end']).'<br>';
|
||||
echo '<br>Total votes <b>'.$POLL['votes_all'].'</b><br>';
|
||||
|
||||
}
|
||||
$showed=true;
|
||||
echo '<div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$showed=true;
|
||||
echo '<div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(admin() && (!isset($_REQUEST['control']) || $_REQUEST['control'] != "true"))
|
||||
{
|
||||
echo '<br><a href="?subtopic='.$link.'&control=true"><b>Panel Control</b></a><br><br>';
|
||||
}
|
||||
if(admin() && (!isset($_REQUEST['control']) || $_REQUEST['control'] != "true"))
|
||||
{
|
||||
echo '<br><a href="?subtopic='.$link.'&control=true"><b>Panel Control</b></a><br><br>';
|
||||
}
|
||||
|
||||
/* Control Panel - Only Add Poll Function */
|
||||
/* Control Panel - Only Add Poll Function */
|
||||
|
||||
if(admin() && isset($_REQUEST['control']) && $_REQUEST['control'] == "true")
|
||||
{
|
||||
if(admin() && isset($_REQUEST['control']) && $_REQUEST['control'] == "true")
|
||||
{
|
||||
$show = false;
|
||||
if(isset($_POST['submit']))
|
||||
{
|
||||
setSession('answers', $_POST['answers']);
|
||||
echo '<form method="post" action=""><b><span style="font-size: 16px">Adding Poll</span></b><br><br>
|
||||
<input type=text name=question value="" /> Question<br>
|
||||
<input type=text name=description value="" /> Description<br>
|
||||
<input type=text name=end value="" /> Time to end, in days<br>';
|
||||
if(isset($_POST['submit']))
|
||||
{
|
||||
setSession('answers', $_POST['answers']);
|
||||
echo '<form method="post" action=""><b><span style="font-size: 16px">Adding Poll</span></b><br><br>
|
||||
<input type=text name=question value="" /> Question<br>
|
||||
<input type=text name=description value="" /> Description<br>
|
||||
<input type=text name=end value="" /> Time to end, in days<br>';
|
||||
|
||||
for( $x = 1; $x <= getSession('answers'); $x++ )
|
||||
{
|
||||
echo '<input type=text name='.$x.' value="" /> Answer no. '.$x.'<br>';
|
||||
}
|
||||
echo '<input type="submit" name="finish" value="Submit" class="input2"/></form><br><br>';
|
||||
$show=true;
|
||||
}
|
||||
for( $x = 1; $x <= getSession('answers'); $x++ )
|
||||
{
|
||||
echo '<input type=text name='.$x.' value="" /> Answer no. '.$x.'<br>';
|
||||
}
|
||||
echo '<input type="submit" name="finish" value="Submit" class="input2"/></form><br><br>';
|
||||
$show=true;
|
||||
}
|
||||
|
||||
if(isset($_POST['finish']))
|
||||
{
|
||||
$id = $db->query('SELECT MAX(id) FROM `z_polls`')->fetch();
|
||||
$id_next = $id[0] + 1;
|
||||
if(isset($_POST['finish']))
|
||||
{
|
||||
$id = $db->query('SELECT MAX(id) FROM `z_polls`')->fetch();
|
||||
$id_next = $id[0] + 1;
|
||||
|
||||
for( $x = 1; $x <= getSession('answers'); $x++ )
|
||||
{
|
||||
$db->insert('z_polls_answers', array(
|
||||
'poll_id' => $id_next,
|
||||
for( $x = 1; $x <= getSession('answers'); $x++ )
|
||||
{
|
||||
$db->insert('z_polls_answers', array(
|
||||
'poll_id' => $id_next,
|
||||
'answer_id' => $x,
|
||||
'answer' => $_POST[$x],
|
||||
'votes' => 0
|
||||
));
|
||||
}
|
||||
$end = $time+24*60*60*$_POST['end'];
|
||||
$db->insert('z_polls', array(
|
||||
'id' => $id_next,
|
||||
}
|
||||
$end = $time+24*60*60*$_POST['end'];
|
||||
$db->insert('z_polls', array(
|
||||
'id' => $id_next,
|
||||
'question' => $_POST['question'],
|
||||
'description' => $_POST['description'],
|
||||
'end' => $end,
|
||||
@ -337,35 +337,35 @@ function getColorByPercent($percent)
|
||||
'start' => $time,
|
||||
'votes_all' => 0
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$POLLS_check = $db->query('SELECT MAX(end) FROM '.$db->tableName('z_polls').'');
|
||||
foreach($POLLS_check as $checked)
|
||||
{
|
||||
if($checked[0] > $time)
|
||||
$check=true;
|
||||
else
|
||||
$check=false;
|
||||
}
|
||||
if(!$show)
|
||||
{
|
||||
if(!$check)
|
||||
{
|
||||
echo '<form method="post" action=""><b><span style="font-size: 16px">Adding Poll</span></b><br><br>
|
||||
<input type=text name=answers value="" /> Number of Answers<br>
|
||||
<input type="submit" name="submit" value="Submit" class="input2"/></form><br><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b><span style="font-size: 16px"><br>Cannot be two and more active polls.<br><br></span></b>';
|
||||
}
|
||||
}
|
||||
$showed=true;
|
||||
echo '<br><div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
|
||||
}
|
||||
$POLLS_check = $db->query('SELECT MAX(end) FROM '.$db->tableName('z_polls').'');
|
||||
foreach($POLLS_check as $checked)
|
||||
{
|
||||
if($checked[0] > $time)
|
||||
$check=true;
|
||||
else
|
||||
$check=false;
|
||||
}
|
||||
if(!$show)
|
||||
{
|
||||
if(!$check)
|
||||
{
|
||||
echo '<form method="post" action=""><b><span style="font-size: 16px">Adding Poll</span></b><br><br>
|
||||
<input type=text name=answers value="" /> Number of Answers<br>
|
||||
<input type="submit" name="submit" value="Submit" class="input2"/></form><br><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b><span style="font-size: 16px"><br>Cannot be two and more active polls.<br><br></span></b>';
|
||||
}
|
||||
}
|
||||
$showed=true;
|
||||
echo '<br><div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
|
||||
}
|
||||
|
||||
if(!$showed)
|
||||
{
|
||||
echo 'This poll doesn\'t exist.<br>';
|
||||
echo '<div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
|
||||
}
|
||||
if(!$showed)
|
||||
{
|
||||
echo 'This poll doesn\'t exist.<br>';
|
||||
echo '<div class=\'hr1\'></div><a href="?subtopic='.$link.'"><span style="font-size: 13px"><b>Go to list of polls</b></span></a>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user