$max_char){ $stringa_tagliata=substr($stringa, 0,$max_char); $last_space=strrpos($stringa_tagliata," "); $stringa_ok=substr($stringa_tagliata, 0,$last_space); return $stringa_ok."...";} else{return $stringa;} } $operazione=$_GET['operazione']; $codice_scheda=$_GET['codice_scheda']; echo " REGGINA NEWS
"; require("menu.php"); echo "
"; require("left.php"); echo "
"; 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 "
$option_text
$percentuale %
"; } 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 "
"; require("right.php"); echo "
"; require("sponsor.php"); echo "
"; require("banner_grande.php"); echo "
"; require("footer.php"); echo "
"; ?>