private function is_in_classe($login_ele,$classe){
  $test=false;
  $modele_select=new modele_select();
  $id_classe=$modele_select->get_id_from_classe($classe);
  $login_eleves=$modele_select->get_eleves_classe($id_classe);
  if(in_array($login_ele,$login_eleves)){
      $test=true;
  }
  return($test);
 }
示例#2
0
    private function traite_incidents($du, $au, $filtres_categories=Null, $filtres_mesures=Null, $filtres_sanctions=Null, $filtres_roles=Null) {

        $this->incidents_from_db['L\'Etablissement'] = $this->modele_incidents->get_incidents('etab_all', 'L\'Etablissement', $du, $au, Null, $filtres_categories, $filtres_mesures, $filtres_sanctions, $filtres_roles);
        if (!isset($this->incidents_from_db['L\'Etablissement']['error'])) {
            $this->liste_id_incidents_selected = $this->make_liste_id($this->incidents_from_db['L\'Etablissement']);
            $this->protagonistes_from_db = $this->modele_incidents->get_protagonistes($this->liste_id_incidents_selected);
            if(isset($this->protagonistes_from_db)) $this->liste_eleves_par_classe['L\'Etablissement'] = $this->make_liste_protagonistes($this->protagonistes_from_db, 'eleve',$this->array_id_incidents);
            $this->mesures_from_db = $this->modele_incidents->get_mesures($this->liste_id_incidents_selected);
            $this->sanctions_from_db = $this->modele_incidents->get_sanctions($this->liste_id_incidents_selected);
        }
        if (isset($_SESSION['eleve_all'])) {
            $this->incidents_from_db['Tous les élèves'] = $this->modele_incidents->get_incidents('eleves_all', 'Tous les élèves', $du, $au, Null, $filtres_categories, $filtres_mesures, $filtres_sanctions, $filtres_roles);
            if (!isset($this->incidents_from_db['Tous les élèves']['error'])) {
                $this->liste_id_incidents_selected = $this->make_liste_id($this->incidents_from_db['Tous les élèves']);
                $this->protagonistes_from_db = $this->modele_incidents->get_protagonistes($this->liste_id_incidents_selected);
                if(isset($this->protagonistes_from_db)) $this->liste_eleves_par_classe['Tous les élèves'] = $this->make_liste_protagonistes($this->protagonistes_from_db, 'eleve',$this->array_id_incidents);
                $this->mesures_from_db = $this->modele_incidents->get_mesures($this->liste_id_incidents_selected);
                $this->sanctions_from_db = $this->modele_incidents->get_sanctions($this->liste_id_incidents_selected);
            }
        }
        if (isset($_SESSION['pers_all'])) {
            $this->incidents_from_db['Tous les personnels'] = $this->modele_incidents->get_incidents('pers_all', 'Tous les personnels', $du, $au, Null, $filtres_categories, $filtres_mesures, $filtres_sanctions, $filtres_roles);
            if (!isset($this->incidents_from_db['Tous les personnels']['error'])) {
                $this->liste_id_incidents_selected = $this->make_liste_id($this->incidents_from_db['Tous les personnels']);
                $this->protagonistes_from_db = $this->modele_incidents->get_protagonistes($this->liste_id_incidents_selected);
                if(isset($this->protagonistes_from_db)) $this->liste_eleves_par_classe['Tous les personnels'] = $this->make_liste_protagonistes($this->protagonistes_from_db, 'eleve',$this->array_id_incidents);
                $this->mesures_from_db = $this->modele_incidents->get_mesures($this->liste_id_incidents_selected);
                $this->sanctions_from_db = $this->modele_incidents->get_sanctions($this->liste_id_incidents_selected);
            }
        }
        if (isset($_SESSION['stats_classes_selected'])) {
            foreach ($_SESSION['stats_classes_selected'] as $value) {
                if (isset($this->liste_eleves))
                    unset($this->liste_eleves);
                $this->liste_eleves[$value] = $this->modele_select->get_eleves_classe($value);
                $modele_select = new modele_select();
                $this->infos_classe = $modele_select->get_infos_classe($value);
                foreach ($this->liste_eleves as $this->classe) {
                    $this->liste_eleves_par_classe[$this->infos_classe[0]['classe']] = $this->classe;
                    $this->incidents_from_db[$this->infos_classe[0]['classe']] = $this->modele_incidents->get_incidents('classe', $this->infos_classe[0]['classe'], $du, $au, $this->modele->make_list_for_request_in($this->classe), $filtres_categories, $filtres_mesures, $filtres_sanctions, $filtres_roles);
                    if (!isset($this->incidents_from_db[$this->infos_classe[0]['classe']]['error'])) {
                        $this->liste_id_incidents_selected = $this->make_liste_id($this->incidents_from_db[$this->infos_classe[0]['classe']]);
                        $this->protagonistes_from_db = $this->modele_incidents->get_protagonistes($this->liste_id_incidents_selected);
                        $this->mesures_from_db = $this->modele_incidents->get_mesures($this->liste_id_incidents_selected);
                        $this->sanctions_from_db = $this->modele_incidents->get_sanctions($this->liste_id_incidents_selected);
                    }
                }
            }
        }
        if (isset($_SESSION['individus'])) {
            foreach ($_SESSION['individus'] as $value) {
                if ($value[1] == 'eleves')
                    $this->liste_eleves_par_classe[$value[0]][] = $value[0];
                $this->incidents_from_db[$value[0]] = $this->modele_incidents->get_incidents('individu', $value[0], $du, $au, $value[0], $filtres_categories, $filtres_mesures, $filtres_sanctions, $filtres_roles);
                if (!isset($this->incidents_from_db[$value[0]]['error'])) {
                    $this->liste_id_incidents_selected = $this->make_liste_id($this->incidents_from_db[$value[0]]);
                    $this->protagonistes_from_db = $this->modele_incidents->get_protagonistes($this->liste_id_incidents_selected);
                    $this->mesures_from_db = $this->modele_incidents->get_mesures($this->liste_id_incidents_selected);
                    $this->sanctions_from_db = $this->modele_incidents->get_sanctions($this->liste_id_incidents_selected);
                }
            }
        }
        if (isset($this->incidents_from_db))
            $this->incidents = $this->traite_donnees_incidents($this->incidents_from_db);
    }