<?php /** * Created by PhpStorm. * User: Jean-Baptiste * Date: 03/12/2015 * Time: 21:31 */ require_once '../Require/Objects.php'; $idTrimestre = $_POST['idTrimestre']; $idEleve = $_POST['idEleve']; $trimestre = Trimestre::getById($idTrimestre); $eleve = Eleve::getById($idEleve); function afficheNote($maxEval, $note) { $laNote = number_format($note, 2, ',', ' '); switch ($maxEval) { case 10: echo ' <td class="Evaluation nivCpt">' . $laNote . '</td> <td class="Evaluation nivCpt"></td>'; break; case 20: echo ' <td class="Evaluation nivCpt"></td> <td class="Evaluation nivCpt">' . $laNote . '</td>'; break; default: echo ' <td class="Evaluation nivCpt"></td> <td class="Evaluation nivCpt"></td>';
$trimestre = Trimestre::getById($_GET['idTrimestre']); $matiereNiveau = MatiereNiveau::getByMatiereNiveau($_GET['idMatiere'], $_GET['idNiveau']); $eleve = Eleve::getById($_GET['idEleve']); $bulletin = Bulletin::getByEleveMatiereNiveauTrimestre($eleve->getIdEleve(), $matiereNiveau->getIdMatiereNiveau(), $trimestre->getIdTrimestre()); if (!$bulletin->getIdBulletin()){ $ret = array(); $ret['contenuBulletin'] = ''; $ret['idBulletin'] = ''; echo json_encode($ret); break; } echo json_encode($bulletin->toArray()); break; case 'addCommentaire': //idEleve: idEleve, idMatiere: idMatiere, idNiveau: idNiveau, idTrimestre:idTrimestre, idBulletin: idBulletin, commBulletin: commBulletin, action: 'addCommentaire' $trimestre = Trimestre::getById($_GET['idTrimestre']); $matiereNiveau = MatiereNiveau::getByMatiereNiveau($_GET['idMatiere'], $_GET['idNiveau']); $eleve = Eleve::getById($_GET['idEleve']); $bulletin = new Bulletin(); if ($_GET['idBulletin'] == 0){ $bulletin->setIdEleve($eleve->getIdUtilisateur()); $bulletin->setIdMatiereNiveau($matiereNiveau->getIdMatiereNiveau()); $bulletin->setContenuBulletin($_GET['commBulletin']); $bulletin->setDateRedacton(date('Y-m-d')); $bulletin->insert(); } else { $bulletin = Bulletin::getById($_GET['idBulletin']); $bulletin->setContenuBulletin($_GET['commBulletin']); //$bulletin->setDateRedacton(date('Y-m-d'));
public function getTrimestre(){ return Trimestre::getById($this->getIdTrimestre()); }
switch ($_GET['action']) { case 'CarnetLiaison' : echo json_encode(CarnetLiaison::getById($_GET['idCarnetLiaison'])->toArray()); break; case 'Evaluation': echo json_encode(Evaluation::getById($_GET['idEvaluation'])->toArray()); break; case 'Matiere' : echo json_encode(Matiere::getById($_GET['idMatiere'])->toArray()); break; case 'Module' : echo json_encode(Module::getById($_GET['idModule'])->toArray()); break; case 'Niveau' : echo json_encode(Niveau::getById($_GET['idNiveau'])->toArray()); break; case 'NiveauCpt' : echo json_encode(NiveauCpt::getById($_GET['idNiveauCpt'])->toArray()); break; case 'Periode': echo json_encode(Periode::getById($_GET['idPeriode'])->toArray()); break; case 'Trimestre': echo json_encode(Trimestre::getById($_GET['idTrimestre'])->toArray()); break; case 'Utilisateur' : echo json_encode(Utilisateur::getById($_GET['idUtilisateur'])->toArray()); break; }
header('content-type: text/html; charset=utf-8'); session_start(); require_once '../Require/Objects.php'; $utilisateur = new Utilisateur(); if (isset($_SESSION['id'])) { $utilisateur = Utilisateur::getById($_SESSION['id']); if (!$utilisateur->estAdministrateur()) { header('location: ../Intranet/mesInformations.php'); } } else { header('location: ../Intranet/connexion.php'); } if (isset($_POST['btSubmit'])) { $trimestre = new Trimestre(); if (!empty($_POST['idTrimestre'])) $trimestre = Trimestre::getById($_POST['idTrimestre']); if (!empty(trim($_POST['dateDebutTrimestre']))) $trimestre->setDateDebutTrimestre(trim($_POST['dateDebutTrimestre'])); if (!empty(trim($_POST['dateFinTrimestre']))) $trimestre->setDateFinTrimestre(trim($_POST['dateFinTrimestre'])); if (!empty(trim($_POST['dateFinCommentaire']))) $trimestre->setDateFinCommentaire(trim($_POST['dateFinCommentaire'])); if (!empty(trim($_POST['libelleTrimestre']))) $trimestre->setLibelleTrimestre($_POST['libelleTrimestre']); if (!empty(trim($trimestre->getLibelleTrimestre()))) if (empty($trimestre->getIdTrimestre())) { if (!empty(trim($trimestre->getLibelleTrimestre()))) $trimestre->insert(); } else $trimestre->update(); }