/**
  * This is construct base of the class.
  *
  * A public constructor; initializes the variable $instanceDataBase.
  *
  */
 public function __construct($instanceDataBase)
 {
     parent::__construct($instanceDataBase);
     CourseNotesBallot::setDataOperationBusiness($instanceDataBase);
     CourseNotesBallot::getBusiness();
     CourseNotesBallot::getDescriptionBusiness();
 }
 } else {
     if (file_exists("upload/cuotas/" . $filename)) {
         unlink("upload/cuotas/" . $filename);
     }
     move_uploaded_file($_FILES["archivo"]["tmp_name"], "upload/cuotas/" . $filename);
     $res = 'OK';
 }
 if ($res == 'OK') {
     $opcion = $_POST['id_type_notes'];
     //TIPO DE ESTRUCTURA A CARGAR
     $filename = "upload/cuotas/" . $filename;
     $fp = fopen($filename, "r");
     $contador = 0;
     //Transaction
     $transaction = new Transaction($registry[$nameDataBase]);
     CourseNotesBallot::setDataOperationBusiness($registry[$nameDataBase]);
     $idTransaction = $transaction->insertTransaction(array(CourseNotesBallot::$business, CourseNotesBallot::$insert, CourseNotesBallot::$descriptionBusiness));
     while (!feof($fp)) {
         $linea = fgets($fp);
         $datos = explode("|", $linea);
         switch ($opcion) {
             case 1:
                 $student = new Student($db);
                 $id_student = $student->getStudentId($datos[1]);
                 $debt_share = new DebtShare($db);
                 $data = array(1, $id_student, $datos[0], $datos[3], $datos[4], $datos[5]);
                 $id = $debt_share->insertDebtShare($data, $idTransaction);
                 //adicionar la confirmacion o error del insert
                 //adicionar registro de los logs
                 $res = $id;
                 //resultado final
     //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]) {
         case 1:
             $pk_id_evaluations_set = $eval->getEvaluationsSettingsId(array($opcion, 1));
             $pk_id_evaluations_set2 = $eval->getEvaluationsSettingsId(array($opcion, 2));
             break;
         case 2:
             $pk_id_evaluations_set = $eval->getEvaluationsSettingsId(array($opcion, 4));