Commit beb3661a authored by Ayolo's avatar Ayolo
Browse files

indent

parent 758d9aca
...@@ -319,7 +319,7 @@ class site extends interfaceweb ...@@ -319,7 +319,7 @@ class site extends interfaceweb
$this->add_box("comptoirs",$this->get_comptoirs_box()); $this->add_box("comptoirs",$this->get_comptoirs_box());
if($site->user->sexe == '2') if($site->user->sexe == '2')
{ {
$this->add_box("sondage",$this->get_sondage()); $this->add_box("sondage",$this->get_sondage());
} }
$this->set_side_boxes("right", $this->set_side_boxes("right",
array("planning","photo","anniv","stream", "services", array("planning","photo","anniv","stream", "services",
......
...@@ -32,95 +32,97 @@ require_once($topdir."include/cts/react.inc.php"); ...@@ -32,95 +32,97 @@ require_once($topdir."include/cts/react.inc.php");
$site = new site (); $site = new site ();
$site->allow_only_logged_users("accueil"); $site->allow_only_logged_users("accueil");
$sdn = new sondage($site->db,$site->dbrw); $sdn = new sondage($site->db,$site->dbrw);
if ( isset($_REQUEST["answord"]) ) if ( isset($_REQUEST["answord"]) )
{ {
$sdn->load_lastest(); $sdn->load_lastest();
if ( $sdn->id > 0 && $_REQUEST["id_sondage"] == $sdn->id ) if ( $sdn->id > 0 && $_REQUEST["id_sondage"] == $sdn->id )
$sdn->repondre($site->user->id,$_REQUEST["numrep"]); $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"]) ) else if ( isset($_REQUEST["id_sondage"]) )
$sdn->load_by_id($_REQUEST["id_sondage"]); $sdn->load_by_id($_REQUEST["id_sondage"]);
if ( $sdn->is_valid() ) if ( $sdn->is_valid() )
{ {
$site->start_page("accueil","Sondage"); $site->start_page("accueil","Sondage");
$cts = new contents("Sondage"); $cts = new contents("Sondage");
if ( $res ) if ( $res )
$cts->add($res); $cts->add($res);
$cts->add_title(2,"Resultats"); $cts->add_title(2,"Resultats");
$cts->add_paragraph($sdn->question); $cts->add_paragraph($sdn->question);
$cts->puts("<p>"); $cts->puts("<p>");
$res = $sdn->get_results(); $res = $sdn->get_results();
foreach ( $res as $re ) foreach ( $res as $re )
{ {
$cumul+=$re[1]; $cumul+=$re[1];
$pc = $re[1]*100/$sdn->total; $pc = $re[1]*100/$sdn->total;
$cts->puts($re[0]."<br/>"); $cts->puts($re[0]."<br/>");
$wpx = floor($pc); $wpx = floor($pc);
if ( $wpx != 0 ) if ( $wpx != 0 )
$cts->puts("<div class=\"activebar\" style=\"width: ".$wpx."px\"></div>"); $cts->puts("<div class=\"activebar\" style=\"width: ".$wpx."px\"></div>");
if ( $wpx != 100 ) if ( $wpx != 100 )
$cts->puts("<div class=\"inactivebar\" style=\"width: ".(100-$wpx)."px\"></div>"); $cts->puts("<div class=\"inactivebar\" style=\"width: ".(100-$wpx)."px\"></div>");
$cts->puts("<div class=\"percentbar\">".round($pc,1)."%</div>"); $cts->puts("<div class=\"percentbar\">".round($pc,1)."%</div>");
$cts->puts("<div class=\"clearboth\"></div>\n"); $cts->puts("<div class=\"clearboth\"></div>\n");
} }
if ( $cumul < $sdn->total ) if ( $cumul < $sdn->total )
{ {
$pc = ( $sdn->total-$cumul)*100/$sdn->total; $pc = ( $sdn->total-$cumul)*100/$sdn->total;
$cts->puts("<br/>Blanc ou nul : ".round($pc,1)."%"); $cts->puts("<br/>Blanc ou nul : ".round($pc,1)."%");
} }
$cts->puts("</p>"); $cts->puts("</p>");
$cts->add_title(2,"Voir aussi"); $cts->add_title(2,"Voir aussi");
$cts->add_paragraph("<a href=\"sondage.php\">Archives</a>"); $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 )); $cts->add(new reactonforum ( $site->db, $site->user, $sdn->question, array("id_sondage"=>$sdn->id), null, true ));
$site->add_contents($cts); $site->add_contents($cts);
$site->end_page(); $site->end_page();
exit(); exit();
} }
$site->start_page("accueil","Sondage"); $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( $site->add_contents(new sqltable(
"listsondages", "listsondages",
"Archives", $req, "../sondage.php", "Archives", $req, "../sondage.php",
"id_sondage", "id_sondage",
array( array(
"question"=>"Question", "question"=>"Question",
"date_sondage"=>"Du", "date_sondage"=>"Du",
"date_fin"=>"Au" "date_fin"=>"Au"
), ),
array(), array(),
array(), array(),
array( ) array( )
)); ));
$site->end_page(); $site->end_page();
......
...@@ -3,9 +3,7 @@ $topdir="../"; ...@@ -3,9 +3,7 @@ $topdir="../";
require_once($topdir. "include/site.inc.php"); require_once($topdir. "include/site.inc.php");
$site = new site(); $site = new site();
echo "<pre>"; $req = new requete($site->dbrw, "UPDATE `site_parametres` SET valeur_param='b:1;' WHERE nom_param='closed'");
print_r($site->user);
echo "</pre>";
exit(); 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