Example #1
0
 /**
  * Searches for equipopozo
  */
 public function searchAction($yacimientoId = null)
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($yacimientoId != null) {
         $equipopozo = Equipopozo::find(array('equipoPozo_yacimientoId=:yacimiento_id:', 'bind' => array('yacimiento_id' => $yacimientoId)));
     } else {
         if ($this->request->isPost()) {
             //$query = parent::fromInput($this->di, 'Equipopozo', $this->request->getPost());
             $query = Criteria::fromInput($this->di, "Equipopozo", $_POST);
             $this->persistent->parameters = $query->getParams();
         } else {
             $numberPage = $this->request->getQuery("page", "int");
         }
         $parameters = $this->persistent->parameters;
         if (!is_array($parameters)) {
             $parameters = array();
         }
         $parameters["order"] = "equipoPozo_id";
         $equipopozo = Equipopozo::find($parameters);
     }
     if (count($equipopozo) == 0) {
         $this->flash->notice("No se encontraron resultados en la busqueda");
         return $this->dispatcher->forward(array("controller" => "equipopozo", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $equipopozo, "limit" => 25, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
Example #2
0
 /**
  * Buscando las planillas.
  * SI el usuario tiene rol de administrador podra ver todas las planillas.
  * Sino se veran las Habilitadas unicamente
  */
 public function searchAction()
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Planilla", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "planilla_id DESC";
     $planilla = Planilla::find($parameters);
     if (count($planilla) == 0) {
         $this->flash->notice("No se encontraron resultados");
         return $this->dispatcher->forward(array("controller" => "planilla", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $planilla, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $miSesion = $this->session->get('auth');
     if ($miSesion['rol_nombre'] == 'ADMIN') {
         $this->view->admin = 1;
     } else {
         $this->view->admin = 0;
     }
 }
Example #3
0
 /**
  * Searches for operadora
  */
 public function searchAction($yacimientoId = null)
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($yacimientoId != null) {
         $operadora = Operadora::find(array('operadora_yacimientoId=:yacimiento_id:', 'bind' => array('yacimiento_id' => $yacimientoId)));
     } else {
         if ($this->request->isPost()) {
             $query = Criteria::fromInput($this->di, "Operadora", $_POST);
             $this->persistent->parameters = $query->getParams();
         } else {
             $numberPage = $this->request->getQuery("page", "int");
         }
         $parameters = $this->persistent->parameters;
         if (!is_array($parameters)) {
             $parameters = array();
         }
         $parameters["order"] = "operadora_id";
         $operadora = Operadora::find($parameters);
     }
     if (count($operadora) == 0) {
         $this->flash->notice("No se han encontrado resultados");
         return $this->dispatcher->forward(array("controller" => "operadora", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $operadora, "limit" => 25, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
Example #4
0
 /**
  * Busca todas las lineas de un cliente especifico. Se utiliza en las tablas.
  */
 public function buscarLineasPorClienteAction($cliente_id)
 {
     parent::importarJsTable();
     $numberPage = 1;
     $numberPage = $this->request->getQuery("page", "int");
     $linea = Linea::find(array('linea_clienteId=:cliente_id: AND linea_habilitado=1', 'bind' => array('cliente_id' => $cliente_id), 'order by' => 'linea_nombre ASC'));
     if (count($linea) == 0) {
         $this->flash->notice("No se encontraron resultados en la busqueda");
         return $this->dispatcher->forward(array("controller" => "linea", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $linea, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $this->view->pick('linea/search');
 }
 /**
  * Searches for concatenado
  */
 public function searchAction()
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Concatenado", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "concatenado_id";
     $concatenado = Concatenado::find($parameters);
     if (count($concatenado) == 0) {
         $this->flash->notice("La búsqueda no encontró ningún resultado");
         return $this->dispatcher->forward(array("controller" => "concatenado", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $concatenado, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
Example #6
0
 /**
  * Searches for cliente
  */
 public function searchAction()
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Cliente", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "cliente_id";
     $cliente = Cliente::find($parameters);
     if (count($cliente) == 0) {
         $this->flash->notice("The search did not find any cliente");
         return $this->dispatcher->forward(array("controller" => "cliente", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $cliente, "limit" => 30, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
Example #7
0
 /**
  * Searches for tipoEquipo
  */
 public function searchAction()
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Tipoequipo", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "tipoEquipo_id";
     $tipoEquipo = Tipoequipo::find($parameters);
     if (count($tipoEquipo) == 0) {
         $this->flash->notice("No se encontraron registros");
         return $this->dispatcher->forward(array("controller" => "tipoequipo", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $tipoEquipo, "limit" => 10000, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
Example #8
0
 /**
  * Searches for orden
  */
 public function searchAction()
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $buscarOrden = $this->generarCriterioBusqueda($_POST);
         $query = Criteria::fromInput($this->di, "Orden", $buscarOrden);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "orden_id";
     $orden = Orden::find($parameters);
     if (count($orden) == 0) {
         $this->flash->notice("No se han encontrado resultados.");
         return $this->dispatcher->forward(array("controller" => "orden", "action" => "index"));
     }
     $tabla = $this->generarTablaDeOrdenes($orden);
     $paginator = new Paginator(array("data" => $tabla, "limit" => 100000, "page" => $numberPage));
     $planilla = Planilla::findFirstByPlanilla_id($tabla[0]['orden_planillaId']);
     if ($planilla) {
         $this->view->planilla = $planilla;
     }
     $this->view->page = $paginator->getPaginate();
 }