# 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(); include('include/config.inc.php'); if(isset($_GET['p']) && isset($_GET['action']) && isset($_GET['numero'])) { require(dirname(__FILE__).'/include/members.inc.php'); $action = $_GET['action']; $numero = $_GET['numero']; $p = $_GET['p']; if (IsProjectAdmin()) { if ( $action == 0 ) { $test = mysql_query("SELECT * FROM ct2_os_trad_state WHERE idprojet = '$numero' "); $etat = mysql_fetch_array($test); $et = $etat['state']; if ($et == 0) $new = 1; else $new = 0; if(mysql_num_rows($test) == 0) { $new = 1; $test = mysql_query("INSERT INTO ct2_os_trad_state (idprojet,state) VALUES ('$numero','$new') "); } else { $test = mysql_query("UPDATE ct2_os_trad_state SET state = '$new' WHERE idprojet = '$numero' "); } } elseif ( $action == 1) { mysql_query("DELETE FROM ct2_os_trad WHERE projet = '$numero' ") or die( mysql_error() ); mysql_query("DELETE FROM ct2_os_trad_prop WHERE idprojet = '$numero' ") or die( mysql_error() ); mysql_query("DELETE FROM ct2_os_trad_state WHERE idprojet = '$numero' ") or die( mysql_error() ); mysql_query("DELETE FROM ct2_os_trad_tem WHERE idprojet = '$numero' ") or die( mysql_error() ); } Header("Location: ".$p."-trad_".$ct_lang.".html"); } } ?>