";
require("banner_centrale.php");
echo "
SONDAGGIO
";
$operazione=$_GET['operazione'];
$codice_sondaggio = isset($_POST['codice_sondaggio'])? $_POST['codice_sondaggio'] : $_GET['codice_sondaggio'];
$sql_sondaggio = "select * from reggina_poll where codice='$codice_sondaggio'";
$result_sondaggio = mysql_query($sql_sondaggio) or die ("Couldn't execute SQL SONDAGGIO");
while ($row =
mysql_fetch_array($result_sondaggio)) {
$id = $row["id"];
$titolo = $row["titolo"];
$voti = $row["voti"];
}
echo "
$titolo
";
if ($operazione=='vota') {
echo "
Grazie per aver votato.
";
}
echo "
RISULTATI
";
$sql_data = "select * from reggina_poll_data where poll_id='$codice_sondaggio' order by posizione asc";
$result_data = mysql_query($sql_data) or die ("Couldn't execute SQL RISPOSTE");
while ($row =
mysql_fetch_array($result_data)) {
$option_text = $row["option_text"];
$votes = $row["votes"];
$width=floor(($votes*400)/$voti);
$coef="px";
$percentuale=floor($width/4);
echo "
";
}
echo "
GLI ALTRI SONDAGGI DI REGGINANEWS
";
include('config/paginazione.inf.php');
$query = "select * from reggina_poll where codice<>'$codice_sondaggio' and visibile='si' order by id desc";
$res = paging($query,50,5);
if (!$res[0]) {
echo "
Non vi sono sondaggi
";
} else {
echo "
";
while($dati = mysql_fetch_array($res[0]))
{
$cod_sondaggio = $dati["codice"];
$titolo = $dati["titolo"];
echo "
";
}
echo "
";
}
echo "