%PDF- %PDF-
Direktori : /home/alliance/domains/congress-intercultural.eu/public_html/ |
Current File : /home/alliance/domains/congress-intercultural.eu/public_html/a-ajouter_theme.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) { $theme = new Theme($connection); $erreur = "ok"; $erreur = $db->verifChamp("libelle",$_POST,$trad->t('Text required (english)','error',$lang->getlang()) ); if($erreur == "ok") { unset($_POST["post"]); $query="SELECT max(ordre) as ordre FROM theme WHERE id_parent=".$_POST["id_parent"]; $max=$db->select_array($query); if($max){ $_POST['ordre']=$max['ordre']+1; } else{ $_POST['ordre']=1; } if(isset($_FILES['file_1']['name']) && $_FILES['file_1']['name'] != null){ $_POST['photo'] = file_move("",$_FILES['file_1']['name'],$_FILES['file_1']['tmp_name']); } if(isset($_FILES['file_2']['name']) && $_FILES['file_2']['name'] != null){ $_POST['photo2'] = file_move("",$_FILES['file_2']['name'],$_FILES['file_2']['tmp_name']); } $theme->add($_POST); header("Location:liste_theme.php?msg=yes"); } else { $err = true; } } //affichage du html include("theme/html.php"); //affichage des metas include("theme/meta.php"); echo "\n<title>".$trad->t("Ajouter un theme","admin")." - ".$info_titresite."</title>\n"; //affichage du header include("theme/header_admin.php"); ?> <div class="text_admin"> <h2><?=$trad->t("Ajouter un theme","admin")?></h2> <?php if(isset($_GET['msg']) && $_GET['msg']=="yes") { echo "<p class=\"infobloc\">Opération effectuée</p>"; } if(isset($err) && $err) { echo "<p class=\"erreurbloc\">".$erreur."</p>"; } ?> <?=$form->geneFlag($lang->id());?> <form action="admin/ajouter_theme.php" method="post" class="form"> <table> <tr> <td class="label"><?=$trad->t('Libelle')?></td> <td class="field top"> <? $html='<input type="text" name="libelle_[LANG]" value="[VALUE]" />'; echo $form->geneField($html,$lang->id(),$_POST); ?> </td> </tr> <tr> <td class="label"><?=$trad->t("Color","admin",$lang->id())?></td> <td class="field"># <input type="text" name="couleur" class="small colorpick" value="<?=(isset($_POST['couleur'])? $_POST['couleur']:"") ?>" /></td> <td class="field"></td> </tr> <tr> <td class="label"><?=$trad->t("Icone","admin",$lang->id())?></td> <td class="field"><input type="text" name="icone" class="" value="<?=(isset($_POST['icone'])? $_POST['icone']:"") ?>" /></td> <td class="field"></td> </tr> <!--<tr> <td class="label top"><?=$trad->t('Theme photo','admin',$lang->id())?></td> <td class="field"><input type="file" name="file_1" id="file_1" /><?php if(isset($_POST['photo'])) echo '<div class="uploadifyQueueItem completed">'.$_POST['photo'].'</div> '; ?></td> <td class="field"><input type="hidden" name="photo" id="photo1" value="<?=((isset($_POST['photo']))?$_POST['photo']:""); ?>" /></td> </tr>--> <tr> <td class="label top"><?=$trad->t('Parent','admin',$lang->id())?></td> <td class="field"> <select name="id_parent"> <?=$theme->getListSelect($lang->getlangid(),true,"",0)?> </select> </td> <td class="field"></td> </tr> <tr> <td class="label top"><?=$trad->t("Photo","admin",$lang->id())?></td> <td class="field"><input type="file" name="file_1" id="file_1" /><?php if(isset($_POST['photo'])) echo '<div class="uploadifyQueueItem completed">'.$_POST['photo'].'</div> '; ?></td> <td class="field"><input type="hidden" name="photo" id="photo1" value="<?php echo $_POST['photo']; ?>" /></td> </tr> <tr> <td class="label top"><?=$trad->t("Photo 2","admin",$lang->id())?></td> <td class="field"><input type="file" name="file_2" id="file_2" /><?php if(isset($_POST['photo2'])) echo '<div class="uploadifyQueueItem completed">'.$_POST['photo2'].'</div> '; ?></td> <td class="field"><input type="hidden" name="photo2" id="photo2" value="<?php echo $_POST['photo2']; ?>" /></td> </tr> <tr> <td class="label top"><?=$trad->t("Description","admin",$lang->id())?></td> <td class="field top"> <?$html='<textarea name="description_[LANG]">[VALUE]</textarea>'; echo $form->geneField($html,$lang->id(),"");?> </td> </tr> </table> <div class="form_bouton"> <input type="hidden" name="post" value="1" /> <input type="submit" class="bouton" id="maj_bouton" value="<?=$trad->t('Creer le theme')?>" /> </div> </form> <?=$form->geneFlag($lang->id());?> </div> <? //affichage du footer include("theme/footer.php"); ?>