예제 #1
0
 public function executeSaveNote()
 {
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     #$this->forward404Unless($counseling);
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     #$this->forward404Unless($academic_calendar);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
                 $ced->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note == null) {
                     $note = new StudentNote();
                 }
                 $note->setStudentId($m);
                 $note->setAcademicCalendarId($academic_calendar->getId());
                 $note->setClassGroupId($counseling->getClassGroupId());
                 $note->setCounselingId($counseling->getId());
                 $note->setNote($desc);
                 $note->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
                 $ced->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note != null) {
                     $note->delete();
                 }
             }
         }
     }
     return $this->redirect('counseling_sd/listNote?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId());
 }
예제 #2
0
            echo $subject_count;
            ?>
">
                                        <?php 
            if (array_key_exists($student_accal_id . '#' . $counseling->getId() . '#133', $remarks)) {
                $remark_all = $remarks[$student_accal_id . '#' . $counseling->getId() . '#133'];
            } else {
                $remark_all = 'A';
            }
            if ($academic_calendar->getDepartmentId() == 10) {
                $cw = new Criteria();
                $cw->add(StudentNotePeer::STUDENT_ID, $student->getId());
                $cw->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
                $cw->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
                $cw->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
                $note = StudentNotePeer::doSelectOne($cw);
                echo $note ? $note->getNote() ? 'Ananda&nbsp;' . $student->getName() . ',&nbsp;' . str_replace("\n", "<br>", $note->getNote()) : ' ' : ' ';
            } else {
                if ($score_rule->getLanguage() == 'Indonesia') {
                    echo $remark_all != 'A' ? 'Ananda&nbsp;' . $student->getName() . ',&nbsp;' . $grade_select[$remark_all] : ' ';
                } else {
                    echo $remark_all != 'A' ? 'Ananda&nbsp;' . $student->getName() . ',&nbsp;' . $detail_select[$remark_all] : ' ';
                }
            }
            ?>
                                    </th>
                                <?php 
        }
        ?>
                                    
                            </tr>
예제 #3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = StudentNotePeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setStudentId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setClassGroupId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setAcademicCalendarId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setCounselingId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setNote($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setRanking($arr[$keys[6]]);
     }
 }
예제 #4
0
 public function getStudentNotesJoinAcademicCalendar($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseStudentNotePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collStudentNotes === null) {
         if ($this->isNew()) {
             $this->collStudentNotes = array();
         } else {
             $criteria->add(StudentNotePeer::COUNSELING_ID, $this->getId());
             $this->collStudentNotes = StudentNotePeer::doSelectJoinAcademicCalendar($criteria, $con);
         }
     } else {
         $criteria->add(StudentNotePeer::COUNSELING_ID, $this->getId());
         if (!isset($this->lastStudentNoteCriteria) || !$this->lastStudentNoteCriteria->equals($criteria)) {
             $this->collStudentNotes = StudentNotePeer::doSelectJoinAcademicCalendar($criteria, $con);
         }
     }
     $this->lastStudentNoteCriteria = $criteria;
     return $this->collStudentNotes;
 }
예제 #5
0
 public function executeUpdate()
 {
     $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
     $this->forward404Unless($counseling);
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $status = $this->getRequestParameter('status');
     $tanggal = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl');
     $tanggal2 = $this->getRequestParameter('thn') . '-0' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl');
     $tgl_cetak = $this->getRequestParameter('tgl');
     $catatan = $this->getRequestParameter('note');
     $cw = new Criteria();
     $cw->add(TempTablePeer::COUNSELING_ID, $counseling->getId());
     TempTablePeer::doDelete($cw);
     $student_list_ser = $this->getRequestParameter('student_list_ser');
     $params = array();
     foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) {
         $p = explode('=', $p);
         $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     }
     if (array_key_exists('students', $params)) {
         foreach ($params['students'] as $student_id) {
             $cr = new Criteria();
             $cr->add(TempTablePeer::COUNSELING_ID, $counseling->getId());
             $cr->add(TempTablePeer::TIME, $tanggal);
             $cr->add(TempTablePeer::STUDENT_ID, $student_id);
             $temp_table = TempTablePeer::doSelectOne($cr);
             if ($temp_table == null) {
                 $temp_table = new TempTable();
             }
             $temp_table->setStudentId($student_id);
             $temp_table->setCounselingId($this->getRequestParameter('counseling_id'));
             $temp_table->setTime($tanggal);
             $temp_table->save();
             if ($catatan != null || $catatan != '') {
                 $cb = new Criteria();
                 $cb->add(StudentNotePeer::STUDENT_ID, $student_id);
                 $cb->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
                 $cb->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
                 $note = StudentNotePeer::doSelectOne($cb);
                 if ($note == null) {
                     $note = new StudentNote();
                 }
                 $note->setStudentId($student_id);
                 $note->setCounselingId($counseling->getId());
                 $note->setClassGroupId($counseling->getClassGroupId());
                 $note->setAcademicCalendarId($academic_calendar->getId());
                 $note->setNote($catatan);
                 $note->save();
             }
         }
     }
     $this->counseling = $counseling;
     $this->tanggal = $tanggal;
     $this->tgl_cetak = $tgl_cetak;
     $this->status = $status;
     $this->catatan = $catatan;
     return $this->redirect('counseling_hist/preview?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&time=' . $tanggal . '&time2=' . $tanggal2 . '&tgl_cetak=' . $tgl_cetak . '&note=' . $catatan);
 }
예제 #6
0
 public function executeSaveNotes()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $ced->add(StudentNotePeer::RANKING, 5);
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note == null) {
                     $note = new StudentNote();
                 }
                 $note->setStudentId($m);
                 $note->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                 $note->setClassGroupId($course_schedule->getClassGroupId());
                 $note->setNote($desc);
                 $note->setRanking(5);
                 $note->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $ced->add(StudentNotePeer::RANKING, 5);
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note != null) {
                     $note->delete();
                 }
             }
         }
     }
     return $this->redirect('course_score/listPersonality?course_id=' . $course_schedule->getId());
 }
예제 #7
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(StudentNotePeer::ID, $pks, Criteria::IN);
         $objs = StudentNotePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
예제 #8
0
 public static function getNotes($studentAccal, $counseling)
 {
     $c = new Criteria();
     $c->add(StudentNotePeer::STUDENT_ID, $studentAccal->getStudentId());
     $c->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $studentAccal->getAcademicCalendarId());
     $c->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
     $c->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
     return StudentNotePeer::doSelectOne($c);
 }