* * Ce fichier fait partie du site de l'Association des Étudiants de * l'UTBM, http://ae.utbm.fr. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License a * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ $topdir = "./"; require_once($topdir. "include/site.inc.php"); require_once($topdir. "include/cts/newsflow.inc.php"); require_once($topdir. "include/cts/sqltable.inc.php"); 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"]); $res = new contents("Merci","Votre réponse a été enregistrée."); } else if ( isset($_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("