示例#1
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();
 }
 /**
  * Searches for usuario
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Usuario", $_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"] = "idusuario";
     $usuario = Usuario::find($parameters);
     if (count($usuario) == 0) {
         $this->flash->notice("The search did not find any usuario");
         return $this->dispatcher->forward(array("controller" => "usuario", "action" => "index"));
     }
     $barcode = new Barcode();
     echo "<style>";
     echo $barcode->getCssStyle();
     echo "</style>";
     //echo $barcode->code39("AB20150wewesdsd");
     $this->view->setVar("barcode", $barcode);
     $paginator = new Paginator(array("data" => $usuario, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Categories", $_POST);
         $this->session->conditions = $query->getConditions();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = array();
     if ($this->session->conditions) {
         $parameters["conditions"] = $this->session->conditions;
     }
     $parameters["order"] = "id";
     $categories = Categories::find($parameters);
     if (count($categories) == 0) {
         $this->flash->notice("The search did not find any categories");
         return $this->dispatcher->forward(array("controller" => "categories", "action" => "index"));
     }
     $paginator = new \Phalcon\Paginator\Adapter\Model(array("data" => $categories, "limit" => 10, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
 }
 /**
  * Searches for vehiculo
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Vehiculo", $_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"] = "idvehiculo";
     $vehiculo = Vehiculo::find($parameters);
     if (count($vehiculo) == 0) {
         $this->flash->notice("The search did not find any vehiculo");
         return $this->dispatcher->forward(array("controller" => "vehiculo", "action" => "index"));
     }
     foreach ($vehiculo as $v) {
         //print_r($v->TiposVehiculo);
     }
     $paginator = new Paginator(array("data" => $vehiculo, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Companies", $_POST);
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = array();
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $companies = Department::find($parameters);
     if (count($companies) == 0) {
         $this->flash->notice("没有找到对应的部门");
         return $this->forward("companies/index");
     }
     $paginator = new Phalcon\Paginator\Adapter\Model(array("data" => $companies, "limit" => 10, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
     $this->view->setVar("companies", $companies);
 }
示例#6
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();
 }
示例#7
0
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Products", $_POST);
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = array();
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $products = Products::find($parameters);
     if (count($products) == 0) {
         $this->flash->notice("The search did not find any products");
         return $this->forward("products/index");
     }
     $paginator = new Phalcon\Paginator\Adapter\Model(array("data" => $products, "limit" => 5, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
 }
示例#8
0
 /**
  * list
  */
 public function indexAction()
 {
     error_reporting(E_ALL & ~E_NOTICE);
     //$this->persistent->parameters = null;
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Topic", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     if ($numberPage == null) {
         $this->persistent->parameters = null;
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     if ($this->request->getPost("topic")) {
         $parameters["conditions"] .= " and topictype = 2 and status = 0";
         //status:
     } else {
         $parameters["conditions"] = "topictype = 2 and status = 0";
         //status:
     }
     //$parameters["order"] = "id";
     $builder = $this->modelsManager->createBuilder()->columns('*')->from('Topic')->where($parameters['conditions'], $parameters['bind'])->orderBy('id');
     $paginator = new PaginatorQueryBuilder(array("builder" => $builder, "limit" => 20, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
示例#9
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;
     }
 }
示例#10
0
 /**
  * Searches for waypoints
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Waypoints", $_POST);
         $this->persistent->parameters = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if ($numberPage <= 0) {
             $numberPage = 1;
         }
     }
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "id";
     $waypoints = Waypoints::find($parameters);
     if (count($waypoints) == 0) {
         $this->flash->notice("The search did not find any waypoints");
         return $this->dispatcher->forward(array("controller" => "waypoints", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $waypoints, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
示例#11
0
 public function indexAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = \Phalcon\Mvc\Model\Criteria::fromInput($this->di, "Models\\News", $_POST);
         $query->order("id ASC, title ASC");
         $this->persistent->searchParams = $query->getParams();
         if (!\Helpers\Arr::is_array_empty($this->persistent->searchParams)) {
             $news = \Models\News::find($this->persistent->searchParams);
         }
     } else {
         $numberPage = $this->request->getQuery("page", "int");
         if (!$numberPage or $numberPage <= 0) {
             $numberPage = 1;
         }
         if ($numberPage > 1 and !\Helpers\Arr::is_array_empty($this->persistent->searchParams)) {
             $news = \Models\News::find($this->persistent->searchParams);
         } else {
             $news = \Models\News::find();
             $this->persistent->searchParams = null;
         }
     }
     if (count($news) == 0) {
         $this->flashSession->notice("Не найдено ни одной новости");
         $this->persistent->searchParams = null;
     }
     $paginator = new \Phalcon\Paginator\Adapter\Model(array("data" => $news, "limit" => 10, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $this->view->setVar("page", $page);
     $this->view->setVar('searchparams', $this->persistent->searchParams);
     $this->view->setVar('numpage', $numberPage);
 }
 public function indexAction()
 {
     $nowurl = $this->request->getURI();
     $type_list = $this->_getBusTypeList();
     $this->view->type_list = $type_list;
     $this->view->url = $nowurl;
     $project_type = '';
     $project_grow_up = '';
     $is_type_belongs = false;
     $numberPage = 1;
     if ($this->request->isGet()) {
         $query = Criteria::fromInput($this->di, "DtbProduct", $_GET);
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $this->persistent->parameters = $query->getParams();
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $parameters["order"] = "product_id";
     $dtb_product = DtbProduct::find($parameters);
     if (count($dtb_product) == 0) {
         $this->flash->notice("The search did not find any dtb_product");
     }
     $paginator = new Paginator(array("data" => $dtb_product, "limit" => $this->config->application->page_size, "page" => $numberPage));
     $page = $paginator->getPaginate();
     $page_split = $this->_split_page($page->current, $page->total_pages);
     $this->view->page_split = $page_split;
     //$this->view->disable();
     $this->view->page = $page;
 }
 /**
  * Searches for motorbikes
  */
 public function searchAction()
 {
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "MotorBike\\Models\\Motorbikes", $this->request->getPost());
         $this->persistent->parameters = $query->getParams();
     }
     return $this->listAction();
 }
 public function getPostsByDealerAction()
 {
     $query = Criteria::fromInput($this->di, "Dealers", array_merge($_GET, $_POST));
     $this->persistent->parameters = $query->getParams();
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $posts = PostsService::getPostsByDealer($parameters);
     $this->view->disable();
     $this->response->setContentType('application/json', 'UTF-8');
     echo json_encode($posts);
 }
 /**
  * Searches for students
  */
 public function searchAction()
 {
     $query = Criteria::fromInput($this->di, "Students", array_merge($_GET, $_POST));
     $this->persistent->parameters = $query->getParams();
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $students = \Students::find($parameters)->toArray(true);
     $this->view->disable();
     $this->response->setContentType('application/json', 'UTF-8');
     echo json_encode(array("student" => $students));
 }
 public function oneAction()
 {
     $query = Criteria::fromInput($this->di, "City", array_merge($_GET, $_POST));
     $this->persistent->parameters = $query->getParams();
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $data = \City::findFirst($parameters)->toArray(true);
     $this->view->disable();
     $this->response->setContentType('application/json', 'UTF-8');
     echo json_encode($data);
 }
 /**
  * Search products based on current criteria
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, 'PhalconDemo\\Models\\Products', $this->request->getPost());
         $this->persistent->set('searchParams', $query->getParams());
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = $this->persistent->get('searchParams', []);
     /** @var \Phalcon\Mvc\Model\Resultset\Simple $products */
     $products = Products::find($parameters);
     if (!$products->count()) {
         $this->flash->notice("The search did not find any products");
         return $this->forward("products/index");
     }
     $paginator = new Paginator(['data' => $products, 'limit' => 10, 'page' => $numberPage]);
     $this->view->setVar('page', $paginator->getPaginate());
 }
示例#18
0
 public function pjCenterAction($raise_id)
 {
     if ($this->request->isGet()) {
         $raise_id = $this->request->getQuery('raise_id');
         if (empty($raise_id)) {
             die('invaild project');
         }
         $query = Criteria::fromInput($this->di, "DtbRaiseProjectBasic", $_GET);
         $this->persistent->parameters = $query->getParams();
         $parameters = $this->persistent->parameters;
         $dtb_raise_project_basic = DtbRaiseProjectBasic::findFirst($parameters);
         $this->view->dtb_raise_project_basic = $dtb_raise_project_basic;
         $volt = new \Phalcon\Mvc\View\Engine\Volt($this->view, $this->di);
         $compiler = $volt->getCompiler();
         $compiler->addFunction('shuffle', 'md5');
     } else {
         die('invaild error');
     }
 }
 /**
  * Searches for users
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, 'Dsc\\Admin\\Models\\Users', $this->request->getPost());
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = array();
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $users = Users::find($parameters);
     if (count($users) == 0) {
         $this->flash->notice("The search did not find any users");
         return $this->dispatcher->forward(array("action" => "index"));
     }
     $paginator = new Paginator(array("data" => $users, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
 public function searchAction()
 {
     $params = array_merge($_GET, $_POST);
     foreach ($params as $key => $v) {
         $params[$key] = preg_replace("/\\//", "", $v);
     }
     $query = Criteria::fromInput($this->di, "Dealers", $params);
     $this->persistent->parameters = $query->getParams();
     $parameters = $this->persistent->parameters;
     if (!is_array($parameters)) {
         $parameters = array();
     }
     $data = \Dealers::find($parameters)->toArray(true);
     $this->view->disable();
     $this->response->setContentType('application/json', 'UTF-8');
     if (count($data) == 1) {
         echo json_encode($data[0]);
         exit;
     }
     echo json_encode($data);
 }
示例#21
0
 /**
  * Searches for roles
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, 'Webird\\Models\\Roles', $this->request->getPost());
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = [];
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $roles = Roles::find($parameters);
     if (count($roles) == 0) {
         $this->flash->notice($this->translate->gettext('The search did not find any roles'));
         return $this->dispatcher->forward(["action" => "index"]);
     }
     $paginator = new Paginator(["data" => $roles, "limit" => 10, "page" => $numberPage]);
     $this->view->page = $paginator->getPaginate();
 }
示例#22
0
 /**
  * Search companies based on current criteria
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Companies", $this->request->getPost());
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = array();
     if ($this->persistent->searchParams) {
         $parameters = $this->persistent->searchParams;
     }
     $companies = Companies::find($parameters);
     if (count($companies) == 0) {
         $this->flash->notice("The search did not find any companies");
         return $this->forward("companies/index");
     }
     $paginator = new Paginator(array("data" => $companies, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $this->view->companies = $companies;
 }
 /**
  * @Route("/search", methods={"POST","GET"}, name="apartmentsearch")
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Apartment", $_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"] = "id";
     $company = $this->request->getPost("company");
     $tower = $this->request->getPost("tower");
     $name = $this->request->getPost("name");
     //$query = $this->modelsManager->createQuery("Select c.name as company,
     // t.number as tower , a.id as id,a.name  as name from Apartment  a
     //INNER JOIN  Company c on c.id =a.companyid
     //INNER JOIN Tower t on t.id =a.towerid
     // HAVING c.name = :company: AND  t.number = :tower:"
     //);
     $apartment = $this->modelsManager->createBuilder()->columns(array('c.name as company', 't.number as tower', 'a.id as id', 'a.name as apartmentname'))->from(array('a' => 'Apartment'))->join('Company', 'c.id = a.companyid', 'c')->join('Tower', 't.id = a.towerid', 't')->where('c.name LIKE :company:', array('company' => '%' . $company . '%'))->andWhere('t.number LIKE :tower:', array('tower' => '%' . $tower . '%'))->andWhere('a.name LIKE :name:', array('name' => '%' . $name . '%'))->getQuery()->execute();
     //$query->execute(array("company"=>$company ,"tower"=>$tower));
     //$apartment = Apartment::find($parameters);
     /*if (count($apartment) == 0) {
                 $this->flash->notice("The search did not find any apartment");
     
                 return $this->dispatcher->forward(array(
                     "controller" => "apartment",
                     "action" => "search"
                 ));
             }
     */
     $paginator = new Paginator(array("data" => $apartment, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
     $this->view->pick("apartment/search");
 }
 /**
  * Searches for dtb_raise_project_idea
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "DtbRaiseProjectIdea", $_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"] = "raise_id";
     $dtb_raise_project_idea = DtbRaiseProjectIdea::find($parameters);
     if (count($dtb_raise_project_idea) == 0) {
         $this->flash->notice("The search did not find any dtb_raise_project_idea");
         return $this->dispatcher->forward(array("controller" => "dtb_raise_project_idea", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $dtb_raise_project_idea, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
示例#25
0
 public function searchAction()
 {
     $request = $this->request;
     $searchParams = null;
     $numberPage = 1;
     if ($request->isPost()) {
         $query = Criteria::fromInput($this->di, 'Phalconvn\\Models\\Categories', $this->request->getPost());
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = array('order' => 'id DESC');
     if ($this->persistent->searchParams == true) {
         $parameters = $this->persistent->searchParams;
     }
     $Categories = Categories::find($parameters);
     if (count($Categories) == 0) {
         $this->flash->notice(_("The search did not find any Categories"));
         return $this->dispatcher->forward(array("action" => "index"));
     }
     $paginator = new Paginator(array("data" => $Categories, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
示例#26
0
 /**
  * Searches for linea
  */
 public function searchAction()
 {
     parent::importarJsTable();
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Linea", $_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"] = "linea_id";
     $linea = Linea::find($parameters);
     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" => 25, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
示例#27
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();
 }
示例#28
0
 /**
  * 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();
 }
示例#29
0
 public function searchAction()
 {
     $request = $this->request;
     $searchParams = null;
     $numberPage = 1;
     if ($request->isPost()) {
         $query = Criteria::fromInput($this->di, 'Phalconvn\\Models\\FileStore', $this->request->getPost());
         $this->persistent->searchParams = $query->getParams();
     } else {
         $numberPage = $this->request->getQuery("page", "int");
     }
     $parameters = array("order" => "created DESC");
     if ($this->persistent->searchParams == true) {
         $parameters = $this->persistent->searchParams;
     }
     $fileStore = FileStore::find($parameters);
     if (count($fileStore) == 0) {
         $this->flash->notice("The search did not find any FileStore");
         return $this->dispatcher->forward(array("action" => "index"));
     }
     // echo $fileStore->fileStore->id;
     $paginator = new Paginator(array("data" => $fileStore, "limit" => 10, "page" => $numberPage));
     $this->view->page = $paginator->getPaginate();
 }
 /**
  * Searches for acceso
  */
 public function searchAction()
 {
     $numberPage = 1;
     if ($this->request->isPost()) {
         $query = Criteria::fromInput($this->di, "Acceso", $_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"] = "time DESC";
     $acceso = Acceso::find($parameters);
     if (count($acceso) == 0) {
         $this->flash->notice("The search did not find any acceso");
         return $this->dispatcher->forward(array("controller" => "acceso", "action" => "index"));
     }
     $paginator = new Paginator(array("data" => $acceso, "limit" => 300, "page" => $numberPage));
     $condominios = Phalcon\Tag::select(array("idcondominio", Condominio::find(), "using" => array("idcondominio", "nombre"), "class" => "form-control"));
     $this->view->setVar("condominios", $condominios);
     $this->view->page = $paginator->getPaginate();
 }