# Copyright (c) 2007 Erwan Briand # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 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; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # ***** END LICENSE BLOCK ***** session_start(); require_once("include/config.inc.php"); require_once("include/members.inc.php"); $numero = $_POST['n']; if (IsProjectAdmin()) { $code = $_POST['p']; $etat = $_POST['statut']; $ma_bis = mysql_query("SELECT * FROM ct2_os WHERE adresse = '$code' "); $mb_bis = mysql_fetch_array($ma_bis); $numerobis = $mb_bis['id']; $sa = mysql_query("SELECT * FROM ct2_os_etat WHERE idprojet = '$numerobis' ") or die (mysql_error()); if (mysql_num_rows($sa) == 0) { mysql_query("INSERT INTO ct2_os_etat (idprojet,etat) VALUES ('$numerobis','$etat')") or die (mysql_error()); } else { mysql_query("UPDATE ct2_os_etat SET etat = '$etat' WHERE idprojet = '$numerobis'") or die (mysql_error()); } Header('Location: '.$racine.'/'.$code.'-aff_'.$ct_lang.'.html'); } else { exit('Error.'); } ?>