static function page_protect($url_redirection='../src/login.php') { if(!CLogin::est_logue()) { CFunction::redirection($url_redirection); } else if(!CTableUser::is_admin($_SESSION['idmbr'])) { if(!in_array(basename($_SERVER['SCRIPT_NAME']), array('categorie.php', 'article.php', 'page.php', 'fichier.php', 'dossier.php', 'login.php', 'index.php', 'menu_semaine.php', 'image_menu.php'))) { CFunction::redirection('../src/index.php'); } } }
//---------------------------------------------------------------------------------------------- ?> <?php if($a == 5) { ?> <form id="form_modif" method="post" action="article.php"> <p> <?php echo CForm::get_hidden(55) ?> </p> <p> <?php echo CForm::get_hidden($id, 'id') ?> </p> <fieldset> <legend>Formulaire de modification de sous-menu</legend> <p> <label>Titre </label> <input name="nom" type="text" value="<?php echo $nom?>" /> <?php echo CHtml::get_msginfo($error_signe['nom'])?></p> <p> <label>Menu </label> <select name="idcat"> <?php echo CForm::get_option($idcat, 'categorie', 'id', 'nom', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?> </select> <?php echo CHtml::get_msginfo($error_signe['idcat'])?> </p> <p> <label>Publier </label> <input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> />non <input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> />oui <?php echo $error_signe['etat']?></p> <p> <input name="creer" type="submit" value="Modifier >>"/> </p> </fieldset> </form> <?php } ?> <!-- InstanceEndEditable --></div> </div> <hr class="clearfloat" />
<?php $oFCKeditor = new FCKeditor('text') ; $oFCKeditor->BasePath = '../plug/fckeditor/'; $oFCKeditor->Value = $text; $oFCKeditor->Height = '300'; $oFCKeditor->Width = '850'; $oFCKeditor->Config['EditorAreaCSS'] = ''; $oFCKeditor->ToolbarSet = 'Page'; $oFCKeditor->Create() ; ?> <?php echo CHtml::get_msginfo($error_signe['text'])?></p> <p> <label>Publier </label> <input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> <?php echo (CTableUser::is_admin($_SESSION['idmbr'])) ? "" : "disabled = 'disabled'" ?>/> non <input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> <?php echo (CTableUser::is_admin($_SESSION['idmbr'])) ? "" : "disabled = 'disabled'" ?>/> oui <?php echo $error_signe['etat']?></p> <p> <input name="creer" type="submit" value="Modifier >>"/> </p> </fieldset> </form> <?php } ?> <!-- InstanceEndEditable --></div> </div> <hr class="clearfloat" /> </div> </div> </body> <!-- InstanceEnd --></html>
<p> <label style="padding-right:0;">URL (http://)</label> <input id="url" name="url" type="text" value="<?php if (($url_ok=='NULL') or ($url_ok=='')) echo 'communesgenevoises.ch'; else echo $url_rpl;?>" style="width:150px;padding-left:2px;color: #003399;font-family: sans-serif;font-size: 11px;"/> <?php echo CHtml::get_msginfo($error_signe['url'])?> </p> <?php // CENTRE ?> </div> <div class="floatleft margin-left"> <h2>Informations personnelles</h2> <p> <label>Secteur</label> <select name="nom_sec" onchange="load_secteur(document.forms['form_ajout'].elements['nom_sec'].options[document.forms['form_ajout'].elements['nom_sec'].selectedIndex].value, 'form_ajout');"> <option value="0" >Secteur</option> <?php echo utf8_encode(CForm::get_option($nom_sec, 'secteur', 'id_sec', 'nom_sec', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr'])); ?> </select> <?php echo CHtml::get_msginfo($error_signe['nom_cat'])?> </p> <p id="cat"> </p> <p> <label>Grouper dans</label> <select name="id_groupe" id="id_groupe"> <option value="0" >Choisir groupe</option> <?php echo CForm::get_option($id_groupe, 'groupeUtilitaire', 'id', 'nom', ' etat = 1') ?> </select> <?php echo CHtml::get_msginfo($error_signe['id_groupe'])?> </p> <p> <label>Résponsable </label>
<a href="envoi.php?a=2&id=<?php echo $email['id'] ?>&etat=2"><img src="../img/publish_u.png" alt="Archivé" /> Archivé</a> <?php } else { ?> <img src="../img/publish_u.png" alt="Archivé" /> Archivé <?php } ?> <br /> <?php if($email['etat'] != 3) { ?> <a href="envoi.php?a=2&id=<?php echo $email['id'] ?>&etat=3"><img src="../img/publish_q.png" alt="Fuile d'attente" /> File d'attente</a> <?php } else { ?> <img src="../img/publish_q.png" alt="File d'attente" /> File d'attente <?php } ?> </div></td> <td align="center"><?php if($email['etat'] == 0) { ?> <a href="envoi.php?id=<?php echo $email['id'] ?>&a=5">>></a> <?php } ?></td> <td align="center"><a href="envoi.php?id=<?php echo $email['id'] ?>&a=7">>></a></td> <td align="center"><?php echo CHtmlSession::get_delbutton($a, $email['id'], $id, CTableUser::is_admin($_SESSION['idmbr'])) ?></td> </tr> <?php } ?> </table> <?php } ?> <?php //---------------------------------------------------------------------------------------------- // AJOUT //---------------------------------------------------------------------------------------------- ?> <?php if($a == 4) { ?> <form id="form_ajout" method="post" action="envoi.php" enctype="multipart/form-data"> <p> <?php echo CForm::get_hidden(44) ?> </p> <fieldset> <legend>Formulaire d'ajout d'email</legend> <p>
<fieldset> <legend>Formulaire de modification d'utilisateur </legend> <div class="floatleft"> <h2>Paramètres de login</h2> <p> <label>Login</label> <input name="login" type="text" value="<?php echo $login?>" /> <?php echo CHtml::get_msginfo($error_signe['login'])?> </p> <p> <label>Passe</label> <input name="passe" type="text" value="<?php echo $passe?>" /> <?php echo CHtml::get_msginfo($error_signe['passe']) ?> </p> <?php if(CTableUser::is_admin($_SESSION['idmbr'])) { ?> <p> <label>Type </label> <?php if(!CTableUser::is_admin($id)) { ?> <input type="radio" name="type" value="0" <?php echo CForm::get_checked($type,0) ?> /> membre <input type="radio" name="type" value="1" <?php echo CForm::get_checked($type,1) ?> /> réda <?php echo CHtml::get_msginfo($error_signe['etat'])?> <?php } else { ?> <input type="radio" name="type" value="2" <?php echo CForm::get_checked($type,2) ?> /> administrateur <?php } ?> </p> <p> <label>Actif </label> <input type="radio" name="etat" value="0" <?php echo CForm::get_checked($etat,0) ?> /> non <input type="radio" name="etat" value="1" <?php echo CForm::get_checked($etat,1) ?> /> oui <?php echo $error_signe['etat']?> </p>
<?php //---------------------------------------------------------------------------------------------- // MODIF //---------------------------------------------------------------------------------------------- ?> <?php if($a == 5) { ?> <form id="form_modif" method="post" action="gr_rdv.php"> <p> <?php echo CForm::get_hidden(55) ?> </p> <p> <?php echo CForm::get_hidden($id, 'id') ?> </p> <fieldset> <legend>Formulaire de modification de rdv </legend> <p> <label>Titre </label> <input name="nom" type="text" value="<?php echo $nom?>" /> <?php echo $error_signe['nom']?> </p> <?php if(CTableUser::is_admin($_SESSION['idmbr'])) { ?> <p> <label>Rédacteur</label> <select name="idreda"> <?php echo CForm::get_option($idreda, 'user', 'id', 'login', ' type = 1 OR type = 2') ?> </select> <?php echo $error_signe['idreda']?> </p> <?php } ?> <p> <label>Visiteur</label> <select name="idlecteur"> <option value="all" <?php echo CForm::get_selected($idlecteur, 'all'); ?>>publics</option> <option value="0" <?php echo CForm::get_selected($idlecteur, '0'); ?>>tous les membres</option> <?php echo CForm::get_option($idlecteur, 'user', 'id', 'login', ' type = 0 OR type = 3') ?> </select> <?php echo $error_signe['idreda']?> </p>
<? //---------------------------------------------------------------------------------------------- // MODIF //---------------------------------------------------------------------------------------------- ?> <? if($a == 5) { ?> <form id="form_modif" method="post" action="departement.php" enctype="multipart/form-data"> <p> <? echo CForm::get_hidden(55) ?> </p> <p> <? echo CForm::get_hidden($id, 'id') ?> </p> <fieldset> <legend>Formulaire de modification de menu </legend> <p id="menu"> <label>Pays</label> <select name="pays"> <? echo CForm::get_option($pays, 'pays', 'code', 'nom', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?> </select> <? echo CHtml::get_msginfo($error_signe['pays'])?> </p> <p> <label>Titre </label> <input name="nom" type="text" value="<? echo $nom ?>" /> <? echo CHtml::get_msginfo($error_signe['nom'])?> </p> <p> <input name="creer" type="submit" value="Modifier >>"/> </p> </fieldset> </form> <? } ?> <!-- InstanceEndEditable --></div>
/*--------------------------------------------------------------------- IMPORTATIONS ----------------------------------------------------------------------*/ include_once("../inc/init.php"); /*--------------------------------------------------------------------- VARIABLES HTTP ----------------------------------------------------------------------*/ $idart = !empty($_GET['idart']) ? $_GET['idart'] : 0; /*-------------------------------------------------------------------- TRAITEMENTS ----------------------------------------------------------------------*/ echo CForm::get_option($idart, 'page', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart : ' idreda = ' . $_SESSION['idmbr'] . ' AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart)); ?> <?php session_start(); /*--------------------------------------------------------------------- IMPORTATIONS ----------------------------------------------------------------------*/ include_once("../inc/init.php"); /*--------------------------------------------------------------------- VARIABLES HTTP ----------------------------------------------------------------------*/ $idart = !empty($_GET['idart']) ? $_GET['idart'] : 0; /*-------------------------------------------------------------------- TRAITEMENTS ----------------------------------------------------------------------*/ echo CForm::get_option($idart, 'page', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart : ' idreda = ' . $_SESSION['idmbr'] . ' AND text LIKE \'%<!--GALERIE-->%\' AND idart = ' . $idart)); ?>
<td align="center"> <?php echo CHtmlUser::get_etat_contact($user['id'], $user['etat_contact'], 0) ?> <!--<?php echo !$user['etat_contact'] ? "NC" : ($user['etat_contact'] == 1 ? "C" : ($user['etat_contact'] == 2 ? "NI" : "A")) ?>--> </td> <td align="center"><?php echo CDate::date_switch(CDate::formate_date($user['date'])) ?></td> <td align="center"><?php echo CDate::date_switch(CDate::formate_date($rdv['date'])) ?></td> <td align="center"><?php echo $rdv['heure'] ?></td> <td align="center"><?php echo $rdv['type']==0 ? "Téléphone" : ($rdv['type']==1 ? "Skype" : "Domicile") ?></td> <td align="center"><a href="user.php?a=5&id=<?php echo $user['id'] ?>" target="_parent"><img src="../img/b_edit.png" alt="modifier, afficher" /></a></td> <td align="center"> <?php if($user['type']==2) { echo ' '; } else { echo CHtmlSession::get_delbutton($a, $user['id'], $id, CTableUser::is_admin($_SESSION['idmbr'])); } ?> </td> <td align="center"><a href="envoi.php?destinataire=<?php echo $user['email'] ?>&a=4" target="_parent">>></a></td> <td> <?php if($user['type']==2) { ?> <?php } else { ?> <input type="checkbox" name="ids[]" class="id_del" value="<?php echo $user['id'] ?>"/> <?php } ?>
<th align="left">Nom</th> <th>Emplacement</th> <th>Date d'ajout </th> <th>Modif</th> <th title="suppr"> Suppr </th> </tr> <?php $i = 0; foreach (CUserFile::sort($arr_urlrep) as $urlrep) { $info_file = CUserFile::get_info_file($urlrep); $file_name = $info_file['name']; $file_mtime= $info_file['mtime']; $file_type = $info_file['type']; $file_url = $info_file['url']; $file_base = $info_file['base']; $actif_btn = CTableUser::is_admin($_SESSION['idmbr'])?1:0; ?> <tr> <td><a href="fichier.php?a=66&url_base_fils=<?php echo $file_url ?>&url_base=<?php echo $file_base ?>"><?php echo $file_name ?></a></td> <td align="center"><?php echo $file_url ?></td> <td align="center"><?php echo CDate::date_switch(CDate::formate_date($file_mtime)) ?></td> <td align="center"><?php echo CHtml::get_editbutton($urlrep, $actif_btn) ?></td> <td align="center"><?php echo CHtml::get_delbutton($a, $urlrep, $id, $actif_btn) ?></td> </tr> <?php } ?> </table> <?php } ?> <?php //---------------------------------------------------------------------------------------------- // AJOUT //----------------------------------------------------------------------------------------------
<?php session_start(); /*--------------------------------------------------------------------- IMPORTATIONS ----------------------------------------------------------------------*/ include_once("../inc/init.php"); /*--------------------------------------------------------------------- VARIABLES HTTP ----------------------------------------------------------------------*/ $idcat = !empty($_GET['idcat']) ? $_GET['idcat'] : 0; $idart = 0; /*-------------------------------------------------------------------- TRAITEMENTS ----------------------------------------------------------------------*/ ?> <option value="0">Choisir le sous-menu</option> <?php echo CForm::get_option($idart, 'article_cat', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND idcat = ' . $idcat : ' idreda = ' . $_SESSION['idmbr'] . ' AND idcat = ' . $idcat)); ?>
} ?> </td> <td align="center"><?php echo $user['pays'] ?></td> <td align="center"><?php echo date("d-m-20y", strtotime($user['date']));?></td> <td align="center"><?php echo CHtmlUser::get_etat_contact($user['id'], $user['etat_contact'], 0) ?></td> <td align="center">R<?php echo $user['relance']; ?></td> <td style="text-align: center;"><?php echo $opp_num[$user['idopportunite']]; ?></td> <?php if ($user['commentaire']) { ?> <td align="center" class="info"><div class="bulle"><?php echo nl2br($user['commentaire']) ?></div></td> <?php } else { ?> <td align="center"></td> <?php } ?> <td><?php echo (CTableUser::is_admin($_SESSION['idmbr']) && !CTableUser::is_admin($user['id'])) ? CHtmlSession::get_etat($user['id'], $user['etat'], $user['id']) : CHtml::get_etat($user['id'], $user['etat']) ?></td> <td align="center"><?php echo CHtmlSession::get_editbutton($user['id'], $user['id']) ?></td> <td align="center"><?php echo (CTableUser::is_admin($_SESSION['idmbr']) && !CTableUser::is_admin($user['id'])) ? CHtmlSession::get_delbutton($a, $user['id'], $id, $user['id']) : CHtml::get_delbutton($a, $user['id'], $id) ?></td> <td><a href="envoi.php?destinataire=<?php echo $user['email'] ?>&a=4&isGr=1">>></a></td> <td align="center"><?php if(CBdd::select_one("SELECT count(id) AS nb_reponse FROM reponse WHERE iduser = "******"../src/reponse.php?id=<?php echo $user['id'] ?>" target="popup" onclick="popup(this.href, this.target, '600', '500'); return false;"> >> </a> <?php } ?></td> <td align="center"><input class="caseacocher" name="tab_user[<?php echo $i ?>]" type="checkbox" id="contact[<?php echo $i ?>]" value="<?php echo $user['id'] ?>" checked /></td> </tr> <?php $i++; } ?> </table> <?php //---------------------------------------------------------------------------------------------- // GROUPE //---------------------------------------------------------------------------------------------- ?> <div class="floatright">
<?php } ?> <?php //---------------------------------------------------------------------------------------------- // AJOUT //---------------------------------------------------------------------------------------------- ?> <?php if($a == 4) { ?> <form id="form_ajout" method="post" action="cat.php" enctype="multipart/form-data"> <p> <?php echo CForm::get_hidden(44) ?> </p> <fieldset> <legend>Formulaire d'ajout de menu </legend> <p id="menu"> <label>Secteur</label> <select name="idcat"> <?php echo CForm::get_option($idcat, 'secteur', 'id_sec', 'nom_sec', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?> </select> <?php echo CHtml::get_msginfo($error_signe['idcat'])?> </p> <p> <label>Titre </label> <input name="nom" type="text" value="<?php echo $nom ?>" /> <p> <input name="creer" type="submit" value="Ajouter >>"/> </p> </fieldset> </form> <?php } ?> <?php //----------------------------------------------------------------------------------------------
<label>Menu </label> <select name="idcat" onchange="update_select_art(document.forms['form_ajout'].elements['idcat'].options[document.forms['form_ajout'].elements['idcat'].selectedIndex].value, 'form_ajout');"> <option value="0">Choisir le menu</option> <?php echo CForm::get_option($idcat, 'categorie', 'id', 'nom', CTableUser::is_admin($_SESSION['idmbr']) ? '1' : ' idreda = ' . $_SESSION['idmbr']); ?> </select> <?php echo CHtml::get_msginfo($error_signe['idcat'])?></p> <p> <label>Sous-menu </label> <select name="idart" id="idart" onchange="update_page(document.forms['form_ajout'].elements['idart'].options[document.forms['form_ajout'].elements['idart'].selectedIndex].value, 'form_ajout');"> <?php echo CForm::get_option($idart, 'article', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND idcat = ' . $idcat : ' idreda = ' . $_SESSION['idmbr'] . ' AND idcat = ' . $idcat)); ?> </select> </p> <p> <label>Page </label> <select name="idpage" id="idpage"> <?php echo CForm::get_option($idpage, 'page', 'id', 'nom', (CTableUser::is_admin($_SESSION['idmbr']) ? '1 AND idart = ' . $idart : ' idreda = ' . $_SESSION['idmbr'] . ' AND idart = ' . $idart)); ?> </select> <?php echo CHtml::get_msginfo($error_signe['page'])?></p> <p> <label>Date </label> <input id="dateevent" name="dateevent" type="text" value="<?php echo $dateevent ?>" /> <?php echo $error_signe['dateevent']?> </p> </div> <hr class="clearfloat" /> <!--<p> <label>Texte défilant</label> <input name="text" type="text" value="<?php echo $text?>" /> <?php echo CHtml::get_msginfo($error_signe['text'])?> </p> <p>
static function get_editbutton($id, $idreda) { $is_admin = CTableUser::is_admin($_SESSION['idmbr']); $actif = ($is_admin) ? 1 : ($_SESSION['idmbr'] == $idreda); $etat = parent::get_editbutton($id, $actif); return $etat; }