%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-modifier_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") { $where = "id = ".$_GET['id']; $where2 = "`id_public` = ".$_GET['id']; //tag_fr $values = array ( "libelle" => $_POST['libelle_fr'] ); $db->update("public_lang", $values, $where2." AND `lang` = 1"); //tag_en $values = array ( "libelle" => $_POST['libelle_en'] ); $db->update("public_lang", $values, $where2." AND `lang` = 2"); header("Location:gerer_public.php?msg=yes"); } else { $err = true; } } else{ $query='SELECT p.*,pl.libelle as libelle_fr FROM `public` p LEFT JOIN `public_lang` pl ON p.id=pl.id_public WHERE lang=1 AND p.id='.$_GET['id']; $data_fr = $db->select_array($query); $query='SELECT p.*,pl.libelle as libelle_en FROM `public` p LEFT JOIN `public_lang` pl ON p.id=pl.id_public WHERE lang=2 AND p.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 public - ".$info_titresite."</title>\n"; //affichage du header include("theme/header_admin.php"); ?> <div class="text_admin"> <h2>Modifier 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/modifier_public.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 <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 le public" /> </div> </form> </div> <? //affichage du footer include("theme/footer.php"); ?>