<?php
#########################################################################################
# Gestion du compte responsable de Pnyx - scripts bdd #
# Auteur : V. Blais #
# Création : 2006-04-05 #
# Modification : 2008-07-01 #
# #
# Pnyx - une application Web (PHP/MySQL) d'élections virtuelles conçue pour des élèves #
# du primaire et du secondaire, dans lequel ils sont amenés à faire des propositions #
# en ligne et voter pour leur favorite, sous la supervision d'un enseignant. #
# #
# Copyright (C) <2008 - 2009> #
# <Service national du RÉCIT de l'univers social de la Commission scolaire de la #
# Pointe-de-l'Île> #
# #
# This program is free software; you can redistribute it and/or modify it under the #
# terms of the GNU General Public License as published by the Free Software Foundation. #
# 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 as the file LICENSE.txt; if not, please see #
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. #
# #
# Service national du RÉCIT de l'univers social #
# http://www.recitus.qc.ca #
# Contact e-mail : steve-hide@address.com #
#########################################################################################
require "entete_php.php";
if ($HTTP_POST_VARS['type_action'] == "valider"){
$requete_sql = "SELECT groupe_id FROM groupe
WHERE resp_id = \"$HTTP_POST_VARS[id_resp]\"
AND projet_id = $projet
";
$reponse_grp = bd_executer_sql($requete_sql);
$nb_grp = mysql_num_rows($reponse_grp);
$requete_sql = "UPDATE lien_resp_projet
SET valide = \"1\",
date_valide = \"$date\",
nb_groupe = \"$nb_grp\"
WHERE resp_id = \"$HTTP_POST_VARS[id_resp]\"
AND projet_id = $projet
";
$reponse_val = bd_executer_sql($requete_sql);
$HTTP_SESSION_VARS['SESSION']['message'] = "Votre participation au projet est validée.";
header("Location: rsp_compte.php");
}
#SUPPRIMER UN MESSAGE
if ($HTTP_POST_VARS['type_action'] == "sup_msg"){
$requete_sql = "DELETE FROM msg_resp
WHERE msg_id = \"$HTTP_POST_VARS[id_msg]\"
";
$reponse_sup_msg = bd_executer_sql($requete_sql);
$HTTP_SESSION_VARS['SESSION']['message'] = "Le message a été supprimé.";
$HTTP_SESSION_VARS['SESSION']['onglet'] = 3;
$page = "rsp_compte.php";
header("Location: $page");
}
?>