<html><head><title>Showpoll</title>
<link rel=stylesheet type="text/css" href="default.css">
</head>
<?php
include ('color.inc');
include ('mysqlvar.php');
$siteInfo=$si[16];
$headZusatz[0]="<b class='code'>$tt_Text[108]<br>".$frage."</b>";
include("head.php");
include('abstaende.php');
$t = new tabelle;
$t->rows = $anzahl+1;
$t->cols = 3;
$t->einrueck = $STL;
$t->rowspan = $anzahl+1; // ecount = eintraege zaehler da jeder beitrag 3 reihen *3 s.u.
$t->border = 0;
$t->sb = array("200","40","200");
$t->klaraPfad = "bilder/klara.gif";
$t->ra = $SBR;// reihen abstand
/* end TABELLEN EINSTELLUNGEN */
$t->doTable("open");
$db=mysql_connect($dbserver,$dbuser,$dbpass);
if (!$db) { die( "<tr><td><b class=\"fehlermeldung\">".$f_Text[8]."</b></td></tr></table></body></html>" ); }
mysql_select_db($dbname,$db);
$query= "SELECT * FROM polls WHERE tid=".$tid;
$result = mysql_query($query,$db);
if (!$result) { die ( "<tr><td><b class=\"fehlermeldung\">".$f_Text[14]."</b></td></tr></table></body></html>" ); }
$ergebnis=mysql_fetch_array($result,MYSQL_ASSOC);
if ($typ == "Abstimmen")
{
$dayafter = time()-86400;
// $dayafter = time()-40;
$query3 = "DELETE FROM pollsperre WHERE zeit < $dayafter";
$result3 = mysql_query($query3,$db);
$userip = getenv('REMOTE_ADDR');
$query2 = "SELECT * FROM pollsperre WHERE ip = '$userip' AND pollnummer = $tid";
$result2 = mysql_query($query2,$db);
$lines2 = mysql_num_rows($result2);
$rower = mysql_fetch_array($result2,MYSQL_ASSOC);
if ($lines2 == 0)
{
if ($antwort == 1)
{
$ergebnis["zaehler1"] = $ergebnis["zaehler1"] +1;
}
if ($antwort == 2)
{
$ergebnis["zaehler2"] = $ergebnis["zaehler2"] +1;
}
if ($antwort == 3)
{
$ergebnis["zaehler3"] = $ergebnis["zaehler3"] +1;
}
if ($antwort == 4)
{
$ergebnis["zaehler4"] = $ergebnis["zaehler4"] +1;
}
if ($antwort == 5)
{
$ergebnis["zaehler5"] = $ergebnis["zaehler5"] +1;
}
$akttime = time();
$query3 = "INSERT INTO pollsperre (ip , zeit, pollnummer) VALUES ('$userip', '$akttime', '$tid')";
$result3 = mysql_query($query3,$db);
}
}
$gesamt = 0;
$gesamt = $ergebnis["zaehler1"]+$ergebnis["zaehler2"]+$ergebnis["zaehler3"]+$ergebnis["zaehler4"]+$ergebnis["zaehler5"];
echo "<tr><td>".$antwort1."</td><td align=\"center\">".$ergebnis["zaehler1"]."</td><td><img src=\"image.php?breite=".$ergebnis["zaehler1"]."&gesamt=".$gesamt."&color=1\"></td></tr>";
echo "<tr><td>".$antwort2."</td><td align=\"center\">".$ergebnis["zaehler2"]."</td><td><img src=\"image.php?breite=".$ergebnis["zaehler2"]."&gesamt=".$gesamt."&color=2\"></td></tr>";
if ($anzahl>=3)
{
echo "<tr><td>".$antwort3."</td><td align=\"center\">".$ergebnis["zaehler3"]."</td><td><img src=\"image.php?breite=".$ergebnis["zaehler3"]."&gesamt=".$gesamt."&color=1\"></td></tr>";
}
if ($anzahl>=4)
{
echo "<tr><td>".$antwort4."</td><td align=\"center\">".$ergebnis["zaehler4"]."</td><td><img src=\"image.php?breite=".$ergebnis["zaehler4"]."&gesamt=".$gesamt."&color=2\"></td></tr>";
}
if ($anzahl==5)
{
echo "<tr><td>".$antwort5."</td><td align=\"center\">".$ergebnis["zaehler5"]."</td><td><img src=\"image.php?breite=".$ergebnis["zaehler5"]."&gesamt=".$gesamt."&color=1\"></td></tr>";
}
echo "<tr><td>".$tt_Text[91]."</td><td align=\"center\">".$gesamt."</td><td><img src=\"image.php?breite=".$gesamt."&gesamt=".$gesamt."&color=3\"></td></tr></table>";
$query = "UPDATE polls SET zaehler1='".$ergebnis["zaehler1"]."', zaehler2='".$ergebnis["zaehler2"]."', zaehler3='".$ergebnis["zaehler3"]."', zaehler4='".$ergebnis["zaehler4"]."', zaehler5='".$ergebnis["zaehler5"]."' WHERE tid=".$tid;
$result = mysql_query($query,$db);
if (!$result) { die ("<tr><td><b class=\"fehlermeldung\">".$f_Text[25]."</b></td></tr></table></body></html>"); }
?>