/**
  * This is construct base of the class.
  *
  * A public constructor; initializes the variable $instanceDataBase.
  *
  */
 public function __construct($instanceDataBase)
 {
     parent::__construct($instanceDataBase);
     AttendanceClass::setDataOperationBusiness($instanceDataBase);
     AttendanceClass::getBusiness();
     AttendanceClass::getDescriptionBusiness();
 }
        });        
    });
</script>  

<?php 
$action = 'INSERT';
if (isset($_GET['ACTION']) && $_GET['ACTION'] == 'EDIT') {
    $action = $_GET['ACTION'];
}
$preview_flag = 0;
$pk_id_student = 0;
if ($_GET['ACTION'] == 'EDIT' && isset($_GET['pk_id_planification_activity'])) {
    $proceso_editar = false;
    $data = array();
    $pk_id_actvity = $_GET['pk_id_planification_activity'];
    $attclass = new AttendanceClass($registry[$nameDataBase]);
    $data = $attclass->getListAttendanceClassByActivity($pk_id_actvity);
    if (count($data) > 0) {
        $proceso_editar = true;
    } else {
        $proceso_editar = false;
    }
}
$studentCourse = new AssignStudentCourseHard($registry[$nameDataBase]);
$list = $studentCourse->getListByCourseHard($_GET['PK_ID_COURSE_HARD']);
?>

<form id="course_data_form" method="POST" action="?page=course/take_care_admin&ACTION=INSERT&ENTITY=REGISTER&pk_id_actvity=<?php 
echo $pk_id_actvity;
?>
&PK_ID_COURSE_HARD=<?php 
Beispiel #3
0
 public function executeSave()
 {
     $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_schedule_id'));
     $tanggal = $this->getRequestParameter('thn') . '-' . $this->getRequestParameter('bln') . '-' . $this->getRequestParameter('tgl');
     $tgl_code = $this->getRequestParameter('tgl') . $this->getRequestParameter('bln') . $this->getRequestParameter('thn');
     $bulan = $this->getRequestParameter('bln');
     $tahun = $this->getRequestParameter('thn');
     $status = $this->getRequestParameter('status');
     if ($status) {
         foreach ($status as $stu_id => $status) {
             $stu = StudentPeer::retrieveByPk($stu_id);
             if ($status == AbsenceCourse::STATUS_PRESENT) {
                 $cr = new Criteria();
                 $cr->add(StudentAbsencePeer::STUDENT_ID, $stu_id);
                 $cr->add(StudentAbsencePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $cr->add(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $cr->add(StudentAbsencePeer::START, $tanggal);
                 $sa = StudentAbsencePeer::doSelectOne($cr);
                 if ($sa != null) {
                     StudentAbsencePeer::doDelete($cr);
                 }
             } else {
                 $cr = new Criteria();
                 $cr->add(StudentAbsencePeer::STUDENT_ID, $stu_id);
                 $cr->add(StudentAbsencePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $cr->add(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $cr->add(StudentAbsencePeer::START, $tanggal);
                 $student_absence = StudentAbsencePeer::doSelectOne($cr);
                 if ($student_absence == null) {
                     $student_absence = new StudentAbsence();
                 }
                 $student_absence->setStudentId($stu_id);
                 $student_absence->setClassGroupId($course_schedule->getClassGroupId());
                 $student_absence->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                 $student_absence->setStatus($status);
                 $student_absence->setStart($tanggal);
                 $student_absence->setEnd($tanggal);
                 $student_absence->setMonth($bulan);
                 $student_absence->setYear($tahun);
                 $student_absence->save();
             }
         }
     }
     $cd = new Criteria();
     $cd->add(AttendanceClassPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $cd->add(AttendanceClassPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $cd->add(AttendanceClassPeer::DATETIME, $tanggal);
     $class_attend = AttendanceClassPeer::doSelectOne($cd);
     if ($class_attend == null) {
         $class_attend = new AttendanceClass();
     }
     $class_attend->setClassGroupId($course_schedule->getClassGroupId());
     $class_attend->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
     $class_attend->setDatetime($tanggal);
     $class_attend->save();
     $co = new Criteria();
     $co->add(VAttendancePeer::DATETIME, $tanggal);
     $co->add(VAttendancePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $attends = VAttendancePeer::doSelect($co);
     $student_codes = array();
     foreach ($attends as $attend) {
         $student_codes[] = $attend->getFingercode();
     }
     $cm = new Criteria();
     $cm->add(AttendancePeer::STUDENT_ID, $student_codes, Criteria::IN);
     AttendancePeer::doDelete($cm);
     return $this->redirect('course_absence/listShow?course_id=' . $course_schedule->getId());
 }
                "sInfoFiltered": "(Filtrando de un total de  _MAX_  registros)",
                "sInfoPostFix": "",
                "sSearch": "Buscar",
                "sUrl": "",
                "oPaginate": {
                    "sFirst":    "Primero",
                    "sPrevious": "Anterior",
                    "sNext":     "Siguiente",
                    "sLast":     "Ultimo"
                }
            }});
    });
</script>
<?php 
$activity = new PlanificationActivity($registry[$nameDataBase]);
$attendance_class = new AttendanceClass($registry[$nameDataBase]);
// Simplificar la ruta de propiedades
$v_label = $property["pages"]["course/take_care_admin"];
$v_label_list = $property["pages"]["general_list"];
// Simplificar el ruteo de edicion/visualizacion
$v_route_edit_preview = 'index.php?page=course/matter_task';
// Simplificar el ruteo de insert
$v_route_insert = '?page=course/matter_task';
// Simplificar el ruteo de lista
$v_route_list = 'index.php?page=course/take_care_admin';
//insert de la actividad tipo clase
if (isset($_POST['ACTION']) && $_POST['ACTION'] == 'INSERT' && $_POST['ENTITY'] == 'ACTIVITY') {
    $res = 0;
    $transaction = new Transaction($registry[$nameDataBase]);
    PlanificationActivity::setDataOperationBusiness($registry[$nameDataBase]);
    $idTransaction = $transaction->insertTransaction(array(PlanificationActivity::$business, PlanificationActivity::$insert, PlanificationActivity::$descriptionBusiness));