Meinungsumfrage:
"; echo '

'; echo "
Bitte loggen Sie sich ein. Eventuell ist Ihre Session abgelaufen.



"; echo '
Fenster schliessen



'; echo "
"; echo "
© efino Communications AG, 2002; Umsetzung: Oliver Werk, werkmedia
"; echo "

"; } if ($user!==''){ $check=mysql_query("select * from votinguser where ((user='$user') AND (titel='$titela'))"); $checkit = mysql_num_rows($check); if($checkit==1){ echo "
Meinungsumfrage:
"; echo '

'; echo "
Sie haben an dieser Umfrage bereits teilgenommen.


"; echo '
Fenster schliessen




'; echo "
"; echo "
© efino Communications AG, 2002; Umsetzung: Oliver Werk, werkmedia
"; echo "

"; } if($checkit==0){ echo "
"; $r= mysql_query("SELECT * FROM voting where titel='$titela'"); while ($daten = mysql_fetch_array($r)){ $titel=$daten["titel"]; $antwort1=$daten["antwort1"]; $antwort2=$daten["antwort2"]; $antwort3=$daten["antwort3"]; $antwort4=$daten["antwort4"]; $antwort5=$daten["antwort5"]; echo "
Meinungsumfrage:
"; echo '

'; echo "
"; echo ""; echo "
$titel

"; echo"
"; echo""; echo""; echo""; echo""; echo""; echo ""; echo ""; echo "
$antwort1
$antwort2
$antwort3
$antwort4
$antwort5

"; echo "
"; echo ""; echo "
"; echo ""; echo '
Fenster schliessen

'; echo "
"; echo "
© efino Communications AG, 2002; Umsetzung: Oliver Werk, werkmedia
"; echo "

"; }}}} function voteadd ($vote,$user,$titel){ $result = mysql_query("select laufnr from votinguser"); $zahl = mysql_num_rows($result); $zahl++; $check=mysql_query("select * from votinguser where ((user='$user') AND (titel='$titel'))"); $checkit = mysql_num_rows($check); if($checkit==0){$gpi = mysql_query("insert into votinguser VALUES ('$zahl','$user','$titel','$vote','1')"); echo "
Meinungsumfrage:
"; echo '

'; echo "
Ihre Stimme wurde gezählt.

"; include("http://www.eficom.ag/vote/vote.php?op=voteergebnis"); echo '
Fenster schliessen


'; echo "
"; echo "
© efino Communications AG, 2002; Umsetzung: Oliver Werk, werkmedia
"; echo "

"; } } function voteergebnis (){ $result = mysql_query("SELECT titel FROM voteaktivierung where aktiv='1'"); list($titela)=mysql_fetch_row($result); $result=mysql_query("select SUM(gesamt) from votinguser where (titel='$titela')"); list($total)=mysql_fetch_row($result); $result= mysql_query("SELECT * FROM voting where titel='$titela'"); $daten = mysql_fetch_array($result); $titel=$daten["titel"]; $antworta=$daten["antwort1"]; $antwortb=$daten["antwort2"]; $antwortc=$daten["antwort3"]; $antwortd=$daten["antwort4"]; $antworte=$daten["antwort5"]; $result=mysql_query("select SUM(gesamt) from votinguser where ((titel='$titela')AND(antwort='1'))"); list($antwort1)=mysql_fetch_row($result); $result=mysql_query("select SUM(gesamt) from votinguser where ((titel='$titela')AND(antwort='2'))"); list($antwort2)=mysql_fetch_row($result); $result=mysql_query("select SUM(gesamt) from votinguser where ((titel='$titela')AND(antwort='3'))"); list($antwort3)=mysql_fetch_row($result); $result=mysql_query("select SUM(gesamt) from votinguser where ((titel='$titela')AND(antwort='4'))"); list($antwort4)=mysql_fetch_row($result); $result=mysql_query("select SUM(gesamt) from votinguser where ((titel='$titela')AND(antwort='5'))"); list($antwort5)=mysql_fetch_row($result); $antwort1inprozent=(($antwort1/$total)*100); $antwort2inprozent=(($antwort2/$total)*100); $antwort3inprozent=(($antwort3/$total)*100); $antwort4inprozent=(($antwort4/$total)*100); $antwort5inprozent=(($antwort5/$total)*100); $answear1 = (round($antwort1inprozent, 2)); $answear2 = (round($antwort2inprozent, 2)); $answear3 = (round($antwort3inprozent, 2)); $answear4 = (round($antwort4inprozent, 2)); $answear5 = (round($antwort5inprozent, 2)); define ('maximalebreite', 50);//Konstante für die maximale Breite echo "
"; echo ""; echo "
$titel

"; echo"
"; echo""; echo''; echo""; echo""; echo""; echo''; echo""; echo""; echo""; echo''; echo""; echo""; echo""; echo''; echo""; echo""; echo""; echo''; echo""; echo""; echo""; echo''; echo""; echo""; echo"
Antwort
%
Votes
$antworta
$answear1
$antwort1
$antwortb
$answear2
$antwort2
$antwortc
$answear3
$antwort3
$antwortd
$answear4
$antwort4
$antworte
$answear5
$antwort5
"; echo "
"; echo ""; echo "

Stimmabgaben insgesamt: $total
"; } switch($op) { case "voteergebnis": voteergebnis(); break; case "voteadd": voteadd($vote,$user,$titel); break; default: vote($user); break; } ?>