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


PHP I2CE_FormStorage::Search方法代码示例

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


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

示例1: academicYearId

 static function academicYearId($academic_year)
 {
     $where = array("operator" => "FIELD_LIMIT", "field" => "name", "style" => "equals", "data" => array("value" => $academic_year));
     $academic_year_array = I2CE_FormStorage::Search("academic_year", false, $where);
     foreach ($academic_year_array as $academic_year_id) {
         return $academic_year_id;
     }
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:8,代码来源:iHRIS_AcademicYear.php

示例2: 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

示例3: action

 protected function action()
 {
     $role = $this->getUser()->role;
     if ($role != "student") {
         $this->userMessage("Only A Student Can Enroll Into Courses");
         $this->setRedirect("view?id=" . $this->Get("parent"));
         return false;
     }
     iHRIS_AcademicYear::ensureAcademicYear();
     $this->person_id = $this->Get("parent");
     $this->getProgramAndSemester();
     ############Deny Course Registration For A Student Dropped Out Of Semester###################
     $persObj = I2CE_FormFactory::instance()->createContainer($this->person_id);
     $persObj->populateChildren("drop_semester");
     foreach ($persObj->getChildren("drop_semester") as $dropSemObj) {
         //check to insure that this drop semester is the one that belongs to the current registration
         if ($dropSemObj->getField("registration")->getDBValue() != $this->student_registration["id"]) {
             continue;
         }
         $dropSemObj->populateChildren("resume_semester");
         $resSemObj = $dropSemObj->getChildren("resume_semester");
         if (count($resSemObj) == 0) {
             $this->userMessage("You Are Currently Dropped From A Semester,Course Enrollment Not Allowed");
             $this->setRedirect("view?id=" . $this->person_id);
             return;
         }
     }
     ############End Of Denying Course Registration For A Student Dropped Out Of Semester###################
     ############checking if course enrollment closed#################
     $username = $this->getUser()->username;
     $this->training_institution = iHRIS_PageFormLecturer::fetch_institution($username);
     $where = array("operator" => "FIELD_LIMIT", "field" => "training_institution", "style" => "equals", "data" => array("value" => $this->training_institution));
     $fields = I2CE_FormStorage::listFields("schedule_course_enrollment", array("start_date", "end_date"), false, $where);
     foreach ($fields as $id => $field) {
         $start_date = $field["start_date"];
         $end_date = $field["end_date"];
     }
     if (count($fields) == 0) {
         $this->userMessage("Course Registration Closed");
         $this->setRedirect("view?id=" . self::$person_id);
         return false;
     } else {
         $start_date = strtotime($start_date);
         $end_date = strtotime($end_date);
         $today = strtotime(date("Y-m-d"));
         if ($today > $end_date) {
             $this->userMessage("Course Registration Closed");
             $this->setRedirect("view?id=" . self::$person_id);
             return false;
         }
     }
     ########### End checking of course enrollment deadline #####################
     ########### Check if this student is not discontinued  #####################
     if ($this->check_discontinue($this->person_id)) {
         $this->userMessage("You have discontinued from this program!!!");
         $this->setRedirect("view?id=" . $this->person_id);
         return false;
     }
     ########### End of checking if a student has discontinued #################
     ########### If its a new semester then increment the semester and level ################
     ######get total number of semesters######
     list($prog_form, $prog_id) = array_pad(explode("|", $this->program, 2), 2, "");
     $total_sems = I2CE_FormStorage::lookupField("training_program", $prog_id, array("total_semesters"), false);
     $total_semesters = $total_sems["total_semesters"];
     ######end of getting total number of semesters######
     ######get passing score######
     list($inst_form, $inst_id) = array_pad(explode("|", $this->training_institution, 2), 2, "");
     $pass_score = I2CE_FormStorage::lookupField("training_institution", $inst_id, array("passing_score"), false);
     $this->passing_score = $pass_score["passing_score"];
     ######end of getting passing score######
     $semester_name = self::getSemesterName($this->curr_semester);
     $where_GPA = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "parent", "style" => "equals", "data" => array("value" => $this->person_id)), 1 => array("operator" => "FIELD_LIMIT", "field" => "semester", "style" => "equals", "data" => array("value" => $this->curr_semester))), 2 => array("operator" => "FIELD_LIMIT", "field" => "registration", "style" => "equals", "data" => array("value" => $this->student_registration["id"])));
     ######if GPA for current semester available then increment the semester######
     $sem_GPA = I2CE_FormStorage::Search("semester_GPA", false, $where_GPA);
     if (count($sem_GPA) > 0 and $semester_name < $total_semesters) {
         $regObj = $this->factory->createContainer($this->student_registration["id"]);
         list($form, $level) = array_pad(explode("|", $this->curr_level, 2), 2, "");
         $semester_name = ++$semester_name;
         if ($semester_name % 2 != 0) {
             $new_level = ++$level;
         }
         $new_semester = "semester|" . $semester_name;
         $user = new I2CE_User();
         $regObj->populate();
         $regObj->getField("semester")->setFromDB($new_semester);
         if ($semester_name % 2 != 0) {
             $regObj->getField("academic_level")->setFromDB("academic_level|" . $new_level);
         }
         $regObj->save($user);
     }
     ########### End of incrementing the semester and level ############
     $this->getProgramCourses($this->curr_semester);
     $this->getElectiveCourses($this->curr_semester);
     $this->getPreviousSemesterCourses($this->curr_semester);
     if (count($this->subject_courses) == 0 and count($this->elective_courses) == 0) {
         $this->userMessage("No courses defined into the system,try later on!!!");
         $this->setRedirect("view?id=" . $this->person_id);
     }
     $this->displayCourses($this->subject_courses, "subject", "Subject Courses");
     if (count($this->elective_courses) > 0) {
//.........这里部分代码省略.........
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:101,代码来源:iHRIS_PageFormEnrollcourse.php

示例4: checkResults

 protected function checkResults($exam_type, $person_id, $training_courses, $enroll_academic_year, $enroll_id)
 {
     $where = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "parent", "style" => "equals", "data" => array("value" => $person_id)), 1 => array("operator" => "FIELD_LIMIT", "field" => "training", "style" => "equals", "data" => array("value" => $training_courses)), 2 => array("operator" => "FIELD_LIMIT", "field" => "enroll_course", "style" => "equals", "data" => array("value" => "enroll_course|" . $enroll_id))));
     $id = I2CE_FormStorage::Search("students_results_grade", false, $where);
     $id = $id[0];
     $resultsObj = $this->ff->createContainer("students_results_grade|" . $id);
     $resultsObj->populateChildren("students_results");
     $result = array();
     foreach ($resultsObj->getChildren("students_results") as $results) {
         $assessment = $results->getFIeld("training_course_exam_type")->getDBValue();
         if ($assessment == $exam_type) {
             $mark = $results->getFIeld("score")->getDBValue();
             $results_id = $results->getFIeld("id")->getDBValue();
             $result[$id] = $mark;
         }
     }
     return $result;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:18,代码来源:iHRIS_PageFormAddResults.php

示例5: getDiscoForm

 protected function getDiscoForm()
 {
     $where = array("operator" => "AND", "operand" => array(0 => array("operator" => "FIELD_LIMIT", "field" => "parent", "style" => "equals", "data" => array("value" => $this->person_id)), 1 => array("operator" => "FIELD_LIMIT", "field" => "registration", "style" => "equals", "data" => array("value" => $this->student_registration["id"]))));
     $disco = I2CE_FormStorage::Search("discontinued", false, $where);
     if (count($disco) > 0) {
         return "discontinued|" . $disco[0];
     } else {
         return "discontinued";
     }
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:10,代码来源:iHRIS_PageFormAddResultsProcess.php


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