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')); $bulletin->update(); } echo json_encode($bulletin->toArray()); break; case 'addNivCpt' : //idEleve: idEleve, idTrimestre:idTrimestre, idPtCpt: idPtCpt, idNivCpt: idNivCpt, action: 'addNivCpt' $pointCptEleve = PointCptEleve::getById($_GET['idPtCpt'], $_GET['idEleve'], $_GET['idTrimestre']);