From beb3661afd44985c05a2962b7f3b6fb21921d258 Mon Sep 17 00:00:00 2001
From: Ayolo
Date: Tue, 8 Apr 2008 08:46:46 +0000
Subject: [PATCH] indent
---
include/site.inc.php | 2 +-
sondage.php | 140 ++++++++++++++++++++++---------------------
temp/bleh.php | 4 +-
3 files changed, 73 insertions(+), 73 deletions(-)
diff --git a/include/site.inc.php b/include/site.inc.php
index 79ad75e0e..9e2d3ee65 100644
--- a/include/site.inc.php
+++ b/include/site.inc.php
@@ -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",
diff --git a/sondage.php b/sondage.php
index 829def371..f78c5aae1 100644
--- a/sondage.php
+++ b/sondage.php
@@ -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("");
-
- $res = $sdn->get_results();
-
- foreach ( $res as $re )
- {
- $cumul+=$re[1];
- $pc = $re[1]*100/$sdn->total;
-
- $cts->puts($re[0]."
");
-
- $wpx = floor($pc);
- if ( $wpx != 0 )
- $cts->puts("
");
- if ( $wpx != 100 )
- $cts->puts("");
-
- $cts->puts("".round($pc,1)."%
");
- $cts->puts("\n");
-
- }
-
- if ( $cumul < $sdn->total )
- {
- $pc = ( $sdn->total-$cumul)*100/$sdn->total;
- $cts->puts("
Blanc ou nul : ".round($pc,1)."%");
- }
-
- $cts->puts("
");
-
- $cts->add_title(2,"Voir aussi");
- $cts->add_paragraph("Archives");
-
+ $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("");
+
+ $res = $sdn->get_results();
+
+ foreach ( $res as $re )
+ {
+ $cumul+=$re[1];
+ $pc = $re[1]*100/$sdn->total;
+
+ $cts->puts($re[0]."
");
+
+ $wpx = floor($pc);
+ if ( $wpx != 0 )
+ $cts->puts("
");
+ if ( $wpx != 100 )
+ $cts->puts("");
+
+ $cts->puts("".round($pc,1)."%
");
+ $cts->puts("\n");
+
+ }
+
+ if ( $cumul < $sdn->total )
+ {
+ $pc = ( $sdn->total-$cumul)*100/$sdn->total;
+ $cts->puts("
Blanc ou nul : ".round($pc,1)."%");
+ }
+
+ $cts->puts("");
+
+ $cts->add_title(2,"Voir aussi");
+ $cts->add_paragraph("Archives");
+
$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();
diff --git a/temp/bleh.php b/temp/bleh.php
index 65e952e51..f91ef7559 100644
--- a/temp/bleh.php
+++ b/temp/bleh.php
@@ -3,9 +3,7 @@ $topdir="../";
require_once($topdir. "include/site.inc.php");
$site = new site();
-echo "";
-print_r($site->user);
-echo "
";
+$req = new requete($site->dbrw, "UPDATE `site_parametres` SET valeur_param='b:1;' WHERE nom_param='closed'");
exit();
?>
--
GitLab