Ejemplo n.º 1
0
 /**
  * This is construct base of the class.
  *
  * A public constructor; initializes the variable $instanceDataBase.
  *
  */
 public function __construct($instanceDataBase)
 {
     parent::__construct($instanceDataBase);
     MainCourse::setDataOperationBusiness($instanceDataBase);
     MainCourse::getBusiness();
     MainCourse::getDescriptionBusiness();
 }
Ejemplo n.º 2
0
?>
                    </td>
                    <td class="col2">                        
                        <?php 
$end_datetime_admission = $action == 'EDIT' ? $data['end_datetime_admission'] : '';
if ($action == 'INSERT') {
    $mcconfig = new MainCourse($registry[$nameDataBase]);
    $list_mcconfig = $mcconfig->getMainCourseConfigurationAll($action);
    $itemsSelect = array();
    foreach ($list_mcconfig as $item) {
        echo "<input type='checkbox' name='chk_cursos[]' id='chk_cursos' value=" . $item['pk_id_main_course'] . ">" . $item['description'] . "<br>";
    }
    echo '<br>';
}
if ($action == 'EDIT') {
    $mcconfig = new MainCourse($registry[$nameDataBase]);
    $list_mcconfig = $mcconfig->getMainCourseConfigurationAll($action);
    $itemsSelect = array();
    foreach ($list_mcconfig as $item) {
        $checked = null;
        foreach ($list_cap as $item_i) {
            if ($item_i['fk_id_main_course'] == $item['pk_id_main_course']) {
                $checked = 'checked';
            }
        }
        echo "<input type='checkbox' name='chk_cursos[]' id='chk_cursos' value=" . $item['pk_id_main_course'] . " " . $checked . ">" . $item['description'] . "<br>";
    }
    echo '<br>';
} elseif ($action == 'PREVIEW') {
    foreach ($list_cap as $item) {
        echo "<input type='checkbox' name='chk_cursos[]' id='chk_cursos' value=" . $item['fk_id_main_course'] . " disabled='true' checked>" . $item['description'] . "<br>";
                }
            }});

    });
</script>
<?php 
$action = 'LIST';
if (isset($_POST['ACTION'])) {
    $action = $_POST['ACTION'];
} else {
    if (isset($_GET['ACTION'])) {
        $action = $_GET['ACTION'];
    }
}
$user = new User($registry[$nameDataBase]);
$catalog = new MainCourse($registry[$nameDataBase]);
// Simplificar la ruta de propiedades
$v_label = $property["pages"]["course/main_course_admin"];
$v_label_list = $property["pages"]["general_list"];
// Simplificar el ruteo de edicion/visualizacion
$v_route_edit_preview = 'index.php?page=course/main_course';
// Simplificar el ruteo de insert
$v_route_insert = '?page=course/main_course';
// Simplificar el ruteo de lista
$v_route_list = 'index.php?page=course/main_course_admin';
switch ($action) {
    case 'INSERT':
        $transaction = new Transaction($registry[$nameDataBase]);
        MainCourse::setDataOperationBusiness($registry[$nameDataBase]);
        $idTransaction = $transaction->insertTransaction(array(MainCourse::$business, MainCourse::$insert, MainCourse::$descriptionBusiness));
        $data = array($_POST['name'], $_POST['course_code'], $_POST['description'], $_POST['is_abstract_course'], $_POST['is_course_configuration'], $_POST['status_main_course'], $_POST['data_1'], $_POST['data_2'], $_POST['data_3'], $_POST['data_4'], $_POST['data_5']);
Ejemplo n.º 4
0
}
?>
                                  <?php 
if ($action != 'PREVIEW') {
    ?>
 <span class="rojo_asterisco"></span><span class="rojo_esc">*</span><?php 
}
?>
                              </td>
                            </tr>
                             <tr>   
                              <td>ULTIMO CURSO VENCIDO:</td>
                              <td>
                                                              
                                    <?php 
$mcconfig = new MainCourse($registry[$nameDataBase]);
$catalogo = $mcconfig->getMainCourseConfigurationAll();
$itemsSelect = array();
foreach ($catalogo as $item) {
    $itemsSelect[$item['pk_id_main_course']] = $item['description'];
}
$itemsSelect['0'] = 'SELECCIONE UNA OPCION';
$curso_vencido = '';
if ($action == 'EDIT' || $action == 'PREVIEW') {
    $curso_vencido = $data['ultimo_curso_vencido'];
}
Forms::printInput('SELECT', 'curso_vencido', $curso_vencido, 'select_requerido', array(), $itemsSelect);
?>
                              <?php 
if ($action != 'PREVIEW') {
    ?>
     $note = new Note($db);
     $data_note = array($datos[7], $datos[8], $id_ballot, $pk_id_evaluations_settings, $id_matter);
     $id_note = $note->insertNote($data_note, $idTransaction);
     //adicionar la confirmacion o error del insert
     //adicionar registro de los logs
     $res = $id_note;
     //resultado final
     break;
 case 4:
     $student = new Student($db);
     $id_student = $student->getStudentId($datos[0]);
     //idStudent
     $course = new CourseHard($db);
     $id_course_hard = $course->getCourseHardId($datos[3]);
     //nombre curso
     $mcourse = new MainCourse($db);
     $id_mcourse = $mcourse->getMainCourseId($datos[3]);
     //nombre curso
     $mcourse_structure = new MCourseStructureNotes($db);
     $data_mcourse = array($id_mcourse, $opcion);
     $id_mcourse_structure = $mcourse_structure->getMCourseStructureNotesId($data_mcourse);
     $ballot = new CourseNotesBallot($db);
     $data = array($id_student, $id_course_hard, $id_mcourse_structure);
     $id_ballot = $ballot->insertCourseNotesBallot($data, $idTransaction);
     $matter = new Matter($db);
     $id_matter = $matter->getMatterId($datos[2]);
     //nombre materia
     $eval = new EvaluationsSettings($db);
     $pk_id_evaluations_settings = 0;
     $pk_id_evaluations_settings2 = 0;
     switch ($datos[6]) {
Ejemplo n.º 6
0
    });
</script>  
<?php 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$action = 'INSERT';
if (isset($_GET['ACTION'])) {
    $action = $_GET['ACTION'];
}
if (isset($_GET['page']) != "course/course_ajax") {
    $action = 'PREVIEW';
}
$preview_flag = 0;
$mainCourse = new MainCourse($registry[$nameDataBase]);
$listCourses = $mainCourse->getListMainCourse();
// print_r($list);
$period = new Period($registry[$nameDataBase]);
$listPeriod = $period->getListPeriod();
$courseStatus = new SystemCatalog($db);
$catalogo1 = $courseStatus->getListSystemCatalog('STATUS_COURSE_HARD');
$courseHard = new CourseHard($registry[$nameDataBase]);
$data = array();
if ($action == 'EDIT' || $action == 'PREVIEW') {
    if (isset($_GET['PK_ID_COURSE_HARD'])) {
        $res = $courseHard->getListCourseHard($_GET['PK_ID_COURSE_HARD']);
        $data = $res[0];
        //print_r($data);
    }
    if ($action == 'PREVIEW') {
Ejemplo n.º 7
0
$v_label = $property["pages"]["course/main_course"];
// Decidir en funcion a la accion
$title_1 = $v_label["NEW_TITLE"];
// INSERT
$action = 'INSERT';
if (isset($_GET['EDIT'])) {
    $action = 'EDIT';
    $title_1 = $v_label["EDIT_TITLE"];
    $elementAction = $_GET['EDIT'];
} elseif (isset($_GET['PREVIEW'])) {
    $action = 'PREVIEW';
    $title_1 = $v_label["PREVIEW_TITLE"];
    $elementAction = $_GET['PREVIEW'];
}
if ($action != 'INSERT') {
    $element = new MainCourse($registry[$nameDataBase]);
    $list = $element->getListMainCourse($elementAction);
    $data_main_course = $list[0];
}
// simplificar acceso a etiquetas de formulario
$v_label_gral_form = $property["pages"]["general_form"];
//print_r($billData);
if ($action == 'PREVIEW') {
    $preview_flag = 1;
}
?>

<div class="grid_10">
    <div class="box round first">
        <h2><?php 
echo $title_1;