本文整理汇总了PHP中Course::getCourseById方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::getCourseById方法的具体用法?PHP Course::getCourseById怎么用?PHP Course::getCourseById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::getCourseById方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayDisciplinesOfSyllabus
public function displayDisciplinesOfSyllabus($syllabusId, $courseId)
{
$syllabusDisciplines = $this->getSyllabusDisciplines($syllabusId);
$course = new Course();
$foundCourse = $course->getCourseById($courseId);
$data = array('syllabusDisciplines' => $syllabusDisciplines, 'syllabusId' => $syllabusId, 'course' => $foundCourse);
loadTemplateSafelyByGroup("secretario", 'syllabus/course_syllabus_disciplines', $data);
}
示例2: __construct
public function __construct()
{
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a course!");
}
$courseId = $this->secureString($_GET['id']);
$this->course = Course::getCourseById($courseId);
$this->view = new LessonAdminView($this->course);
}
示例3: __construct
public function __construct()
{
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a lesson!");
}
$lessonId = $this->secureString($_GET['id']);
$this->lesson = Lesson::getLesson($lessonId);
$this->course = Course::getCourseById($this->lesson->getCourseId());
$this->view = new TutorialAdminView($this->lesson, $this->course);
}
示例4: __construct
public function __construct()
{
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a lesson!");
}
$lessonId = $this->secureString($_GET['id']);
$this->lesson = Lesson::getLesson($lessonId);
if (!isset($this->lesson)) {
die("This lesson was not found!");
}
$this->course = Course::getCourseById($this->lesson->getCourseId());
$this->view = new ExerciseView($this->lesson, $this->course);
}
示例5: removeCourseFromProgram
public function removeCourseFromProgram($courseId, $programId)
{
$course = new Course();
$programExists = $this->checkIfProgramExists($programId);
$courseExists = $course->checkIfCourseExists($courseId);
$dataIsOk = $programExists && $courseExists;
if ($dataIsOk) {
$this->db->where('id_course', $courseId);
$this->db->update('course', array('id_program' => NULL));
$course = new Course();
$foundCourse = $course->getCourseById($courseId);
if ($foundCourse['id_program'] == $programId) {
$wasRemoved = FALSE;
} else {
$wasRemoved = TRUE;
}
} else {
$wasRemoved = FALSE;
}
return $wasRemoved;
}
示例6: die
<?php
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a lesson!");
}
$lessonId = htmlspecialchars($_GET['id']);
$lessonId = DB::escapeString($lessonId);
$lesson = Lesson::getLesson($lessonId);
$course = Course::getCourseById($lesson->getCourseId());
if (!isset($lesson)) {
die("This lesson was not found!");
}
$courseId = $lesson->getCourseId();
$filePath = PAGE_DIR . "lessons/{$courseId}-{$lessonId}.html";
$exerciseComponent = '<div class="well ui">
<form action="' . ROOT_DIR . 'exercises/' . $lessonId . '" method="post">
<button type="submit" class="btn btn-default btn-block">' . I18n::t('lesson.startexercises') . '</button>
</form>
</div>';
// display content
echo '<ol class="breadcrumb">
<li><a href="' . ROOT_DIR . 'courseoverview">' . I18n::t('courseoverview.title') . '</a></li>
<li><a href="' . ROOT_DIR . 'course/' . $course->getId() . '">' . $course->getName(I18n::getLang()) . '</a></li>
<li class="active">' . $lesson->getName(I18n::getLang()) . '</li>
</ol>';
echo $exerciseComponent;
echo '<h1>' . $lesson->getName(I18n::getLang()) . '</h1>';
if (file_exists($filePath) && filesize($filePath) > 1) {
echo '<h2>Tutorial</h2>';
echo file_get_contents($filePath);
echo $exerciseComponent;
示例7: searchForStudentRequest
public function searchForStudentRequest()
{
$this->load->model("request_model");
$searchType = $this->input->post('searchType');
$courseId = $this->input->post('courseId');
$semester = new Semester();
$currentSemester = $semester->getCurrentSemester();
define("SEARCH_BY_STUDENT_ID", "by_id");
define("SEARCH_BY_STUDENT_NAME", "by_name");
switch ($searchType) {
case SEARCH_BY_STUDENT_ID:
$studentIds = array();
$studentId = $this->input->post('student_identifier');
if (!empty($studentId)) {
$studentIds[] = $studentId;
} else {
$studentIds[] = 0;
}
$courseRequests = $this->getStudentRequests($courseId, $currentSemester['id_semester'], $studentIds);
break;
case SEARCH_BY_STUDENT_NAME:
$studentName = $this->input->post('student_identifier');
$user = new Usuario();
$foundUser = $user->getUserByName($studentName);
if ($foundUser !== FALSE) {
$studentId = array();
foreach ($foundUser as $student) {
$studentId[] = $student['id'];
}
$courseRequests = $this->getStudentRequests($courseId, $currentSemester['id_semester'], $studentId);
} else {
$courseRequests = FALSE;
}
break;
default:
break;
}
$course = new Course();
$courseData = $course->getCourseById($courseId);
$data = array('requests' => $courseRequests, 'course' => $courseData);
loadTemplateSafelyByGroup("secretario", 'request/course_requests', $data);
}
示例8: displayCourseStudents
public function displayCourseStudents($courseId)
{
$course = new Course();
$courseStudents = $course->getCourseStudents($courseId);
$courseData = $course->getCourseById($courseId);
$data = array('courseStudents' => $courseStudents, 'course' => $courseData);
loadTemplateSafelyByGroup("coordenador", 'program/coordinator_course_students', $data);
}
示例9: actionAjaxCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionAjaxCreate()
{
$model = new Semester();
if (!isset($_SESSION['course_id'])) {
$_SESSION['course_id'] = 1;
}
if (isset($_GET['ID'])) {
$_SESSION['course_id'] = $_GET['ID'];
}
$course = Course::getCourseById($_SESSION['course_id']);
if (!empty($course)) {
$model->ID_Course = $course->Name;
}
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if (isset($_POST['Semester'])) {
$model->attributes = $_POST['Semester'];
$model->ID_Course = $_SESSION['course_id'];
if ($model->save()) {
$this->redirect(array('index', 'id' => $model->ID));
}
}
$this->renderPartial('_form', array('model' => $model), false, true);
}
示例10: student_offerList
public function student_offerList($courseId)
{
$semester = new Semester();
$currentSemester = $semester->getCurrentSemester();
$course = new Course();
$courseData = $course->getCourseById($courseId);
$offer = new Offer();
$offerListDisciplines = $offer->getCourseApprovedOfferListDisciplines($courseId, $currentSemester['id_semester']);
$data = array('currentSemester' => $currentSemester, 'course' => $courseData, 'offerListDisciplines' => $offerListDisciplines);
loadTemplateSafelyByGroup("estudante", 'usuario/student_offer_list', $data);
}
示例11: Course
<div class = "column">
<div class="column-content">
<!-- course second section image -->
<?php
if (isset($_GET['id']) && !empty($_GET['id'])) {
$id = $_GET['id'];
$crs = new Course();
$c = $crs->getCourseById($id);
}
?>
<div class="col-img">
<a href="#">
<img alt="<?php
echo $c->img_alt;
?>
" src="<?php
echo $c->course_img;
?>
">
</a>
</div>
<!-- course second section links -->
<div class="col-txt">
<header class="crs-header">
<h5><a href="#"><?php
echo $c->course_name;
?>
</a></h5>
<a class="author" href="#"><?php
echo $c->course_author;
?>
示例12: die
<?php
require AUTH_DIR . 'requirelogin.routine.php';
?>
<?php
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("Please first select a course!");
}
$courseId = htmlspecialchars($_GET['id']);
$courseId = DB::escapeString($courseId);
$course = Course::getCourseById($courseId);
if (!isset($course)) {
die("This course was not found!");
}
?>
<ol class="breadcrumb">
<li><a href="<?php
echo ROOT_DIR;
?>
courseoverview"><?php
echo I18n::t('courseoverview.title');
?>
</a></li>
<li class="active"><?php
echo $course->getName(I18n::getLang());
?>
</li>
</ol>
<h1><?php
示例13: showCapesAvaliationsNews
function showCapesAvaliationsNews($atualizations)
{
$courseController = new Course();
if ($atualizations) {
echo "<div class='panel panel-primary'>";
echo "<div class='panel-heading'><h4> Ultimas atualizações de avaliações <i>CAPES</i> </h4></div>";
foreach ($atualizations as $new => $courseAtualization) {
$course = $courseController->getCourseById($courseAtualization['id_course']);
echo "<div class='panel-body'>";
echo "<div class='modal-info'>";
echo "<div class='modal-content'>";
echo "<div class='modal-header bg-news'";
echo "<h4 class='model-title'>" . $course['course_name'] . "</h4>";
echo "</div>";
echo "<div class='modal-body'>";
echo "<h3>";
echo "<label class='label label-info'>";
echo "Nota Obtida: " . $courseAtualization['course_grade'] . "";
echo "</label>";
echo " " . anchor("capesavaliation/checkAsVisualized/{$courseAtualization['id_avaliation']}", "<span class='fa fa-check'></span>", "class='btn btn-success'");
echo "</h3>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "</div>";
}
echo "<div class='panel-footer' align='center'><i>Clique em <span class='fa fa-check'></span> para marcar como vizualizada</i></div>";
echo "</div>";
} else {
echo "<div class='panel panel-primary'>";
echo "<div class='panel-heading'><h4> Ultimas atualizações de avaliações <i>CAPES</i> </h4></div>";
echo "<h3>";
echo "<label class='label label-info'>";
echo "Não existem atualizações até o momento.";
echo "</label>";
echo "</h3>";
echo "</div>";
}
}