%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/congress-intercultural.eu/public_html/sauv/
Upload File :
Create Path :
Current File : /home/alliance/domains/congress-intercultural.eu/public_html/sauv/a-modifier_type_activite.php

<?php
include_once("inc/config.php");
include_once("inc/functions.php");
include_once("inc/init.php");
include_once("inc/session.php");

verif_co_admin();

$db = new BaseOps();

if(isset($_POST['post']) && $_POST['post'] == 1)
{
	$erreur = $db->verif($_POST['libelle_fr'], "Le libelle français");
	if($erreur == "ok") $erreur = $db->verif($_POST['libelle_en'], "Le libelle anglais");
	if($erreur == "ok")
	{
		// type_activite
		$where = "id = ".$_GET['id'];
		$where2 = "`activite` = ".$_GET['id'];
		
		
		
		//type_activite_fr
		$values = array (
			"libelle" => $_POST['libelle_fr'] );
		$db->update("type_activite_lang", $values, $where2." AND `lang` = 1");
			
		//type_activite_en
		$values = array (
			"libelle" => $_POST['libelle_en']);
		$db->update("type_activite_lang", $values, $where2." AND `lang` = 2");
		
		header("Location:liste_type_act.php?msg=yes");
	}
	else {
		$err = true;
	}
}
else{
	$query='SELECT c.*,cl.libelle as libelle_fr FROM `type_activite` c LEFT JOIN `type_activite_lang` cl ON c.id=cl.activite WHERE lang=1 AND c.id='.$_GET['id'];
	$data_fr = $db->select_array($query);
	$query='SELECT c.*,cl.libelle as libelle_en FROM `type_activite` c LEFT JOIN `type_activite_lang` cl ON c.id=cl.activite WHERE lang=2 AND c.id='.$_GET['id'];
	$data_en = $db->select_array($query);
	

	$_POST['libelle_fr'] = $data_fr['libelle_fr'];
	$_POST['libelle_en'] = $data_en['libelle_en'];
}

//affichage du html
include("theme/html.php");
//affichage des metas
include("theme/meta.php");
echo "\n<title>Modifier une activité - ".$info_titresite."</title>\n";
//affichage du header
include("theme/header_admin.php");

$this_edition=$edition->getEdition($_GET['id']);
?>

<div class="text_admin">
<h2>Modifier une activité </h2>
<h3><?=$this_edition['titre']?></h3>
<?php
if($_GET['msg']=="yes") {
	echo "<p class=\"infobloc\">Opération effectuée</p>";
}
if($err) {
	echo "<p class=\"erreurbloc\">".$erreur."</p>";
}	
?>
<form action="admin/modifier_type_activite.php?id=<?=$_GET['id']?>" method="post" class="form">
	<table>
		<tr>
			<td class="label"></td>
			<td class="field head">Français</td>
			<td class="field head">Anglais</td>
		</tr>
		<tr>
			<td class="label">Libelle de l'activité <span class="etoile">*</span></td>
			<td class="field"><input type="text" name="libelle_fr" value="<?php echo $_POST['libelle_fr']; ?>" /></td>
			<td class="field"><input type="text" name="libelle_en" value="<?php echo $_POST['libelle_en']; ?>" /></td>
		</tr>
		
		
	</table>
	<div class="form_bouton">
		<input type="hidden" name="post" value="1" />
		<input type="submit" class="bouton" id="maj_bouton" value="Modifier l'activité" />
	</div>
</form>


</div>

<?

//affichage du footer
include("theme/footer.php");

?>

Zerion Mini Shell 1.0