public function __construct() { parent::__construct(); $this->_ciudad = $this->loadModel('ciudad'); Buscador::validaForm(); $this->_loadLeft(); }
protected function _loadLeft() { if (substr($this->getServer('HTTP_REFERER'), 16, 22) == 'panamericanaturismo.cl' || substr($this->getServer('HTTP_REFERER'), 14, 22) == 'panamericanaturismo.cl') { // /bloqueos/buscar/form/3f7a2611ee08c6645796463e0bb1ae7f //echo $_SERVER['REQUEST_URI']; exit; $cliente = explode('/', substr($this->getServer('HTTP_REFERER'), 16, strlen($this->getServer('HTTP_REFERER')))); if ($cliente[1]) { Buscador::getCliente(trim($cliente[1])); } } if ($this->getTexto('mL_txtFechaIn')) { Session::set('sess_fechaDefault', $this->getTexto('mL_txtFechaIn')); } else { if ($this->getTexto('mL_txtFechaIn_PRG')) { Session::set('sess_fechaDefault', $this->getTexto('mL_txtFechaIn_PRG')); } else { Session::set('sess_fechaDefault', date('d/m/Y')); } } if (!Session::get('sess_BP_fechaIn')) { $this->_view->ML_fechaIni = Session::get('sess_fechaDefault'); } else { $this->_view->ML_fechaIni = Session::get('sess_BP_fechaIn'); } if (!Session::get('sess_BP_fechaOut')) { $this->_view->ML_fechaFin = Functions::sumFecha(Session::get('sess_fechaDefault'), 0, 6); //Session::get('sess_fechaDefault'); } else { $this->_view->ML_fechaFin = Session::get('sess_BP_fechaOut'); } if (!Session::get('sess_BP_fechaIn_PRG')) { $this->_view->ML_fechaIni_PRG = Functions::sumFecha(Session::get('sess_fechaDefault'), 0, 3); //Session::get('sess_fechaDefault'); } else { $this->_view->ML_fechaIni_PRG = Session::get('sess_BP_fechaIn_PRG'); } if (!Session::get('sess_BP_fechaOut_PRG')) { $this->_view->ML_fechaFin_PRG = Session::get('sess_fechaDefault'); } else { $this->_view->ML_fechaFin_PRG = Session::get('sess_BP_fechaOut_PRG'); } }
<?php session_start(); if ($_SESSION['estatus'] == '1') { ?> <!-- Autor: Víctor Javier Báez Morales LSCA--> <?php include "config.php"; $c = new Buscador(); $c->Conectar(); $q = $_GET['q']; if ($q == null) { print 'Ingrese algun dato para buscar'; } else { $c->Buscar($q); } /* include("../../../Scripts/conexion.php"); $q = $_GET['q']; if($q==""){ print "cosulta"; }else{ print "siiii"; }*/ ?> <?php
<?php include "findinv.php"; $conexion = new Buscador(); $conexion->Conectar(); $q = $_GET['q']; $conexion->Buscar($q);
/** * Metodo procesador: Procesa los datos de la busqueda de programas. * <PRE> * -.Creado: 19/05/2015 * </PRE> * @author Jonathan Estay */ public function buscar($form = '', $url = '') { Buscador::buscar($url); $BP_cntHab = $this->getInt('mL_cmbHab_PRG'); $BP_ciudadDes = $this->getTexto('mL_txtCiudadDestino_PRG'); $BP_fechaIn = $this->getTexto('mL_txtFechaIn_PRG'); $BP_fechaOut = $this->getTexto('mL_txtFechaOut_PRG'); $BP_hotel = $this->getTexto('mL_txtHotel_PRG'); if ($BP_ciudadDes) { Session::set('sess_BP_ciudadDes_PRG', $BP_ciudadDes); } Session::set('sess_BP_cntHab_PRG', $BP_cntHab); Session::set('sess_BP_fechaIn_PRG', $BP_fechaIn); Session::set('sess_BP_fechaOut_PRG', $BP_fechaOut); Session::set('sess_BP_hotel_PRG', $BP_hotel); Session::set('sess_BP_cntPas', 0); Session::set('sess_BP_cntAdl', 0); Session::set('sess_BP_cntChd', 0); Session::set('sess_BP_cntInf', 0); for ($i = 1; $i <= 3; $i++) { if ($i <= $BP_cntHab) { Session::set('sess_BP_Adl_' . $i, $this->getInt('mL_cmbAdultos_' . $i)); Session::set('sess_BP_Chd_' . $i, $this->getInt('mL_child_' . $i)); Session::set('sess_BP_Inf_' . $i, $this->getInt('mL_inf_' . $i)); if (Session::get('sess_BP_Adl_' . $i) > 0) { Session::set('sess_BP_cntAdl', Session::get('sess_BP_cntAdl') + 1); } if (Session::get('sess_BP_Chd_' . $i) > 0) { Session::set('sess_BP_cntChd', Session::get('sess_BP_cntChd') + 1); } if (Session::get('sess_BP_Inf_' . $i) > 0) { Session::set('sess_BP_cntInf', Session::get('sess_BP_cntInf') + 1); } for ($x = 1; $x <= 2; $x++) { Session::set('sess_BP_edadChd_' . $x . '_' . $i, $this->getInt('mL_edadChild_' . $x . '_' . $i)); } Session::set('sess_BP_cntPas', Session::get('sess_BP_cntPas') + Session::get('sess_BP_Adl_' . $i) + Session::get('sess_BP_Chd_' . $i)); } else { Session::set('sess_BP_Adl_' . $i, 0); Session::set('sess_BP_Chd_' . $i, 0); Session::set('sess_BP_Inf_' . $i, 0); Session::set('sess_BP_edadChd_1_' . $i, 0); Session::set('sess_BP_edadChd_2_' . $i, 0); } } $this->redireccionar('programas/index/' . $form); }
<?php _::define_controller('search', function () { _::declare_component('searcher'); $toSearch = _::$post['q']; $search = new Buscador((string) $toSearch); // get querys to execute in db $querys = $search->getQuerys(); foreach ($querys as $query) { $pdo = _::$db->prepare('SELECT id FROM posts WHERE title_post LIKE \'%' . $query . '%\''); $pdo->execute(); $results = $pdo->fetchAll(); // join all results $search->merge($results); } $LIMIT = 10; // limit of results // delete repeated results $results = $search->filterQuerys('id', $LIMIT); // $search->error (BOOLEAN) /* $search->error_id (ONE OF THIS CONSTANTS: * BUSCADOR_TEXTO_PEQUENIO, BUSCADOR_PALABRAS_PEQUENIAS, BUSCADOR_MUCHAS_PALABRAS * Little TEXT, little words, many words, respectively) */ // now, in $results is array of results }, true);
public function buscar($form = '', $url = '') { Buscador::buscar($url); if ($form === 'a') { Session::acceso('Usuario'); } $BP_cntHab = $this->getInt('mL_cmbHab'); $BP_ciudadDes = $this->getTexto('mL_txtCiudadDestino'); $BP_fechaIn = $this->getTexto('mL_txtFechaIn'); $BP_fechaOut = $this->getTexto('mL_txtFechaOut'); $BP_hotel = $this->getTexto('mL_txtHotel'); if ($BP_ciudadDes) { Session::set('sess_BP_ciudadDes', $BP_ciudadDes); } Session::set('sess_BP_cntHab', $BP_cntHab); Session::set('sess_BP_fechaIn', $BP_fechaIn); Session::set('sess_BP_fechaOut', $BP_fechaOut); if ($BP_hotel == 'Nombre del hotel') { $BP_hotel = ''; } Session::set('sess_BP_hotel', $BP_hotel); Session::set('sess_BP_cntAdl', 0); Session::set('sess_BP_cntChd', 0); Session::set('sess_BP_cntInf', 0); for ($i = 1; $i <= 3; $i++) { if ($i <= $BP_cntHab) { Session::set('sess_BP_Adl_' . $i, $this->getInt('mL_cmbAdultos_' . $i)); Session::set('sess_BP_Chd_' . $i, $this->getInt('mL_child_' . $i)); Session::set('sess_BP_Inf_' . $i, $this->getInt('mL_inf_' . $i)); if (Session::get('sess_BP_Adl_' . $i) > 0) { Session::set('sess_BP_cntAdl', Session::get('sess_BP_cntAdl') + 1); } if (Session::get('sess_BP_Chd_' . $i) > 0) { Session::set('sess_BP_cntChd', Session::get('sess_BP_cntChd') + 1); } if (Session::get('sess_BP_Inf_' . $i) > 0) { Session::set('sess_BP_cntInf', Session::get('sess_BP_cntInf') + 1); } for ($x = 1; $x <= 2; $x++) { if ($x <= Session::get('sess_BP_Chd_' . $i) && !$this->getInt('mL_edadChild_' . $x . '_' . $i)) { Session::set('sess_BP_edadChd_' . $x . '_' . $i, 2); } else { Session::set('sess_BP_edadChd_' . $x . '_' . $i, $this->getInt('mL_edadChild_' . $x . '_' . $i)); } } } else { Session::set('sess_BP_Adl_' . $i, 0); Session::set('sess_BP_Chd_' . $i, 0); Session::set('sess_BP_Inf_' . $i, 0); Session::set('sess_BP_edadChd_1_' . $i, 0); Session::set('sess_BP_edadChd_2_' . $i, 0); } } $this->redireccionar('bloqueos/index/' . $form); }
<?php include "findinv.php"; $conexion = new Buscador(); $q = $_GET['q']; $conexion->Buscarsuc($q);