/** * * Get Attendance status of class in a subject * * @param Acad_Model_Class $class * @param string $subjectCode * @param string $subjectMode * @param date $dateFrom * @param date $dateUpto * @param string $subjectType */ public function getSubjectAttendanceDetail(Acad_Model_Class $class, $subjectCode, $subjectMode = null, $dateFrom = null, $dateUpto = null) { $data = array(); $sql = $this->getDbTable()->getAdapter()->select(); $fetchMode = null; if ($subjectCode != null) { $sql->from('attendance', array('period_date', 'subject_mode_id', 'group_id', 'student_roll_no'))->where('subject_code = ?', $subjectCode)->where('department_id = ?', $class->getDepartment()); $fetchMode = Zend_db::FETCH_GROUP; } else { $subjects = $class->getSubjects(); $sql->from('attendance', array('period_date', 'subject_mode_id', 'group_id', 'student_roll_no')); foreach ($subjects as $key => $subject) { $sql->where('subject_code = ?', $subjectCode)->where('department_id = ?', $class->getDepartment()); } //@TODO do smthing } if ($dateFrom != null) { $data['dateFrom'] = $dateFrom; if ($dateUpto != null) { $data['dateUpto'] = $dateUpto; $sql->where('`period_date` BETWEEN :dateFrom AND :dateUpto'); } else { $sql->where('`period_date` = :dateFrom'); } } return $sql->query(null, $data)->fetchAll($fetchMode); }
public function viewstuwiseAction() { $this->_helper->viewRenderer->setNoRender(false); $this->_helper->layout()->enableLayout(); $class = new Acad_Model_Class(); $class->setDepartment('cse')->setProgramme_id('btech')->setSemester('8'); //$this->_helper->logger($class->getAttendance('CSE-202E',null,'2011-03-08','2011-03-10')); $this->_helper->logger($class->getSubjects()); }