%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/test/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/test/a-ajouter_ed_lang.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) { $db = new BaseOps; $erreur = $db->verif($_POST['titre_fr'], "Le titre français"); if($erreur == "ok") $erreur = $db->verif($_POST['titre_en'], "Le titre anglais"); if($erreur == "ok") $erreur = $db->verif($_POST['date_debut'], "La date de début"); if($erreur == "ok") $erreur = $db->verif($_POST['date_fin'], "La date de fin"); if($erreur == "ok") $erreur = $db->verif($_POST['date_ins'], "La date d'inscription"); if($erreur == "ok") $erreur = $db->verif($_POST['date_pub'], "La date de bascule"); if($erreur == "ok") { // edition $next_id = $db->next_id("edition"); $values = array( "id" => $next_id, "date_debut" => dateUs($_POST['date_debut']), "date_fin" => dateUs($_POST['date_fin']), "date_ins" => dateUs($_POST['date_ins']), "date_pub" => dateUs($_POST['date_pub']) ); $db->insert("edition", $values); //edition_fr $values = array ( "edition" => $next_id, "lang" => 1, "titre" => $_POST['titre_fr'], "texte" => $_POST['texte_fr'] ); $db->insert("edition_lang", $values); //section_en $values = array ( "edition" => $next_id, "lang" => 2, "titre" => $_POST['titre_en'], "texte" => $_POST['texte_en']); $db->insert("edition_lang", $values); header("Location:liste_ed.php?msg=yes"); } else { $err = true; } } //affichage du html include("theme/html.php"); //affichage des metas include("theme/meta.php"); echo "\n<title>Ajouter une edition - ".$info_titresite."</title>\n"; //affichage du header include("theme/header_admin.php"); ?> <div class="text_admin"> <h2>Texte de l'édition</h2> <?php if($err) { echo "<p class=\"erreurbloc\">".$erreur."</p>"; } if($yes) { echo "<p class=\"infobloc\">Opération effectuée</p>"; } ?> <form action="admin/ajouter_ed_lang.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 class="news"> <td class="label"></td> <td class="field" colspan="2"> <div id="toolbar"></div> </td> </tr> <tr class="news"> <td class="label top">Texte</td> <td class="field top"><textarea name="texte_fr"><?php echo $_POST['texte_fr']; ?></textarea></td> <td class="field top"><textarea name="texte_en"><?php echo $_POST['texte_en']; ?></textarea></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 une édition" /> </div> </form> </div> <? //affichage du footer include("theme/footer.php"); ?>