public function executeUploadFinish() { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee_id = $employee_id; $this->employee = $employee; $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $actions = array(); $this->actions = $actions; $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - (' . $course_schedule->getClassGroup()->toString() . ' # ' . $course_schedule->getAcademicCalendar()->getName() . ')'; $this->type = 'edit'; $this->course_schedule = $course_schedule; $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $cr->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cw = new Criteria(); $cw->add(GradeSpecPeer::PARENT, 7); $cw->addAscendingOrderByColumn(GradeSpecPeer::ID); $this->grade2 = GradeSpecPeer::doSelect($cw); $this->count2 = GradeSpecPeer::doCount($cw); $cm = new Criteria(); $cm->addJoin(StudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID); $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = StudentAccalPeer::doCount($cm); }
/** * getStudentClassCount function * function to get count of student accal of the class * @param int $academicCalendarId * @param int $classGroupId * @return int */ public static function getStudentClassCount($academicCalendarId, $classGroupId) { $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academicCalendarId); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $classGroupId); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); return StudentAccalPeer::doCount($c); }
public function executeListScoreAsCSV() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $cr = new Criteria(); $cr->add(GradeSpecPeer::PARENT, 1); $cr->addAscendingOrderByColumn(GradeSpecPeer::CODE); $this->grade1 = GradeSpecPeer::doSelect($cr); $this->count1 = GradeSpecPeer::doCount($cr); $cw = new Criteria(); $cw->add(GradeSpecPeer::PARENT, 7); $cw->addAscendingOrderByColumn(GradeSpecPeer::CODE); $this->grade2 = GradeSpecPeer::doSelect($cw); $this->count2 = GradeSpecPeer::doCount($cw); $cm = new Criteria(); $cm->addJoin(StudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID); $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId()); $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID); $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $this->student_count = StudentAccalPeer::doCount($cm); $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString(); $this->course_schedule = $course_schedule; $this->setLayout(false); $this->getResponse()->setHttpHeader('Content-Type', 'text/csv'); $this->getResponse()->setHttpHeader('Content-Disposition', 'attachment; filename="' . $this->getModuleName() . '.csv"'); }
<td> <?php $counselings = CounselingPeer::retrieveByPK($counseling->getId()); $tutors = array(); foreach ($counselings->getCounselingTutors() as $cr) { $tutors[] = $cr->getEmployee() ? '· ' . $cr->getEmployee()->getName() : '-'; } echo join("<br>", $tutors); ?> </td> <td style="text-align: center;"> <?php $c = new Criteria(); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendar()->getChildB()->getId()); $total_count = StudentAccalPeer::doCount($c); echo link_to_remote($total_count, array('url' => 'counselor_new/show?id=' . $counseling->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')); ?> </td> </tr> <?php } } ?> </tbody> </table> <?php if ($pager->getNbResults() > 1) { echo include_partial('global/pager', array('position' => 'bottom', 'pager' => $pager, 'module' => 'Counseling')); } ?>
<td style="font-weight: bold;"><?php if (VClassGroupPeer::retrieveByPK($payment_status->getClassGroup()->getParent())->getParent() != 34) { echo $payment_status->getClassGroup() ? $payment_status->getClassGroup()->toString() . ' - ' . VClassGroupPeer::retrieveByPK($payment_status->getClassGroup()->getParent())->getParentName() : '-'; } else { echo $payment_status->getClassGroup() ? $payment_status->getClassGroup()->toString() . ' - ' . $payment_status->getClassGroup()->getParentName() : '-'; } ?> </td> <td style="text-align: center;"><?php $cw = new Criteria(); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'A'); $cw->add(AcademicCalendarPeer::PARENT, $payment_status->getAcademicCalendarId()); $cw->addJoin(StudentAccalPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $cw->add(StudentAccalPeer::CLASS_GROUP_ID, $payment_status->getClassGroupId()); $total_student = StudentAccalPeer::doCount($cw); echo $total_student ? link_to_remote($total_student, array('url' => 'history_spp/listStudent?class_group_id=' . $payment_status->getClassGroupId() . '&accal_id=' . $payment_status->getAcademicCalendarId() . '&user_id=' . $payment_status->getUserId() . '&month=' . $payment_status->getMonth(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')) : '-'; ?> </td> <td style="text-align:right;"><?php $y = $payment_status->getAmount() * $total_student; echo format_number($y); ?> </td> <td style="text-align:center;"> <?php echo $payment_status->getStudentCount() ? link_to_remote($payment_status->getStudentCount(), array('url' => 'history_spp/listPaid?class_group_id=' . $payment_status->getClassGroupId() . '&accal_id=' . $payment_status->getAcademicCalendarId() . '&user_id=' . $payment_status->getUserId() . '&month=' . $payment_status->getMonth(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')) : '-'; ?> </td>
public function countStudentAccals($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseStudentAccalPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(StudentAccalPeer::STUDENT_ID, $this->getId()); return StudentAccalPeer::doCount($criteria, $distinct, $con); }
<?php $c = new Criteria(); $c->add(AcademicCalendarPeer::COURSE_MODEL, 'A'); $c->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId()); $accal1 = AcademicCalendarPeer::doSelectOne($c); $cw = new Criteria(); $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B'); $cw->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId()); $accal2 = AcademicCalendarPeer::doSelectOne($cw); $bln1 = substr($accal1->getStart(), 5, 2); $bln2 = substr($accal2->getStart(), 5, 2); $cm = new Criteria(); $cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $accal1->getId()); $cm->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $stu_count = StudentAccalPeer::doCount($cm); ?> <td><?php echo $stu_count . ' Siswa'; ?> </td> <td style="text-align: center;"> <?php echo link_to_remote(image_tag('agenda.png', 'title=Administrasi Absen'), array('url' => 'counseling_menu/listAbsenceByEmployee?accal_id=' . $accal1->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id . '&month_id=' . $bln1, 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()")); ?> </td> <td style="text-align: center;"> <?php