Commit beb3661a authored by Ayolo's avatar Ayolo

indent

parent 758d9aca
......@@ -319,7 +319,7 @@ class site extends interfaceweb
$this->add_box("comptoirs",$this->get_comptoirs_box());
if($site->user->sexe == '2')
{
$this->add_box("sondage",$this->get_sondage());
$this->add_box("sondage",$this->get_sondage());
}
$this->set_side_boxes("right",
array("planning","photo","anniv","stream", "services",
......
......@@ -32,95 +32,97 @@ require_once($topdir."include/cts/react.inc.php");
$site = new site ();
$site->allow_only_logged_users("accueil");
$sdn = new sondage($site->db,$site->dbrw);
if ( isset($_REQUEST["answord"]) )
{
$sdn->load_lastest();
if ( $sdn->id > 0 && $_REQUEST["id_sondage"] == $sdn->id )
$sdn->repondre($site->user->id,$_REQUEST["numrep"]);
$sdn->load_lastest();
if ( $sdn->id > 0 && $_REQUEST["id_sondage"] == $sdn->id )
$sdn->repondre($site->user->id,$_REQUEST["numrep"]);
$res = new contents("Merci","Votre réponse a été enregistrée.");
}
$res = new contents("Merci","Votre réponse a été enregistrée.");
}
else if ( isset($_REQUEST["id_sondage"]) )
$sdn->load_by_id($_REQUEST["id_sondage"]);
$sdn->load_by_id($_REQUEST["id_sondage"]);
if ( $sdn->is_valid() )
{
$site->start_page("accueil","Sondage");
$cts = new contents("Sondage");
if ( $res )
$cts->add($res);
$cts->add_title(2,"Resultats");
$cts->add_paragraph($sdn->question);
$cts->puts("<p>");
$res = $sdn->get_results();
foreach ( $res as $re )
{
$cumul+=$re[1];
$pc = $re[1]*100/$sdn->total;
$cts->puts($re[0]."<br/>");
$wpx = floor($pc);
if ( $wpx != 0 )
$cts->puts("<div class=\"activebar\" style=\"width: ".$wpx."px\"></div>");
if ( $wpx != 100 )
$cts->puts("<div class=\"inactivebar\" style=\"width: ".(100-$wpx)."px\"></div>");
$cts->puts("<div class=\"percentbar\">".round($pc,1)."%</div>");
$cts->puts("<div class=\"clearboth\"></div>\n");
}
if ( $cumul < $sdn->total )
{
$pc = ( $sdn->total-$cumul)*100/$sdn->total;
$cts->puts("<br/>Blanc ou nul : ".round($pc,1)."%");
}
$cts->puts("</p>");
$cts->add_title(2,"Voir aussi");
$cts->add_paragraph("<a href=\"sondage.php\">Archives</a>");
$site->start_page("accueil","Sondage");
$cts = new contents("Sondage");
if ( $res )
$cts->add($res);
$cts->add_title(2,"Resultats");
$cts->add_paragraph($sdn->question);
$cts->puts("<p>");
$res = $sdn->get_results();
foreach ( $res as $re )
{
$cumul+=$re[1];
$pc = $re[1]*100/$sdn->total;
$cts->puts($re[0]."<br/>");
$wpx = floor($pc);
if ( $wpx != 0 )
$cts->puts("<div class=\"activebar\" style=\"width: ".$wpx."px\"></div>");
if ( $wpx != 100 )
$cts->puts("<div class=\"inactivebar\" style=\"width: ".(100-$wpx)."px\"></div>");
$cts->puts("<div class=\"percentbar\">".round($pc,1)."%</div>");
$cts->puts("<div class=\"clearboth\"></div>\n");
}
if ( $cumul < $sdn->total )
{
$pc = ( $sdn->total-$cumul)*100/$sdn->total;
$cts->puts("<br/>Blanc ou nul : ".round($pc,1)."%");
}
$cts->puts("</p>");
$cts->add_title(2,"Voir aussi");
$cts->add_paragraph("<a href=\"sondage.php\">Archives</a>");
$cts->add(new reactonforum ( $site->db, $site->user, $sdn->question, array("id_sondage"=>$sdn->id), null, true ));
$site->add_contents($cts);
$site->end_page();
exit();
$site->add_contents($cts);
$site->end_page();
exit();
}
$site->start_page("accueil","Sondage");
$req = new requete($site->db, "SELECT * FROM `sdn_sondage` ORDER BY date_sondage");
$req = new requete($site->db, "SELECT * FROM `sdn_sondage` ORDER BY date_sondage");
$site->add_contents(new sqltable(
"listsondages",
"Archives", $req, "../sondage.php",
"id_sondage",
array(
"question"=>"Question",
"date_sondage"=>"Du",
"date_fin"=>"Au"
),
array(),
array(),
array( )
));
"listsondages",
"Archives", $req, "../sondage.php",
"id_sondage",
array(
"question"=>"Question",
"date_sondage"=>"Du",
"date_fin"=>"Au"
),
array(),
array(),
array( )
));
$site->end_page();
......
......@@ -3,9 +3,7 @@ $topdir="../";
require_once($topdir. "include/site.inc.php");
$site = new site();
echo "<pre>";
print_r($site->user);
echo "</pre>";
$req = new requete($site->dbrw, "UPDATE `site_parametres` SET valeur_param='b:1;' WHERE nom_param='closed'");
exit();
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment