Ejemplo n.º 1
0
 /**
  * @param Criteria $query
  * @return HttpResponse
  */
 public function response(Criteria $query)
 {
     if ($this->getPayload()->getOrder()) {
         $query->orderBy($this->getPayload()->getOrderQuery());
     }
     $response = new CollectionResponsePayload($query, $this->createMeta($query));
     return new HttpResponse($response);
 }
Ejemplo n.º 2
0
 /**
  * @param string $preparedUrl
  * @return null|string
  */
 private static function buildWhere($preparedUrl)
 {
     $criteria = new Criteria();
     $andList = explode('|', $preparedUrl);
     $andList = array_filter($andList);
     foreach ($andList as $condition) {
         $criteria->andWhere(self::buildOR($condition));
     }
     return $criteria->getWhere();
 }
Ejemplo n.º 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();
 }
 /**
  * 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 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;
 }
Ejemplo n.º 8
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();
 }
Ejemplo n.º 9
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();
 }
Ejemplo n.º 10
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();
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 12
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;
     }
 }
 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);
 }
Ejemplo n.º 14
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);
 }
Ejemplo n.º 15
0
 /**
  * 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();
 }
Ejemplo n.º 16
0
 public function fromInput($modelName, $data)
 {
     if (!is_array($data)) {
         throw new Exception("Input data must be an Array");
     }
     $conditions = array();
     if (count($data)) {
         $metaData = $this->getDI()->getShared('modelsMetadata');
         $model = new $modelName();
         $dataTypes = $metaData->getDataTypes($model);
         $columnMap = $metaData->getReverseColumnMap($model);
         $bind = array();
         foreach ($data as $fieldName => $value) {
             if (isset($columnMap[$fieldName])) {
                 $field = $columnMap[$fieldName];
             } else {
                 continue;
             }
             if (isset($dataTypes[$field])) {
                 if (!is_null($value)) {
                     if ($value != '') {
                         $type = $dataTypes[$field];
                         if ($type == 2) {
                             $condition = $fieldName . " LIKE :" . $fieldName . ":";
                             $bind[$fieldName] = '%' . $value . '%';
                         } else {
                             $condition = $fieldName . ' = :' . $fieldName . ':';
                             $bind[$fieldName] = $value;
                         }
                         $conditions[] = $condition;
                     }
                 }
             }
         }
     }
     $criteria = new Criteria();
     if (count($conditions)) {
         $joinConditions = join(' AND ', $conditions);
         $criteria->where($joinConditions);
         $criteria->bind($bind);
     }
     return $criteria;
 }
Ejemplo n.º 17
0
 public function execute($params = array())
 {
     if (array_key_exists('binds', $params)) {
         $binds = $params['binds'];
         $this->query->bind($binds);
     }
     if (array_key_exists('order', $params)) {
         $order = $params['order'];
         $this->query->orderBy($order);
     }
     if (array_key_exists('limit', $params)) {
         $limit = $params['limit'];
         $this->query->limit($limit[0], $limit[1]);
     }
     try {
         return $this->query->execute();
     } catch (Exception $e) {
         return false;
     }
 }
 /**
  * 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 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);
 }
 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);
 }
Ejemplo n.º 21
0
 /**
  * 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());
 }
Ejemplo n.º 22
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');
     }
 }
 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);
 }
Ejemplo n.º 24
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();
 }
Ejemplo n.º 25
0
 /**
  * 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();
 }
 /**
  * @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");
 }
Ejemplo n.º 27
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;
 }
 /**
  * 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();
 }
Ejemplo n.º 29
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();
 }
Ejemplo n.º 30
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();
 }