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


PHP I2CE_FormStorage::ListFields方法代码示例

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


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

示例1: showCourses

 protected function showCourses()
 {
     if (!($listNode = $this->template->getElementByID("existing_course_list")) instanceof DOMNode) {
         return;
     }
     if ($this->getUser()->role == "registrar" || $this->getUser()->role == "lecturer" || $this->getUser()->role == "hod" || $this->getUser()->role == "principal" || $this->getUser()->role == "deputy_principal") {
         ######getting id of the currently logged in lecturer######
         $username = $this->getUser()->username;
         $where = array("operator" => "FIELD_LIMIT", "field" => "identification_number", "style" => "equals", "data" => array("value" => $username));
         $lecturer = I2CE_FormStorage::search("lecturer", false, $where);
         foreach ($lecturer as $id) {
             $lecturer_id = "lecturer|" . $id;
         }
         ######Getting the current academic year######
         $academic_year = iHRIS_AcademicYear::currentAcademicYear();
         $where = array("operator" => "FIELD_LIMIT", "field" => "name", "style" => "equals", "data" => array("value" => $academic_year));
         $academic_year_id = I2CE_FormStorage::Search("academic_year", false, $where);
         $academic_year_id = "academic_year|" . $academic_year_id[0];
         ######Getting a list of courses assigned to this lecturer######
         $where_assign_course = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "lecturer", "style" => "equals", "data" => array("value" => $lecturer_id)), 1 => array("operator" => "FIELD_LIMIT", "field" => "academic_year", "style" => "equals", "data" => array("value" => $academic_year_id))));
         $assigned_courses = I2CE_FormStorage::listFields("assign_course_trainer", array("training"), false, $where_assign_course);
     } else {
         $this->userMessage("Login as a training provider to add results");
         $this->redirect("manage?action=provider");
         return false;
     }
     ######Displaying courses assigned to this lecturer######
     if (count($assigned_courses) == 0) {
         $this->userMessage("No courses assigned to you,contact the Registrar for further assistance");
         $this->redirect("manage?action=provider");
         return false;
     }
     foreach ($assigned_courses as $id => $course) {
         $course_id = explode("|", $course["training"]);
         $course_id = $course_id[1];
         $where = array("operator" => "FIELD_LIMIT", "field" => "id", "style" => "equals", "data" => array("value" => $course_id));
         $training_courses = I2CE_FormStorage::ListFields("training", array("name", "code"), false, $where);
         foreach ($training_courses as $id => $training_course) {
             $course_name = $training_course["name"];
             $course_code = $training_course["code"];
             $course = $course_code . "-" . $course_name;
             $id = "training|" . $id;
             $aNode = $this->template->createElement("a", array(href => "add_results?id=" . $id), $course);
             $liNode = $this->template->createElement("li");
             $this->template->appendNode($aNode, $liNode);
             $this->template->appendNode($liNode, $listNode);
         }
     }
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:49,代码来源:iHRIS_PageFormSelectcourse.php

示例2: ensureAcademicYear

 static function ensureAcademicYear()
 {
     $academic_year = self::currentAcademicYear();
     $academic_years = I2CE_FormStorage::ListFields("academic_year", array("name"));
     $latest = false;
     //check to see if the academic_year in the DB is latest
     foreach ($academic_years as $db_academic_year) {
         if ($db_academic_year["name"] == $academic_year) {
             $latest = true;
         }
     }
     //if not latest,add latest
     if ($latest == false) {
         $accObj = I2CE_FormFactory::instance()->createContainer("academic_year");
         $accObj->getField("name")->setFromPost($academic_year);
         $user = new I2CE_User();
         $accObj->save($user);
     }
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:19,代码来源:iHRIS_AcademicYear.php

示例3: getElectiveCourses

 protected function getElectiveCourses($curr_semester)
 {
     $current_academic_year = iHRIS_AcademicYear::currentAcademicYear();
     $academic_year_id = iHRIS_AcademicYear::academicYearId($current_academic_year);
     $current_academic_year_id = "academic_year|" . $academic_year_id;
     $semester = self::getSemesterName($curr_semester);
     $trng_prgrms = self::get_institution_programs();
     unset($trng_prgrms[$this->program]);
     for ($semester = $semester; $semester > 0; $semester = $semester - 2) {
         $semester_id = "semester|" . self::getSemesterId($semester);
         $where = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "semester", "style" => "equals", "data" => array("value" => $semester_id)), 1 => array(0 => array("operator" => "FIELD_LIMIT", "field" => "training_program", "style" => "in", "data" => array("value" => $trng_prgrms)))));
         $courses = I2CE_FormStorage::listFields("training", array("id"), false, $where);
         foreach ($courses as $id => $course_array) {
             $training_course = "training|" . $id;
             if ($this->is_rescheduled($training_course, $current_academic_year_id, $curr_semester)) {
                 continue;
             }
             //check if a student took and passed this course then skip displaying it
             $where = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "training", "style" => "equals", "data" => array("value" => $training_course)), 1 => array("operator" => "FIELD_LIMIT", "field" => "parent", "style" => "equals", "data" => array("value" => $this->person_id)), 2 => array("operator" => "FIELD_LIMIT", "field" => "registration", "style" => "equals", "data" => array("value" => $this->student_registration["id"]))));
             $results = I2CE_FormStorage::ListFields("students_results_grade", array("total_marks", "status"), false, $where);
             $status = "display";
             foreach ($results as $result) {
                 if ($result["status"] == "status|pass") {
                     $status = "pass";
                     break;
                 }
             }
             if ($status == "display") {
                 $this->elective_courses[$id] = $training_course;
             }
         }
         //get elective courses that have been rescheduled to this semester
         $where = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "academic_year", "style" => "equals", "data" => array("value" => $current_academic_year_id)), 1 => array("operator" => "FIELD_LIMIT", "field" => "semester", "style" => "equals", "data" => array("value" => $semester)), 2 => array("operator" => "NOT", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "training_program", "style" => "equals", "data" => array("value" => $this->program)))), 3 => array("operator" => "FIELD_LIMIT", "field" => "training_institution", "style" => "equals", "data" => array("value" => $this->training_institution))));
         $courses = I2CE_FormStorage::listFields("reschedule_course", array("training"), false, $where);
         foreach ($courses as $course) {
             $trn_id = explode("|", $course["training"]);
             $id = $trn_id[1];
             $this->elective_courses[$id] = $course["training"];
         }
     }
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:41,代码来源:iHRIS_PageFormEnrollcourse.php

示例4: getCourseHighestMark

 protected function getCourseHighestMark($course_id)
 {
     $where = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "registration_number", "style" => "equals", "data" => array("value" => $this->reg_num)), 1 => array("operator" => "FIELD_LIMIT", "field" => "training", "style" => "equals", "data" => array("value" => $course_id)), 2 => array("operator" => "FIELD_LIMIT", "field" => "registration", "style" => "equals", "data" => array("value" => $this->student_registration["id"]))));
     $results = I2CE_FormStorage::ListFields("students_results_grade", array("total_marks"), false, $where);
     $mark = null;
     foreach ($results as $result) {
         //if total marks is missing then this course has no all results,return false
         if ($mark < $result["total_marks"]) {
             $mark = $result["total_marks"];
         }
     }
     return $mark;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:13,代码来源:iHRIS_PageFormAddResultsProcess.php


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