<?php
$chemin120 = "$"."chemin";
if ($chemin == "") die ("<font face=\"Arial\" size=\"2\"><b>@lexPHPteam alert:</b> error, the variable $chemin120 isn't inform.</font>");
$abc_url = $PHP_SELF;
$where_my_slash = strrpos($abc_url, "/");
$where_my_slash++;
$sup_why = substr($abc_url, $where_my_slash);
$abc_url = str_replace($sup_why, "", $abc_url);
?>
<head>
<?php
if ($my_alex_function != "oui")
include ("$chemin/alex_functions2.inc.php");
?>
</head>
<?php
include ("$chemin/identif/logins.php");
include ("$chemin/identif/admin_infos.php");
//on détecte l'url d'origine
$alex_ext = $QUERY_STRING;
$nonono = 0;
$date = date("Y-m-d");
$table = "$table1";
@MYSQL_CONNECT ($serveur,$login2,$pass2) or die ("error, mysql connexion failed");
mysql_select_db("$base");
if ($id_sond == "")
$com_sql = "sond_actif='1'";
else
$com_sql = "id_sond='$id_sond'";
$query = "select id_sond,s_quest from $table WHERE id_sond = $id_sond AND date BETWEEN sond_actif AND archives";
$resultat = mysql_query($query);
$i = 1;
$id_sond3 = array();
$s_quest3 = array();
while ($ligne = mysql_fetch_array($resultat))
{
$id_sond3[$i] = $ligne["id_sond"];
$s_quest3[$i] = $ligne["s_quest"];
$i = $i + 1;
}
$i = 1;
$table = "$table2";
$query = "select id_rep,reponse,nbre_rep from $table where id_sond='$id_sond3[$i]' ORDER BY nbre_rep DESC";
$resultat = mysql_query($query);
$nblignes = mysql_num_rows($resultat);
$i = 1;
$id_rep3 = array();
$reponse3 = array();
$nbre_rep3 = array();
while ($ligne = mysql_fetch_array($resultat))
{
$id_rep3[$i] = $ligne["id_rep"];
$reponse3[$i] = $ligne["reponse"];
$nbre_rep3[$i] = $ligne["nbre_rep"];
$i = $i + 1;
}
$i = 1;
mysql_close();
$nbre_votant = 0;
$i=1;
while ($i <= $nblignes)
{
$nbre_votant = $nbre_rep3[$i] + $nbre_votant;
$i = $i + 1;
}
$i = 1;
if ($controle2 == "1" or $controle2 == "3") //cookies autorisés ?
{//1
while ($i <= $alex_max_sondage)
{
if ($alex_sondage_cook[$i] == $id_sond3[1])
{
$nonono = 1;
break;
}
$i++;
}
}//1
$id_sondage = $id_sond3[1];
$supp_ip_inv = 0; //on supprime pas les ip, on est à l'affichage
if (($controle2 == "2" or $controle2 == "3") && $nonono != "1" && ($suite != "ok3" && $choix_enr != "0"))
{
include ("$chemin/test_ip.php");
}
if ($afficher_results == "1") //pour la partie admin
$nonono = 1;
if ($nblignes > "0")
{//////////////////////////////////////////////////si sondage, on entre
if (($nonono != "1" && $for_previsulualisation != "2") or $for_previsulualisation == "1")
{//ert
$pas_aff_archives = 0;
include ("$chemin/aff_voter.php");
}//ert
else
{//tre
$bis_chem = "$chemin/images/$nom_image2";
include("$chemin/aff_resultats.php");
}//tre
}///////////////////////////////////////fin si sondage on entre
else
{///////////////////////////////////////si pas de sondage
echo "<center><font face='Arial' size='1'>il n'y a pas de sondage valide sélectionné</font></center>";
}//////////////////////////////////////fin si pas de sondages
?>