%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-ajouter_tag.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") { if(!isset($_POST['visible']) || $_POST['visible']==""){ $_POST['visible']=0; } // tag $next_ordre = $db->next_ordre("tag","id_edition=".$_GET['id']); $values = array( "id_edition" => $_GET['id'], "ordre" => $next_ordre, "visible" => $_POST['visible'] ); $db->insert("tag", $values); $next_id=$db->lastId(); //tag_fr $values = array ( "id_tag" => $next_id, "lang" => 1, "libelle" => $_POST['libelle_fr'], "detail" => $_POST['detail_fr'] ); $db->insert("tag_lang", $values); //tag_en $values = array ( "id_tag" => $next_id, "lang" => 2, "libelle" => $_POST['libelle_en'], "detail" => $_POST['detail_fr'] ); $db->insert("tag_lang", $values); header("Location:gerer_tag.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 tag - ".$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_tag.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">Nom du tag <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">Détail du tag</td> <td class="field"><input type="text" name="detail_fr" value="<?php echo $_POST['detail_fr']; ?>" /></td> <td class="field"><input type="text" name="detail_en" value="<?php echo $_POST['detail_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 tag" /> </div> </form> </div> <? //affichage du footer include("theme/footer.php"); ?>