コード例 #1
0
  private function traite_evolution_roles($filtres_roles=Null,$filtres_categories=Null,$filtres_mesures=Null,$filtres_sanctions=Null) {
    $this->liste_roles=$this->objet_filtre->get_liste_roles();
    //on cree la liste type
    if($filtres_roles) {
      $this->filtres_roles=$this->objet_filtre->get_roles_selected();
      foreach($this->filtres_roles as $role) {
        $this->liste_type[]=$role;
      }
    } else {
      foreach($this->liste_roles as $role) {
        $this->liste_type[]=$role->qualite;
      }
      $this->liste_type[]='Non défini';
    }

    //On traite mois par mois
    foreach($this->months as $key=>$month) {
      $this->objet_incident= new ClassIncidents();
      $this->data_months=Gepi_Date::get_begin_end_month($key);
      $this->objet_incident->traite_incidents_criteres(Gepi_Date::format_date_fr_iso($this->data_months['du']),Gepi_Date::format_date_fr_iso( $this->data_months['au']), $filtres_categories,$filtres_mesures,$filtres_sanctions,$filtres_roles);
      $this->incidents_mois=$this->objet_incident->get_incidents();
      $this->protagonistes_mois=$this->objet_incident->get_protagonistes();

      foreach( $this->incidents_mois as $selection=>$incidents) {
        //on met les compteurs à 0
        foreach($this->liste_type as $role) {
          $this->evolution[$selection][$role][$key]=0;
          if(!isset($this->totaux_par_type[$selection][$role])) $this->totaux_par_type[$selection][$role]=0;
          $this->totaux_par_mois[$selection][$key]=0;
          if(!isset($this->total_general[$selection])) $this->total_general[$selection]=0;
        }
        //On compte les incidents du mois et le total global
        foreach($incidents as $titre=>$incident) {
          if($titre!='error') {
            if(isset($this->protagonistes_mois[$incident->id_incident])) {
              foreach($this->protagonistes_mois[$incident->id_incident] as $protagoniste) {
                if ($protagoniste->qualite =='')$protagoniste->qualite='Non défini';
                //si le type n'est pas initialisée on le fait
                if(!in_array($protagoniste->qualite,$this->liste_type)) {
                  foreach($this->months as $key2=>$month2) {
                    $this->evolution[$selection][$protagoniste->qualite][$key2]=0;
                  }
                  $this->totaux_par_type[$selection][$protagoniste->qualite]=0;
                  $this->liste_type[]=$protagoniste->qualite;
                }
                if($selection !='L\'Etablissement' && $selection !='Tous les élèves'&& $selection !='Tous les personnels' && !is_null($_SESSION['stats_classes_selected'])) {
                     //on a une classe ou un eleve
                    if($this->is_classe($selection)){
                       if(!$this->is_in_classe($protagoniste->login, $selection)){
                         break;  //le rôle ne correspond pas à un eleve de la classe
                       }
                    }else{
                        //on a un eleve on verifie si le rôle est à lui
                        if($protagoniste->login!=$selection)break;
                    }
                  }
                $this->evolution[$selection][$protagoniste->qualite][$key]+=1;
                $this->totaux_par_type[$selection][$protagoniste->qualite]+=1;
                $this->totaux_par_mois[$selection][$key]+=1;
                $this->total_general[$selection]+=1;
              }
            }
          }
        }
      }
    }
    $this->infos_individus=$this->objet_incident->get_infos_individus();
  }
コード例 #2
0
ファイル: Modele.Incidents.php プロジェクト: rhertzog/lcs
  private function get_db_nbre_total_sanctions($liste=Null) {

    $this->sql='SELECT COUNT(san.id_sanction) from s_sanctions san 
        INNER JOIN s_incidents sin  ON  san.id_incident=sin.id_incident
        INNER JOIN s_protagonistes spr ON (spr.id_incident=san.id_incident AND spr.login=san.login)
        WHERE sin.date BETWEEN \''.Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['du']).
            '\' AND \''.Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['au']).'\'  ';
    if($liste)$this->sql.=" AND sin.id_incident IN ('".parent::make_list_for_request_in($liste)."')";
    //$this->sql.=" OR sin.id_incident is null"; (je pense que les sanctions ne sont pas supprimées)
    return(mysqli_fetch_row($this->res=mysqli_query($GLOBALS["mysqli"], $this->sql)));
  }
コード例 #3
0
ファイル: SelectCtrl.php プロジェクト: rhertzog/lcs
 private function get_debut_fin_periode($num) {
   foreach($this->periodes_calendrier as $value) {
     if ($value['id_calendrier']==$num) {
       return Array('periode'=>$num,'du'=>Gepi_Date::format_date_iso_fr($value['jourdebut_calendrier']),
               'au'=>Gepi_Date::format_date_iso_fr($value['jourfin_calendrier']));
     }
   }
 }
コード例 #4
0
ファイル: Class.Incidents.php プロジェクト: rhertzog/lcs
 private function traite_donnees_sanctions($tableau_sanctions) {
     foreach ($tableau_sanctions as $id_incident) {
         foreach ($id_incident as $id_sanction) {
             foreach ($id_sanction as $protagoniste) {
                 if ($protagoniste->nature == 'Exclusion') {
                     $this->crenaux = $this->modele_incidents->get_crenaux();
                     if (is_null($this->crenaux) || (!isset($this->crenaux[$protagoniste->exc_heure_debut]) && !isset($this->crenaux[$protagoniste->exc_heure_fin]))) {
                         $date_debut_ex = "08:00:00";
                         $date_fin_ex = "18:00:00";
                     } else if (!isset($this->crenaux[$protagoniste->exc_heure_debut])) {
                         $date_debut_ex = "08:00:00";
                         $date_fin_ex = $this->crenaux[$protagoniste->exc_heure_fin]->heurefin_definie_periode;
                     } else if (!isset($this->crenaux[$protagoniste->exc_heure_fin])) {
                         $date_debut_ex = $this->crenaux[$protagoniste->exc_heure_debut]->heuredebut_definie_periode;
                         $date_fin_ex = "18:00:00";
                     } else {
                         $date_debut_ex = $this->crenaux[$protagoniste->exc_heure_debut]->heuredebut_definie_periode;
                         $date_fin_ex = $this->crenaux[$protagoniste->exc_heure_fin]->heurefin_definie_periode;
                     }
                     $protagoniste->exc_duree = Gepi_Date::calcule_duree_exclusion($protagoniste->exc_date_debut, $date_debut_ex, $protagoniste->exc_date_fin, $date_fin_ex);
                 }
                 if (!is_null($protagoniste->ret_date))
                     $protagoniste->ret_date = $this->traite_date_tableau($protagoniste->ret_date);
                 if (!is_null($protagoniste->exc_date_debut))
                     $protagoniste->exc_date_debut = $this->traite_date_tableau($protagoniste->exc_date_debut);
                 if (!is_null($protagoniste->exc_date_fin))
                     $protagoniste->exc_date_fin = $this->traite_date_tableau($protagoniste->exc_date_fin);
                 if (!is_null($protagoniste->trv_date_retour))
                     $protagoniste->trv_date_retour = $this->traite_date_tableau($protagoniste->trv_date_retour);
             }
         }
     }
     return $tableau_sanctions;
 }
コード例 #5
0
ファイル: BilansCtrl.php プロジェクト: rhertzog/lcs
 public function top() {
   try {
     $this->teste_selection();
     $this->action_from='top';
     $this->vue->setVar('action_from',$this->action_from);
     $this->affichage_etab=isset($_SESSION['etab_all'])? $_SESSION['etab_all']:null ;
     $this->traite_filtres();
     $this->objet_incidents= new ClassIncidents();
     $this->top_incidents=$this->objet_incidents->get_top_incidents(Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['du']),Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['au']),$this->filtres_categories,$this->filtres_mesures,$this->filtres_sanctions,$this->filtres_roles);
     $this->vue->setVar('top_incidents', $this->top_incidents);
     $this->top_sanctions=$this->objet_incidents->get_top_sanctions(Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['du']),Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['au']),$this->filtres_categories,$this->filtres_mesures,$this->filtres_sanctions,$this->filtres_roles);
     $this->vue->setVar('top_sanctions', $this->top_sanctions);
     $this->top_retenues=$this->objet_incidents->get_top_retenues(Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['du']),Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['au']),$this->filtres_categories,$this->filtres_mesures,$this->filtres_sanctions,$this->filtres_roles);
     $this->vue->setVar('top_retenues', $this->top_retenues);
     $this->top_exclusions=$this->objet_incidents->get_top_exclusions(Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['du']),Gepi_Date::format_date_fr_iso($_SESSION['stats_periodes']['au']),$this->filtres_categories,$this->filtres_mesures,$this->filtres_sanctions,$this->filtres_roles);
     $this->vue->setVar('top_exclusions', $this->top_exclusions);
     $this->vue->afficheVue('top.php',$this->vue->getVars());
     //echo"<script type='text/javascript'>inittab();</script>";
   }
   catch (Exception $e) {
     echo 'Exception reçue : ',  $e->getMessage(), "\n";
   }
 }