X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=redakcia%2Fpolladmin.php;fp=redakcia%2Fpolladmin.php;h=1776720a06dda40947554810ab26854f007f85c5;hb=bc13d5d6e1834068f8b690c32bba114e352dacdd;hp=0000000000000000000000000000000000000000;hpb=07269e54b4e79c0a5e77d8f378cf0849bd8276e5;p=mirrors%2FKyberia-bloodline.git diff --git a/redakcia/polladmin.php b/redakcia/polladmin.php new file mode 100644 index 0000000..1776720 --- /dev/null +++ b/redakcia/polladmin.php @@ -0,0 +1,91 @@ +"; +echo "Otazka: "; +echo "id rubriky: "; +echo "
Aktivni:  ano:ne:
"; +echo "Odpoved 1
"; +echo "Odpoved 2
"; +echo "Odpoved 3
"; +echo "Odpoved 4
"; +echo "Odpoved 5
"; +echo ""; +} + +elseif (IsSet($info)) { +$sqlcmd = "Select * from polls where id_poll='$info'"; +$result =mysql_query($sqlcmd); +$riadok=mysql_fetch_array($result); +echo "

Anketa: $riadok[question]

"; +echo "odpovedalo $riadok[responses] lidi"; +$sqlcmd = "Select * from poll_options where id_poll='$info'"; +$result =mysql_query($sqlcmd); +echo ""; +while ($riadok=mysql_fetch_array($result)) { + echo ""; +} +echo ""; +} + + +elseif ($insert=="Pridej") { + $sqlcmd = "insert into polls set responses=0,question='$question', active='$active',id_rubrika='$id_rubrika'"; + $result =mysql_query($sqlcmd); + $id_poll=mysql_insert_id(); + if (IsSet($option1)) { + $sqlcmd = "insert into poll_options set text='$option1', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + if (IsSet($option2) AND $option2!="") { + $sqlcmd = "insert into poll_options set text='$option2', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + + if (IsSet($option3) AND $option3!="") { + $sqlcmd = "insert into poll_options set text='$option3', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + + if (IsSet($option4) AND $option4!="") { + $sqlcmd = "insert into poll_options set text='$option4', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } + + if (IsSet($option5) AND $option5!="") { + $sqlcmd = "insert into poll_options set text='$option5', id_poll='$id_poll' ,number='0'"; + mysql_query($sqlcmd); + } +} + + +else { +if ($up=="Uloz" AND IsSet($update)) { + + +$sqlcmd="update polls set active='$$update' where id_poll='$update'"; +mysql_query($sqlcmd); +} +$sqlcmd = "Select active,id_poll,question from polls order by time desc"; +$result= mysql_query($sqlcmd); +echo "
$riadok[text]$riadok[number] lidi
"; +while ($record = mysql_fetch_array($result)) { + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
IDOtazkaAktivni?
",$record["id_poll"],"",$record["question"],"Ano:"; + echo " Ne:
"; +echo "
Pridat novu anketu."; +} +?> \ No newline at end of file