/** * @param $eleve * @param $trimestre */ function afficheDomaine($eleve, $trimestre, $idMatiere) { $Domaines = DomaineCpt::getByMatiere($idMatiere); if (count($Domaines) > 0) { foreach ($Domaines as $domaine) { echo '<tr> <td colspan="3"></td> <td class="domaine" colspan="2">' . $domaine->getLibelleDomaineCpt() . '</td> <td class="nivCpt"></td> <td class="nivCpt"></td> <td class="nivCpt"></td> <td class="nivCpt"></td> </tr>'; $pointCpts = PointCpt::getByDomaineCpt($domaine->getIdDomaineCpt()); foreach ($pointCpts as $ptCpt) { //$idPointCpt, $idEleve, $idTrimestre $EPT = PointCptEleve::getById($ptCpt->getIdPointCpt(), $eleve->getIdUtilisateur(), $trimestre->getIdTrimestre()); //echo '<tr><td colspan="5"></td><td>'.$EPT->getIdEleve().'</td>'.niveauCpt(0).'</tr>'; if (!is_null($EPT->getIdNiveauCpt())) { echo '<tr> <td colspan="4"></td> <td class="pCpt">' . $EPT->getPointCpt()->getLibellePointCpt() . '</td>'; niveauCpt($EPT->getIdNiveauCpt()); echo '</tr>'; } } } } }
public function getDomaineCpt() { return DomaineCpt::getById($this->getIdDomaineCpt()); }
case 'getListe': $return = array(); $idEval = $_GET['idEvaluation']; $pointsCpt = PointCpt::getByEvaluation($idEval); foreach ($pointsCpt as $pointCpt){ $tmp = array(); $tmp['pointCpt'] = $pointCpt->toArray(); $tmp['domaineCpt'] = $pointCpt->getDomaineCpt()->toArray(); $return[] = $tmp; $tmp = array(); } echo json_encode($return); break; case 'getAllDomaineCpt': $domaines = DomaineCpt::getAll(); $return = array(); foreach ($domaines as $domaine){ $return[] = $domaine->toArray(); } echo json_encode($return); break; } } function majEvalCompetence($idEval, $idPoint){ $evalPoint = EvaluationPointCpt::getByEvalPoint($idEval, $idPoint); if (!$evalPoint->getIdEvaluationPointCpt()){ $evalPoint->setIdEvaluation($idEval); $evalPoint->setIdPointCpt($idPoint); $evalPoint->insert();
$ligne .= '<td>'.$elevePointCpt->getNiveauCpt()->getCodeNiveauCpt().'</td>'; else $ligne .= '<td></td>'; } $nbCpt--; $ligne .= '</tr>'; $return[] = $ligne; } echo json_encode($return); break; } }elseif ($_POST['action']) { switch ($_POST['action']){ case 'insertDomaine': $return = new DomaineCpt(); $return->setLibelleDomaineCpt($_POST['libDomaineCpt']); $matiereNiveau = MatiereNiveau::getByMatiereNiveau($_POST['idMatiere'], $_POST['idNiveau']); $return->setIdMatiere($matiereNiveau->getIdMatiereNiveau()); if(!$return->exist()) $return->insert(); echo json_encode($return->toArray()); break; case 'insertCompetence': $return = new PointCpt(); $return->setLibellePointCpt($_POST['libPointCpt']); $return->setIdDomaineCpt($_POST['idDomaineCpt']); if (!$return->exist()) $return->insert(); echo json_encode($return->toArray()); break;
</tr> </table> </fieldset> <fieldset> <legend>gestion des compétences</legend> <table> <tr> <td rowspan="2">Domaine</td> <td><input type="text" id="txtDomaine" ></td> </tr> <tr> <td> <select id="selectDomaine"> <option value=""></option> <?php $domaines = DomaineCpt::getByMatiere($evaluation->getMatiereNiveau()->getIdMatiere()); foreach ($domaines as $domaine){ echo "<option value='".$domaine->getIdDomaineCpt()."'>".$domaine->getLibelleDomaineCpt()."</option>"; } ?> </select> </td> </tr> <tr> <td rowspan="2">Compétence</td> <td><input type="text" id="txtCpt"></td> </tr> <tr> <td> <select id="selectCpt" name="selectCpt"> <option value=""></option>