+ Error on line 219
$this->data['preguntas']=$r;
<?php
/**
* MainController
* @author Manuel Cuevas
*/
class MainController extends DooController {
public $data;
public function index() {
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$idioma = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
}else{
$idioma = 'es';
}
return Doo::conf()->APP_URL . $idioma;
}
public function spanish() {
$idioma = "spanish.php";
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->buildMenu("es");
$this->Menu("es");
$this->buildOptionfotter();
$param = $this->db()->find("Parametros", array("select" => "botonInicio,linkInicio", "limit" => 1));
$this->data['botonInicio'] = $param->botonInicio;
$this->data['linkInicio'] = $param->linkInicio;
$m = Doo::db()->find('Pages', array("where" => "page= 'section1' ", "limit" => 1));
$this->data['titulosection1'] = $m->titulo;
$this->data['htmlsection1'] = $m->descripcion;
$this->data['imgsection1'] = $m->foto;
$this->data['colorsection1'] = $m->color_descripcion;
$this->data['colortitulo1'] = $m->color_titulo;
$this->data["headTitle"] = $m->metaTitulo;
$this->data["headTitle1"] = $m->metaTitulo1;
$this->data["keywords"] = $m->metaDescription;
$section2 = Doo::db()->find('Pages', array("where" => "page= 'section2' ", "limit" => 1));
$this->data['titulosection2'] = $section2->titulo;
$this->data['htmlsection2'] = $section2->descripcion;
$this->data['imgsection2'] = $section2->foto;
$this->data['colorsection2'] = $section2->color_descripcion;
$this->data['colortitulo2'] = $section2->color_titulo;
$section3 = Doo::db()->find('Pages', array("where" => "page= 'section3' ", "limit" => 1));
$this->data['titulosection3'] = $section3->titulo;
$this->data['htmlsection3'] = $section3->descripcion;
$this->data['imgsection3'] = $section3->foto;
$this->data['colorsection3'] = $section3->color_descripcion;
$this->data['colortitulo3'] = $section3->color_titulo;
$section4 = Doo::db()->find('Pages', array("where" => "page= 'section4' ", "limit" => 1));
$this->data['titulosection4'] = $section4->titulo;
$this->data['htmlsection4'] = $section4->descripcion;
$this->data['imgsection4'] = $section4->foto;
$this->data['colorsection4'] = $section4->color_descripcion;
$this->data['colortitulo4'] = $section4->color_titulo;
$section5 = Doo::db()->find('Pages', array("where" => "page= 'section5' ", "limit" => 1));
$this->data['titulosection5'] = $section5->titulo;
$this->data['htmlsection5'] = $section5->descripcion;
$this->data['imgsection5'] = $section5->foto;
$this->data['colorsection5'] = $section5->color_descripcion;
$this->data['colortitulo5'] = $section5->color_titulo;
$this->data['content'] = 'inicio';
$this->data['scriptactiveM'] = "$('#HL1').addClass('activeM');";
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
public function english() {
$idioma = "english.php";
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->buildMenu("en");
$this->Menu("en");
$this->buildOptionfotter();
$param = $this->db()->find("Parametros", array("select" => "botonInicioIngles,linkInicioIngles", "limit" => 1));
$this->data['botonInicio'] = $param->botonInicioIngles;
$this->data['linkInicio'] = $param->linkInicioIngles;
$m = Doo::db()->find('Pages', array("where" => "page= 'section1' ", "limit" => 1));
$this->data['titulosection1'] = $m->titulo2;
$this->data['htmlsection1'] = $m->english;
$this->data['imgsection1'] = $m->foto;
$this->data['colorsection1'] = $m->color_descripcion;
$this->data['colortitulo1'] = $m->color_titulo;
$this->data["headTitle"] = $m->metaTituloIngles;
$this->data["headTitle1"] = $m->metaTitulo1Ingles;
$this->data["keywords"] = $m->metaDescription;
$section2 = Doo::db()->find('Pages', array("where" => "page= 'section2' ", "limit" => 1));
$this->data['titulosection2'] = $section2->titulo2;
$this->data['htmlsection2'] = $section2->english;
$this->data['imgsection2'] = $section2->foto;
$this->data['colorsection2'] = $section2->color_descripcion;
$this->data['colortitulo2'] = $section2->color_titulo;
$section3 = Doo::db()->find('Pages', array("where" => "page= 'section3' ", "limit" => 1));
$this->data['titulosection3'] = $section3->titulo2;
$this->data['htmlsection3'] = $section3->english;
$this->data['imgsection3'] = $section3->foto;
$this->data['colorsection3'] = $section3->color_descripcion;
$this->data['colortitulo3'] = $section3->color_titulo;
$section4 = Doo::db()->find('Pages', array("where" => "page= 'section4' ", "limit" => 1));
$this->data['titulosection4'] = $section4->titulo2;
$this->data['htmlsection4'] = $section4->english;
$this->data['imgsection4'] = $section4->foto;
$this->data['colorsection4'] = $section4->color_descripcion;
$this->data['colortitulo4'] = $section4->color_titulo;
$section5 = Doo::db()->find('Pages', array("where" => "page= 'section5' ", "limit" => 1));
$this->data['titulosection5'] = $section5->titulo2;
$this->data['htmlsection5'] = $section5->english;
$this->data['imgsection5'] = $section5->foto;
$this->data['colorsection5'] = $section5->color_descripcion;
$this->data['colortitulo5'] = $section5->color_titulo;
$this->data['content'] = 'inicio';
$this->data['scriptactiveM'] = "$('#HL1').addClass('activeM');";
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
public function destacadas() {
Doo::loadModel("Articulos");
$a = new Articulos();
$a->publicado = "S";
$a->destacada = "S";
$articles = Doo::db()->find($a, array(
"select" => "id,titulo,intro,imagen",
"desc" => "id",
"asArray" => true));
return $articles;
}
public function imagen() {
$param = $this->params['pindex'];
$id = $_REQUEST['id'];
$rs = Doo::db()->find($param, array("select" => "imagen",
"where" => "id = ?",
"limit" => 1,
"param" => array($id)));
$imagen = $rs->imagen;
if ($imagen == "") {
echo "";
} else {
Header("Content-type: image/jpg ");
echo $imagen;
}
}
public function showPage() {
$page = $this->params['pagina'];
Doo::loadModel("Pages");
$p = new Pages();
$p->page = $page;
$idiomapage = $this->params['idioma'];
$p = Doo::db()->find($p, array('limit' => 1));
if ($p == false) {
return array(Doo::conf()->APP_URL . "/error", 404);
}else {
$multicontenido = Doo::db()->query("SELECT d.multicontenido FROM direcciones d INNER JOIN `pages` p on d.url=p.`page` and d.multicontenido=1 and p.page='$p->page' ")->fetch();
if($multicontenido['multicontenido']==1){
//---------------------------------------------------------nuevo-----------------------------------------------
$direccion = Doo::db()->query("SELECT g.id FROM grup g inner join direcciones d on (d.id=g.id_direccion) where d.url='$p->page'")->fetch();
$this->data['tituloPreguntas']="";
if ($idiomapage == "en") {
$r = Doo::db()->find("Rgrup", array("select" => "id,id_grup,pregunta2 AS title, descripcion2 AS des, foto2 AS foto ,video2 AS video", "where" => "id_grup = '$direccion[id]'", "asArray" => true,/*'limit' => 4*/));
$p = Doo::db()->find($p, array('limit' => 1));
$this->data['titulo'] = $p->titulo2;
$this->data['html'] = $p->english;
$this->data['fondo'] = $p->foto;
$idioma = "english.php";
/* */
$this->data['subpage'] =Doo::db()->query("SELECT dividir,color_descripcion,color_titulo,color_fondo,foto,titulo2 as titulo,replace(english,'{{video}}',video) as descripcion,video,has_video FROM pages WHERE id_direccion IN ( SELECT id FROM direcciones WHERE url='$p->page') ORDER BY orden")->fetchAll();
$this->data['headTitle'] = $p->metaTituloIngles;
$this->data['headTitle1'] = $p->metaTitulo1Ingles;
$this->data['keywords'] = $p->metaDescriptionIngles;
if($r != null){
$this-> data['tituloPreguntas'] = "Frequent Questions";
}
}
if ($idiomapage == "es") {
$r = Doo::db()->find("Rgrup", array("select" => "id,id_grup,pregunta AS title, descripcion AS des, foto AS foto, video AS video", "where" => "id_grup ='$direccion[id]'", "asArray" => true,/*'limit' => 4*/));
$p = Doo::db()->find($p, array('limit' => 1));
$this->data['titulo'] = $p->titulo;
$this->data['html'] = $p->descripcion;
$this->data['fondo'] = $p->foto;
$idioma = "spanish.php";
/* dividir,color_descripcion,color_titulo,color_fondo,foto */
$this->data['subpage'] =Doo::db()->query("SELECT dividir,color_descripcion,color_titulo,color_fondo,foto,titulo,replace(descripcion,'{{video}}',video) as descripcion,video,has_video FROM pages WHERE id_direccion IN ( SELECT id FROM direcciones WHERE url='$p->page') ORDER BY orden")->fetchAll();
$this->data['headTitle'] = $p->metaTitulo;
$this->data['headTitle1'] = $p->metaTitulo1;
$this->data['keywords'] = $p->metaDescription;
if($r != null){
$this-> data['tituloPreguntas'] = "Preguntas Frecuentes";
}
}
$this->data['preguntas']=$r;
$this->data['idioma'] = $idioma;
$this->buildMenu($idiomapage);
$this->Menu($idiomapage);
$this->buildOptionfotter($idiomapage);
// $this->data['scriptactiveM'] = "$('#M$p->page').addClass('activeM');";
$this->data['content'] = 'parallax';
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}else{
if ($idiomapage == "en") {
$this->data['titulo'] = $p->titulo2;
$this->data['html'] = $p->english;
$this->data['fondo'] = $p->foto;
$idioma = "english.php";
$this->data['headTitle'] = $p->metaTituloIngles;
$this->data['headTitle1'] = $p->metaTitulo1Ingles;
$this->data['keywords'] = $p->metaDescriptionIngles;
}
if ($idiomapage == "es") {
$this->data['titulo'] = $p->titulo;
$this->data['html'] = $p->descripcion;
$this->data['fondo'] = $p->foto;
$idioma = "spanish.php";
$this->data['headTitle'] = $p->metaTitulo;
$this->data['headTitle1'] = $p->metaTitulo1;
$this->data['keywords'] = $p->metaDescription;
}
$this->data["pagina"]=$p;
$this->data['idioma'] = $idioma;
$this->buildMenu($idiomapage);
$this->Menu($idiomapage);
$this->buildOptionfotter($idiomapage);
$this->data['scriptactiveM'] = "$('#M$p->page').addClass('activeM');";
$this->data['content'] = 'pagina';
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
}
}
//aqui iba parallaxPage
public function ShowCaracteristica() {
return Doo::conf()->APP_URL;
}
public function preguntas_frecuentes() {
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$p = Doo::db()->find("Preguntas", array("select" => "pregunta,respuesta", "where" => "tipo = 'F' and idioma='en'"));
$idioma = "english.php";
} else {
$p = Doo::db()->find("Preguntas", array("select" => "pregunta,respuesta", "where" => "tipo = 'F' and idioma='es'"));
$idioma = "spanish.php";
}
$this->buildMenu($idiomapage);
$this->getBanners($idiomapage);
$this->getGalerias();
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->data['preguntas'] = $p;
$this->data['content'] = "preguntas_frecuentes";
$this->renderc('home', $this->data, true);
}
public function ShowDescargas() {
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$p = Doo::db()->find('Pages', array('where' => 'page="downloads"', 'limit' => 1));
$this->data['html'] = $p->english;
$this->data['titulo'] = $p->titulo2;
$this->data['fondo'] = $p->foto;
$idioma = "english.php";
$this->buildMenu("en");
$this->Menu("en");
$this->data['headTitle'] = $p->metaTituloIngles;
$this->data['headTitle1'] = $p->metaTitulo1Ingles;
$this->data['keywords'] = $p->metaDescriptionIngles;
} else {
$p = Doo::db()->find('Pages', array('where' => 'page="downloads"', 'limit' => 1));
$this->data['html'] = $p->descripcion;
$this->data['titulo'] = $p->titulo;
$this->data['fondo'] = $p->foto;
$this->data['headTitle'] = $p->metaTitulo;
$this->data['headTitle1'] = $p->metaTitulo1;
$this->data['keywords'] = $p->metaDescription;
$idioma = "spanish.php";
$this->buildMenu("es");
$this->Menu("es");
}
$this->buildOptionfotter();
$this->data['idioma'] = $idioma;
$this->data['scriptactiveM'] = "$('#Mdownloads').addClass('activeM');";
$this->data['content'] = 'descargas';
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
public function ShowQuesVoipeer() {
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$sql = "SELECT id,descripcionen as descripcion from ques_voipeer WHERE estado=1 and tipo='S'";
$ren = Doo::db()->query($sql);
$sql2 = "SELECT id,descripcionen as descripcion from ques_voipeer WHERE estado=1 and tipo='N'";
$ren2 = Doo::db()->query($sql2);
$p = Doo::db()->find('Pages', array('where' => 'page="whatisvoipeer"', 'limit' => 1));
$this->data['html'] = $p->english;
$this->data['titulo'] = $p->titulo2;
$this->data['fondo'] = $p->foto;
$titulos = Doo::db()->find('Titulos', array('where' => 'id="1"', 'limit' => 1));
$this->data['que_es_voipeer'] = $titulos->titulo1ingles;
$this->data['no_es_voipeer'] = $titulos->titulo2ingles;
$idioma = "english.php";
$this->buildMenu("en");
$this->Menu("en");
} else {
$sql = "SELECT id,descripcion as descripcion from ques_voipeer WHERE estado=1 and tipo='S'";
$ren = Doo::db()->query($sql);
$sql2 = "SELECT id,descripcion as descripcion from ques_voipeer WHERE estado=1 and tipo='N'";
$ren2 = Doo::db()->query($sql2);
$p = Doo::db()->find('Pages', array('where' => 'page="whatisvoipeer"', 'limit' => 1));
$this->data['html'] = $p->descripcion;
$this->data['titulo'] = $p->titulo;
$this->data['fondo'] = $p->foto;
$titulos = Doo::db()->find('Titulos', array('where' => 'id="1"', 'limit' => 1));
$this->data['que_es_voipeer'] = $titulos->titulo1espanol;
$this->data['no_es_voipeer'] = $titulos->titulo2espanol;
$idioma = "spanish.php";
$this->buildMenu("es");
$this->Menu("es");
}
$this->buildOptionfotter();
$this->data['idioma'] = $idioma;
$this->data['whatvp'] = $ren;
$this->data['nowhatvp'] = $ren2;
$this->data['scriptactiveM'] = "$('#Mcaracteristica').addClass('activeM');";
$this->data['content'] = 'que_es_voipeer';
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
public function ShowNumeros() {
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$p = Doo::db()->find('Pages', array('where' => 'page="virtualnumbers"', 'limit' => 1));
$this->data['html'] = $p->english;
$this->data['titulo'] = $p->titulo2;
$this->data['fondo'] = $p->foto;
$idioma = "english.php";
$this->buildMenu("en");
$this->Menu("en");
} else {
$p = Doo::db()->find('Pages', array('where' => 'page="virtualnumbers"', 'limit' => 1));
$this->data['html'] = $p->descripcion;
$this->data['titulo'] = $p->titulo;
$this->data['fondo'] = $p->foto;
$idioma = "spanish.php";
$this->buildMenu("es");
$this->Menu("es");
}
$this->buildOptionfotter();
$this->data['idioma'] = $idioma;
$this->data['scriptactiveM'] = "$('#Mvirtualnumbers').addClass('activeM');";
$this->data['content'] = 'numero_virtual';
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
public function soporte() {
$idiomapage = $this->params['idioma'];
//SELECT dividir,color_descripcion,color_titulo,color_fondo,foto,titulo2 as titulo,english as descripcion
if ($idiomapage == "en") {
$p = Doo::db()->find('Pages', array("select"=>"metaTituloIngles,metaDescriptionIngles,metaTitulo1Ingles,dividir,color_descripcion,color_titulo,color_fondo,foto,titulo2 as titulo,english as descripcion ",'where' => 'page="contactenos"', 'limit' => 1));
$idioma = "english.php";
$this->data['headTitle'] = $p->metaTituloIngles;
$this->data['headTitle1'] = $p->metaTitulo1Ingles;
$this->data['keywords'] = $p->metaDescriptionIngles;
$this->data['Servicios'] = $this->db()->find("Servicios",array("select"=>"nombreIngles as nombre,descripcionIngles as descripcion,id,icono,busqueda"));
} else {
$p = Doo::db()->find('Pages', array("select"=>"metaTitulo,metaDescription,metaTitulo1,dividir,color_descripcion,color_titulo,color_fondo,foto, titulo,descripcion ",'where' => 'page="contactenos"', 'limit' => 1));
$this->data["headTitle"] = $p->metaTitulo;
$this->data["headTitle1"] = $p->metaTitulo1;
$this->data["keywords"] = $p->metaDescription;
$this->data['Servicios'] = $this->db()->find("Servicios",array("select"=>"nombre,descripcion,id,icono,busqueda"));
$idioma = "spanish.php";
}
$this->buildMenu($idiomapage);
$param = $this->db()->find("Parametros", array("limit" => 1));
$this->data['mensaje'] = $param;
$this->data["description"]=$p->descripcion;
$this->data["titulo"]=$p->titulo;
$this->data["foto"]=$p->foto;
$this->data['idioma'] = $idioma;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['content'] = "soporte";
$this->renderc('home', $this->data, true);
}
public function Showmultimedia() {
Doo::loadHelper('DooPager');
$rst = Doo::db()->query("select count(*) as total FROM fotos_proyectos WHERE estado=1", array("limit" => 1));
$t = $rst->fetch();
if (count($t) > 0) {
$total = $t["total"];
} else {
$total = 0;
}
if ($total == 0) {
$total = 1;
}
$pager = new DooPager(Doo::conf()->APP_URL . "infop//page", $total, 6, 5);
if (isset($this->params['number']))
$pager->paginate(intval($this->params['number']));
else
$pager->paginate(1);
$sql = "SELECT id,nombre,fotos,descripcion from fotos_proyectos WHERE estado=1 LIMIT " . $pager->limit;
$rs = Doo::db()->query($sql);
$this->data["productos"] = $rs->fetchAll();
$this->buildMenu();
$this->Menu();
$this->buildOptionfotter();
$this->data['pager'] = $pager->output;
$this->data['content'] = 'multimedia';
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
private function buildMenu($idioma) {
$sql = "SELECT id,etiqueta,url,ingles,destino,submenu,alto,multicontenido, micromenu FROM direcciones WHERE istop='S' AND dependencia='0' ORDER BY ordercolumn2";
$rs = Doo::db()->query($sql);
if($idioma == "es"){
$this->data["footerMenu"]=Doo::db()->query("SELECT id,etiqueta,url FROM direcciones WHERE isfotter='S' ORDER BY orderfotter;")->fetchAll();
}else{
$this->data["footerMenu"]=Doo::db()->query("SELECT id,ingles as etiqueta,url FROM direcciones WHERE isfotter='S' ORDER BY orderfotter;")->fetchAll();
}
$parentMenu = $rs->fetchAll();
$this->data["htmlmenu"] = '<ul class="nav navbar-nav navbar-right">';
$this->buildChildMenu($parentMenu, false, $idioma);
$this->data["htmlmenu"].= '</ul>';
$param = $this->db()->find("Parametros", array("select" => "title,politica", "limit" => 1));
$this->data['linkLlamame'] = $param->title;
$this->data['contenidoLlamame'] = $param->politica;
}
private function buildChildMenu($parentMenu, $sub, $idioma,$number = 1) {
foreach ($parentMenu as $row) {
$id = $row["id"];
$submenu = $row["submenu"];
$etiqueta = $row["etiqueta"];
$alto = $row["alto"];
$ingles = $row["ingles"];
$url = $row["url"];
$destino = $row["destino"];
$multicontenido=$row["multicontenido"];
if ($submenu == 'S') {
$microMenu = $row["micromenu"];
if($microMenu === 'F'){
$this->data["htmlmenu"].= '<li class="dropdown-submenu"><a id="M' . $id . '" href="#" class="dropdown-toggle" data-toggle="dropdown">' . ($idioma == "es" ? $etiqueta : $ingles) . '<b class="caret"></b></a>';
}else{
$this->data["htmlmenu"].= '<li class="dropdown"><a id="M' . $id . '" href="#" class="dropdown-toggle" data-toggle="dropdown">' . ($idioma == "es" ? $etiqueta : $ingles) . '<b class="caret"></b></a>';
}
$sql = "SELECT id,etiqueta,url,ingles,destino,submenu,alto,multicontenido, micromenu FROM direcciones WHERE istop='S' AND dependencia='$id' ORDER BY ordercolumn2";
$rs = Doo::db()->query($sql);
$childMenu = $rs->fetchAll();
$this->data["htmlmenu"].= '<ul class="dropdown-menu">';
$this->buildChildMenu($childMenu, true, $idioma);
$this->data["htmlmenu"].= '</ul ></li><li></li>';
$this->data['scriptactivePrincipal'] = "$('#M$id').addClass('activeM');";
}
else {
$this->data["htmlmenu"].= '<li>';
if ($destino == 'E') {
$this->data["htmlmenu"].= '<a id="M' . $url . '" class="ancla" target="_blank" href="' . ($url != "" ? $url . '/' : $url) . '">' . ($idioma == "es" ? $etiqueta : $ingles) . '</a>';
} else {
if ($url == '#' || $url == "") {
$this->data["htmlmenu"].= '<a id="HL' . $id . '" class="ancla" href="' . Doo::conf()->APP_URL . ($url != "" ? $url . '/' : $url) . $idioma . '">' . ($idioma == "es" ? $etiqueta : $ingles) . '</a>';
} else {
if($multicontenido==1){
//$this->data["htmlmenu"].= '<a id="M' . $url . '" class="ancla" href="' . Doo::conf()->APP_URL ."pages/". ($url != "" ? $url . '/' : $url) . $idioma . '">' . ($idioma == "es" ? $etiqueta : $ingles) . '</a>';
$this->data["htmlmenu"].= '<a id="M' . $url . '" class="ancla" href="' . Doo::conf()->APP_URL . ($url != "" ? $url . '/' : $url) . $idioma . '">' . ($idioma == "es" ? $etiqueta : $ingles) . '</a>';
}else{
$this->data["htmlmenu"].= '<a id="M' . $url . '" class="ancla" href="' . Doo::conf()->APP_URL . ($url != "" ? $url . '/' : $url) . $idioma . '">' . ($idioma == "es" ? $etiqueta : $ingles) . '</a>';
}
}
}
$this->data["htmlmenu"].= '</li><li>';
if (!$sub) {
$this->data["htmlmenu"].= '</li>';
}
}
}
}
public function send() {
Doo::loadHelper('DooValidator');
$validator = new DooValidator;
$validator->checkMode = DooValidator:: CHECK_ALL_ONE;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->NoticiasyAseguradoras();
$this->buildMenu();
Doo::loadHelper('DooMailer');
$mail = new DooMailer();
$param = $this->db()->find("Parametros", array("select" => "email", "limit" => 1));
$mail->addTo($param->email);
$mail->setSubject($_POST['asunto']);
$mail->setBodyHtml($_POST['mensaje']);
$mail->setFrom($_POST['email'], $_POST['nombre']);
$mail->send();
$this->data['content'] = 'confirmacion';
$this->data["message"] = "El mensaje ha sido enviado exitosamente ..";
$this->renderc('home', $this->data, true);
}
public function confirmacion() {
$this->buildMenu();
$this->data['content'] = 'confirmacion';
$this->data["message"] = "Tu Registro ha sido Satisfactorio ..";
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('home', $this->data, true);
}
private function buildOptionfotter() {
$sql = "SELECT etiqueta,url,destino FROM direcciones WHERE isfotter='S' AND posicionf='1' ORDER BY orderfotter";
$rs = Doo::db()->query($sql);
$primeracolumna = $rs->fetchAll();
$sql = "SELECT etiqueta,url,destino FROM direcciones WHERE isfotter='S' AND posicionf='2' ORDER BY orderfotter";
$rs = Doo::db()->query($sql);
$segundacolumna = $rs->fetchAll();
$sql = "SELECT etiqueta,url,destino FROM direcciones WHERE isfotter='S' AND posicionf='3' ORDER BY orderfotter";
$rs = Doo::db()->query($sql);
$terceracolumna = $rs->fetchAll();
$this->data["menufotter"] = '<nav class="nav" style="width:70%; margin-left:auto; margin-right:auto;float:none;"><ul class="nav navbar-nav">';
foreach ($primeracolumna as $row):
$url = $row['url'];
$destino = $row['destino'];
$etiqueta = $row['etiqueta'];
$this->data["menufotter"].= '<li style="border-left:1px solid #92DDFA; float:left;"><a style="padding-bottom:5px; padding-top:5px;" ' . ($destino == 'L' ? '' : 'target="_black"') . ' href="' . $url . '">' . $etiqueta . '</a></li>';
endforeach;
$this->data["menufotter"].= '</nav></ul>';
$this->data["menufotter"].= '<nav class="nav">';
foreach ($segundacolumna as $row2):
$url = $row2['url'];
$destino = $row2['destino'];
$etiqueta = $row2['etiqueta'];
$this->data["menufotter"].= '<ul class="menu"><li style="font-size: 15px; color:#FF4D1D; display:inline" ' . ($destino == 'L' ? '' : 'target="_black"') . ' href="' . $url . '">' . $etiqueta . '</li></ul>';
endforeach;
$this->data["menufotter"].= '</nav>';
$this->data["menufotter"].= '<nav class="nav">';
foreach ($terceracolumna as $row3):
$url = $row3['url'];
$destino = $row3['destino'];
$etiqueta = $row3['etiqueta'];
$this->data["menufotter"].= '<ul class="menu 3"><li style="font-size: 15px; color:#FF4D1D; display:inline" ' . ($destino == 'L' ? '' : 'target="_black"') . ' href="' . $url . '">' . $etiqueta . '</li></ul>';
endforeach;
$this->data["menufotter"].= '</nav>';
}
public function Ayuda() {
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$p = Doo::db()->find("Grup", array("select" => "id,nombre2 as nombre ,icono","ORDER BY id"=>" id DESC"));
$idioma = "english.php";
} else {
$p = Doo::db()->find("Grup", array("select" => "id,nombre ,icono","ORDER BY id"=>"id DESC"));
$idioma = "spanish.php";
}
if (!isset($this->params['id'])) {
$primer_grupo = Doo::db()->find("Grup", array("select" => "id","ORDER BY"=>"orden ASC" ,"limit" => 1));
if ($idiomapage == "en") {
$r = Doo::db()->find("Rgrup", array("select" => "id,id_grup,pregunta2 AS title", "where" => "id_grup = $primer_grupo->id", "asArray" => true));
$idioma = "english.php";
} else {
$r = Doo::db()->find("Rgrup", array("select" => "id,id_grup,pregunta AS title", "where" => "id_grup = $primer_grupo->id", "asArray" => true));
$idioma = "spanish.php";
}
$primera_preg = $r[0]["id"];
// $this->data['scriptactive']="$('#g".$primer_grupo->id."').addClass('active');$('#p".$primera_preg."').addClass('activep');";
$this->data['respuestas'] = $r;
if ($idiomapage == "en") {
//cabezeraAyuda
$r2 = Doo::db()->find("Rgrup", array("select" => "id,descripcion2 AS texto, foto2 AS foto, video2 AS video", "where" => "id = $primera_preg", "asArray" => true));
$Headpage = Doo::db()->find('Pages', array("select"=>"titulo2 as titulo,foto,english as descripcion,metaTitulo1",'where' => 'page="cabezeraAyuda"', 'limit' => 1));
$page = Doo::db()->find('Pages', array("select"=>"titulo2 as titulo,foto,english as descripcion,metaTitulo1",'where' => 'page="help"', 'limit' => 1));
$this->data['headTitle'] = $page->metaTitulo;
$this->data['headTitle1'] = $page->metaTitulo1;
$this->data['keywords'] = $page->metaDescription;
$idioma = "english.php";
} else {
$r2 = Doo::db()->find("Rgrup", array("select" => "id,descripcion AS texto, foto AS foto, video AS video", "where" => "id = $primera_preg", "asArray" => true));
$page = Doo::db()->find('Pages', array("select"=>"titulo,foto,descripcion,metaTitulo1",'where' => 'page="help"', 'limit' => 1));
$Headpage = Doo::db()->find('Pages', array("select"=>"titulo,foto,descripcion,metaTitulo1",'where' => 'page="cabezeraAyuda"', 'limit' => 1));
$this->data['headTitle'] = $page->metaTitulo;
$this->data['headTitle1'] = $page->metaTitulo1;
$this->data['keywords'] = $page->metaDescription;
$idioma = "spanish.php";
}
$this->data['texto_respuesta'] = $r2[0]["texto"];
$this->data['foto_respuestas'] = $r2[0]["foto"];
$this->data['video_respuestas'] = $r2[0]["video"];
}
$this->data['scriptactiveM'] = "$('#Mhelp').addClass('activeM');";
$this->data['page'] = $page;
$this->data['Headpage'] = $Headpage;
$this->buildMenu($idiomapage);
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->data['ayuda'] = $p;
$this->data['scriptactiveM'] = "$('#Mhelp').addClass('activeM');";
$this->data['content'] = "ayuda";
$this->renderc('home', $this->data, true);
}
public function Respuestas2(){
$id=$_POST["id"];
$languaje=$_POST["idioma"];
$r = Doo::db()->find("Rgrup", array("where" => "id = $id","asArray" => true,"limit"=>1));
if($languaje=="es"){
$this->data['texto_respuesta'] = $r["descripcion"];
$this->data['foto_respuestas'] = $r["foto"];
$this->data['video_respuestas'] = $r["video"];
$this->data['pregunta_respuestas'] = $r["pregunta"];
}else{
$this->data['texto_respuesta'] = $r["descripcion2"];
$this->data['foto_respuestas'] = $r["foto2"];
$this->data['video_respuestas'] = $r["video2"];
$this->data['pregunta_respuestas'] = $r["pregunta2"];
}
//$this->data['scriptactive']="$('#g".$id."').addClass('active');$('#p".$primera_preg."').addClass('activep');";
$this->data['scriptactive']="$('#p".$id."').addClass('activep');";
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->renderc('Response', $this->data, true);
}
public function RespuestasAyuda() {
$idiomapage = $this->params['idioma'];
$id = $this->params['id'];
$primer_grupo = Doo::db()->find("Grup", array("select" => "id","ORDER BY"=>"orden ASC" ,"limit" => 1));
if ($idiomapage == "en") {
$p = Doo::db()->find("Grup", array("select" => "id,nombre2,icono","where" => "id = $id","limit"=>1));
$r = Doo::db()->find("Rgrup", array("select" => "id,id_grup,pregunta2 AS title", "where" => "id_grup = $id", "asArray" => true));
$page = Doo::db()->find('Pages', array("select"=>"metaTituloIngles,metaTitulo1Ingles,metaDescriptionIngles,titulo2 as titulo,foto,english",'where' => 'page="help"', 'limit' => 1));
$idioma = "english.php";
$this->data["headTitle"] = $page->metaTituloIngles;
$this->data["headTitle1"] = $page->metaTitulo1Ingles;
$this->data["keywords"] = $page->metaDescriptionIngles;
} else {
$p = Doo::db()->find("Grup", array("select" => "id,nombre,icono","where" => "id = $id","limit"=>1));
$r = Doo::db()->find("Rgrup", array("select" => "id,id_grup,pregunta AS title", "where" => "id_grup = $id", "asArray" => true));
$page = Doo::db()->find('Pages', array("select"=>"metaTitulo,metaTitulo1,metaDescription,titulo,foto,descripcion",'where' => 'page="help"', 'limit' => 1));
$idioma = "spanish.php";
$this->data['headTitle'] = $page->metaTitulo;
$this->data['headTitle1'] = $page->metaTitulo1;
$this->data['keywords'] = $page->metaDescription;
}
$this->data['page'] = $page;
$this->data['categoria'] = $p;
$this->data['respuestas'] = $r;
$this->buildMenu($idiomapage);
$this->data['idioma'] = $idioma;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['content'] = "principalAyuda";
$this->renderc('home', $this->data, true);
}
//
// public function Respuestas() {
// $idiomapage = $this->params['idioma'];
// $id = $_GET['idrps'];
// if ($idiomapage == "en") {
// $r2 = Doo::db()->find("Rgrup", array("select" => "descripcion2 AS texto, foto2 AS foto", "where" => "id = $id", "asArray" => true));
// $idioma = "english.php";
// } else {
// $r2 = Doo::db()->find("Rgrup", array("select" => "descripcion AS texto, foto AS foto", "where" => "id = $id", "asArray" => true));
// $idioma = "spanish.php";
// }
//
//
// $this->data['texto_respuesta'] = $r2[0]["texto"];
// $this->data['foto_respuestas'] = $r2[0]["foto"];
// $this->RespuestasAyuda();
// }
public function SendSoporte(){
if ($_POST["g-recaptcha-response"]!="") {
Doo::loadHelper('DooMailer');
$mail = new DooMailer();
$msj="<span><b>Nombre:</b> ".$_POST["nombre"]."</span><br>"
. "<span><b>Telefono:</b> ".$_POST["telefono"]."</span><br>"
. "<span><b>Pais:</b> ".$_POST["pais"]."</span><br>"
. "<span><b>Email:</b> ".$_POST["email"]."</span><br>"
. "<span><b>Asunto:</b> ".$_POST["asunto"]."</span><br>"
. "<span><b>Mensaje:</b> ".$_POST["mensaje"]."</span><br>";
$param = $this->db()->find("Parametros", array("select" => "email", "limit" => 1));
$mail->addTo($param->email);
$mail->setSubject($_POST['asunto']);
$mail->setBodyHtml($msj);
$mail->setFrom($_POST['email'], "VOICE TO PHONE");
$mail->send();
echo true;
}else {
echo false;
}
}
public function SendContacto(){
$languaje=$_POST["idioma"];
Doo::loadHelper('DooMailer');
$mail = new DooMailer();
$param = $this->db()->find("Parametros", array("select" => "email", "limit" => 1));
$mail->addTo($param->email);
$mail->setSubject($_POST['asunto']);
$mail->setBodyHtml($_POST['mensaje']);
$mail->setFrom($_POST['email'], "Voipeer");
$mail->send();
if($languaje=="en"){
$this->renderc('confirmacioni', $this->data, true);
}
else{
$idioma = "spanish.php";
$this->renderc('confirmacion', $this->data, true);
}
$this->data['rootUrl'] = Doo::conf()->APP_URL;
}
public function numeroVirtualCiudad(){
$idiomapage = $this->params['idioma'];
$idpais =urldecode($this->params['pindex']);
$idciudad = urldecode($this->params['cindex']);
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
//$ch = curl_init("http://www.geoplugin.net/php.gp?ip=".$ip);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// $country_code = curl_exec($ch);
//$res = unserialize($country_code);
$country_code ='CO';//$res["geoplugin_countryCode"];
$dolar = Doo::db()->query("SELECT dolar FROM parametros")->fetch();
$ciudades='';
if($country_code=='CO'){
$country_code='COP';
$ciudades = Doo::db()->query("SELECT c.nombre,c.precio_usd as precio_ciudad_usd, p.precio_usd as pais_usd , c.precio_usd as precio, moneda,c.indicativo from ciudad c inner join pais p on (p.codigo=c.pais) where replace(trim(lower(c.nombre)),' ','-')='$idciudad' and c.estado='1';")->fetch();
if($ciudades["precio_ciudad_usd"]){
$ciudades["precio"] = ' $ ' . number_format($dolar["dolar"]*$ciudades["precio_ciudad_usd"])." ".$country_code ;
}else{
$ciudades["precio"] = ' $ ' . number_format($dolar["dolar"]*$ciudades["pais_usd"])." ". $country_code ;
}
}else{}
$country_code='USD';
$ciudades =Doo::db()->query("SELECT c.nombre,concat('$country_code',' $ ', if(c.precio_usd='' OR c.precio_usd=0,p.precio_usd,c.precio_usd) ) as precio,moneda,c.indicativo from ciudad c inner join pais p on (p.codigo=c.pais) where replace(trim(lower(c.nombre)),' ','-')='$idciudad' and c.estado='1';")->fetch();
$pais = Doo::db()->query("SELECT nombre,codigo FROM pais WHERE replace(trim(lower(nombre)),' ','-')='$idpais'")->fetch();
if(!$pais){
header("HTTP/1.1 301 Moved Permanently");
return Doo::conf()->APP_URL."numero-virtual/es";
}
if($idiomapage == "en"){
$idioma = "english.php";
$p = Doo::db()->query("SELECT REPLACE(REPLACE(REPLACE(titulo2,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}',' $ciudades[nombre]') as titulo,REPLACE(REPLACE(REPLACE(english,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id not IN (5) and tipo='C' order by orden")->fetchAll();
$header = Doo::db()->query("SELECT REPLACE(REPLACE(REPLACE(titulo2,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}',' $ciudades[nombre]') as titulo,REPLACE(REPLACE(REPLACE(english,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=5 and tipo='C'")->fetch();
$infoCiudad = Doo::db()->query("SELECT REPLACE(REPLACE(REPLACE(titulo2,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as titulo,REPLACE(REPLACE(REPLACE(english,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=1 and tipo='C' ")->fetch();
$head = Doo::db()->query("SELECT REPLACE(REPLACE(metaTituloIngles,'{{ciudad}}','$ciudades[nombre]'),'{{pais}}','$pais[nombre]') as metaTitulo, REPLACE(metaTitulo1Ingles,'{{ciudad}}','$ciudades[nombre]') as metaTitulo1 FROM metas WHERE tipo='C';")->fetch();
}else {
$idioma = "spanish.php";
$p = Doo::db()->query("SELECT REPLACE(REPLACE(REPLACE(titulo,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}',' $ciudades[nombre]') as titulo,REPLACE(REPLACE(REPLACE(descripcion,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id not IN (5) and tipo='C' order by orden")->fetchAll();
$header = Doo::db()->query("SELECT REPLACE(REPLACE(REPLACE(titulo,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}',' $ciudades[nombre]') as titulo,REPLACE(REPLACE(REPLACE(descripcion,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=5 and tipo='C'")->fetch();
$infoCiudad = Doo::db()->query("SELECT REPLACE(REPLACE(REPLACE(titulo,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as titulo,REPLACE(REPLACE(REPLACE(descripcion,'{{pais}}','$pais[nombre]'),'{{precio}}','$ciudades[precio]'),'{{ciudad}}','$ciudades[nombre]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=1 and tipo='C' ")->fetch();
$head = Doo::db()->query("SELECT REPLACE(REPLACE(metaTitulo,'{{ciudad}}','$ciudades[nombre]'),'{{pais}}','$pais[nombre]') as metaTitulo, REPLACE(REPLACE(metaTitulo1,'{{ciudad}}','$ciudades[nombre]'),'{{pais}}','$pais[nombre]') as metaTitulo1 FROM metas where tipo='C';")->fetch();
}
$this->data['infoCiudades'] = $infoCiudad;
$this->data["plantilla"] = $p;
$this->data['titulo'] = $header["titulo"];
$this->data['fondo'] = $header["foto"];
$this->data['html'] = $header["descripcion"];
$this->data["ciudades"]=$ciudades;
$this->data['headTitle'] = $head["metaTitulo"];
$this->data['headTitle1'] = $head["metaTitulo1"];
$this->data['keywords'] = "";
$this->buildMenu($idiomapage);
$this->data['idioma'] = $idioma;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['content'] = "numero_virtual_ciudad";
$this->renderc('home', $this->data, true);
}
public function numerovirtual(){
$idiomapage = $this->params['idioma'];
$id = $this->params['pindex'];
$id =urldecode($id);
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
/*
$ch = curl_init("http://www.geoplugin.net/php.gp?ip=".$ip);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$country_code = curl_exec($ch);
$res = unserialize($country_code);*/
$country_code = 'SS';//$res["geoplugin_countryCode"];
$dolar = Doo::db()->query("SELECT dolar FROM parametros")->fetch();
$this->data["dolar"]=$dolar;
$this->data["country_code"]=$country_code;
if ($idiomapage == "en") {
$pais = Doo::db()->query("SELECT nombreIngles as nombre,codigo,replace(trim(lower(nombreIngles)),' ','-') as url FROM pais WHERE replace(trim(lower(nombreIngles)),' ','-') ='$id'")->fetch();
$ciudades =Doo::db()->query("SELECT p.id as idpais,c.id as id,c.nombre,c.precio_usd as precio,p.precio_usd as precio_usd,moneda,c.indicativo,p.codigo,replace(trim(lower(c.nombre)),' ','-') as urlciudad,replace(trim(lower(p.nombreIngles)),' ','-') as url from ciudad c inner join pais p on (p.codigo=c.pais) where pais='$pais[codigo]' and c.estado='1'")->fetchAll();
}else{
$pais = Doo::db()->query("SELECT nombre,codigo,replace(trim(lower(nombre)),' ','-') as url FROM pais WHERE replace(trim(lower(nombre)),' ','-') ='$id'")->fetch();
$ciudades =Doo::db()->query("SELECT p.id as idpais,c.id as id,c.nombre,c.precio_usd as precio,p.precio_usd as precio_usd,moneda,c.indicativo,p.codigo,replace(trim(lower(c.nombre)),' ','-') as urlciudad,replace(trim(lower(p.nombre)),' ','-') as url from ciudad c inner join pais p on (p.codigo=c.pais) where pais='$pais[codigo]' and c.estado='1'")->fetchAll();
}
if(!$pais && !$ciudades){
header("HTTP/1.1 301 Moved Permanently");
return Doo::conf()->APP_URL."numero-virtual/es";
}
// $ciudades =Doo::db()->query("SELECT p.id as idpais,c.id as id,c.nombre,c.precio_usd as precio,p.precio_usd as precio_usd,moneda,c.indicativo,p.codigo,replace(trim(lower(c.nombre)),' ','-') as urlciudad,replace(trim(lower(p.nombre)),' ','-') as url from ciudad c inner join pais p on (p.codigo=c.pais) where pais='$pais[codigo]' and c.estado='1'")->fetchAll();
if($country_code=='CO'){
$country_code='COP';
if ($idiomapage == "en") {
$precio = Doo::db()->query("SELECT precio_usd as precio FROM pais WHERE replace(trim(lower(nombreIngles)),' ','-') ='$id'")->fetch();
}else{
$precio = Doo::db()->query("SELECT precio_usd as precio FROM pais WHERE replace(trim(lower(nombre)),' ','-') ='$id'")->fetch();
}
$precio["precio"] = ' $ ' . number_format($dolar["dolar"]*$precio["precio"])." ".$country_code ;
}else{}
$country_code='USD';
if ($idiomapage == "en") {
$precio = Doo::db()->query("SELECT CONCAT('$country_code',' $ ', precio_usd) as precio FROM pais WHERE replace(trim(lower(nombre)),' ','-')='$id'")->fetch();
}else{
$precio = Doo::db()->query("SELECT CONCAT('$country_code',' $ ', precio_usd) as precio FROM pais WHERE replace(trim(lower(nombre)),' ','-')='$id'")->fetch();
}
$this->data["dolar"]=$dolar["dolar"];
if ($idiomapage == "en") {
$idioma = "english.php";
$p = Doo::db()->query("SELECT REPLACE(REPLACE(titulo2,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as titulo,REPLACE(REPLACE(english,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]' ) as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id not IN (1,2) and tipo='P' order by orden")->fetchAll();
$header = Doo::db()->query("SELECT REPLACE(REPLACE(titulo2,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as titulo,REPLACE(REPLACE(english,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=1 and tipo='P'")->fetch();
$infoCiudad = Doo::db()->query("SELECT REPLACE(REPLACE(titulo2,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as titulo,REPLACE(REPLACE(english,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=2 and tipo='P' ")->fetch();
$head = Doo::db()->query("SELECT REPLACE(metaTituloIngles,'{{pais}}','$pais[nombre]') as metaTitulo, REPLACE(metaTitulo1Ingles,'{{pais}}','$pais[nombre]') as metaTitulo1 FROM metas WHERE tipo='P';")->fetch();
}else{
$idioma = "spanish.php";
$p = Doo::db()->query("SELECT REPLACE(REPLACE(titulo,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as titulo,REPLACE(REPLACE(descripcion,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id not IN (1,2) and tipo='P' order by orden")->fetchAll();
$header = Doo::db()->query("SELECT REPLACE(REPLACE(titulo,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as titulo,REPLACE(REPLACE(descripcion,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=1 and tipo='P' ")->fetch();
$infoCiudad = Doo::db()->query("SELECT REPLACE(REPLACE(titulo,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as titulo,REPLACE(REPLACE(descripcion,'{{pais}}','$pais[nombre]'),'{{precio}}','$precio[precio]') as descripcion,id,dividir,foto,color_fondo,color_titulo,color_descripcion FROM plantilla where id=2 and tipo='P'")->fetch();
$head = Doo::db()->query("SELECT REPLACE(metaTitulo,'{{pais}}','$pais[nombre]') as metaTitulo, REPLACE(metaTitulo1,'{{pais}}','$pais[nombre]') as metaTitulo1 FROM metas WHERE tipo ='P'")->fetch();
}
$this->data['infoCiudades'] = $infoCiudad;
$this->data["plantilla"] = $p;
$this->data['titulo'] = $header["titulo"];
$this->data['fondo'] = $header["foto"];
$this->data['html'] = $header["descripcion"];
$this->data["ciudades"]=$ciudades;
$this->data['headTitle'] = $head["metaTitulo"];
$this->data['headTitle1'] = $head["metaTitulo1"];
$this->data['keywords'] = "";
$this->buildMenu($idiomapage);
$this->data['idiomapage'] = $idiomapage;
$this->data['idioma'] = $idioma;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['content'] = "numero_virtual";
$this->renderc('home', $this->data, true);
}
public function tarifasUnit(){
$idiomapage = $this->params['idioma'];
$id = $this->params['pindex'];
$this->data["id"]=$id;
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$ch="";
// $ch = curl_init("http://www.geoplugin.net/php.gp?ip=".$ip);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//$country_code = 'CO';
$country_code = 'UUS';
//var_dump($country_code);
//exit();
//$res = unserialize($country_code);
//$country_code =$res["geoplugin_countryCode"];
// var_dump($country_code);
$dolar = Doo::db()->query("SELECT dolar FROM parametros")->fetch();
$this->data["dolar"]=$dolar["dolar"];
$this->data["country_code"]= $country_code;
//var_dump($this->data["country_code"]);
$this->data["idiomapage"]=$idiomapage;
if ($idiomapage == "en") {
$this->data["boton"]=Doo::db()->query("SELECT botonPreciosIngles as boton FROM parametros")->fetch();
$this->data['paises'] = $this->db()->query("SELECT nombreIngles as nombre,id,replace(lower(nombreIngles),' ','-') as url FROM pais WHERE estado='1' ORDER BY nombre");
$p = Doo::db()->find("Pages", array("limit" => 1, "select" => "id,metaTituloIngles,metaDescriptionIngles,metaTitulo1Ingles,titulo2 as titulo,english as descripcion,foto", "where" => "page = 'tarifas'"));
$this->data['headTitle'] = $p->metaTituloIngles;
$this->data['headTitle1'] = $p->metaTitulo1Ingles;
$this->data['keywords'] = $p->metaDescriptionIngles;
$this->data['Servicios'] = $this->db()->query("select nombreIngles as nombre,descripcionIngles as descripcion,id,icono,busqueda,pagina,titulo_detalle_ingles as titulo_detalle,descripcion_detalle_ingles as descripcion_detalle from servicios where id='$id'")->fetch();
//$this->db()->find("Servicios",array("select"=>"nombreIngles as nombre,descripcionIngles as descripcion,id,icono,busqueda,pagina,titulo_detalle_ingles as titulo_detalle,descripcion_detalle_ingles as descripcion_detalle", "where"=> "id='$id'","limit" => 1));
$idpagina = $this->data["Servicios"]["pagina"];
$this->data["banner"] = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaTituloIngles,metaDescriptionIngles,metaTitulo1Ingles,titulo2 as titulo,english as descripcion,foto", "where" => "id = '$idpagina'"));
$this->data['TiposServicios'] = $this->db()->find("TiposServicios",array("select" =>"id_servicio,nombreIngles as nombre,descripcionIngles as descripcion,precioIngles as precio, monedaIngles as moneda, periodoIngles as periodo,beneficiosIngles as beneficios","where"=> "id_servicio='$id' "));
$idioma = "english.php";
}else{
$this->data["boton"] = Doo::db()->query("SELECT botonPrecios as boton FROM parametros")->fetch();
$this->data['paises'] = $this->db()->query("SELECT nombre,id,replace(lower(nombre),' ','-') as url FROM pais WHERE estado='1' ORDER BY nombre");
$p = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaTitulo,metaDescription,metaTitulo1,titulo,descripcion,foto", "where" => "page = 'tarifas'"));
$this->data['headTitle'] = $p->metaTitulo;
$this->data['headTitle1'] = $p->metaTitulo1;
$this->data['keywords'] = $p->metaDescription;
$this->data['Servicios'] = $this->db()->query("select id,nombre,descripcion,icono,busqueda,pagina,titulo_detalle,descripcion_detalle from servicios where id='$id'")->fetch(); //find("Servicios",array(""=>"", "where"=> "id=''","limit" => 1));
$idpagina = $this->data["Servicios"]["pagina"];
$this->data["banner"] = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaTitulo,metaDescription,metaTitulo1,titulo,descripcion,foto", "where" => "id = '$idpagina'"));
$this->data['TiposServicios'] = $this->db()->find("TiposServicios",array("select"=>"id_servicio,nombre,descripcion,precioIngles as precio,moneda,periodo,beneficios","where"=> "id_servicio='$id'"));
$idioma = "spanish.php";
}
//id_servicio,nombre,descripcion,precio,moneda,periodo,beneficios
//id_servicio,nombreIngles as nombre,descripcionIngles as descripcion,precioIngles as precio, modenaIngles as moneda, periodoIngles as periodo,beneficiosIngles as beneficios
$this->data['titulo'] = $p->titulo;
$this->data['foto'] = $p->foto;
$this->data['html'] = $p->descripcion;
$this->buildMenu($idiomapage);
$this->getBanners($idiomapage);
$this->data['idioma'] = $idioma;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['content'] = "tarifasUnit";
$this->renderc('home', $this->data, true);
}
public function tarifas(){
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$idioma = "english.php";
}else{
$idioma = "spanish.php";
}
$this->buildMenu($idiomapage);
$this->getBanners($idiomapage);
$this->data['idioma'] = $idioma;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['content'] = "precios";
$this->renderc('home', $this->data, true);
}
public function tarifas2() {
if ((!isset($_POST['texto']))) {
$idiomapage = $this->params['idioma'];
if ($idiomapage == "en") {
$info = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaDescriptionIngles,metaTitulo1Ingles,metaTituloIngles,titulo2 as titulo,english as descripcion,foto", "where" => "page = 'infoTarifas'"));
$p = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaDescriptionIngles,metaTitulo1Ingles,metaTituloIngles,titulo2 as titulo,english as descripcion,foto", "where" => "page = 'tarifas'"));
$this->data['headTitle'] = $p->metaTituloIngles;
$this->data['headTitle1'] = $p->metaTitulo1Ingles;
$this->data['keywords'] = $p->metaDescriptionIngles;
$tarifas = Doo::db()->find("Tarifas", array("select" => "destino as origen,tarifa"));
$idioma = "english.php";
$titulo_destino2="Popular Destination";
$popular=Doo::db()->find("Tarifas",array("select"=>"foto,destino as pais,tarifa","where"=>"estado=1 and destacado='S'","limit" => 4));
$this->buildMenu($idiomapage);
$this->getBanners($idiomapage);
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->data['scriptactiveM'] = "$('#Mrates').addClass('activeM');";
$this->data['carpeta'] = "destino";
$this->data['titulo'] = $p->titulo;
$this->data['foto'] = $p->foto;
$this->data['html'] = $p->descripcion;
$this->data['tituloInfo'] = $info->titulo;
$this->data['htmlInfo'] = $info->descripcion;
$this->data['tarifas'] = $tarifas;
$this->data['destino'] = $titulo_destino2;
$this->data['popular'] = $popular;
$this->data['servicios'] = $data = $this->db()->query("SELECT nombreIngles as nombre,descripcionIngles as descripcion,id,icono,busqueda FROM servicios order by orden")->fetchAll();// find("Servicios",array("select"=>"nombre,descripcion,id,icono,busqueda",array("ASC"=>"orden")));
$this->db()->find("Servicios",array("select"=>"nombreIngles as nombre,descripcionIngles as descripcion,id,icono,busqueda",array("ASC"=>"ORDER BY ORDEN")));
$this->data['TiposServicios'] = $this->db()->find("TiposServicios");
$this->data['content'] = "tarifas2";
$this->data['texto'] = "";
$this->renderc('home', $this->data, true);
} else {
$info = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaTitulo,metaDescription,metaTitulo1,titulo,descripcion,foto", "where" => "page = 'infoTarifas'"));
$p = Doo::db()->find("Pages", array("limit" => 1, "select" => "metaTitulo,metaDescription,metaTitulo1,titulo,descripcion,foto", "where" => "page = 'tarifas'"));
$this->data['headTitle'] = $p->metaTitulo;
$this->data['headTitle1'] = $p->metaTitulo1;
$this->data['keywords'] = $p->metaDescription;
$tarifas = Doo::db()->find("Tarifas", array("select" => "origen,tarifa"));
$idioma = "spanish.php";
$titulo_destino2="Algunas de nuestras ofertas";
$popular=Doo::db()->find("Tarifas",array("select"=>"foto,origen as pais,tarifa","where"=>"estado=1 and destacado='S'","limit" => 4));
$this->buildMenu($idiomapage);
$this->getBanners($idiomapage);
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->data['scriptactiveM'] = "$('#Mrates').addClass('activeM');";
$this->data['carpeta'] = "destino";
$this->data['titulo'] = $p->titulo;
$this->data['foto'] = $p->foto;
$this->data['html'] = $p->descripcion;
$this->data['tituloInfo'] = $info->titulo;
$this->data['htmlInfo'] = $info->descripcion;
$this->data['tarifas'] = $tarifas;
$this->data['destino'] = $titulo_destino2;
$this->data['popular'] = $popular;
$data = $this->db()->query("SELECT id,nombre,descripcion,icono,busqueda FROM servicios order by orden")->fetchAll();// find("Servicios",array("select"=>"nombre,descripcion,id,icono,busqueda",array("ASC"=>"orden")));
$this->data['servicios'] = $data;
$this->data['TiposServicios'] = $this->db()->find("TiposServicios");
$this->data['content'] = "tarifas2";
$this->data['texto'] = "";
$this->renderc('home', $this->data, true);
}
} else {
$texto = $_POST['texto'];
$where = "origen LIKE ?";
$wheres = "destino LIKE ?";
$idiomapage = $_POST['idioma'];
if ($idiomapage == "en") {
$this->data["boton"]=Doo::db()->query("SELECT botonPreciosIngles as boton FROM parametros")->fetch();
$p = Doo::db()->find("Pages", array("limit" => 1, "select" => "titulo2 as titulo,english as descripcion", "where" => "page = 'tarifas'"));
$tarifas = Doo::db()->find("Tarifas", array("select" => "destino as origen,tarifa", "where" => $wheres, "param" => array('%'.$texto.'%')));
$idioma = "english.php";
$titulo_origen="Country";
$titulo_tarifas="Rates (Usd)";
} else {
$this->data["boton"]=Doo::db()->query("SELECT botonPrecios as boton FROM parametros")->fetch();
$p = Doo::db()->find("Pages", array("limit" => 1, "select" => "titulo,descripcion", "where" => "page = 'tarifas'"));
$tarifas = Doo::db()->find("Tarifas", array("select" => "origen,tarifa", "where" => $where, "param" => array('%'.$texto.'%')));
$idioma = "spanish.php";
$titulo_origen="Pais";
$titulo_tarifas="Tarifas (Usd)";
}
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$ch = curl_init("http://www.geoplugin.net/php.gp?ip=".$ip);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$country_code = curl_exec($ch);
$res = unserialize($country_code);
$country_code =$res["geoplugin_countryCode"];
$this->data["country_code"]=$country_code;
$dolar = Doo::db()->query("SELECT dolar FROM parametros")->fetch();
$this->data["dolar"]=$dolar["dolar"];
if ($p == false) {
return array(Doo::conf()->APP_URL . "/error", 404);
}
$this->buildMenu($idiomapage);
$this->getBanners($idiomapage);
$this->data['idiomapage'] = $idiomapage;
$this->data['rootUrl'] = Doo::conf()->APP_URL;
$this->data['idioma'] = $idioma;
$this->data['titul_origen'] = $titulo_origen;
$this->data['titul_tarifas'] = $titulo_tarifas;
$this->data['carpeta'] = "destino";
$this->data['titulo'] = $p->titulo;
$this->data['html'] = $p->descripcion;
$this->data['tarifas'] = $tarifas;
$this->renderc('tariasresponse', $this->data, true);
}
}
}
?>
* Stack Trace...
- /home/voicetop/public_html/index.php(27) calling run()
- /home/voicetop/public_html/dooframework/app/DooWebApp.php(34) calling routeTo()
- /home/voicetop/public_html/dooframework/app/DooWebApp.php(116) calling showPage()
object(DooConfig)#1 (34) {
["AUTOLOAD"] => NULL
["SITE_PATH"] => string(27) "/home/voicetop/public_html/"
["PROTECTED_FOLDER"] => string(10) "protected/"
["BASE_PATH"] => string(40) "/home/voicetop/public_html/dooframework/"
["LOG_PATH"] => NULL
["APP_URL"] => string(29) "https://www.voicetophone.com/"
["SUBFOLDER"] => string(1) "/"
["APP_MODE"] => string(3) "dev"
["AUTOROUTE"] => bool(true)
["DEBUG_ENABLED"] => bool(true)
["ERROR_404_DOCUMENT"] => NULL
["ERROR_404_ROUTE"] => string(6) "/error"
["CACHE_PATH"] => NULL
["AUTO_VIEW_RENDER_PATH"] => string(16) "/:pagina/:idioma"
["MEMCACHE"] => NULL
["TEMPLATE_ENGINE"] => string(7) "DooView"
["TEMPLATE_SHOW_COMMENT"] => NULL
["TEMPLATE_ALLOW_PHP"] => NULL
["TEMPLATE_COMPILE_ALWAYS"] => NULL
["TEMPLATE_GLOBAL_TAGS"] => NULL
["MODULES"] => NULL
["APP_NAMESPACE_ID"] => NULL
["RELATIVE_IMG_DIR"] => string(13) "/uploads/img/"
["IMG_DIR"] => string(35) "/home/voicetop/public_html/uploads/"
["FILE_DIR"] => string(34) "/home/voicetop/public_html//files/"
["PRODU_DIR"] => string(38) "/home/voicetop/public_html//productos/"
["IMG_CATEGORIA"] => string(43) "/home/voicetop/public_html//img_categorias/"
["IMG_AYUDA"] => string(41) "/home/voicetop/public_html//iconos_ayuda/"
["PROY_DIR"] => string(38) "/home/voicetop/public_html//proyectos/"
["GALERIA_CARACT"] => string(47) "/home/voicetop/public_html//img_caract/galeria/"
["FONDO_PAGES"] => string(40) "/home/voicetop/public_html//fondo_pages/"
["GALERIA_PROYECTO_WEB"] => string(21) "//img_caract/galeria/"
["DIR_NOW"] => string(36) "www.voicetophone.com/numero-virtual/"
["PARAM"] => string(0) ""
}
$_SESSION Variables
array(0) {
}
$_COOKIE Variables
array(0) {
}