Exemplo n.º 1
0
 public function filterCounseling($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'NAME') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'CODE') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('CODE');
         } elseif ($key == 'CODE2') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('CODE2');
         } elseif ($key == 'YEAR') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('YEAR');
         } elseif ($key == 'SUBJECT_NAME') {
             $c->addJoin(ClassCounselingPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
             $c->addJoin(CourseSchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
             $c->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID);
             $column = SubjectPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ACADEMIC_CALENDAR_ID') {
             $c->addJoin(ClassCounselingPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
             $c->addJoin(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $column = AcademicCalendarPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CLASS_NAME') {
             $c->addJoin(ClassCounselingPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } else {
             $column = ClassCounselingPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $c->add($name, $value, Criteria::LIKE);
         } else {
             if ($creoleType == CreoleTypes::DATE) {
                 $c->add($name, $value, Criteria::LIKE);
             } else {
                 if ($creoleType == CreoleTypes::INTEGER) {
                     $c->add($name, $value, Criteria::EQUAL);
                 } else {
                     if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                         $c->add($name, "%{$value}%", Criteria::LIKE);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public function executeReply()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $class_counseling = ClassCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_counseling);
     $this->outbox_emp = new OutboxEmp();
     $this->outbox_emp = new OutboxEmp();
     $this->actions = array(array('name' => 'kirim', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'employee_counsel/list', 'color' => 'black'));
     $this->subtitle = $employee->toString();
     $this->type = 'add';
     $this->employee_id = $employee_id;
     $this->class_counseling = $class_counseling;
     $this->student_id = $class_counseling->getStudentId();
 }
Exemplo n.º 3
0
 public function executeShowCounseling()
 {
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $course_schedule_id = $course_schedule->getId();
     $class_counseling = ClassCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_counseling);
     $this->subtitle = $class_counseling->toString() . ' - id:' . $class_counseling->getId();
     $actions = array(array('name' => 'back', 'url' => 'course_counseling/list?course_id=' . $course_schedule->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Riwayat Agenda Kelas</span>', 'url' => 'rpt_course/listAgenda?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     array_unshift($actions2, array('name' => '<span>Riwayat Akademik</span>', 'url' => 'rpt_course/list', 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Riwayat Absensi Kelas</span>', 'url' => 'rpt_course/listAbsence?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Riwayat Jadwal Tugas/Ulangan/PR</span>', 'url' => 'rpt_course/listSched?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Riwayat Bimbingan Konseling</span>', 'url' => 'rpt_course/listCounseling?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Riwayat Penilaian</span>', 'url' => 'rpt_course/listScore?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     $this->actions2 = $actions2;
     $this->class_counseling = $class_counseling;
     $this->course_schedule = $course_schedule;
 }
Exemplo n.º 4
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(ClassCounselingPeer::ID, $pks, Criteria::IN);
         $objs = ClassCounselingPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemplo n.º 5
0
 public function executeUpdateEmail()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $class_counseling = ClassCounselingPeer::retrieveByPK($this->getRequestParameter('class_counseling_id'));
     $this->forward404Unless($class_counseling);
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     if (!$this->getRequestParameter('student_id')) {
         $emp = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_2'));
         $this->forward404Unless($emp);
         $inbox_emp = new InboxEmp();
         $inbox_emp->setEmployee2($this->getRequestParameter('employee_id'));
         $inbox_emp->setEmployeeId($emp->getId());
         $inbox_emp->setSubject($this->getRequestParameter('subject'));
         $inbox_emp->setDetail($this->getRequestParameter('detail'));
         $inbox_emp->setType(2);
         $inbox_emp->setCreatedAt($this->getRequestParameter('created_at'));
         $inbox_emp->setCode($emp->toString());
         $inbox_emp->save();
         $employee = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_id'));
         $this->forward404Unless($employee);
         $outbox_emp = new OutboxEmp();
         $outbox_emp->setEmployee2($this->getRequestParameter('employee_id'));
         $outbox_emp->setEmployeeId($emp->getId());
         $outbox_emp->setSubject($this->getRequestParameter('subject'));
         $outbox_emp->setDetail($this->getRequestParameter('detail'));
         $outbox_emp->setType(2);
         $outbox_emp->setCreatedAt($this->getRequestParameter('created_at'));
         $outbox_emp->setCode($employee->toString());
         $outbox_emp->save();
     } else {
         $emp = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_2'));
         $this->forward404Unless($emp);
         $inbox_stu = new InboxStu();
         $inbox_stu->setStudent2($this->getRequestParameter('student_id'));
         $inbox_stu->setEmployeeId($emp->getId());
         $inbox_stu->setSubject($this->getRequestParameter('subject'));
         $inbox_stu->setDetail($this->getRequestParameter('detail'));
         $inbox_stu->setType(1);
         $inbox_stu->setCreatedAt($this->getRequestParameter('created_at'));
         $inbox_stu->setCode($emp->toString());
         $inbox_stu->save();
         $stu = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
         $this->forward404Unless($stu);
         $outbox_emp = new OutboxEmp();
         $outbox_emp->setStudentId($this->getRequestParameter('student_id'));
         $outbox_emp->setEmployeeId($emp->getId());
         $outbox_emp->setSubject($this->getRequestParameter('subject'));
         $outbox_emp->setDetail($this->getRequestParameter('detail'));
         $outbox_emp->setType(1);
         $outbox_emp->setCreatedAt($this->getRequestParameter('created_at'));
         $outbox_emp->setCode($stu->toStringCap());
         $outbox_emp->save();
         /* SMS ADD */
         if (SF_ENVIRONMENT == 'dev') {
             if ($this->getRequestParameter('send_message') == 1) {
                 $lekarSms = new lekarSms();
                 $sms = array('subject' => $this->getRequestParameter('subject'), 'message' => $this->getRequestParameter('detail'));
                 $userType = $this->getContext()->getUser()->getAttribute('usertype', '', 'bo');
                 $lekarSms->sendSmsCounseling($userType, $emp->getId(), $this->getRequestParameter('student_id'), $sms);
             }
         }
         /* ------------------------------- */
     }
     if ($class_counseling->getCourseSchedule()->getAcademicCalendar()->getCourseModel() == 'A') {
         return $this->redirect('course_counseling/listByEmployee');
     } else {
         return $this->redirect('course_counseling/listByEmployee2');
     }
 }
Exemplo n.º 6
0
 public function executeShowCounseling()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'sm_content/listCounseling');
     $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;
     $class_counseling = ClassCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_counseling);
     $this->subtitle = $class_counseling->toString() . ' - id:' . $class_counseling->getId();
     $actions = array(array('name' => 'back', 'url' => 'sm_content/listCounseling', 'color' => 'black'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Konseling Dalam Kelas</span>', 'url' => 'sm_content/listCounseling', 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Konseling Luar Kelas</span>', 'url' => 'sm_content/listOutclassCounseling', 'color' => 'sky'));
     $this->actions2 = $actions2;
     $this->class_counseling = $class_counseling;
 }
Exemplo n.º 7
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = ClassCounselingPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setCourseScheduleId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setDetail($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setAction($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setStatus($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setStudentId($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setCounselingStatusId($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setClassGroupId($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setEmployeeId($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setGrade($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setReward($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setTimeReport($arr[$keys[11]]);
     }
 }
Exemplo n.º 8
0
 public function executeShowCounseling()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $course_schedule_id = $course_schedule->getId();
     $class_counseling = ClassCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_counseling);
     $this->subtitle = $class_counseling->toString() . ' - id:' . $class_counseling->getId();
     $actions = array(array('name' => 'back', 'url' => 'course_counseling/list?course_id=' . $course_schedule->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $actions2 = array(array('name' => '<span>Riwayat Agenda Kelas</span>', 'url' => 'course_history/listAgenda?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     array_unshift($actions2, array('name' => '<span>Riwayat Akademik</span>', 'url' => 'course_history/list', 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Riwayat Absensi Kelas</span>', 'url' => 'course_history/listAbsence?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Riwayat Jadwal Tugas/Ulangan/PR</span>', 'url' => 'course_history/listSched?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
     array_push($actions2, array('name' => '<span>Riwayat Bimbingan Konseling</span>', 'url' => 'course_history/listCounseling?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
     $this->class_counseling = $class_counseling;
     $this->course_schedule = $course_schedule;
 }