public function execute()
 {
     try {
         $fields = array(pagoEmpleadosTableClass::ID, pagoEmpleadosTableClass::ID_EMPLEADO, pagoEmpleadosTableClass::NOMBRE, pagoEmpleadosTableClass::FECHA_INICIO, pagoEmpleadosTableClass::FECHA_FIN, pagoEmpleadosTableClass::FECHA_PAGO, pagoEmpleadosTableClass::TOTAL);
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NUMERO_DOC);
         $fields2 = array(empleadoTableClass::ID);
         $fJoin1 = pagoEmpleadosTableClass::ID_EMPLEADO;
         $fJoin2 = empleadoTableClass::ID;
         $orderBy = array(pagoEmpleadosTableClass::ID);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         $f = array(pagoEmpleadosTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = pagoEmpleadosTableClass::getAllCount($f, false, $lines);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         $this->objPago = pagoEmpleadosTableClass::getAllJoin($fields, $fields2, null, null, $fJoin1, $fJoin2, null, null, null, null, false, $orderBy, 'ASC', config::getRowGrid(), $page);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, true);
         $this->defineView('index', 'pago', 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['fecha_inicio']) and $filter['fecha_inicio'] !== null and $filter['fecha_inicio'] !== '' and isset($filter['fecha_final']) and $filter['fecha_fina'] !== null and $filter['fecha_final'] !== '') {
                 $where[procesoVentaTableClass::getNameTable() . '.' . procesoVentaTableClass::FECHA_HORA_VENTA] = array(date(config::getFormatTimestamp(), strtotime($filter['fecha_inicial'] . ' 00.00.00')), date(config::getFormatTimestamp(), strtotime($filter['fecha_final'] . ' 23.59.59')));
             }
             //close if
             if (isset($filter['cliente']) and $filter['cliente'] !== null and $filter['cliente'] !== '') {
                 $where[procesoVentaTableClass::CLIENTE_ID] = $filter['cliente'];
             }
             //close if
             session::getInstance()->setAttribute('facturaVentaFilter', $where);
         } elseif (session::getInstance()->hasAttribute('facturaVentaFilter')) {
             $where = session::getInstance()->getAttribute('facturaVentaFilter');
         }
         //close if
         $fieldsEmple = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $fieldsCli = array(clienteTableClass::ID, clienteTableClass::NOMBRE);
         $fieldsFacturaVenta = array(procesoVentaTableClass::ID, procesoVentaTableClass::FECHA_HORA_VENTA, procesoVentaTableClass::ACTIVA);
         $fieldsEmpleado = array(empleadoTableClass::NOMBRE);
         $fieldsCliente = array(clienteTableClass::NOMBRE);
         $fieldsEmpleado2 = array(empleadoTableClass::NOMBRE, empleadoTableClass::ID);
         $fieldsCliente2 = array(clienteTableClass::NOMBRE, clienteTableClass::ID);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fJoin1 = procesoVentaTableClass::EMPLEADO_ID;
         $fJoin2 = empleadoTableClass::ID;
         $fJoin3 = procesoVentaTableClass::CLIENTE_ID;
         $fJoin4 = clienteTableClass::ID;
         $orderBy = array(procesoVentaTableClass::FECHA_HORA_VENTA);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado2, false);
         $this->objCliente = clienteTableClass::getAll($fieldsCliente2, false);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         //close if
         $f = array(procesoVentaTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = procesoVentaTableClass::getAllCount($f, true, $lines, $where);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         //close if
         $this->objCliente = clienteTableClass::getAll($fieldsCli, true);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmple, true);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->objFacturaVenta = procesoVentaTableClass::getAllJoin($fieldsFacturaVenta, $fieldsEmpleado, $fieldsCliente, null, $fJoin1, $fJoin2, $fJoin3, $fJoin4, null, null, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         log::register(i18n::__('ver', null, 'facturaVenta'), procesoVentaTableClass::getNameTable());
         $this->defineView('index', 'facturaVenta', 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['fecha_fin']) and $filter['fecha_fin'] !== null and $filter['fecha_fin'] !== '' and isset($filter['fecha_inicio']) and $filter['fecha_inicio'] !== null and $filter['fecha_inicio'] !== '') {
                 $where[entradaBodegaTableClass::getNameTable() . '.' . entradaBodegaTableClass::FECHA] = array(date(config::getFormatTimestamp(), strtotime($filter['fecha_inicio'] . ' 00.00.00')), date(config::getFormatTimestamp(), strtotime($filter['fecha_fin'] . ' 23.59.59')));
             }
             //                if (isset($filter['fecha']) and $filter['fecha'] !== null and $filter['fecha'] !== '') {
             //                    $where[entradaBodegaTableClass::FECHA] = $filter['fecha'];
             //                }//close if
             if (isset($filter['empleado']) and $filter['empleado'] !== null and $filter['empleado'] !== '') {
                 $where[entradaBodegaTableClass::EMPLEADO] = $filter['empleado'];
             }
             //close if
             session::getInstance()->setAttribute('entradaFilter', $where);
         } elseif (session::getInstance()->hasAttribute('entradaFilter')) {
             $where = session::getInstance()->getAttribute('entradaFilter');
         }
         //close if
         $fieldsEntrada = array(entradaBodegaTableClass::ID, entradaBodegaTableClass::FECHA, entradaBodegaTableClass::EMPLEADO, entradaBodegaTableClass::ESTADO);
         $fieldsEmpleado = array(empleadoTableClass::NOMBRE);
         $fieldsEmpleado2 = array(empleadoTableClass::NOMBRE, empleadoTableClass::ID);
         $fJoin1 = entradaBodegaTableClass::EMPLEADO;
         $fJoin2 = empleadoTableClass::ID;
         $orderBy = array(entradaBodegaTableClass::ID);
         $fieldsInsumo = array(insumoTableClass::ID, insumoTableClass::NOMBRE);
         $fieldsTipoInsumo = array(tipoInsumoTableClass::ID, tipoInsumoTableClass::DESCRIPCION);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         //close if
         $f = array(entradaBodegaTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = entradaBodegaTableClass::getAllCount($f, true, $lines, $where);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         //close if
         $this->objTipoInsumo = tipoInsumoTableClass::getAll($fieldsTipoInsumo, false);
         $this->objInsumo = insumoTableClass::getAll($fieldsInsumo, true);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado2, false);
         $this->objEntradaBodega = entradaBodegaTableClass::getAllJoin($fieldsEntrada, $fieldsEmpleado, null, null, $fJoin1, $fJoin2, null, null, null, null, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         log::register(i18n::__('ver', null, 'bodega'), entradaBodegaTableClass::getNameTable());
         $this->defineView('index', 'entradaBodega', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, true);
         $this->defineView('insert', 'salidaBodega', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fields = array(empleadoTableClass::NOMBRE, empleadoTableClass::APELLIDO_EMPLEADO, empleadoTableClass::TELEFONO_EMPLEADO);
         $this->objListEmpleado = empleadoTableClass::getAll($fields);
         $this->defineView('listaEmpleado', 'prestamo', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
Exemplo n.º 6
0
 public function execute()
 {
     try {
         $fields = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE, empleadoTableClass::APELLIDO, empleadoTableClass::DIRECCION, empleadoTableClass::TELEFONO, empleadoTableClass::MOVIL, empleadoTableClass::CORREO);
         $orderBy = array(empleadoTableClass::NOMBRE);
         $this->objEmpleado = empleadoTableClass::getAll($fields, true, $orderBy, 'ASC');
         $this->defineView('listado', 'empleado', 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);
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $this->idAnimalSeleccionado = request::getInstance()->getGet(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL, true));
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, true);
         $this->defineView('insertRegistroPeso', 'animal', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, true);
         $fieldsCliente = array(clienteTableClass::ID, clienteTableClass::NOMBRE);
         $this->objCliente = clienteTableClass::getAll($fieldsCliente, false);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->defineView('insert', 'facturaVenta', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $fieldsGestacion = array(gestacionTableClass::ID, gestacionTableClass::FECHA, gestacionBaseTableClass::FECHA_MONTA, gestacionTableClass::EMPLEADO, gestacionTableClass::ANIMAL, gestacionTableClass::ANIMAL_FECUNDADOR);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $where = array(gestacionTableClass::ID => request::getInstance()->getRequest(gestacionTableClass::ID, true));
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, true);
         $this->objGestacion = gestacionTableClass::getAll($fieldsGestacion, false, null, null, null, null, $where);
         $this->defineView('edit', 'gestacion', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(salidaBodegaTableClass::ID)) {
             $fieldsSalida = array(salidaBodegaTableClass::ID, salidaBodegaTableClass::FECHA, salidaBodegaTableClass::EMPLEADO);
             $where = array(salidaBodegaTableClass::ID => request::getInstance()->hasRequest(salidaBodegaTableClass::ID));
             $fieldsEmpleado2 = array(empleadoTableClass::NOMBRE, empleadoTableClass::ID);
             $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado2, false);
             $this->objSalidaBodega = salidaBodegaTableClass::getAll($fieldsSalida, true, null, null, null, null, $where);
             $this->defineView('edit', 'salidaBodega', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('bodega', 'indexSalida');
         }
         //close if
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(usuarioTableClass::ID)) {
             $fields = array(usuarioTableClass::ID, usuarioTableClass::USER, usuarioTableClass::PASSWORD);
             $where = array(usuarioTableClass::ID => request::getInstance()->getRequest(usuarioTableClass::ID));
             $fields1 = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE, empleadoTableClass::APELLIDO_EMPLEADO, empleadoTableClass::DIRECCION_EMPLEADO, empleadoTableClass::TELEFONO_EMPLEADO, empleadoTableClass::MOVIL_EMPELADO, empleadoTableClass::CORREO_EMPLEADO, empleadoTableClass::CARGO_ID);
             $where1 = array(empleadoTableClass::ID => request::getInstance()->getRequest(usuarioTableClass::ID));
             $fields2 = array(cargoTableClass::ID, cargoTableClass::DESC_CARGO);
             $this->objCargo = cargoTableClass::getAll($fields2);
             $this->objUsuario = usuarioTableClass::getAll($fields, true, null, null, null, null, $where);
             $this->objEmpleado = empleadoTableClass::getAll($fields1, true, null, null, null, null, $where1);
             $this->defineView('formEmpleado', 'prestamo', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('prestamo', 'insert');
         }
         //      if (request::getInstance()->isMethod('POST')) {
         //
         //        $usuario = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::USUARIO, true));
         //        $password = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::PASSWORD, true));
         //
         //        if (strlen($usuario) > usuarioTableClass::USUARIO_LENGTH) {
         //          throw new PDOException(i18n::__(00001, null, 'errors', array(':longitud' => usuarioTableClass::USUARIO_LENGTH)), 00001);
         //        }
         //
         //        $data = array(
         //            usuarioTableClass::USUARIO => $usuario,
         //            usuarioTableClass::PASSWORD => md5($password)
         //        );
         //        usuarioTableClass::insert($data);
         //        routing::getInstance()->redirect('default', 'index');
         //      } else {
         //        routing::getInstance()->redirect('default', 'index');
         //      }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasRequest(empleadoTableClass::ID)) {
             $fields = array(empleadoTableClass::ID, empleadoTableClass::NUMERO_DOC, empleadoTableClass::NOMBRE, empleadoTableClass::TEL, empleadoTableClass::CIUDAD, empleadoTableClass::CARGO, empleadoTableClass::DIRECCION, empleadoTableClass::TIPO_DOC);
             $where = array(empleadoTableClass::ID => request::getInstance()->getRequest(empleadoTableClass::ID));
             $fieldsCiudad = array(ciudadTableClass::ID, ciudadTableClass::NOMBRE);
             $fieldsCargo = array(cargoTableClass::ID, cargoTableClass::DESCRIPCION);
             $fieldsTipo_doc = array(tipoDocumentoTableClass::ID, tipoDocumentoTableClass::DESCRIPCION);
             $this->objCargo = cargoTableClass::getAll($fieldsCargo, true);
             $this->objCiudad = ciudadTableClass::getAll($fieldsCiudad, true);
             $this->objTipo_doc = tipoDocumentoTableClass::getAll($fieldsTipo_doc, false);
             $this->objEmpleado = empleadoTableClass::getAll($fields, true, null, null, null, null, $where);
             $this->defineView('edit', 'empleado', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('personal', 'indexEmpleado');
         }
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         if (request::getInstance()->hasGet('id') === true) {
             $id = request::getInstance()->getGet('id');
             $fields = array(empleadoTableClass::ID, empleadoTableClass::TIPO_DOCUMENTO_ID, empleadoTableClass::IDENTIFICACION, empleadoTableClass::NOMBRE, empleadoTableClass::APELLIDO, empleadoTableClass::DIRECCION, empleadoTableClass::TELEFONO, empleadoTableClass::MOVIL, empleadoTableClass::CORREO);
             $where = array(empleadoTableClass::ID => $id);
             $fields2 = array(tipo_documentoTableClass::ID, tipo_documentoTableClass::DESC_DOCUMENTO);
             //        $fields1 = array(
             //            localidadTableClass::ID,
             //            localidadTableClass::NOMBRE,
             //        );
             $this->objTipoDocumento = tipo_documentoTableClass::getAll($fields2);
             //        $this->objLocalidad = localidadTableClass::getAll($fields1);
             $this->objEmpleado = empleadoTableClass::getAll($fields, true, null, null, null, null, $where);
             $this->defineView('editEmpleado', 'empleado', session::getInstance()->getFormatOutput());
         } else {
             routing::getInstance()->redirect('@empleado_listado');
         }
     } 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['fecha_fin']) and $filter['fecha_fin'] !== null and $filter['fecha_fin'] !== '' and isset($filter['fecha_inicio']) and $filter['fecha_inicio'] !== null and $filter['fecha_inicio'] !== '') {
                 $where[procesoCompraTableClass::getNameTable() . '.' . procesoCompraTableClass::FECHA_HORA_COMPRA] = array($filter['fecha_inicio'], $filter['fecha_fin']);
                 if (isset($filter['empleado']) and $filter['empleado'] !== null and $filter['empleado'] !== '') {
                     $where[procesoCompraTableClass::EMPLEADO_ID] = $filter['empleado'];
                 }
                 //close if
                 if (isset($filter['proveedor']) and $filter['proveedor'] !== null and $filter['proveedor'] !== '') {
                     $where[procesoCompraTableClass::PROVEEDOR_ID] = $filter['proveedor'];
                 }
                 //close if
             }
             //close if
             session::getInstance()->setAttribute('facturaCompraFilter', $where);
         } elseif (session::getInstance()->hasAttribute('facturaCompraFilter')) {
             $where = session::getInstance()->getAttribute('facturaCompraFilter');
         }
         //close if
         $fieldsEmple = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $fieldsProve = array(proveedorTableClass::ID, proveedorTableClass::NOMBRE);
         $fieldsFacturaCompra = array(procesoCompraTableClass::ID, procesoCompraTableClass::FECHA_HORA_COMPRA, procesoCompraTableClass::EMPLEADO_ID, procesoCompraTableClass::PROVEEDOR_ID, procesoCompraTableClass::NUMERO, procesoCompraTableClass::ACTIVA);
         $fieldsEmpleado = array(empleadoTableClass::NOMBRE);
         $fieldsProveedor = array(proveedorTableClass::NOMBRE);
         $fJoin1 = procesoCompraTableClass::EMPLEADO_ID;
         $fJoin2 = empleadoTableClass::ID;
         $fJoin3 = procesoCompraTableClass::PROVEEDOR_ID;
         $fJoin4 = proveedorTableClass::ID;
         $orderBy = array(procesoCompraTableClass::FECHA_HORA_COMPRA);
         $fieldsInsumo = array(insumoTableClass::ID, insumoTableClass::NOMBRE);
         $this->objInsumo = insumoTableClass::getAll($fieldsInsumo, true);
         $fieldsEmpleados = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleados, true);
         $fieldsProveedores = array(proveedorTableClass::ID, proveedorTableClass::NOMBRE);
         $this->objProveedor = proveedorTableClass::getAll($fieldsProveedores, false);
         $fieldsTipoInsumo = array(tipoInsumoTableClass::ID, tipoInsumoTableClass::DESCRIPCION);
         $this->objTipoInsumo = tipoInsumoTableClass::getAll($fieldsTipoInsumo, false);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         //close if
         $f = array(procesoCompraTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = procesoCompraTableClass::getAllCount($f, true, $lines, $where);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         //close if
         $this->objProveedor = proveedorTableClass::getAll($fieldsProve, true);
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmple, true);
         $this->objFacturaCompra = procesoCompraTableClass::getAllJoin($fieldsFacturaCompra, $fieldsEmpleado, $fieldsProveedor, null, $fJoin1, $fJoin2, $fJoin3, $fJoin4, null, null, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         log::register(i18n::__('ver', null, 'facturaCompra'), procesoCompraTableClass::getNameTable());
         $this->defineView('index', 'facturaCompra', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $where = null;
         $idHojaVida = request::getInstance()->getGet(hojaVidaBaseTableClass::getNameField(hojaVidaTableClass::ANIMAL, TRUE));
         if (isset($idHojaVida)) {
             $where[registroPesoTableClass::ANIMAL] = $idHojaVida;
         }
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             if (isset($filter['fecha']) and $filter['fecha'] !== null and $filter['fecha'] !== '' and isset($filter['fin']) and $filter['fin'] !== null and $filter['fin'] !== '') {
                 $where[registroPesoTableClass::getNameTable() . '.' . registroPesoTableClass::FECHA] = array(date(config::getFormatTimestamp(), strtotime($filter['fecha'] . ' 00.00.00')), date(config::getFormatTimestamp(), strtotime($filter['fin'] . ' 23.59.59')));
             }
             if (isset($filter['empleado']) and $filter['empleado'] !== null and $filter['empleado'] !== '') {
                 $where[registroPesoTableClass::getNameTable() . '.' . registroPesoTableClass::EMPLEADO] = $filter['empleado'];
             }
             //close if
             if (isset($filter['kilo']) and $filter['kilo'] !== null and $filter['kilo'] !== '') {
                 $where[registroPesoTableClass::KILO] = $filter['kilo'];
             }
             //close if
             if (isset($filter['total']) and $filter['total'] !== null and $filter['total'] !== '') {
                 $where[registroPesoTableClass::getNameTable() . '.' . registroPesoTableClass::VALOR] = $filter['total'];
             }
             //close if
             if (isset($filter['peso']) and $filter['peso'] !== null and $filter['peso'] !== '') {
                 $where[registroPesoTableClass::getNameTable() . '.' . registroPesoTableClass::PESO] = $filter['peso'];
             }
             //close if
             session::getInstance()->setAttribute('animalFiltersRegistroPeso', $where);
         } elseif (session::getInstance()->hasAttribute('animalFiltersRegistroPeso')) {
             $where = session::getInstance()->getAttribute('animalFiltersRegistroPeso');
         }
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fields = array(registroPesoTableClass::ID, registroPesoTableClass::FECHA, registroPesoTableClass::KILO, registroPesoTableClass::PESO, registroPesoTableClass::VALOR);
         $fields2 = array(empleadoTableClass::NOMBRE);
         $fields3 = array(animalTableClass::NUMERO);
         $fJoin3 = registroPesoTableClass::EMPLEADO;
         $fJoin4 = empleadoTableClass::ID;
         $fJoin1 = registroPesoTableClass::ANIMAL;
         $fJoin2 = animalTableClass::ID;
         $orderBy = array(registroPesoTableClass::ID);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         $f = array(registroPesoTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = registroPesoTableClass::getAllCount($f, false, $lines);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         $this->idHojaVida = $idHojaVida;
         $this->idAnimalSeleccionado = request::getInstance()->getGet(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL, true));
         $this->objPeso = registroPesoTableClass::getAllJoin($fields, $fields2, $fields3, null, $fJoin3, $fJoin4, $fJoin1, $fJoin2, null, null, false, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         //$this->page = request::getInstance()->getGet('page');
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, true);
         $this->defineView('indexRegistroPeso', 'animal', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }
 public function execute()
 {
     try {
         $idHojaVida = request::getInstance()->getGet(hojaVidaBaseTableClass::getNameField(hojaVidaTableClass::ANIMAL, TRUE));
         if (isset($idHojaVida)) {
             $where[gestacionTableClass::ANIMAL] = $idHojaVida;
         }
         if (request::getInstance()->hasPost('filter')) {
             $filter = request::getInstance()->getPost('filter');
             if (isset($filter['fecha']) and $filter['fecha'] !== null and $filter['fecha'] !== '') {
                 $where[gestacionTableClass::getNameTable() . '.' . gestacionTableClass::FECHA] = $filter['fecha'];
             }
             //close if
             if (isset($filter['numero']) and $filter['numero'] !== null and $filter['numero'] !== '') {
                 $where[gestacionTableClass::ANIMAL] = $filter['numero'];
             }
             //close if
             if (isset($filter['fechaMonta']) and $filter['fechaMonta'] !== null and $filter['fechaMonta'] !== '') {
                 $where[gestacionTableClass::getNameTable() . '.' . gestacionTableClass::FECHA_MONTA] = $filter['fechaMonta'];
             }
             //close if
             //                if (isset($filter['fechaParto']) and $filter['fechaParto'] !== null and $filter['fechaParto'] !== '') {
             //                    $where[gestacionTableClass::getNameTable() . '.' . gestacionTableClass::FECHA_PROBABLE_PARTO] = $filter['fechaParto'];
             //                }//close if
             if (isset($filter['macho']) and $filter['macho'] !== null and $filter['macho'] !== '') {
                 $where[gestacionTableClass::ANIMAL_FECUNDADOR] = $filter['macho'];
             }
             //close if
             if (isset($filter['empleado']) and $filter['empleado'] !== null and $filter['empleado'] !== '') {
                 $where[gestacionTableClass::getNameTable() . '.' . gestacionTableClass::EMPLEADO] = $filter['empleado'];
             }
             //close if
             session::getInstance()->setAttribute('animalFiltersGestacion', $where);
         } elseif (session::getInstance()->hasAttribute('animalFiltersGestacion')) {
             $where = session::getInstance()->getAttribute('animalFiltersGestacion');
         }
         $idAnimalHojaVida = request::getInstance()->getGet(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL, true));
         $where = array(gestacionTableClass::ANIMAL => $idAnimalHojaVida);
         $fieldsEmpleado = array(empleadoTableClass::ID, empleadoTableClass::NOMBRE);
         $fieldsAnimal = array(animalTableClass::ID, animalTableClass::NUMERO);
         $fields = array(gestacionTableClass::ID, gestacionTableClass::FECHA, gestacionTableClass::FECHA_MONTA, gestacionTableClass::ANIMAL_FECUNDADOR);
         $fields2 = array(animalTableClass::NUMERO);
         $fields3 = array(empleadoTableClass::NOMBRE);
         $fJoin1 = gestacionTableClass::ANIMAL;
         $fJoin2 = animalTableClass::ID;
         $fJoin3 = gestacionTableClass::EMPLEADO;
         $fJoin4 = empleadoTableClass::ID;
         $orderBy = array(gestacionTableClass::ID);
         $page = 0;
         if (request::getInstance()->hasGet('page')) {
             $page = request::getInstance()->getGet('page') - 1;
             $page = $page * config::getRowGrid();
         }
         $f = array(gestacionTableClass::ID);
         $lines = config::getRowGrid();
         $this->cntPages = gestacionTableClass::getAllCount($f, false, $lines);
         if (request::getInstance()->hasGet('page')) {
             $this->page = request::getInstance()->getGet('page');
         } else {
             $this->page = $page;
         }
         $this->idHojaVida = $idHojaVida;
         //            $this->idAnimalSeleccionado = request::getInstance()->getGet(hojaVidaTableClass::getNameField(hojaVidaTableClass::ANIMAL,true));
         $this->objGestacion = gestacionTableClass::getAllJoin($fields, $fields2, $fields3, null, $fJoin1, $fJoin2, $fJoin3, $fJoin4, null, null, false, $orderBy, 'ASC', config::getRowGrid(), $page, $where);
         $this->objAnimal = animalTableClass::getAll($fieldsAnimal, true);
         //$this->page = request::getInstance()->getGet('page');
         $this->idAnimalHojaVida = $idAnimalHojaVida;
         $this->objEmpleado = empleadoTableClass::getAll($fieldsEmpleado, false);
         $this->defineView('index', 'gestacion', session::getInstance()->getFormatOutput());
     } catch (PDOException $exc) {
         session::getInstance()->setFlash('exc', $exc);
         routing::getInstance()->forward('shfSecurity', 'exception');
     }
 }