public function executeUpdateStudent() { $counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id')); $this->forward404Unless($counseling); $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id')); $this->forward404Unless($academic_calendar); $tanggal = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); if ($this->getRequestParameter('bln') < 10) { $tanggal2 = $this->getRequestParameter('thn') . '-0' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); } else { $tanggal2 = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); } $tgl_cetak = $this->getRequestParameter('tgl'); $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(); } } $this->counseling = $counseling; $this->tanggal = $tanggal; $this->tgl_cetak = $tgl_cetak; return $this->redirect('counseling_raport/previewStudent?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&time=' . $tanggal . '&time2=' . $tanggal2 . '&tgl_cetak=' . $tgl_cetak); }
public function delete($con = null) { if ($this->isDeleted()) { throw new PropelException("This object has already been deleted."); } if ($con === null) { $con = Propel::getConnection(TempTablePeer::DATABASE_NAME); } try { $con->begin(); TempTablePeer::doDelete($this, $con); $this->setDeleted(true); $con->commit(); } catch (PropelException $e) { $con->rollback(); throw $e; } }
public function executeUpdate() { $now = date('d-m-Y'); $cw = new Criteria(); $cw->add(TempTablePeer::EMPLOYEE_ID, 1112); TempTablePeer::doDelete($cw); $collection_list_ser = $this->getRequestParameter('collection_list_ser'); $params = array(); foreach (explode('&', $this->getRequestParameter('collection_list_ser')) as $p) { $p = explode('=', $p); $params[rawurldecode($p[0])][] = rawurldecode($p[1]); } if (array_key_exists('collections', $params)) { foreach ($params['collections'] as $collection_id) { $cr = new Criteria(); $cr->add(TempTablePeer::COUNSELING_ID, $collection_id); $cr->add(TempTablePeer::EMPLOYEE_ID, 1112); $temp_table = TempTablePeer::doSelectOne($cr); if ($temp_table == null) { $temp_table = new TempTable(); } $temp_table->setCounselingId($collection_id); $temp_table->setEmployeeId(1112); $temp_table->save(); } } return $this->redirect('collection_print/preview'); }
public function executeUpdate() { $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->forward404Unless($academic_calendar); $department_id = $this->getRequestParameter('department_id'); $department = DepartmentPeer::retrieveByPK($department_id); $this->forward404Unless($department); $month_id1 = $this->getRequestParameter('month1'); $month1 = MonthPeer::retrieveByPK($month_id1); $this->forward404Unless($month1); $month_id2 = $this->getRequestParameter('month2'); $month2 = MonthPeer::retrieveByPK($month_id2); $this->forward404Unless($month2); $thn1 = $this->getRequestParameter('thn1'); $thn2 = $this->getRequestParameter('thn2'); $tgl_absen1 = $this->getRequestParameter('tgl_absen1'); $tgl_absen2 = $this->getRequestParameter('tgl_absen2'); $tanggal = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); if ($this->getRequestParameter('bln') < 10) { $tanggal2 = $this->getRequestParameter('thn') . '-0' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); } else { $tanggal2 = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl'); } $tgl_cetak = $this->getRequestParameter('tgl'); $cw = new Criteria(); $cw->add(TempTablePeer::COUNSELING_ID, $academic_calendar->getId()); $cw->add(TempTablePeer::STUDENT_ID, $department->getId()); TempTablePeer::doDelete($cw); $employee_list_ser = $this->getRequestParameter('employee_list_ser'); $params = array(); foreach (explode('&', $this->getRequestParameter('employee_list_ser')) as $p) { $p = explode('=', $p); $params[rawurldecode($p[0])][] = rawurldecode($p[1]); } if (array_key_exists('employees', $params)) { foreach ($params['employees'] as $employee_id) { $cr = new Criteria(); $cr->add(TempTablePeer::COUNSELING_ID, $academic_calendar->getId()); $cr->add(TempTablePeer::STUDENT_ID, $department->getId()); $cr->add(TempTablePeer::TIME, $tanggal); $cr->add(TempTablePeer::EMPLOYEE_ID, $employee_id); $temp_table = TempTablePeer::doSelectOne($cr); if ($temp_table == null) { $temp_table = new TempTable(); } $temp_table->setEmployeeId($employee_id); $temp_table->setCounselingId($this->getRequestParameter('academic_calendar_id')); $temp_table->setStudentId($this->getRequestParameter('department_id')); $temp_table->setTime($tanggal); $temp_table->save(); } } $this->academic_calendar = $academic_calendar; $this->department = $department; $this->month1 = $month1; $this->month2 = $month2; $this->tanggal = $tanggal; $this->tgl_cetak = $tgl_cetak; $this->tgl_absen1 = $tgl_absen1; $this->tgl_absen2 = $tgl_absen2; $this->tanggal2 = $tanggal2; $this->thn1 = $thn1; $this->thn2 = $thn2; return $this->redirect('employee_report/previewAbsence?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId() . '&time=' . $tanggal . '&time2=' . $tanggal2 . '&tgl_cetak=' . $tgl_cetak . '&month_id1=' . $month1->getId() . '&month_id2=' . $month2->getId() . '&tgl_absen1=' . $tgl_absen1 . '&tgl_absen2=' . $tgl_absen2 . '&thn1=' . $thn1 . '&thn2=' . $thn2); }