%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/congress-pact1in5.eu/public_html/
Upload File :
Create Path :
Current File : /home/alliance/domains/congress-pact1in5.eu/public_html/a-modifier_condition.php

<?php
include_once("inc/config.php");
include_once("inc/functions.php");
include_once("inc/session.php");
include_once("inc/init.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")
	{
		// condition
		$where = "id = ".$_GET['id'];
		$where2 = "`condition` = ".$_GET['id'];
		
		
		
		//condition_fr
		$values = array (
			"libelle" => $_POST['libelle_fr'] );
		$db->update("condition_lang", $values, $where2." AND `lang` = 1");
			
		//condition_en
		$values = array (
			"libelle" => $_POST['libelle_en']);
		$db->update("condition_lang", $values, $where2." AND `lang` = 2");
		
		header("Location:gerer_condition.php?msg=yes&id=".$_GET['id_edition']);
	}
	else {
		$err = true;
	}
}
else{
	$query='SELECT c.*,cl.libelle as libelle_fr FROM `condition` c LEFT JOIN `condition_lang` cl ON c.id=cl.condition WHERE lang=1 AND c.id='.$_GET['id'];
	$data_fr = $db->select_array($query);
	$query='SELECT c.*,cl.libelle as libelle_en FROM `condition` c LEFT JOIN `condition_lang` cl ON c.id=cl.condition 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 un engagement - ".$info_titresite."</title>\n";
//affichage du header
include("theme/header_admin.php");

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

<div class="text_admin">
<h2>Modifier un engagement </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_condition.php?id=<?=$_GET['id']?>&id_edition=<?=$_GET['id_edition']?>" 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'engagement <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'engagement" />
	</div>
</form>


</div>

<?

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

?>

Zerion Mini Shell 1.0