| Current Path : /var/www/html/mmishra/indem/poll/ |
| Current File : /var/www/html/mmishra/indem/poll/tshirt.inc |
<span id='title'>Opinion Poll</span><br>
<?php
//if (!isset($_SESSION["uid"])) {
//login($pg);
//} else {
$uid = strtolower($_SESSION["uid"]);
dbConnect();
$tbl = "pollscore";
$id = $_REQUEST["id"];
if ($id) {
echo "<h2>Polling over</h2>";
/*
if ($id < 1 && $id > 5) echo "<br><b>Wrong choice, please click on link only</b><br>";
if (mysql_num_rows(mysql_query("select * from $tbl where uid='$uid'"))) {
mysql_query("update $tbl set choice=$id,dated=now() where uid='$uid'");
echo "<br><b>You have already submitted your choice that has now been updated</b><br>";
} else {
mysql_query("insert into $tbl(uid,choice,dated) values('$uid',$id,now())");
}
*/
}
$vote = array(0,0,0,0,0);
$rs = mysql_query("select count(uid) as tot, choice from $tbl group by choice");
if ($rs) {
while ($o = mysql_fetch_object($rs)) {
$i++;
$vote[$i] = $o->tot;
$total += $o->tot;
}
}
//echo "<br>Please cast your vote to help in finalizing the design of T-Shirt for <em>EffervescenceMM'8</em>. Thanks,<br>
echo "<br>Thanks for submitting your valuable opinion. Result is as below:<br>
<div align='right'><b>Total votes: $total</b></div>
<center><table width='90%' border='1'>
<tr><th>No.</th><th>Polling Option</th><th>Result</th></tr>
<tr><td>1</td><td><img src='poll/sample/bluefront1.jpg' width='100' height='100'>
<img src='poll/sample/blueback1.jpg' width='100' height='100'></td>
<!--<td align='center'><a href='?pg=poll/tshirt&id=1'>Vote here</a></td></tr>-->
<td align='center'>$vote[1] (".number_format($vote[1]*100/$total,2).")</td></tr>
<tr><td>2</td><td><img src='poll/sample/redfront2.jpg' width='100' height='100'>
<img src='poll/sample/redback2.jpg' width='100' height='100'></td>
<!--<td align='center'><a href='?pg=poll/tshirt&id=2'>Vote here</a></td></tr>-->
<td align='center'>$vote[2] (".number_format($vote[2]*100/$total,2).")</td></tr>
<tr><td>3</td><td><a href='poll/sample/blackfront3a.jpg'><img src='poll/sample/blackfront3a.jpg' width='100' height='100'></a>
<a href='poll/sample/blackback3.jpg'><img src='poll/sample/blackback3.jpg' width='100' height='100'></a></td>
<!--<td align='center'><a href='?pg=poll/tshirt&id=3'>Vote here</a></td></tr>-->
<td align='center'><font color='red'>$vote[3] (".number_format($vote[3]*100/$total,2).")</font></td></tr>
<tr><td>4</td><td><img src='poll/sample/greyfront4.jpg' width='100' height='100'> plain back</td>
<!--<td align='center'><a href='?pg=poll/tshirt&id=4'>Vote here</a></td></tr>-->
<td align='center'>$vote[4] (".number_format($vote[4]*100/$total,2).")</td></tr>
<tr><td>5</td><td><img src='poll/sample/blackfront3b.jpg' width='100' height='100'> plain back</td>
<!--<td align='center'><a href='?pg=poll/tshirt&id=5'>Vote here</a></td></tr>-->
<td align='center'>$vote[5] (".number_format($vote[5]*100/$total,2).")</td></tr>
</table></center>";
//}
?>