예제 #1
0
    /**
     * Test conducted in class.
     * @param Acad_Model_Class $class
     */
    public function getConducted(Acad_Model_Class $class)
    {
        $sql = 'SELECT
  test_id,
  (SELECT
     test_id
   FROM test
   WHERE test_type_id = ?
   ORDER BY test_id DESC
   LIMIT 1) AS max_test_id
FROM test_info
WHERE (department_id = ?
       AND degree_id = ?
       AND semester_id = ?
       AND test_type_id = ?)
ORDER BY test_type_id,test_id DESC
LIMIT 1';
        $bind[] = self::getTest_type_id();
        $bind[] = $class->getDepartment();
        $bind[] = $class->getDegree();
        $bind[] = $class->getSemester();
        $bind[] = self::getTest_type_id();
        return Zend_Db_Table::getDefaultAdapter()->query($sql, $bind)->fetch();
    }
예제 #2
0
 /**
  * 
  * Enter description here ...
  * @param Acad_Model_Class $class
  * @FIXME It is not complete
  */
 public function save(Acad_Model_Class $class)
 {
     $data = array('department_id' => $class->getDepartment(), 'degree_id' => $class->getDegree(), 'batchstart' => $class->getBatchStart());
 }
예제 #3
0
 /**
  * Get Faculty Subjects
  * @param Acad_Model_Member_Faculty $faculty
  * @return array
  */
 public function fetchSubjects(Acad_Model_Member_Faculty $faculty, Acad_Model_Class $class = NULL, $showModes = NULL)
 {
     $select = $this->getDbTable()->getAdapter()->select();
     $select->distinct()->from('subject_faculty', array('subject_code'))->join('subject', 'subject_faculty.subject_code = subject.subject_code', array('subject_name'))->join('subject_department', 'subject_department.subject_code = subject.subject_code', array())->where('subject_faculty.staff_id = ?', $faculty->getMemberId());
     if (isset($showModes)) {
         $select->columns('subject_mode_id');
     }
     if (isset($class)) {
         $select->where('subject_department.department_id = ?', $class->getDepartment())->where('subject_department.degree_id = ?', $class->getDegree())->where('subject_department.semester_id = ?', $class->getSemester());
     }
     return $select->query()->fetchAll(Zend_Db::FETCH_GROUP);
 }