예제 #1
0
		$a = 4;
		break;
	}
	
	$tcat = new CTableCommune(array('nom_com'=>utf8_decode(CFunction::addslashes($nom)),'url'=>utf8_decode(CFunction::addslashes($url)), 'cp'=>$cp, 'actif'=>$etat));
	$tcat->insert();
	$msginfo = 'Commune ajoutée';
	$a = 0;
	break;
	
case 5 : // Modifier 1	
	if(!empty($_GET['id'])) $id = $_GET['id'];
	
	$_SESSION['id'] = $id;
	$tcat 		= new CTableCommune(array('id_com'=>$id));
	$cat  		= $tcat->select_row();
	$nom  		= $cat['id_com'];
	$etat  		= $cat['actif'];
	$idcat		= $cat['secteur_cat'];
	
	$requetteSql = "SELECT commune.*, departement.* FROM commune INNER JOIN departement ON commune.departement=departement.id_dep WHERE id_com=".$id."";
	$comVal = CBdd::select_row($requetteSql);
	//print_r($zsql);
	//echo $comVal['nom_com'];
	//print_r($id);
	if(!CLogin::protect_action($idreda)) {
		$a = 0;
		$msginfo = 'Action non autorisée';
	}
		
	break;