public static function doSelectByStudent(Criteria $criteria, $con = null) { $usertype = sfContext::getInstance()->getUser()->getAttribute('usertype', 'common', 'bo'); $student = null; $student_id = null; if ($usertype == 'student') { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); } if ($student == null) { $student_id = sfContext::getInstance()->getRequest()->getParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); } $criteria->add(StudentPeer::CURRICULUM_ID, $student->getCurriculumId()); $criteria->addJoin(StudentPeer::CURRICULUM_ID, CurriculumPeer::ID); $criteria->addJoin(CurriculumPeer::DEPARTMENT_ID, DepartmentPeer::ID); $tmp_depts = DepartmentPeer::doSelect($criteria); $depts = array(); foreach ($tmp_depts as $key => $val) { $pi = $val->getParentalIndex(); $prefix = ''; for ($i = 0; $i < $val->level - 1; $i++) { $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue(); } $val->setdescription($prefix . $val->getDescription()); $val->setCode($prefix . $val->getCode()); $depts[$pi] = $val; } ksort($depts); $result = array(); foreach ($depts as $r) { $result[] = $r; } return $result; }
public function configure() { $student_id = $this->getOption('student_id'); $this->student = StudentPeer::retrieveByPK($student_id); $this->career_school_year_id = $this->getOption('career_school_year_id'); $this->course_subject_id = $this->getOption('course_subject_id'); $this->division_id = $this->getOption('division_id'); $sf_formatter_attendance_week = new sfWidgetFormSchemaFormatterAttendanceWeek($this->getWidgetSchema()); $this->getWidgetSchema()->addFormFormatter("AttendanceWeek", $sf_formatter_attendance_week); $this->getWidgetSchema()->setFormFormatterName('AttendanceWeek'); $day = $this->getOption('day'); $this->widgetSchema->setNameFormat('attendance_' . $student_id . '][%s]'); #student $this->setWidget("student_id", new sfWidgetFormInputHidden()); $this->setValidator("student_id", new sfValidatorPropelChoice(array("model" => "Student", "required" => true))); $this->setWidget("student", new mtWidgetFormPlain(array('object' => $this->student))); for ($i = 0; $i <= 6; $i++) { $day_i = date('Y-m-d', strtotime($day . '-' . $i . 'day a go')); $student_attendance = StudentAttendancePeer::retrieveOrCreateByDateAndStudent($day_i, $this->student, $this->getOption('course_subject_id')); if ($student_attendance) { $this->setDefault("value_" . $i, $student_attendance->getAbsenceTypeId()); } $this->setWidget("value_" . $i, $this->getAttendanceWidget()); $this->getWidget("value_" . $i, $this->getAttendanceWidget())->setAttribute('class', 'attendance_week_input'); $this->setValidator("value_" . $i, $this->getAttendanceValidator()); } $this->setDefault("student_id", $student_id); $this->disableCSRFProtection(); $this->course_subject = CourseSubjectPeer::retrieveByPK($this->course_subject_id); $period = CareerSchoolYearPeriodPeer::retrieveByPK($this->course_subject->getCourse()->getCurrentPeriod()); $this->setWidget('period', new mtWidgetFormPartial(array('module' => 'student_attendance', 'partial' => 'totalAbsences', 'form' => $this, 'parameters' => array('career_school_year_id' => $this->career_school_year_id, 'period' => $period, 'course_subject_id' => $this->course_subject_id, 'student' => $this->student)))); $this->getWidgetSchema()->moveField('period', sfWidgetFormSchema::LAST); }
public function executeListSched() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $c = new Criteria(); $c->add(SchedulePeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN); $c->add(SchedulePeer::CLASS_GROUP_ID, $student->getClassGroupId(), Criteria::IN); $c->add(SchedulePeer::TYPE, Schedule::IS_SCHED, Criteria::IN); $c->addAscendingOrderByColumn(SchedulePeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'schedule')); $this->getUser()->setAttribute('max_per_page', $rpp, 'schedule'); $pager = new sfPropelPager('Schedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'schedule')); $this->getUser()->setAttribute('page', $page, 'schedule'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $actions = array(array('name' => 'filter', 'color' => 'white')); array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_schedule/listSchedAsCSV?{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_schedule/listSchedAsPDF?{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $this->subtitle = $student->getName() . ' - ' . $student->getClassGroup()->toString(); $this->student_id = $student_id; }
public function executeListByStudent() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->student = $student; $this->forward404Unless($student); $c = new Criteria(); $c->add(AcademicCalendarPeer::ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $student->getAcademicCalendar()->getDepartment()->getChildRecurs(), Criteria::IN); $c->addJoin(AccalActivityPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addDescendingOrderByColumn(AccalActivityPeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'accal_activity')); $this->getUser()->setAttribute('max_per_page', $rpp, 'accal_activity'); $pager = new sfPropelPager('AccalActivity', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'accal_activity')); $this->getUser()->setAttribute('page', $page, 'accal_activity'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $this->actions = $actions; $actions2 = array(array('name' => '<span>Tahun Ajaran 2011/2012</span>', 'url' => 'accal_activity/listByStudent', 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public static function retrieveByStudentId($student_id) { $c = new Criteria(); $student = StudentPeer::retrieveByPK($student_id); $scsy = StudentCareerSchoolYearPeer::retrieveCareerSchoolYearForStudentAndYear($student, SchoolYearPeer::retrieveCurrent()); $c->add(self::STUDENT_CAREER_SCHOOL_YEAR_ID, $scsy[0]->getId()); $c->add(self::IS_DELETED, true, Criteria::EQUAL); return self::doSelectOne($c); }
public static function doSelectByStudentAll() { $student = StudentPeer::retrieveByPK(sfContext::getInstance()->getRequest()->getParameter('student_id')); if (!$student) { return array(); } $c = new Criteria(); $c->add(VStudentCoursePeer::STUDENT_ID, $student->getId()); return VStudentCoursePeer::doSelect($c); }
public function executeIndex() { $lekarSms = new lekarSms(); $students = StudentPeer::retrieveByPK('1'); echo '<pre>'; print_r($students); echo '</pre>'; var_dump($students->getCode()); //sfLoader::loadHelpers(array('myHelper')); }
public function setStudentsIds($students_ids) { foreach ($students_ids as $student_id) { $student = StudentPeer::retrieveByPK($student_id); $this->setWidget("student_{$student_id}", new mtWidgetFormPlain(array("object" => $student, "add_hidden_input" => true, "use_retrieved_value" => false))); $this->setValidator("student_{$student_id}", new sfValidatorPropelChoice(array("model" => "Student", "required" => true))); $this->setDefault("student_{$student_id}", $student_id); $this->widgetSchema->setLabel("student_{$student_id}", "Student"); $this->widgetSchema->moveField("shift_id", "after", "student_{$student_id}"); } }
/** * Redefines preExecute because this action CANT BE RISED WITHOUT A REFERENCE * */ public function preExecute() { if (!$this->getUser()->getReferenceFor('student')) { $this->getUser()->setFlash('warning', 'Debe seleccionar un estudiante para poder administrar las sanciones.'); $this->redirect('@student'); } $this->student = StudentPeer::retrieveByPK($this->getUser()->getReferenceFor('student')); if (is_null($this->student)) { $this->getUser()->setFlash('warning', 'Debe seleccionar un estudiante para poder administrar las sanciones.'); $this->redirect('@student'); } parent::preExecute(); }
public function executeByStudent() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $c = new Criteria(); $cton1 = $c->getNewCriterion(InboxPeer::STUDENT_ID, $student_id, Criteria::IN); $cton2 = $c->getNewCriterion(InboxPeer::TYPE, 2, Criteria::IN); $cton1->addAnd($cton2); $c->add($cton1); $c->addDescendingOrderByColumn(InboxPeer::SUBJECT); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'outbox')); $this->getUser()->setAttribute('max_per_page', $rpp, 'outbox'); $pager = new sfPropelPager('Inbox', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'outbox')); $this->getUser()->setAttribute('page', $page, 'outbox'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'black')); $this->actions = $actions; $this->subtitle = $student->toString(); $this->student_id = $student_id; }
public function executeListByStudent() { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $c = new Criteria(); $c->add(AbsencePeer::STUDENT_ID, $student->getId()); $c->addAscendingOrderByColumn(AbsencePeer::TIME_IN); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($this->hasRequestParameter('student_name') && $this->getRequestParameter('student_name') == '') { $filters['STUDENT_ID'] = null; } if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'attendance')); $this->getUser()->setAttribute('max_per_page', $rpp, 'attendance'); $pager = new sfPropelPager('Absence', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'attendance')); $this->getUser()->setAttribute('page', $page, 'attendance'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $this->actions = $actions; $this->subtitle = $student->toString(); $this->student_id = $student_id; }
public function sendSmsAttendance($student_code, $type, $time) { $connection = Propel::getConnection(); $query = "\n\t\t\tselect id as student_id from student where replace(code, '.', '') = '{$student_code}';\n\t\t"; $statement = $connection->prepareStatement($query); $resultset = $statement->executeQuery(); $resultset->next(); $studentId = $resultset->getInt('student_id'); $student = StudentPeer::retrieveByPK($studentId); $senderId = $this->getSenderId($student->getClassGroup()->getDepartmentId()); $prefix = $senderId->getText(); $date = date('j-M-Y', $time); $hour = date('H:i', $time); $recipients = array(array('type' => 'student', 'value' => $student->getId())); if ($type == 'attend') { $subject = 'Attend SMS ' . $student->getName() . ' - ' . $student->getClassGroup()->getName(); $message = $prefix . ' Alhamdulillah, Ananda ' . $student->getName() . ' telah hadir di sekolah pada tgl ' . $date . ' pkl ' . $hour; } else { if ($type == 'return') { $subject = 'Return SMS ' . $student->getName() . ' - ' . $student->getClassGroup()->getName(); $message = $prefix . 'Ananda ' . $student->getName() . ' tlh selesai kbm di sekolah pd ' . $date . ' pkl ' . $hour; $message .= '. Silahkan dijemput'; } else { return; } } $log = new SmsLog(); //$log->setCreatorUserId($employeeId); $log->setCreatorType('system'); $log->setSubject($subject); $log->setRecipient($this->jsonwrapper->json_encode($recipients)); $log->setMessage($message); $log->setSenderId($senderId->getId()); $log->setCreated(date('Y-m-d H:i:s')); $log->setSmsLong(1); $log->setSmsCount(1); $sendAt = date('Y-m-d H:i:s'); $log->setSendAt('now'); $log->save(); $recNumber = $student->getStudentDetail()->getCellphone(); $rec = new SmsLogRecipient(); $rec->setLogId($log->getId()); $rec->setRecipientId($student->getId()); $rec->setRecipientType('student'); $rec->setRecipientNumber($recNumber); $rec->setStatus('pending'); $rec->setLog(0); $rec->save(); /* Saving to gammu Database */ $save = $this->smsConn->send($rec->getId(), 1, 2, 3, $recNumber, $log->getMessage(), $log->getCreated(), $log->getSendAt()); }
/** * redefines preExecute because this action CANT BE RISED WITHOUT A REFERENCE * */ public function preExecute() { if (!$this->getUser()->getReferenceFor('student') && is_null($this->getUser()->getAttribute('student_id'))) { $this->getUser()->setFlash('warning', 'Debe seleccionar un alumno para poder administrar sus reincorporaciones.'); $this->redirect('@student'); } $this->student = StudentPeer::retrieveByPK($this->getUser()->getReferenceFor('student')); if (is_null($this->student)) { $this->student = StudentPeer::retrieveByPK($this->getUser()->getAttribute('student_id')); } if (is_null($this->student)) { $this->getUser()->setFlash('warning', 'Debe seleccionar un alumno para poder administrar sus reincorporaciones.'); $this->redirect('@student'); } parent::preExecute(); }
public function executeUpdateEquivalence(sfWebRequest $request) { $parametrs = $request->getPostParameters(); $this->career_school_year = CareerSchoolYearPeer::retrieveByPK($parametrs['career_school_year_id']); $this->career = $this->career_school_year->getCareer(); $this->career_subject_school_years = array(); $this->years = array(); $this->forms = array(); for ($y = 1; $y <= $this->career->getQuantityYears(); $y++) { $this->years[] = $y; $this->career_subject_school_years[$y] = $this->career->getCareerSubjectsForYear($y, true); } unset($parametrs['_save']); unset($parametrs['career_school_year_id']); $valid = true; foreach ($parametrs as $parameter) { $career_subject_id = $parameter['career_subject_id']; $student_id = $parameter['student_id']; $school_year_id = $parameter['school_year']; $career_subject = CareerSubjectPeer::retrieveByPK($career_subject_id); $student = StudentPeer::retrieveByPK($student_id); $student_approved_career_subject = StudentApprovedCareerSubjectPeer::retrieveOrCreateByCareerSubjectAndStudent($career_subject->getId(), $student->getId()); $student_approved_career_subject->setSchoolYearId($school_year_id); $parameter['career_subject_id'] = $student_approved_career_subject->getCareerSubjectId(); $this->form = new EquivalenceForm($student_approved_career_subject); $this->form->setCareerSubjectAndStudent($career_subject, $student); if (isset($parameter['mark']) && $parameter['mark'] != "") { $this->form->bind($parameter); if ($this->form->isValid()) { $this->form->save(); } else { $valid = false; } } $this->form = new EquivalenceForm($student_approved_career_subject); $this->form->setCareerSubjectAndStudent($career_subject, $student); $this->forms[$career_subject->getId()] = $this->form; $parameter['career_subject_id'] = $career_subject_id; } if ($valid) { $this->getUser()->setFlash('notice', 'subjects are updated correctly'); } else { $this->setProcessFormErrorFlash(); } $this->module = $this->getModuleName(); $this->setTemplate('makeUpEquivalence'); }
public static function doSelectByStudentCurriculum(Criteria $criteria, $con = null) { $usertype = sfContext::getInstance()->getUser()->getAttribute('usertype', 'common', 'bo'); $student = null; $student_id = null; if ($usertype == 'student') { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); } if ($student == null) { $student_id = sfContext::getInstance()->getRequest()->getParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); } $curr = $student->getCurriculum(); $cgs = array(); foreach ($curr->getAcademicCalendars() as $accal) { foreach ($accal->getClassGroup()->getChildRecurs() as $cg) { array_push($cgs, $cg); } } $criteria->add(VClassGroupPeer::ID, $cgs, Criteria::IN); $tmp_depts = VClassGroupPeer::doSelect($criteria); $depts = array(); foreach ($tmp_depts as $key => $val) { $pi = $val->getParentalIndex(); $prefix = ''; for ($i = 0; $i < $val->level - 1; $i++) { $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue(); } $val->setName($prefix . $val->getName()); $val->setCode($prefix . $val->getCode()); $depts[$pi] = $val; } ksort($depts); $result = array(); foreach ($depts as $r) { $result[] = $r; } return $result; }
public function configure() { $student_id = $this->getOption('student_id'); $this->student = StudentPeer::retrieveByPK($student_id); $this->career_school_year_id = $this->getOption('career_school_year_id'); $this->course_subject_id = $this->getOption('course_subject_id'); $this->division_id = $this->getOption('division_id'); $sf_formatter_attendance_week = new sfWidgetFormSchemaFormatterAttendanceWeek($this->getWidgetSchema()); $this->getWidgetSchema()->addFormFormatter("AttendanceWeek", $sf_formatter_attendance_week); $this->getWidgetSchema()->setFormFormatterName('AttendanceWeek'); $day = $this->getOption('day'); $this->widgetSchema->setNameFormat('attendance_' . $student_id . '][%s]'); #student $this->setWidget("student_id", new sfWidgetFormInputHidden()); $this->setValidator("student_id", new sfValidatorPropelChoice(array("model" => "Student", "required" => true))); $this->setWidget("student", new mtWidgetFormPlain(array('object' => $this->student))); $sf_user = sfContext::getInstance()->getUser(); if ($sf_user->isPreceptor()) { $limit = SchoolBehaviourFactory::getInstance()->getDaysForMultipleAttendanceForm(); } else { $limit = BaseSchoolBehaviour::DAYS_FOR_MULTIPLE_ATTENDANCE_FORM; } for ($i = 0; $i <= $limit; $i++) { $day_i = date('Y-m-d', strtotime($day . '-' . $i . 'day ago')); $student_attendance = StudentAttendancePeer::retrieveOrCreateByDateAndStudent($day_i, $this->student, $this->getOption('course_subject_id')); if ($student_attendance) { $this->setDefault("value_" . $i, $student_attendance->getAbsenceTypeId()); } $this->setWidget("value_" . $i, $this->getAttendanceWidget()); #$this->getWidget('value_'.$i)->setLabel($day_i); $this->setValidator("value_" . $i, $this->getAttendanceValidator()); } #sumarle 7 dias al dia antes de mandarlo a la funcion // $total_absenses = $this->student->getAmountStudentAttendanceUntilDay( strtotime($day . '+ 7 day a go')); // $this->setWidget("total", new mtWidgetFormPartial(array('module'=>'student_attendance','partial'=>'total_absens','form'=>$this,'parameters'=>array('total'=>$total_absenses )) )); $this->setDefault("student_id", $student_id); $this->disableCSRFProtection(); $this->setWidget('period', new mtWidgetFormPartial(array('module' => 'student_attendance', 'partial' => 'totalAbsences', 'form' => $this, 'parameters' => array('career_school_year_id' => $this->career_school_year_id, 'course_subject_id' => null, 'student' => $this->student, 'day' => $day)))); $this->getWidgetSchema()->moveField('period', sfWidgetFormSchema::LAST); }
if ($can_remove) { echo link_to_remote(__('delete'), array('url' => ' payment_journal_s/delete?id=' . $payment_journal->getId() . '&student_id=' . $student->getId(), 'confirm' => __('Are you sure?'), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'red')); } ?> </p> </td> <?php } else { ?> <td class='first'> <?php $payer = null; if ($payment_journal->getPayerType() == PaymentJournal::PAYER_TYPE_APPLICANT) { $payer = TestApplicantPeer::retrieveByPK($payment_journal->getPayer()); } elseif ($payment_journal->getPayerType() == PaymentJournal::PAYER_TYPE_STUDENT) { $payer = StudentPeer::retrieveByPK($payment_journal->getPayer()); } ?> <?php echo link_to_function(strlen($payment_journal->getPayer() && $payer != null) > 0 ? $payer->tostring() : 'n/a', visual_effect('toggle_appear', 'row_' . $payment_journal->getId(), array('onclick' => 'this.blur()'))); ?> <p id="row_<?php echo $payment_journal->getId(); ?> " style="display:none;">. <?php echo link_to_remote(__('detail'), array('url' => ' payment_journal_s/show?id=' . $payment_journal->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'green')); ?> <?php if ($can_edit) { echo link_to_remote(__('edit'), array('url' => ' payment_journal_s/edit?id=' . $payment_journal->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'blue'));
echo $outbox_stu->getEmployeeId() ? $outbox_stu->getEmployee()->toString() : '-'; ?> </p></td> </tr> <?php } else { ?> <tr> <td class='first' width="20%" style="vertical-align:middle;"><label ><?php echo __('Kepada'); ?> </label></td> <td class="first" width="2%" style="text-align:center; vertical-align:middle;">:</td> <td class="first" style="vertical-align:middle;"> <p class="detail" style="font-weight: bold;"><?php echo $outbox_stu->getStudent2() ? StudentPeer::retrieveByPK($outbox_stu->getStudent2())->toStringCap() : '-'; ?> </p></td> </tr> <?php } ?> <tr> <td width="20%" style="vertical-align:middle;"><label ><?php echo __('Tanggal'); ?> </label></td> <td width="2%" style="text-align:center; vertical-align:middle;">:</td> <td style="vertical-align:middle;"><p class="detail"><?php echo $outbox_stu->getCreatedAt() ? $outbox_stu->getCreatedAt('d-m-Y') : '-'; ?>
public function executeListHistory() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); $c = new Criteria(); $c->add(PaymentJournalPeer::PAYER_TYPE, PaymentJournal::PAYER_TYPE_STUDENT); $c->add(PaymentJournalPeer::PAYER, $student->getId()); $c->addJoin(PaymentHistoryPeer::PAYMENT_JOURNAL_ID, PaymentJournalPeer::ID); $this->sortHistory($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterHistory($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'payment_history')); $this->getUser()->setAttribute('max_per_page', $rpp, 'payment_history'); $pager = new sfPropelPager('PaymentHistory', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'payment_history')); $this->getUser()->setAttribute('page', $page, 'payment_history'); $pager->setPage($page); $pager->init(); $this->pager = $pager; if ($student->getStatus() == Student::STATUS_GRADUATE) { $actions2 = array(array('name' => '<span>Data Akademik</span>', 'url' => 'scholar_graduate/list', 'color' => 'sky')); } elseif ($student->getStatus() == Student::STATUS_OVERDUE) { $actions2 = array(array('name' => '<span>Data Akademik</span>', 'url' => 'scholar_graduate/list', 'color' => 'sky')); } else { $actions2 = array(array('name' => '<span>Data Akademik</span>', 'url' => 'scholar/list', 'color' => 'sky')); } array_push($actions2, array('name' => '<span>Kartu Tanda Murid</span>', 'url' => 'student_info/inputExpiredDate?id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Orang Tua Murid</span>', 'url' => 'student_parents/list?student_id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Prestasi Murid</span>', 'url' => 'student_achievement/list?student_id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Bakat Murid</span>', 'url' => 'student_talent/list?student_id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Penilaian Murid</span>', 'url' => 'student_info/listScore?student_id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Absensi Murid</span>', 'url' => 'student_info/listAbsence?student_id=' . $student->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Riwayat Pembayaran</span>', 'url' => 'student_info/listHistory?student_id=' . $student->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; $actions = array(); array_unshift($actions, array('name' => 'Print PDF', 'url' => "student_info/listHistoryAsPDF?student_id=" . $student->getId(), 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print Excel', 'url' => "student_info/listHistoryAsCSV?student_id=" . $student->getId(), 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $this->subtitle = $student->toString(); $this->student = $student; }
public function getStudentRelatedByStudent2($con = null) { include_once 'lib/model/om/BaseStudentPeer.php'; if ($this->aStudentRelatedByStudent2 === null && $this->student_2 !== null) { $this->aStudentRelatedByStudent2 = StudentPeer::retrieveByPK($this->student_2, $con); } return $this->aStudentRelatedByStudent2; }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); if (!$student) { $student_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $student = StudentPeer::retrieveByPK($student_id); } $this->forward404Unless($student); $this->student = $student; $c = new Criteria(); $c->add(StudentJobHistoryPeer::STUDENT_ID, $student->getId()); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_job_history')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student_job_history'); $pager = new sfPropelPager('StudentJobHistory', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_job_history')); $this->getUser()->setAttribute('page', $page, 'student_job_history'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); if ($acl->getAddPriv()) { array_unshift($actions, array('name' => 'add', 'url' => 'student_job_history/create?student_id=' . $student->getId(), 'color' => 'green')); } $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_job_history/listAsCSV?{$filter_string}&student_id=" . $student->getId(), 'color' => 'white', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_job_history/listAsPDF?{$filter_string}&student_id=" . $student->getId(), 'color' => 'white', 'type' => 'direct')); $this->actions = $actions; $this->subtitle = $student->toString(); }
public function executePaymentSlip() { $stu = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $job = JobPeer::retrieveByCode($this->getModuleName()); $academic_process = $job->getAcademicProcess(); $this->forward404Unless($stu && $job && $academic_process); $c = new Criteria(); $c->add(AcademicProcessPeer::CODE, $academic_process->getCode()); $c->addJoin(AcademicProcessPeer::ID, AcademicCostPeer::ACADEMIC_PROCESS_ID); $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, StudentLeavePeer::ACADEMIC_CALENDAR_ID); $c->add(StudentLeavePeer::STATUS, StudentLeave::STATUS_APPROVED); $c->add(StudentLeavePeer::STUDENT_ID, $stu->getId()); $costs = AcademicCostPeer::doSelect($c); $total_cost = 0; foreach ($costs as $c) { $total_cost += $c->getAmount(); } $this->stu = $stu; $this->costs = $costs; $this->total_cost = $total_cost; $this->setViewClass('sfDomPDF'); }
public function getStudent($con = null) { include_once 'lib/model/om/BaseStudentPeer.php'; if ($this->aStudent === null && $this->student_id !== null) { $this->aStudent = StudentPeer::retrieveByPK($this->student_id, $con); } return $this->aStudent; }
$i = 0; foreach ($pager->getResults() as $payment_history) { ++$i; ?> "<?php echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage(); ?> ",<?php if (!$byStudent) { ?> "<?php $payer = null; if ($payment_history->getPaymentJournal()->getPayerType() == PaymentJournal::PAYER_TYPE_APPLICANT) { $payer = TestApplicantPeer::retrieveByPK($payment_history->getPaymentJournal()->getPayer()); } elseif ($payment_history->getPaymentJournal()->getPayerType() == PaymentJournal::PAYER_TYPE_STUDENT) { $payer = StudentPeer::retrieveByPK($payment_history->getPaymentJournal()->getPayer()); } echo strlen($payment_history->getPaymentJournal()->getPayer() && $payer != null) > 0 ? $payer->tostring() : 'n/a'; ?> ",<?php } ?> "<?php echo $payment_history->getPaymentJournal()->getAcademicCost() ? $payment_history->getPaymentJournal()->getAcademicCost()->getAcademicCostComponent() ? $payment_history->getPaymentJournal()->getAcademicCost()->getAcademicCostComponent()->toString() : '-' : '-'; ?> ","<?php echo $payment_history->getPaymentJournal()->getAcademicProcess() ? $payment_history->getPaymentJournal()->getAcademicProcess()->toString() : '-'; ?> ","<?php echo $payment_history->getPaymentJournal()->getAcademicCost()->getAcademicCalendar()->getCurriculum()->getDepartment() ? $payment_history->getPaymentJournal()->getAcademicCost()->getAcademicCalendar()->getCurriculum()->getDepartment()->toString() : '-'; ?>
public function executeDelete() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $alumni_work_history = AlumniWorkHistoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($alumni_work_history); $ref_error = 0; foreach ($alumni_work_history->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $alumni_work_history->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('alumni_work_history/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('alumni_work_history/delete', '_ERR_DELETE_ (' . $alumni_work_history->toString() . ' - id:' . $alumni_work_history->getId() . ')'); } else { $alumni_work_history->delete(); } $this->getRequest()->setParameter('student_id', $student_id); return $this->forward('alumni_work_history', 'list?student_id=' . $student_id); }
public function executeGetAcademicCosts() { $student_id = $this->getRequestParameter('payer'); $student = StudentPeer::retrieveByPK($student_id); #$this->forward404Unless($student); $c = new Criteria(); $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $c->addJoin(AcademicCalendarPeer::ID, AcademicCostPeer::ACADEMIC_CALENDAR_ID); $c->add(StudentPeer::ID, $student_id); #if ($student->getClassGroupId()) $c->add(AcademicCalendarPeer::CLASS_GROUP_ID, $student->getClassGroup()->getParentRecurs(), Criteria::IN); $objs = AcademicCostPeer::doSelect($c); $ac_costs = array(); foreach ($objs as $o) { $ac_costs[$o->getId()] = $o->toString(); } $this->content = $ac_costs; #$this->forward404Unless($ac_costs); $this->setTemplate('buildOptions'); }
public function executePrintFinal() { $this->tanggalCetak = $this->getRequestParameter('time'); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); if (!$counseling) { if (SF_ENVIRONMENT == 'dev') { echo 'Counseling Not Found'; } die; } $this->counseling = $counseling; $this->waliKelas = $counseling->toStringEmployee(); $this->academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id')); if (!$this->academic_calendar) { if (SF_ENVIRONMENT == 'dev') { echo 'Academic Calendar Not Found'; } die; } $this->department = $this->academic_calendar->getDepartment(); $this->departmentDetail = $this->department->getThisDepartmentDetail(); $time = $this->getRequestParameter('time'); $time2 = $this->getRequestParameter('time2'); $tgl = $this->getRequestParameter('tgl_cetak'); /* Get Student */ $student_id = $this->getRequestParameter('student_id'); $this->student = StudentPeer::retrieveByPK($student_id); if (!$this->student) { if (SF_ENVIRONMENT == 'dev') { echo 'Student Not Found'; } die; } /* Get StudentAccal */ $this->studentAccal = StudentAccalPeer::getStudentByAccal($this->academic_calendar->getId(), $this->student->getId()); if (!$this->studentAccal) { if (SF_ENVIRONMENT == 'dev') { echo 'Student Accal Not Found'; } die; } /* Get Score Rule */ $this->scoreRule = nilaiRapor::getScoreRuleAkhir($this->academic_calendar->getId(), $counseling->getClassGroup()->getClassTypeId()); if (!$this->scoreRule) { if (SF_ENVIRONMENT == 'dev') { echo 'AccalId => ' . $this->academic_calendar->getId() . '<br />'; echo 'getClassTypeId => ' . $counseling->getClassGroup()->getClassTypeId() . '<br />'; echo 'Score Rule Not Found'; } die; } $this->scoreRuleSubject = nilaiRapor::getScoreRuleSubject($this->scoreRule->getId()); $this->orientation = 'portrait'; $this->papersize = 'a4'; if (SF_ENVIRONMENT != 'dev') { $this->setViewClass('sfDomPDF'); } }
<?php /* * Kimkëlen - School Management Software * Copyright (C) 2013 CeSPI - UNLP <*****@*****.**> * * This file is part of Kimkëlen. * * Kimkëlen is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License v2.0 as published by * the Free Software Foundation. * * Kimkëlen is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Kimkëlen. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>. */ $student_id = is_null($sf_user->getReferenceFor('student')) ? $sf_user->getAttribute('student_id') : $sf_user->getReferenceFor('student'); ?> <h2><?php echo __("Alumno: %student%", array("%student%" => StudentPeer::retrieveByPK($student_id))); ?> </h2>
public function executeSaveScore() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->forward404Unless($academic_calendar); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $student_accal_id = $this->getRequestParameter('student_accal_id'); $student_accal = StudentAccalPeer::retrieveByPK($student_accal_id); $this->forward404Unless($student_accal); $scores = $this->getRequestParameter('score'); foreach ($scores as $k => $score) { if ($score != null) { $cb = new Criteria(); $cb->add(CounselingRaportPeer::STUDENT_ACCAL_ID, $student_accal->getId()); $cb->add(CounselingRaportPeer::COUNSELING_SPEC_ID, $k); $raport = CounselingRaportPeer::doSelectOne($cb); if ($raport == null) { $raport = new CounselingRaport(); } $raport->setStudentAccalId($student_accal->getId()); $raport->setCounselingSpecId($k); $raport->setGrade($score); $raport->save(); } else { $cb = new Criteria(); $cb->add(CounselingRaportPeer::STUDENT_ACCAL_ID, $student_accal->getId()); $cb->add(CounselingRaportPeer::COUNSELING_SPEC_ID, $k); $raport = CounselingRaportPeer::doSelectOne($cb); if ($raport != null) { $raport->delete(); } } } return $this->redirect('counseling_raport/listCounselingScore?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId()); }
echo link_to(__('paymentReceipt'), '#', array('class' => 'white', 'style' => 'font-size:10px;', 'onclick' => "window.open(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'payment/printReceipt?id=" . $payment->getId() . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'link',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height=480,width=640,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)")) . ' '; ?> </p> </td> <?php } else { ?> <td class='first'> <?php $payer = null; $year = null; if ($payment->getPayerType() == PaymentJournal::PAYER_TYPE_APPLICANT) { $payer = TestApplicantPeer::retrieveByPK($payment->getPayer()); $year = $payer->getYear(); } elseif ($payment->getPayerType() == PaymentJournal::PAYER_TYPE_STUDENT) { $payer = StudentPeer::retrieveByPK($payment->getPayer()); if ($payer) { $year = $payer->getAcademicCalendar()->getName(); } else { $year = '-'; } } ?> <?php echo link_to_function(strlen($payment->getPayer() && $payer != null) > 0 ? $payer->getCode() : 'n/a', visual_effect('toggle_appear', 'row_' . $payment->getId(), array('onclick' => 'this.blur()'))); ?> <p id="row_<?php echo $payment->getId(); ?> " style="display:none;">. <?php