当前位置: 首页>>代码示例>>PHP>>正文


PHP projects::ShowProjectByIntern方法代码示例

本文整理汇总了PHP中projects::ShowProjectByIntern方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::ShowProjectByIntern方法的具体用法?PHP projects::ShowProjectByIntern怎么用?PHP projects::ShowProjectByIntern使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在projects的用法示例。


在下文中一共展示了projects::ShowProjectByIntern方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 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");
 }
开发者ID:gragor3000,项目名称:Projet-Integrateur,代码行数:39,代码来源:intern.php

示例2: interview

 public function interview($_internID)
 {
     parent::view("shared/header");
     parent::view("cie/menu");
     parent::model("docs");
     $model1 = new docs();
     parent::model("accounts");
     $model2 = new accounts();
     parent::model("projects");
     $model3 = new projects();
     parent::model("business");
     $model4 = new business();
     if ($_internID != null || isset($_POST['intern'])) {
         if (isset($_POST['intern'])) {
             $data['intern'] = $model2->ShowUserByID($_POST['intern']);
         } else {
             $data['intern'] = $model2->ShowUserByID($_internID[0]);
         }
         if ($data['intern'] != null) {
             $project = $model3->ShowProjectByIntern($data['intern']->ID);
         }
         if ($project != null) {
             $cie = $model4->ShowCieByUserID($_SESSION['ID']);
             if ($project->businessID == $cie->ID && $project->status == 1) {
                 $data['readOnly'] = $model1->ReadOnlyCie($data['intern']->ID, 'interview');
                 if (!$data['readOnly']) {
                     //Si le formulaire n'existe pas
                     //Enregistrer l'entrevue.
                     if (isset($_POST['sendInterview']) && isset($_POST['intern']) && $_SESSION['form_timer'] + 1200 > time()) {
                         try {
                             $model1->SaveCie($_SESSION['ID'], 'interview', $_POST);
                             $data['interview'] = $model1->LoadCie($_POST['intern'], 'interview');
                             $data['alert'] = "alert-success";
                             $data['message'] = "L'entrevue a été enregistrée avec succès.";
                             $data['readOnly'] = true;
                         } catch (exception $ex) {
                             $data['alert'] = "alert-warning";
                             $data['message'] = "L'entrevue n'a pas pu être enregistrée.";
                         }
                     }
                 } else {
                     //si le formulaire existe
                     $data['interview'] = $model1->LoadCie($_internID[0], 'interview');
                     $data['alert'] = "alert-warning";
                     $data['message'] = "L'entrevue pour ce stagiaire existe déjà.";
                 }
                 parent::view("cie/interview", $data);
                 parent::view("shared/footer");
             } else {
                 $data['alert'] = "alert-warning";
                 $data['message'] = "Il vous est interdit de visualiser ce formulaire.";
                 $this->index($data);
             }
         } else {
             $data['alert'] = "alert-warning";
             $data['message'] = "Le projet et/ou le stagiaire n'existe pas.";
             $this->index($data);
         }
     } else {
         $this->index(null);
     }
 }
开发者ID:gragor3000,项目名称:Projet-Integrateur,代码行数:62,代码来源:cie.php

示例3: evalAdv

 public function evalAdv($_review)
 {
     parent::model("accounts");
     parent::model("docs");
     $model1 = new accounts();
     $model2 = new docs();
     if (isset($_review["intern"]) && isset($_review["#review"]) || isset($_POST["intern"])) {
         $data['advisors'] = $model1->ShowUsersByRank(0);
         $data['interns'] = $model1->ShowUsersByRank(2);
         $intern = null;
         $review = null;
         if (isset($_POST['intern'])) {
             $_review = null;
             $intern = $_POST['intern'];
             $review = $_POST['review'];
         } else {
             if ($_review != null) {
                 $intern = $_review["intern"];
                 $review = $_review["#review"];
             }
         }
         $data['readOnly'] = $model2->ReadOnlyAdvisor($intern, $review);
         parent::model("projects");
         $project = new projects();
         $projectIntern = null;
         if (ctype_digit($intern)) {
             $projectIntern = $project->ShowProjectByIntern($intern);
         }
         if ($projectIntern != null) {
             if (!$data['readOnly']) {
                 if (isset($_POST['evalIntern']) && $_SESSION['form_timer'] + 300 > time()) {
                     try {
                         $model2->SaveAdvisor($_SESSION['ID'], $review, $_POST);
                         $data['alert'] = "alert-success";
                         $data['message'] = "L'évaluation a été enregistrée avec succès!";
                         $data['review'] = $model2->LoadAdvisor($intern, $review);
                         $data['readOnly'] = true;
                     } catch (exception $ex) {
                         $data['alert'] = "alert-warning";
                         $data['message'] = "L'enregistrement de l'évaluation a échoué.";
                         $this->ShowInterns($data);
                     }
                 }
             } else {
                 $data['alert'] = "alert-warning";
                 $data['message'] = "Cette évaluation existe déjà pour ce stagiaire.";
                 $data['review'] = $model2->LoadAdvisor($intern, $review);
             }
             $data['intern'] = $intern;
             $data['#review'] = $review;
             parent::view("shared/header");
             parent::view("advisor/menu");
             parent::view("advisor/eval", $data);
             parent::view("shared/footer");
         } else {
             $data['alert'] = "alert-warning";
             $data['message'] = "Ce stagiaire n'a pas encore été jumelé à un projet.";
             $this->ShowInterns($data);
         }
     } else {
         $this->ShowInterns(null);
     }
 }
开发者ID:gragor3000,项目名称:Projet-Integrateur,代码行数:63,代码来源:advisor.php


注:本文中的projects::ShowProjectByIntern方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。