public function execute()
 {
     try {
         $fieldsVeterinario = array(veterinarioTableClass::ID, veterinarioTableClass::NOMBRE);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         //            $this->objAnimal = animalTableClass::subQuery();
         $this->objVeterinario = veterinarioTableClass::getAll($fieldsVeterinario, true);
         $this->defineView('insert', 'vacunacion', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $where = NULL;
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             //                validacion de datos
             if (isset($filter['telefono']) and $filter['telefono'] !== null and $filter['telefono'] !== '') {
                 $where[veterinarioTableClass::TEL] = $filter['telefono'];
             }
             if (isset($filter['nombre_completo']) and $filter['nombre_completo'] !== null and $filter['nombre_completo'] !== '') {
                 $where[veterinarioTableClass::NOMBRE] = $filter['nombre_completo'];
             }
             if (isset($filter['tipo_doc']) and $filter['tipo_doc'] !== null and $filter['tipo_doc'] !== '') {
                 $where[veterinarioTableClass::TIPO_DOC] = $filter['tipo_doc'];
             }
             session::getInstance()->setAttribute('veterinarioDeleteFilters', $where);
         }
         $fieldsTipoDoc = array(tipoDocumentoTableClass::ID, tipoDocumentoTableClass::DESCRIPCION);
         $fields = array(veterinarioTableClass::ID, veterinarioTableClass::NUMERO_DOC, veterinarioTableClass::CIUDAD, veterinarioTableClass::NOMBRE, veterinarioTableClass::TEL, veterinarioTableClass::TIPO_DOC, veterinarioTableClass::DIRECCION);
         $fields2 = array(ciudadTableClass::NOMBRE);
         $fields3 = array(tipoDocumentoTableClass::DESCRIPCION);
         $fJoin1 = veterinarioTableClass::CIUDAD;
         $fJoin2 = ciudadTableClass::ID;
         $fJoin3 = veterinarioTableClass::TIPO_DOC;
         $fJoin4 = tipoDocumentoTableClass::ID;
         $orderBy = array(veterinarioTableClass::ID);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         $f = array(veterinarioTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = veterinarioTableClass::getAllCount($f, true, $lines);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         $this->objVeterinario = veterinarioTableClass::getAllJoin($fields, $fields2, $fields3, null, $fJoin1, $fJoin2, $fJoin3, $fJoin4, null, null, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         $this->objTipoDoc = tipoDocumentoTableClass::getAll($fieldsTipoDoc, false);
         $this->defineView('index', 'veterinario', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fieldsVeterinario = array(veterinarioTableClass::ID, veterinarioTableClass::NOMBRE);
         $fieldsVacuna = array(vacunaTableClass::ID, vacunaTableClass::NOMBRE_VACUNA);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->objVeterinario = veterinarioTableClass::getAll($fieldsVeterinario, true);
         $this->objVacuna = vacunaTableClass::getAll($fieldsVacuna, true);
         $this->idAnimalHojaVida = request::getInstance()->getGet(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL, true));
         $this->defineView('insertVacunacion', 'animal', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->isMethod('POST') and request::getInstance()->isAjaxRequest()) {
             $id = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::ID, true));
             $ids = array(veterinarioTableClass::ID => $id);
             $this->arrayAjax = array('code' => 11, 'msg' => 'La eliminacion ha sido exitosa');
             veterinarioTableClass::delete($ids, true);
             $this->defineView('delete', 'veterinario', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('personal', 'indexVeterinario');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fieldsVacunacion = array(carneVacunasTableClass::ACCION, carneVacunasTableClass::ANIMAL, carneVacunasTableClass::DOSIS, carneVacunasTableClass::FECHA_VACUNACION, carneVacunasTableClass::ID, carneVacunasTableClass::VACUNA, carneVacunasTableClass::VETERINARIO);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fieldsVacuna = array(vacunaTableClass::ID, vacunaTableClass::NOMBRE_VACUNA);
         $fieldsVeterinario = array(veterinarioTableClass::ID, veterinarioTableClass::NOMBRE);
         $where = array(carneVacunasTableClass::ID => request::getInstance()->getRequest(carneVacunasTableClass::ID, true));
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->objVacuna = vacunaTableClass::getAll($fieldsVacuna, true);
         $this->objVeterinario = veterinarioTableClass::getAll($fieldsVeterinario, true);
         $this->objCarne = carneVacunasTableClass::getAll($fieldsVacunacion, true, null, null, null, null, $where);
         $this->defineView('editVacunacion', 'animal', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(veterinarioTableClass::ID)) {
             $fields = array(veterinarioTableClass::ID, veterinarioTableClass::NUMERO_DOC, veterinarioTableClass::NOMBRE, veterinarioTableClass::TEL, veterinarioTableClass::CIUDAD, veterinarioTableClass::DIRECCION, veterinarioTableClass::TIPO_DOC);
             $where = array(veterinarioTableClass::ID => request::getInstance()->getRequest(veterinarioTableClass::ID));
             $fieldsCiudad = array(ciudadTableClass::ID, ciudadTableClass::NOMBRE);
             $fieldsTipo_doc = array(tipoDocumentoTableClass::ID, tipoDocumentoTableClass::DESCRIPCION);
             $this->objCiudad = ciudadTableClass::getAll($fieldsCiudad, true);
             $this->objTipo_documento = tipoDocumentoTableClass::getAll($fieldsTipo_doc, false);
             $this->objVeterinario = veterinarioTableClass::getAll($fields, true, null, null, null, null, $where);
             $this->defineView('edit', 'veterinario', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('personal', 'indexVeterinario');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->isMethod('POST')) {
             $nombre_completo = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::NOMBRE, true));
             $telefono = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::TEL, true));
             $tipo_documento_id = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::TIPO_DOC, true));
             $direccion = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::DIRECCION, true));
             $ciudad = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::CIUDAD, true));
             $numero_documento = request::getInstance()->getPost(veterinarioTableClass::getNameField(veterinarioTableClass::NUMERO_DOC, true));
             veterinarioTableClass::validateCreate($nombre_completo, $direccion, $telefono, $numero_documento);
             $data = array(veterinarioTableClass::NUMERO_DOC => $numero_documento, veterinarioTableClass::TIPO_DOC => $tipo_documento_id, veterinarioTableClass::NOMBRE => $nombre_completo, veterinarioTableClass::TEL => $telefono, veterinarioTableClass::DIRECCION => $direccion, veterinarioTableClass::CIUDAD => $ciudad);
             veterinarioTableClass::insert($data);
             log::register(i18n::__('create'), veterinarioTableClass::getNameTable());
             routing::getInstance()->redirect('personal', 'indexVeterinario');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(vacunacionTableClass::ID)) {
             $fields = array(vacunacionTableClass::ID, vacunacionTableClass::ANIMAL, vacunacionTableClass::VETERINARIO, vacunacionTableClass::FECHA);
             $where = array(vacunacionTableClass::ID => request::getInstance()->getRequest(vacunacionTableClass::ID));
             $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
             $fieldsVeterinario = array(veterinarioTableClass::ID, veterinarioTableClass::NOMBRE);
             $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
             $this->objVeterinario = veterinarioTableClass::getAll($fieldsVeterinario, true);
             $this->objVacunacion = vacunacionTableClass::getAll($fields, true, null, null, null, null, $where);
             $this->defineView('edit', 'vacunacion', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('vacunacion', 'indexVacunacion');
         }
         //close if
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $where = null;
         if (request::getInstance()->hasRequest('reportVeterinario')) {
             $report = request::getInstance()->getPost('reportVeterinario');
         }
         $fields = array(veterinarioTableClass::ID, veterinarioTableClass::NUMERO_DOC, veterinarioTableClass::CIUDAD, veterinarioTableClass::NOMBRE, veterinarioTableClass::TEL, veterinarioTableClass::TIPO_DOC, veterinarioTableClass::DIRECCION);
         $fields2 = array(ciudadTableClass::NOMBRE);
         $fields3 = array(tipoDocumentoTableClass::DESCRIPCION);
         $fJoin1 = veterinarioTableClass::CIUDAD;
         $fJoin2 = ciudadTableClass::ID;
         $fJoin3 = veterinarioTableClass::TIPO_DOC;
         $fJoin4 = tipoDocumentoTableClass::ID;
         $orderBy = array(veterinarioTableClass::ID);
         $this->objVeterinario = veterinarioTableClass::getAllJoin($fields, $fields2, $fields3, null, $fJoin1, $fJoin2, $fJoin3, $fJoin4, null, null, true, $orderBy, 'ASC', $where);
         $this->mensaje = 'Informe de Veterinarios en Nuestro Sistema';
         $this->defineView('index', 'veterinario', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
                    <a href="#close" title="Close" class="close">X</a>
                    <div class="modal-body">
                       <?php 
    echo i18n::__('confirm', null, 'animal');
    ?>
                    </div>
                    <div class="modal-footer">
                      <a href="#close2" title="Close" class="close2 btn btn-default fa fa-times-circle-o"> <?php 
    echo i18n::__('cancel');
    ?>
</a>
                      <button type="button" class="btn btn-primary fa fa-eraser" onclick="eliminar(<?php 
    echo $key->{$id};
    ?>
, '<?php 
    echo veterinarioTableClass::getNameField(veterinarioTableClass::ID, true);
    ?>
', '<?php 
    echo routing::getInstance()->getUrlWeb('personal', 'deleteVeterinario');
    ?>
')"> <?php 
    echo i18n::__('delete');
    ?>
</button>
                    </div>
                  </div>
                </div>
                </form>
                <?php 
    $countDetale++;
    ?>
 public function execute()
 {
     try {
         $where = null;
         $idHojaVida = request::getInstance()->getGet(hojaVidaBaseTableClass::getNameField(hojaVidaTableClass::ANIMAL, TRUE));
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             if (isset($filter['fecha_inicio']) and $filter['fecha_inicio'] !== null and $filter['fecha_inicio'] !== '' and isset($filter['fecha_fin']) and $filter['fecha_fin'] !== null and $filter['fecha_fin'] !== '') {
                 $where[carneVacunasTableClass::getNameTable() . '.' . carneVacunasTableClass::FECHA_VACUNACION] = array(date(config::getFormatTimestamp(), strtotime($filter['fecha_inicio'] . ' 00.00.00')), date(config::getFormatTimestamp(), strtotime($filter['fecha_fin'] . ' 23.59.59')));
             }
             //close if
             if (isset($filter['veterinario']) and $filter['veterinario'] !== null and $filter['veterinario'] !== '') {
                 $where[carneVacunasTableClass::getNameTable() . '.' . carneVacunasTableClass::VETERINARIO] = $filter['veterinario'];
             }
             //close if
             if (isset($filter['vacuna']) and $filter['vacuna'] !== null and $filter['vacuna'] !== '') {
                 $where[carneVacunasTableClass::getNameTable() . '.' . carneVacunasTableClass::VACUNA] = $filter['vacuna'];
             }
             //close if
             if (isset($filter['dosis']) and $filter['dosis'] !== null and $filter['dosis'] !== '') {
                 $where[carneVacunasTableClass::DOSIS] = $filter['dosis'];
             }
             //close if
             if (isset($filter['accion']) and $filter['accion'] !== null and $filter['accion'] !== '') {
                 $where[carneVacunasTableClass::getNameTable() . '.' . carneVacunasTableClass::ACCION] = $filter['accion'];
             }
             //close if
             session::getInstance()->setAttribute('animalFiltersVacunacion', $where);
         } elseif (session::getInstance()->hasAttribute('animalFiltersVacunacion')) {
             $where = session::getInstance()->getAttribute('animalFiltersVacunacion');
         }
         $fieldsVeterinario = array(veterinarioTableClass::ID, veterinarioTableClass::NOMBRE);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fieldsVacuna = array(vacunaTableClass::ID, vacunaTableClass::NOMBRE_VACUNA);
         $fields = array(carneVacunasTableClass::ACCION, carneVacunasTableClass::DOSIS, carneVacunasTableClass::FECHA_VACUNACION, carneVacunasTableClass::ID);
         $fields2 = array(animalTableClass::NUMERO);
         $fields3 = array(veterinarioTableClass::NOMBRE);
         $fields4 = array(vacunaTableClass::NOMBRE_VACUNA);
         $fJoin1 = carneVacunasTableClass::ANIMAL;
         $fJoin2 = animalTableClass::ID;
         $fJoin3 = carneVacunasTableClass::VETERINARIO;
         $fJoin4 = veterinarioTableClass::ID;
         $fJoin5 = carneVacunasTableClass::VACUNA;
         $fJoin6 = vacunaTableClass::ID;
         $orderBy = array(carneVacunasTableClass::FECHA_VACUNACION);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         $f = array(carneVacunasTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = carneVacunasTableClass::getAllCount($f, true, $lines);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         $this->idHojaVida = $idHojaVida;
         $this->objCarne = carneVacunasTableClass::getAllJoin($fields, $fields2, $fields3, $fields4, $fJoin1, $fJoin2, $fJoin3, $fJoin4, $fJoin5, $fJoin6, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         //$this->page = request::getInstance()->getGet('page');
         $this->objVeterinario = veterinarioTableClass::getAll($fieldsVeterinario, true);
         $this->objVacuna = vacunaTableClass::getAll($fieldsVacuna, true);
         $this->idAnimalHojaVida = request::getInstance()->getGet(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL, true));
         $this->defineView('indexVacunacion', 'animal', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $where = null;
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             //                if (isset($filter['id']) and $filter['id'] !== null and $filter['id'] !== '') {
             //                    $where[vacunacionTableClass::getNameTable() . '.' . vacunacionTableClass::ID] = $filter['id'];
             //                }//close if
             if (isset($filter['fecha']) and $filter['fecha'] !== null and $filter['fecha'] !== '') {
                 $where[vacunacionTableClass::FECHA] = $filter['fecha'];
             }
             //close if
             if (isset($filter['animal']) and $filter['animal'] !== null and $filter['animal'] !== '') {
                 $where[vacunacionTableClass::ANIMAL] = $filter['animal'];
             }
             //close if
             if (isset($filter['veterinario']) and $filter['veterinario'] !== null and $filter['veterinario'] !== '') {
                 $where[vacunacionTableClass::VETERINARIO] = $filter['veterinario'];
             }
             //close if
             session::getInstance()->setAttribute('vacunacionFiltersAnimal', $where);
         } elseif (session::getInstance()->hasAttribute('vacunacionFiltersAnimal')) {
             $where = session::getInstance()->getAttribute('vacunacionFiltersAnimal');
         }
         //close if
         $fieldsVeterinario = array(veterinarioTableCLass::ID, veterinarioTableClass::NOMBRE);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $orderBy = array(vacunacionTableClass::FECHA);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         //close if
         $f = array(vacunacionTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = vacunacionTableClass::getAllCount($f, true, $lines, $where);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         //close if
         $fieldsVavuna = array(vacunaTableClass::ID, vacunaTableClass::NOMBRE_VACUNA);
         $fieldsVacunacion = array(vacunacionTableClass::ID, vacunacionTableClass::FECHA);
         $fieldsVete = array(veterinarioTableClass::NOMBRE);
         $fieldsAni = array(animalTableClass::NUMERO);
         $fJoin1 = vacunacionTableClass::VETERINARIO;
         $fJoin2 = veterinarioTableClass::ID;
         $fJoin3 = vacunacionTableClass::ANIMAL;
         $fJoin4 = animalTableClass::ID;
         $this->objVacuna = vacunaTableClass::getAll($fieldsVavuna, true);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->objVeterinario = veterinarioTableClass::getAll($fieldsVeterinario, true);
         $this->objVacunacion = vacunacionTableClass::getAllJoin($fieldsVacunacion, $fieldsVete, $fieldsAni, null, $fJoin1, $fJoin2, $fJoin3, $fJoin4, null, null, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         //            $this->objVacunacion = vacunacionTableClass::getAll($fields, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         log::register(i18n::__('view', null, 'empleado'), vacunacionTableClass::getNameTable());
         $this->defineView('index', 'vacunacion', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public static function validateEdit($nombre_completo, $direccion, $numero_documento, $telefono)
 {
     $flag = false;
     $patron = "^[a-zA-Z0-9]{3,20}\$";
     if (empty($numero_documento)) {
         session::getInstance()->setError('vacio el campo num');
         $flag = true;
         session::getInstance()->setFirstCall(veterinarioTableClass::getNameField(clienteTableClass::NUMERO_DOC, true), true);
     }
     if (empty($telefono)) {
         session::getInstance()->setError('vacio el campo tel');
         $flag = true;
         session::getInstance()->setFirstCall(veterinarioTableClass::getNameField(veterinarioTableClass::TEL, true), true);
     }
     if (empty($direccion)) {
         session::getInstance()->setError('vacio el campo direc');
         $flag = true;
         session::getInstance()->setFirstCall(veterinarioTableClass::getNameField(veterinarioTableClass::DIRECCION, true), true);
     }
     if (empty($nombre_completo) or !isset($nombre_completo) or $nombre_completo == '') {
         session::getInstance()->setError('No puede ser vacio');
         $flag = true;
         session::getInstance()->setFlash(veterinarioTableClass::getNameField(veterinarioTableClass::NOMBRE, true), true);
     } else {
         if (strlen($nombre_completo) < 2) {
             session::getInstance()->setError('Minimo dos caracteres');
             $flag = true;
             session::getInstance()->setFlash(veterinarioTableClass::getNameField(veterinarioTableClass::NOMBRE, true), true);
         } else {
             if (!ereg($patron, $nombre_completo)) {
                 session::getInstance()->setError('No se permiten caracteres especiales');
                 $flag = true;
                 session::getInstance()->setFirstCall(veterinarioTableClass::getNameField(veterinarioTableClass::NOMBRE, true), true);
             }
         }
     }
     if ($flag == true) {
         request::getInstance()->setMethod('GET');
         routing::getInstance()->forward('personal', 'editVeterinario');
     }
 }