* Consultez la Licence Générale Publique GNU pour plus de détails.
 * 
 * Vous devriez avoir reçu une copie de la Licence Générale Publique GNU avec SACoche ;
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */

if(!defined('SACoche')) {exit('Ce fichier ne peut être appelé directement !');}
$TITRE = "Désactiver des comptes utilisateurs";
?>

<?php
// Fabrication des éléments select du formulaire
$select_f_groupes              = Formulaire::afficher_select(DB_STRUCTURE_COMMUN::DB_OPT_regroupements_etabl()                   , $select_nom=false , $option_first='oui' , $selection=false , $optgroup='oui');
$select_parents                = Formulaire::afficher_select(DB_STRUCTURE_COMMUN::DB_OPT_parents_etabl($statut=1)                , $select_nom=false , $option_first='non' , $selection=false , $optgroup='non');
$select_professeurs_directeurs = Formulaire::afficher_select(DB_STRUCTURE_COMMUN::DB_OPT_professeurs_directeurs_etabl($statut=1) , $select_nom=false , $option_first='non' , $selection=false , $optgroup='oui');
?>

<ul class="puce">
	<li><span class="manuel"><a class="pop_up" href="<?php echo SERVEUR_DOCUMENTAIRE ?>?fichier=support_administrateur__gestion_statuts">DOC : Statuts : désactiver / réintégrer / supprimer</a></span></li>
	<li><span class="astuce">Pour un traitement individuel on peut utiliser les pages [<a href="./index.php?page=administrateur_eleve&amp;section=gestion">Gérer les élèves</a>] [<a href="./index.php?page=administrateur_parent&amp;section=gestion">Gérer les parents</a>] [<a href="./index.php?page=administrateur_professeur&amp;section=gestion">Gérer les professeurs</a>] [<a href="./index.php?page=administrateur_directeur">Gérer les directeurs</a>].</span></li>
</ul>

<hr />

<form action="#" method="post">
	<table>
		<tr>
			<td style="width:55em" colspan="2">
				<p class="hc">
					<input id="f_profil_eleves" name="f_profil" type="radio" value="eleves" /><label for="f_profil_eleves"> Élèves</label>
function fabriquer_chaine_option($mini, $maxi)
{
    $options = '';
    for ($i = $mini; $i <= $maxi; $i++) {
        $options .= '<option value="' . $i . '">' . number_format($i / 10, 1, ',', '') . 'cm</option>';
    }
    return $options;
}
$options_horizontal_gauche = str_replace('"' . $_SESSION['ENVELOPPE']['HORIZONTAL_GAUCHE'] . '"', '"' . $_SESSION['ENVELOPPE']['HORIZONTAL_GAUCHE'] . '" selected', fabriquer_chaine_option(90, 120));
$options_horizontal_milieu = str_replace('"' . $_SESSION['ENVELOPPE']['HORIZONTAL_MILIEU'] . '"', '"' . $_SESSION['ENVELOPPE']['HORIZONTAL_MILIEU'] . '" selected', fabriquer_chaine_option(85, 115));
$options_horizontal_droite = str_replace('"' . $_SESSION['ENVELOPPE']['HORIZONTAL_DROITE'] . '"', '"' . $_SESSION['ENVELOPPE']['HORIZONTAL_DROITE'] . '" selected', fabriquer_chaine_option(15, 25));
$options_vertical_haut = str_replace('"' . $_SESSION['ENVELOPPE']['VERTICAL_HAUT'] . '"', '"' . $_SESSION['ENVELOPPE']['VERTICAL_HAUT'] . '" selected', fabriquer_chaine_option(40, 60));
$options_vertical_milieu = str_replace('"' . $_SESSION['ENVELOPPE']['VERTICAL_MILIEU'] . '"', '"' . $_SESSION['ENVELOPPE']['VERTICAL_MILIEU'] . '" selected', fabriquer_chaine_option(35, 55));
$options_vertical_bas = str_replace('"' . $_SESSION['ENVELOPPE']['VERTICAL_BAS'] . '"', '"' . $_SESSION['ENVELOPPE']['VERTICAL_BAS'] . '" selected', fabriquer_chaine_option(15, 25));
// Formulaire avec la liste des directeurs et professeurs
$select_user = HtmlForm::afficher_select(DB_STRUCTURE_COMMUN::DB_OPT_professeurs_directeurs_etabl(1), 'f_user', 'tampon_structure', FALSE, 'profs_directeurs');
// Récupérer les signatures existantes, dont le tampon de l'établissement.
$li_signatures = '';
$DB_TAB = DB_STRUCTURE_IMAGE::DB_lister_signatures_avec_identite();
foreach ($DB_TAB as $DB_ROW) {
    // Enregistrer temporairement le fichier sur le disque
    $texte = $DB_ROW['user_id'] ? 'Signature ' . $DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] : 'Tampon de l\'établissement';
    $fichier_nom = 'signature_' . $_SESSION['BASE'] . '_' . $DB_ROW['user_id'] . '_' . fabriquer_fin_nom_fichier__date_et_alea() . '.' . $DB_ROW['image_format'];
    FileSystem::ecrire_fichier(CHEMIN_DOSSIER_EXPORT . $fichier_nom, base64_decode($DB_ROW['image_contenu']));
    // Générer la balise html pour afficher l'image
    list($width, $height) = dimensions_affichage_image($DB_ROW['image_largeur'], $DB_ROW['image_hauteur'], 200, 200);
    $li_signatures .= '<li id="sgn_' . $DB_ROW['user_id'] . '">' . html($texte) . ' : <img src="' . URL_DIR_EXPORT . $fichier_nom . '" alt="' . html($texte) . '" width="' . $width . '" height="' . $height . '" /><q class="supprimer" title="Supprimer cette image (aucune confirmation ne sera demandée)."></q></li>';
}
$li_signatures = $li_signatures ? $li_signatures : '<li id="sgn_none">Aucun fichier image trouvé !</li>';
?>
 * Logiciel placé sous la licence libre Affero GPL 3 <https://www.gnu.org/licenses/agpl-3.0.html>.
 * ****************************************************************************************************
 * 
 * Ce fichier est une partie de SACoche.
 * 
 * SACoche est un logiciel libre ; vous pouvez le redistribuer ou le modifier suivant les termes 
 * de la “GNU Affero General Public License” telle que publiée par la Free Software Foundation :
 * soit la version 3 de cette licence, soit (à votre gré) toute version ultérieure.
 * 
 * SACoche est distribué dans l’espoir qu’il vous sera utile, mais SANS AUCUNE GARANTIE :
 * sans même la garantie implicite de COMMERCIALISABILITÉ ni d’ADÉQUATION À UN OBJECTIF PARTICULIER.
 * Consultez la Licence Publique Générale GNU Affero pour plus de détails.
 * 
 * Vous devriez avoir reçu une copie de la Licence Publique Générale GNU Affero avec SACoche ;
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */
// Mettre à jour l'élément de formulaire "select_professeurs" et le renvoyer en HTML
if (!defined('SACoche')) {
    exit('Ce fichier ne peut être appelé directement !');
}
if ($_SESSION['SESAMATH_ID'] == ID_DEMO) {
}
$statut = isset($_POST['f_statut']) ? Clean::entier($_POST['f_statut']) : 0;
$selection = empty($_POST['f_selection']) ? FALSE : TRUE;
$multiple = empty($_POST['f_multiple']) ? FALSE : TRUE;
// Autres valeurs à récupérer ou à définir.
$select_nom = $multiple ? 'f_user' : FALSE;
$option_first = $multiple ? FALSE : '';
exit(HtmlForm::afficher_select(DB_STRUCTURE_COMMUN::DB_OPT_professeurs_directeurs_etabl($statut), $select_nom, $option_first, $selection, 'profs_directeurs', $multiple));
Example #4
0
 /**
  * Retourner, sur une ou plusieurs colonnes, une liste HTML ordonnée des professeurs, avec un formulaire de choix d'un attribut pour chacun.
  *
  * @param string  $only_profs
  * @param array   $tab_options
  * @return string
  */
 public static function afficher_select_collegues($only_profs, $tab_options)
 {
     $affichage = '';
     // Affichage de la liste des professeurs
     $DB_TAB = $only_profs ? DB_STRUCTURE_COMMUN::DB_OPT_professeurs_etabl() : DB_STRUCTURE_COMMUN::DB_OPT_professeurs_directeurs_etabl(1);
     if (is_string($DB_TAB)) {
         echo $DB_TAB;
     } else {
         $nb_profs = !empty($DB_TAB) ? count($DB_TAB) : 0;
         $nb_profs_maxi_par_col = 20;
         $nb_cols = floor(($nb_profs - 1) / $nb_profs_maxi_par_col) + 1;
         $nb_profs_par_col = ceil($nb_profs / $nb_cols);
         $tab_div = array_fill(0, $nb_cols, '');
         $select_options = '<option value="x">0</option>';
         foreach ($tab_options as $option_texte => $option_value) {
             $select_options .= '<option value="' . $option_value . '">' . $option_texte . '</option>';
         }
         foreach ($DB_TAB as $i => $DB_ROW) {
             if ($DB_ROW['valeur'] != $_SESSION['USER_ID']) {
                 $tab_div[floor($i / $nb_profs_par_col)] .= '<select id="p_' . $DB_ROW['valeur'] . '" name="p_' . $DB_ROW['valeur'] . '" class="t9">' . $select_options . '</select><span class="select_img droit_x">&nbsp;</span><label>' . html($DB_ROW['texte']) . '</label><br />';
             } else {
                 $tab_div[floor($i / $nb_profs_par_col)] .= '<select id="p_' . $DB_ROW['valeur'] . '" name="p_' . $DB_ROW['valeur'] . '" class="t9" disabled><option value="z">4</option></select><span class="droit_z">&nbsp;</span><label>' . html($DB_ROW['texte']) . '</label><br />';
             }
         }
         $affichage .= '<p class="hc">Choisir <label for="p_0_x"><input type="radio" name="prof_check_all" id="p_0_x" value="x" /><span class="select_img droit_x">&nbsp;</span></label>';
         foreach ($tab_options as $option_value) {
             $affichage .= ' ou <label for="p_0_' . $option_value . '"><input type="radio" name="prof_check_all" id="p_0_' . $option_value . '" value="' . $option_value . '" /><span class="select_img droit_' . $option_value . '">&nbsp;</span></label>';
         }
         $affichage .= ' pour tout le monde.</p>' . NL;
         $affichage .= '<div class="prof_liste">' . implode('</div>' . NL . '<div class="prof_liste">', $tab_div) . '</div>' . NL;
     }
     return $affichage;
 }
  for( $i=$mini ; $i<=$maxi ; $i++ )
  {
    $options .= '<option value="'.$i.'">'.number_format($i/10,1,',','').'cm</option>';
  }
  return $options;
}

$options_horizontal_gauche = str_replace( '"'.$_SESSION['ENVELOPPE']['HORIZONTAL_GAUCHE'].'"' , '"'.$_SESSION['ENVELOPPE']['HORIZONTAL_GAUCHE'].'" selected' , fabriquer_chaine_option(90,120) );
$options_horizontal_milieu = str_replace( '"'.$_SESSION['ENVELOPPE']['HORIZONTAL_MILIEU'].'"' , '"'.$_SESSION['ENVELOPPE']['HORIZONTAL_MILIEU'].'" selected' , fabriquer_chaine_option(85,115) );
$options_horizontal_droite = str_replace( '"'.$_SESSION['ENVELOPPE']['HORIZONTAL_DROITE'].'"' , '"'.$_SESSION['ENVELOPPE']['HORIZONTAL_DROITE'].'" selected' , fabriquer_chaine_option(15,25) );
$options_vertical_haut     = str_replace( '"'.$_SESSION['ENVELOPPE']['VERTICAL_HAUT']    .'"' , '"'.$_SESSION['ENVELOPPE']['VERTICAL_HAUT']    .'" selected' , fabriquer_chaine_option(40,60) );
$options_vertical_milieu   = str_replace( '"'.$_SESSION['ENVELOPPE']['VERTICAL_MILIEU']  .'"' , '"'.$_SESSION['ENVELOPPE']['VERTICAL_MILIEU']  .'" selected' , fabriquer_chaine_option(35,55) );
$options_vertical_bas      = str_replace( '"'.$_SESSION['ENVELOPPE']['VERTICAL_BAS']     .'"' , '"'.$_SESSION['ENVELOPPE']['VERTICAL_BAS']     .'" selected' , fabriquer_chaine_option(15,25) );

// Formulaire avec la liste des directeurs et professeurs
$select_user = HtmlForm::afficher_select(DB_STRUCTURE_COMMUN::DB_OPT_professeurs_directeurs_etabl( 1 /*statut*/) , 'f_user' /*select_nom*/ , 'tampon_structure' /*option_first*/ , FALSE /*selection*/ , 'profs_directeurs' /*optgroup*/ );

// Récupérer les signatures existantes, dont le tampon de l'établissement.
$li_signatures = '';
$DB_TAB = DB_STRUCTURE_IMAGE::DB_lister_signatures_avec_identite();
foreach($DB_TAB as $DB_ROW)
{
  // Enregistrer temporairement le fichier sur le disque
  $texte = ($DB_ROW['user_id']) ? 'Signature '.$DB_ROW['user_nom'].' '.$DB_ROW['user_prenom'] : 'Tampon de l\'établissement' ;
  $fichier_nom = 'signature_'.$_SESSION['BASE'].'_'.$DB_ROW['user_id'].'_'.fabriquer_fin_nom_fichier__date_et_alea().'.'.$DB_ROW['image_format'];
  FileSystem::ecrire_fichier( CHEMIN_DOSSIER_EXPORT.$fichier_nom , base64_decode($DB_ROW['image_contenu']) );
  // Générer la balise html pour afficher l'image
  list($width,$height) = dimensions_affichage_image( $DB_ROW['image_largeur'] , $DB_ROW['image_hauteur'] , 200 /*largeur_maxi*/ , 200 /*hauteur_maxi*/ );
  $li_signatures .= '<li id="sgn_'.$DB_ROW['user_id'].'">'.html($texte).' : <img src="'.URL_DIR_EXPORT.$fichier_nom.'" alt="'.html($texte).'" width="'.$width.'" height="'.$height.'" /><q class="supprimer" title="Supprimer cette image (aucune confirmation ne sera demandée)."></q></li>';
}
$li_signatures = ($li_signatures) ? $li_signatures : '<li id="sgn_none">Aucun fichier image trouvé !</li>' ;