SO 1-final
[specialops1.git] / pollform.inc.php
blob8cb55dffab41ff45c550ebb51a0af287905697b9
1 <?php
2 $pollinfo = mysql_fetch_row (mysql_query ('SELECT * FROM `poll` ORDER BY `pollid` DESC LIMIT 1'));
3 if (!empty ($pollinfo[1]))
5 if (empty ($userinfo['hidepoll']) || $userinfo['level'] < INACTIVE_USER || ($userinfo['hidepoll'] == 2 && $userinfo['lastpoll'] == $pollinfo[0]))
6 echo '<div class="c3"><a href="poll.php">Current Poll</a>: '.$pollinfo[1].'</div>
7 ';
8 else
10 echo '<form action="poll.php" method="post" style="display:inline">
11 <div class="c3"><a href="poll.php">Current Poll</a>: '.$pollinfo[1].'</div>
13 for ($optnum = 0; $pollinfo[($optnum + 2)] != '' && $optnum < 8; $optnum++)
15 echo '<div class='.colour().'>';
16 if (empty ($userinfo['username']) || $userinfo['lastpoll'] == $pollinfo[0])
17 echo $pollinfo[($optnum + 10)].' | '.$pollinfo[($optnum+2)];
18 else
19 echo '<input type="radio" name="voteid" value="'.($optnum+1).'"'.($optnum === 0 ? ' checked="checked"' : '').' id="pl'.($optnum+1).'"/> <label for="pl'.($optnum+1).'">'.$pollinfo[($optnum+2)].'</label>';
20 echo '</div>
23 if (isset ($userinfo['username']) && $userinfo['lastpoll'] != $pollinfo[0])
24 echo '<div class="c3"><input type="submit" name="submit" value="Vote"/></div>
26 echo '</form>