示例#1
0
		$error_type = 2;
		$error_signe['menu'] = "*";
	}
	if ($nom=='') {
		$error_type = 2;
		$error_signe['nom_com'] = '*';
	}
	if ($error_type > 0) {
		//erreur de type champ non valide
		$msginfo = 'Champ non valide';
		$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."";