public function execute() { try { // $fields = array( // empleadoBaseTableClass::ID, // empleadoBaseTableClass::NOMBRE, // empleadoBaseTableClass::APELLIDO_EMPLEADO, // empleadoBaseTableClass::DIRECCION_EMPLEADO, // empleadoBaseTableClass::TELEFONO_EMPLEADO, // empleadoBaseTableClass::MOVIL_EMPELADO, // empleadoBaseTableClass::CORREO_EMPLEADO, // empleadoBaseTableClass::USUARIO_ID, // // ); // // $fields1 = array(cargoTableClass::ID, cargoTableClass::DESC_CARGO); // // $fields3 = array( // usuarioTableClass::ID, // usuarioTableClass::PASSWORD, // usuarioTableClass::LAST_LOGIN_AT // // ); $this->objCargo = cargoTableClass::getAll($fields1); // $this->objUsuario= usuarioTableClass::getAll($fields3); $this->defineView('formEmpleado', 'prestamo', session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { session::getInstance()->setFlash('exc', $exc); routing::getInstance()->forward('shfSecurity', 'exception'); } }
public function execute() { try { echo 1; $fields = array(cargoBaseTableClass::ID, cargoBaseTableClass::DESCRIPCION); $orderBy = array(cargoTableClass::ID); $page = 0; if (request::getInstance()->hasGet('page')) { $page = request::getInstance()->getGet('page') - 1; $page = $page * config::getRowGrid(); } $f = array(cargoTableClass::ID); $lines = config::getRowGrid(); $this->cntPages = cargoTableClass::getAllCount($f, true, $lines); if (request::getInstance()->hasGet('page')) { $this->page = request::getInstance()->getGet('page'); } else { $this->page = $page; } $this->objCargo = cargoTableClass::getAll($fields, true, $orderBy, 'ASC', config::getRowGrid(), $page); $this->defineView('index', 'cargo', 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[empleadoTableClass::TEL] = $filter['telefono']; } if (isset($filter['nombre_completo']) and $filter['nombre_completo'] !== null and $filter['nombre_completo'] !== '') { $where[empleadoTableClass::NOMBRE] = $filter['nombre_completo']; } if (isset($filter['cargo']) and $filter['cargo'] !== null and $filter['cargo'] !== '') { $where[empleadoTableClass::CARGO] = $filter['cargo']; } if (isset($filter['tipo_doc']) and $filter['tipo_doc'] !== null and $filter['tipo_doc'] !== '') { $where[empleadoTableClass::TIPO_DOC] = $filter['tipo_doc']; } session::getInstance()->setAttribute('empleadoDeleteFilters', $where); } $fieldsCargo = array(cargoTableClass::ID, cargoTableClass::DESCRIPCION); $fieldsTipoDoc = array(tipoDocumentoTableClass::ID, tipoDocumentoTableClass::DESCRIPCION); $fields = array(empleadoTableClass::ID, empleadoTableClass::NUMERO_DOC, empleadoTableClass::CIUDAD, empleadoTableClass::NOMBRE, empleadoTableClass::TEL, empleadoTableClass::CARGO, empleadoTableClass::TIPO_DOC, empleadoTableClass::DIRECCION); $fields2 = array(ciudadTableClass::NOMBRE); $fields3 = array(cargoTableClass::DESCRIPCION); $fields4 = array(tipoDocumentoTableClass::DESCRIPCION); $fJoin1 = empleadoTableClass::CIUDAD; $fJoin2 = ciudadTableClass::ID; $fJoin3 = empleadoTableClass::CARGO; $fJoin4 = cargoTableClass::ID; $fJoin5 = empleadoTableClass::TIPO_DOC; $fJoin6 = tipoDocumentoTableClass::ID; $orderBy = array(empleadoTableClass::ID); $page = 0; if (request::getInstance()->hasGet('page')) { $page = request::getInstance()->getGet('page') - 1; $page = $page * config::getRowGrid(); } $f = array(empleadoTableClass::ID); $lines = config::getRowGrid(); $this->cntPages = empleadoTableClass::getAllCount($f, true, $lines); if (request::getInstance()->hasGet('page')) { $this->page = request::getInstance()->getGet('page'); } else { $this->page = $page; } $this->objEmpleado = empleadoTableClass::getAllJoin($fields, $fields2, $fields3, $fields4, $fJoin1, $fJoin2, $fJoin3, $fJoin4, $fJoin5, $fJoin6, true, $orderBy, 'ASC', config::getRowGrid(), $page, $where); $this->objCargo = cargoTableClass::getAll($fieldsCargo, true); $this->objtipoDoc = tipoDocumentoTableClass::getAll($fieldsTipoDoc, false); $this->defineView('index', 'empleado', session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { session::getInstance()->setFlash('exc', $exc); routing::getInstance()->forward('shfSecurity', 'exception'); } }
public function execute() { try { $fields = array(cargoTableClassTableClass::ID, cargoTableClassTableClass::DESC_CARGO); $this->objcargo = cargoTableClass::getAll($fields, true); $this->defineView($cargo, $default, session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { echo $exc->getMessage(); echo 'br'; echo $exc->getTraceAsString(); } }
public function execute() { try { $fieldsTipo_doc = array(tipoDocumentoTableClass::ID, tipoDocumentoTableClass::DESCRIPCION); $fieldsCargo = array(cargoTableClass::ID, cargoTableClass::DESCRIPCION); $fieldsCiudad = array(ciudadTableClass::ID, ciudadTableClass::NOMBRE); $this->objCargo = cargoTableClass::getAll($fieldsCargo, true); $this->objCiudad = ciudadTableClass::getAll($fieldsCiudad, true); $this->objTipo_doc = tipoDocumentoTableClass::getAll($fieldsTipo_doc, true); $this->defineView('insert', 'empleado', session::getInstance()->getFormatOutput()); } catch (PDOException $exc) { session::getInstance()->setFlash('exc', $exc); routing::getInstance()->forward('shfSecurity', 'exception'); } }
public function execute() { try { if (request::getInstance()->hasRequest(cargoTableClass::ID)) { $fields = array(cargoTableClass::ID, cargoTableClass::DESCRIPCION); $where = array(cargoTableClass::ID => request::getInstance()->getRequest(cargoTableClass::ID)); $this->objCargo = cargoTableClass::getAll($fields, false, null, null, null, null, $where); $this->defineView('edit', 'cargo', session::getInstance()->getFormatOutput()); } else { routing::getInstance()->redirect('personal', 'indexCargo'); } } 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'); } }