Exemple #1
0
 function __toString()
 {
     $listeProfsString = '';
     $tab_p = $this->getProfsCours();
     for ($i = 0; $i < count($tab_p); $i++) {
         $profEnQuestion = ModelProf::getProfByNumeroProf($tab_p[$i][0]);
         $listeProfsString = $listeProfsString . $profEnQuestion->getNomProf() . "; ";
     }
     $s = 'Cours de ' . $this->matiereCours . '(' . $this->typeCours . ') par ' . $listeProfsString . ' ' . $this->prixCours . '€ ' . '</br>';
     return $s;
 }
Exemple #2
0
                $erreur = "Modification impossible : pas de prof lié a la modification.";
            }
        } else {
            $title = "Droit non accordés";
            $view = "viewCoursUnadmin";
        }
        break;
        //quand on a modifié un Prof
    //quand on a modifié un Prof
    case "modified":
        if ($typeUtilisateur == 'admin') {
            // on verifie qu'on est bien admin
            $nomProf = $_POST["nomProf"];
            //on recupere les param
            $prenomProf = $_POST["prenomProf"];
            ModelProf::modifyProf($numero_p, $nomProf, $prenomProf);
            // on modifie le profs avec les paras
            $title = "Ajout réussi";
            $view = "viewModifiedProf";
        } else {
            $title = "Droit non accordés";
            $view = "viewUnadmin";
        }
        break;
        //par defaut, si il y a une erreur dans le passage de l'url, ou si quelqu'un s'amuse a chercher en tatonnant, etc
    //par defaut, si il y a une erreur dans le passage de l'url, ou si quelqu'un s'amuse a chercher en tatonnant, etc
    default:
        $action = 'Erreur 404';
        $view = "view404";
}
require "{$ROOT}{$DS}view{$DS}prof{$DS}view.php";
Exemple #3
0
<?php

if (isset($_SESSION['typeUtilisateur']) && $_SESSION['typeUtilisateur']) {
    echo '<p><a href = "index.php?controller=cours&action=create">Ajouter un cours</a></p></br>';
}
foreach ($tab_c as $c) {
    $tab_p = $c->getProfsCours();
    $listeProfsString = '';
    for ($i = 0; $i < count($tab_p); $i++) {
        $profEnQuestion = ModelProf::getProfByNumeroProf($tab_p[$i][0]);
        $listeProfsString = $listeProfsString . $profEnQuestion->getNomProf() . "; ";
    }
    echo '<p> <a href="index.php?controller=cours&action=view&numeroCours=' . $c->getNumeroCours() . '"> Cours de ' . $c->getMatiereCours() . ' (' . $c->getSujetCours() . ') par ' . $listeProfsString . '</a></p>';
}
Exemple #4
0
     if ($typeUtilisateur == 'admin') {
         // si on est bien admin
         if (isset($_POST["listeProf"]) && count($_POST["listeProf"]) > 0) {
             // et qu'on a au moins un prof
             $matiereCours = $_POST["matiereCours"];
             //on affecte tout les parametres
             $sujetCours = $_POST["sujetCours"];
             $typeCours = $_POST["typeCours"];
             $prixCours = $_POST["prixCours"];
             ModelCours::modifyCours($numero_c, $matiereCours, $sujetCours, $typeCours, $prixCours);
             // on update le cours
             ModelProf::viderCours($numero_c);
             // on reset le cours dans participe (pour faciliter la gestion des profs, on supprime tout, et on réaffecte tout les nouveaux profs)
             foreach ($_POST["listeProf"] as $numP) {
                 // pour chaque prof qui y participe, on l'ajoute dans la table avec le cours en question
                 ModelProf::getProfByNumeroProf($numP)->insertParticipe($numero_c);
             }
             $title = "Ajout réussi";
             $view = "viewModifiedCours";
         } else {
             $title = "Modification impossible";
             $view = "viewModifyFail";
             $erreur = "Modification impossible : il faut au moins un prof.";
         }
     } else {
         $title = "Droit non accordés";
         $view = "viewUnadmin";
     }
     break;
     //par defaut, si il y a une erreur dans le passage de l'url, ou si quelqu'un s'amuse a chercher en tatonnant, etc
 //par defaut, si il y a une erreur dans le passage de l'url, ou si quelqu'un s'amuse a chercher en tatonnant, etc