<?php $eleves = Eleve::getAllActif(); foreach ($eleves as $eleve){ echo "<option value='".$eleve->getIdEleve()."'>".$eleve->getLibelleUtilisatur().'</option>'; } ?> </select> </td> </tr> <tr> <td>Niveau : </td> <td> <select id="selectNiveau"> <option value=""></option> <?php $niveaux = Niveau::getAll(); foreach ($niveaux as $niv){ //$niv = new Niveau(); echo '<option value="'.$niv->getIdNiveau().'">'.$niv->getLibelleNiveau().'</option>'; } ?> </select> </td> </tr> <tr> <td>Matière : </td> <td> <select id="selectMatiere"> <option value=""></option> </select> </td>
public function getNiveau(){ return Niveau::getById($this->getIdNiveau()); }
function lvlUp($id_avatar) { $test = true; $niveau = new Niveau(); $avatar = new Avatar(); $avatar = $avatar->findById($id_avatar); $classe = new Classe(); $classe = $classe->findById($avatar->id_classe); $up_hp = $classe->hp_classe; $up_mp = $classe->mp_classe; $up_att = $classe->att_classe; $up_def = $classe->def_classe; $up_attS = $classe->attsp_classe; $up_defS = $classe->defsp_classe; $up_vit = $classe->vit_classe; while ($test) { $lvup = $niveau->getNextLvlExp($avatar->id_niveau); if ($lvup && $avatar->exp_avatar >= $lvup) { $data = array('id_niveau' => $avatar->id_niveau + 1, 'hpmax_avatar' => $avatar->hpmax_avatar + $up_hp, 'mpmax_avatar' => $avatar->mpmax_avatar + $up_mp, 'att_avatar' => $avatar->att_avatar + $up_att, 'attsp_avatar' => $avatar->attsp_avatar + $up_attS, 'def_avatar' => $avatar->def_avatar + $up_def, 'defsp_avatar' => $avatar->defsp_avatar + $up_defS, 'vit_avatar' => $avatar->vit_avatar + $up_vit); $where = 'id_avatar = ' . $id_avatar; $avatar = new Avatar(); $avatar->update($data, $where); } else { $test = false; } $avatar = new Avatar(); $avatar = $avatar->findById($id_avatar); } }
foreach($pointsCpt as $pointCpt){ //$pointCpt = new PointCpt(); $return[] = "<option value='".$pointCpt->getIdPointCpt()."'>(".$pointCpt->getDomaineCpt()->getLibelleDomaineCpt().") ".$pointCpt->getLibellePointCpt()."</option>"; } echo json_encode($return); break; case 'getByEleveMatiereTrimestre': //idEleve: idEleve, idMatiere: idMatiere, idNiveau: idNiveau, idTrimestre:idTrimestre, action: 'getByEleveMatiereTrimestre // ?action=getByEleveMatiereTrimestre&idEleve=19&idMatiere=6&idTrimestre=1&isNiveau=2 $return = array(); $eleve=Eleve::getById($_GET['idEleve']); $matiere = Matiere::getById($_GET['idMatiere']); $niveau = Niveau::getById($_GET['idNiveau']); $matiereNiveau = MatiereNiveau::getByMatiereNiveau($matiere->getIdMatiere(), $niveau->getIdNiveau()); $trimestre = Trimestre::getById($_GET['idTrimestre']); $eleveEvalPointCpt = EleveEvaluationPointCpt::getByEleveMatiereTrimestre($eleve->getIdEleve(), $matiere->getIdMatiere(), $trimestre->getIdTrimestre()); foreach ($eleveEvalPointCpt as $EEPC){ //$EEPC = new EleveEvaluationPointCpt(); $tmp = array(); $tmp['libCpt'] = $EEPC->getEvaluationPointCpt()->getEvaluation()->getLibelleEvaluation(); $tmp['noteCpt'] = $EEPC->getNiveauCpt()->getCodeNiveauCpt(). ' (' .$EEPC->getNiveauCpt()->getLibelleNiveauCpt() . ')'; $return[] = $tmp; }
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; }