本文整理汇总了PHP中projects::ShowProjectByID方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::ShowProjectByID方法的具体用法?PHP projects::ShowProjectByID怎么用?PHP projects::ShowProjectByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::ShowProjectByID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: review
public function review($_projectID)
{
parent::view("shared/header");
parent::view("cie/menu");
parent::model("projects");
$model = new projects();
if ($_projectID != null || isset($_POST['project'])) {
parent::model("docs");
$model1 = new docs();
parent::model("projects");
$model2 = new projects();
if (isset($_POST['project'])) {
$project = $model2->ShowProjectByID($_POST['project']);
} else {
$project = $model2->ShowProjectByID($_projectID[0]);
}
if ($project != null) {
parent::model("business");
$model4 = new business();
$cie = $model4->ShowCieByUserID($_SESSION['ID']);
if ($project->status == 1 && $project->businessID == $cie->ID) {
$data['title'] = $project->title;
$data['projectID'] = $project->ID;
$internId = $project->internID;
if ($internId != null) {
//Vérifier l'existence d'une évaluation de stage
$data['readOnly'] = $model1->ReadOnlyAdvisor($internId, 'cieReview');
parent::model("accounts");
$model3 = new accounts();
$data['intern'] = $model3->ShowUserByID($internId);
if ($data['readOnly']) {
//si le formulaire existe
$data['review'] = $model1->LoadAdvisor($internId, "cieReview");
$data['alert'] = "alert-warning";
$data['message'] = "L'évaluation pour ce stagiaire et pour ce projet existe déjà.";
} else {
//si le formulaire n'existe pas
//Enregistrer le formulaire d'évaluation.
if (isset($_POST['sendReview']) && isset($_POST['project']) && $_SESSION['form_timer'] + 1200 > time()) {
try {
$_POST['intern'] = $internId;
$model1->SaveAdvisor($_SESSION['ID'], "cieReview", $_POST);
$data['review'] = $model1->LoadAdvisor($internId, 'cieReview');
$data['alert'] = "alert-success";
$data['message'] = "L'évaluation a été enregistrée avec succès.";
$data['readOnly'] = true;
} catch (Exception $e) {
$data['alert'] = "alert-warning";
$data['message'] = "L'évaluation n'a pas pu être enregistrée.";
}
}
}
parent::view("cie/review", $data);
parent::view("shared/footer");
} else {
$data['alert'] = "alert-warning";
$data['message'] = "Aucun stagiaire associé à ce projet.";
$this->index($data);
}
} 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'] = "Ce projet n'existe pas.";
$this->index($data);
}
} else {
$this->index(null);
}
}
示例2: review
public function review($_review)
{
parent::view("shared/header");
parent::view("intern/menu");
parent::model("accounts");
$intern = new accounts();
$data['intern'] = $intern->ShowUserByID($_SESSION['ID']);
parent::model("docs");
$model = new docs();
$data['readOnly'] = true;
//Tout dépendant du premier paramètre passer en paramètre, choisir la bonne page
switch ($_review[0]) {
case "evalAdvMid":
$exist = $model->ReadOnlyAdvisor($_SESSION['ID'], "review1");
if (!$exist) {
$data['alert'] = "alert-warning";
$data['message'] = "Aucune évaluation de mi-stage pour le moment.";
$this->info($data);
} else {
$data["review"] = $model->LoadAdvisor($_SESSION['ID'], "review1");
$data['advisor'] = $intern->ShowUserByID($data["review"]->Coordonnateur);
parent::view("intern/eval", $data);
}
break;
case "evalAdvFinale":
$exist = $model->ReadOnlyAdvisor($_SESSION['ID'], "review2");
if (!$exist) {
$data['alert'] = "alert-warning";
$data['message'] = "Aucune évaluation de fin de stage pour le moment.";
$this->info($data);
} else {
$data["review"] = $model->LoadAdvisor($_SESSION['ID'], "review2");
$data['advisor'] = $intern->ShowUserByID($data["review"]->Coordonnateur);
parent::view("intern/eval", $data);
}
break;
case "interview":
$exist = $model->ReadOnlyCie($_SESSION['ID'], "interview");
if (!$exist) {
$data['alert'] = "alert-warning";
$data['message'] = "Aucune entrevue évaluée pour le moment.";
$this->info($data);
} else {
$data["interview"] = $model->LoadCie($_SESSION['ID'], "interview");
parent::view("intern/interview", $data);
}
break;
case "evalSup":
$exist = $model->ReadOnlyAdvisor($_SESSION['ID'], "cieReview");
if (!$exist) {
$data['alert'] = "alert-warning";
$data['message'] = "Aucune évaluation du superviseur pour le moment.";
$this->info($data);
} else {
$data["review"] = $model->LoadAdvisor($_SESSION['ID'], "cieReview");
parent::model("projects");
$model = new projects();
$data['project'] = $model->ShowProjectByID($data["review"]->project);
parent::view("intern/evalSup", $data);
}
break;
default:
$this->index();
}
parent::view("shared/footer");
}
示例3: review
public function review($_review)
{
parent::view("shared/header");
parent::view("advisor/menu");
if (isset($_review[0]) && isset($_review[1])) {
parent::model("accounts");
$interns = new accounts();
parent::model("projects");
$project = new projects();
$projectIntern = null;
if (ctype_digit($_review[1])) {
$projectIntern = $project->ShowProjectByIntern($_review[1]);
}
if ($projectIntern != null) {
$data["interns"] = $interns->ShowUsersByRank(2);
$data['intern'] = $interns->ShowUserByID($_review[1]);
parent::model("docs");
$model = new docs();
$data['readOnly'] = true;
if ($_review[0] == "logbook") {
if (!$model->ReadOnlyLog($_review[1])) {
$data['alert'] = "alert-warning";
$data['message'] = "Il n'y a pas de journal de bord associé à ce stagiaire pour le moment.";
$this->ShowInterns($data);
} else {
$data["logs"] = $model->LoadLog($_review[1]);
$data['logs'] = array_reverse($data['logs']);
parent::view("advisor/log", $data);
}
}
//Tout dépendant du premier paramètre passer en paramètre, choisir la bonne page
switch ($_review[0]) {
case "evalAdvMid":
$data['intern'] = $_review[1];
$exist = $model->ReadOnlyAdvisor($_review[1], "review1");
$data["#review"] = "review1";
if (!$exist) {
$this->evalAdv($data);
} else {
$data['advisors'] = $interns->ShowUsersByRank(0);
$data["review"] = $model->LoadAdvisor($_review[1], "review1");
$data['advisor'] = $interns->ShowUserByID($data["review"]->Coordonnateur);
parent::view("advisor/eval", $data);
}
break;
case "evalAdvFinale":
$data['intern'] = $_review[1];
$exist = $model->ReadOnlyAdvisor($_review[1], "review2");
$data["#review"] = "review2";
if (!$exist) {
$this->evalAdv($data);
} else {
$data['advisors'] = $interns->ShowUsersByRank(0);
$data["review"] = $model->LoadAdvisor($_review[1], "review2");
$data['advisor'] = $interns->ShowUserByID($data["review"]->Coordonnateur);
parent::view("advisor/eval", $data);
}
break;
case "interview":
$exist = $model->ReadOnlyCie($_review[1], "interview");
if (!$exist) {
$data['alert'] = "alert-warning";
$data['message'] = "Aucune entrevue évaluée pour le moment.";
$this->ShowInterns($data);
} else {
$data["interview"] = $model->LoadCie($_review[1], "interview");
parent::view("advisor/interview", $data);
}
break;
case "evalSup":
$exist = $model->ReadOnlyAdvisor($_review[1], "cieReview");
if (!$exist) {
$data['alert'] = "alert-warning";
$data['message'] = "Aucune évaluation du superviseur pour le moment.";
$this->ShowInterns($data);
} else {
$data["review"] = $model->LoadAdvisor($_review[1], "cieReview");
parent::model("projects");
$model = new projects();
$data['project'] = $model->ShowProjectByID($data["review"]->project);
parent::view("advisor/evalSup", $data);
}
break;
}
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);
}
}