Exemplo n.º 1
0
 public function projects()
 {
     parent::view("shared/header");
     parent::view("advisor/menu");
     parent::model("projects");
     $projects = new projects();
     $data['projects'] = $projects->ShowProjectByStatus(1);
     //Récupère les informations des compagnies reliées aux projets acceptés
     parent::model("business");
     $model = new business();
     if ($data['projects'] != null) {
         foreach ($data['projects'] as $project) {
             //Obtenir les informations de l'entreprise.
             $data['cieP'][$project->businessID] = $model->ShowCieByID($project->businessID);
         }
     }
     parent::view("advisor/projects", $data);
     parent::view("shared/footer");
 }
Exemplo n.º 2
0
 public function index()
 {
     parent::view("shared/header");
     parent::view("intern/menu");
     //Si l'usager à envoyer une évaluation, l'enregistrer
     if (isset($_POST['id'])) {
         parent::model("ratings");
         $rating = new ratings();
         $rating->RatingProject($_SESSION['ID'], $_POST['id'], $_POST['rating']);
     }
     parent::model("projects");
     $model = new projects();
     //Obtenir le projet assigné.
     $data['project'] = $model->ShowProjectByIntern($_SESSION['ID']);
     //Sinon obtenir tous les projets.
     if ($data['project'] == null) {
         $data['projects'] = $model->ShowProjectByStatus(1);
         parent::model("business");
         $model = new business();
         parent::model("ratings");
         $rating = new ratings();
         if ($data['projects'] != null) {
             foreach ($data['projects'] as $project) {
                 //Obtenir les informations de l'entreprise.
                 $data['cie'][$project->businessID] = $model->ShowCieByID($project->businessID);
                 //Obtenir le rating.
                 $data['ratings'][$project->ID] = $rating->FindRateByID($_SESSION['ID'], $project->ID);
             }
         }
         parent::view("intern/list", $data);
     } else {
         parent::model("business");
         $model = new business();
         //Obtenir les informations de l'entreprise.
         $data['cie'][$data['project']->ID] = $model->ShowCieByID($data['project']->businessID);
         parent::view("intern/index", $data);
     }
     parent::view("shared/footer");
 }