@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $rutaLib = RUTA_LIBS . $libreria . '.php'; |
| 39 | 39 | if(is_readable($rutaLib)){ |
| 40 | 40 | require_once $rutaLib; |
| 41 | - //echo 'libreria cargada'; |
|
| 41 | + //echo 'libreria cargada'; |
|
| 42 | 42 | } |
| 43 | 43 | else { |
| 44 | 44 | throw new Exception("houston tenemos un problema! al cargar libreria"); |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | protected function cargaModelo($modelo){ |
| 49 | 49 | $modelo=$modelo.'Modelo'; |
| 50 | - $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
| 50 | + $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
| 51 | 51 | if(is_readable($rutaMod)){ |
| 52 | 52 | require_once $rutaMod; |
| 53 | 53 | $modelo = new $modelo; |
| 54 | 54 | return $modelo; |
| 55 | - //echo 'modelo cargado'; |
|
| 55 | + //echo 'modelo cargado'; |
|
| 56 | 56 | } |
| 57 | 57 | else { |
| 58 | 58 | //echo $rutaMod; |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | protected function cargaAyudante($ayudante){ |
| 67 | - $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
| 67 | + $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
| 68 | 68 | if(is_readable($rutaAyudante)){ |
| 69 | 69 | require_once $rutaAyudante; |
| 70 | - //echo 'libreria cargada'; |
|
| 70 | + //echo 'libreria cargada'; |
|
| 71 | 71 | } |
| 72 | 72 | else { |
| 73 | 73 | throw new Exception("houston tenemos un problema! al cargar ayudante"); |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | if(is_readable($rutaLib)){ |
| 40 | 40 | require_once $rutaLib; |
| 41 | 41 | //echo 'libreria cargada'; |
| 42 | - } |
|
| 43 | - else { |
|
| 42 | + } else { |
|
| 44 | 43 | throw new Exception("houston tenemos un problema! al cargar libreria"); |
| 45 | 44 | } |
| 46 | 45 | } |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | $modelo = new $modelo; |
| 54 | 53 | return $modelo; |
| 55 | 54 | //echo 'modelo cargado'; |
| 56 | - } |
|
| 57 | - else { |
|
| 55 | + } else { |
|
| 58 | 56 | //echo $rutaMod; |
| 59 | 57 | |
| 60 | 58 | |
@@ -68,8 +66,7 @@ discard block |
||
| 68 | 66 | if(is_readable($rutaAyudante)){ |
| 69 | 67 | require_once $rutaAyudante; |
| 70 | 68 | //echo 'libreria cargada'; |
| 71 | - } |
|
| 72 | - else { |
|
| 69 | + } else { |
|
| 73 | 70 | throw new Exception("houston tenemos un problema! al cargar ayudante"); |
| 74 | 71 | } |
| 75 | 72 | } |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $this->_vista = new CFVista(new CFSolicitud); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - protected function cargaLib($libreria){ |
|
| 38 | - $rutaLib = RUTA_LIBS . $libreria . '.php'; |
|
| 39 | - if(is_readable($rutaLib)){ |
|
| 37 | + protected function cargaLib($libreria) { |
|
| 38 | + $rutaLib = RUTA_LIBS.$libreria.'.php'; |
|
| 39 | + if (is_readable($rutaLib)) { |
|
| 40 | 40 | require_once $rutaLib; |
| 41 | 41 | //echo 'libreria cargada'; |
| 42 | 42 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - protected function cargaModelo($modelo){ |
|
| 49 | - $modelo=$modelo.'Modelo'; |
|
| 50 | - $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
| 51 | - if(is_readable($rutaMod)){ |
|
| 48 | + protected function cargaModelo($modelo) { |
|
| 49 | + $modelo = $modelo.'Modelo'; |
|
| 50 | + $rutaMod = RUTA_MOD.$modelo.'.php'; |
|
| 51 | + if (is_readable($rutaMod)) { |
|
| 52 | 52 | require_once $rutaMod; |
| 53 | 53 | $modelo = new $modelo; |
| 54 | 54 | return $modelo; |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - protected function cargaAyudante($ayudante){ |
|
| 67 | - $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
| 68 | - if(is_readable($rutaAyudante)){ |
|
| 66 | + protected function cargaAyudante($ayudante) { |
|
| 67 | + $rutaAyudante = RUTA_AYUDANTES.$ayudante.'.php'; |
|
| 68 | + if (is_readable($rutaAyudante)) { |
|
| 69 | 69 | require_once $rutaAyudante; |
| 70 | 70 | //echo 'libreria cargada'; |
| 71 | 71 | } |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php'; |
| 43 | 43 | include_once $ver_ruta; |
| 44 | 44 | include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php'; |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | |
| 48 | 47 | header('Location: '. Cf_BASE_URL.'error/index'.'?error='.'vista' ); |
| 49 | 48 | |
@@ -36,16 +36,16 @@ |
||
| 36 | 36 | public function imprimirVista($vista, $item = false) |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - $ver_ruta = VIEW_PATH . $this->_controlador . DS . $vista . '.phtml'; |
|
| 39 | + $ver_ruta = VIEW_PATH.$this->_controlador.DS.$vista.'.phtml'; |
|
| 40 | 40 | |
| 41 | - if(is_readable($ver_ruta)){ |
|
| 42 | - include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php'; |
|
| 41 | + if (is_readable($ver_ruta)) { |
|
| 42 | + include_once SITE_ROOT.'mvc/vistas'.DS.ADICIONALES_VISTA.DS.'encabezado.php'; |
|
| 43 | 43 | include_once $ver_ruta; |
| 44 | - include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php'; |
|
| 44 | + include_once SITE_ROOT.'mvc/vistas'.DS.ADICIONALES_VISTA.DS.'pie_de_pagina.php'; |
|
| 45 | 45 | } |
| 46 | 46 | else { |
| 47 | 47 | |
| 48 | - header('Location: '. Cf_BASE_URL.'error/index'.'?error='.'vista' ); |
|
| 48 | + header('Location: '.Cf_BASE_URL.'error/index'.'?error='.'vista'); |
|
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
| 62 | 62 | |
| 63 | 63 | $datas->insertarDatos( |
| 64 | - $this->_ayuda->filtrarEntero($_POST['id']), |
|
| 65 | - $this->_ayuda->filtrarTexto($_POST['nombre']), |
|
| 66 | - $this->_ayuda->filtrarTexto($_POST['email']), |
|
| 67 | - $this->_ayuda->filtrarTexto($_POST['comentario']) |
|
| 64 | + $this->_ayuda->filtrarEntero($_POST['id']), |
|
| 65 | + $this->_ayuda->filtrarTexto($_POST['nombre']), |
|
| 66 | + $this->_ayuda->filtrarTexto($_POST['email']), |
|
| 67 | + $this->_ayuda->filtrarTexto($_POST['comentario']) |
|
| 68 | 68 | ); |
| 69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
| 70 | 70 | $_POST['option1']=false; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function insertarComentario(){ |
| 77 | 77 | |
| 78 | - /*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
| 78 | + /*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
| 79 | 79 | if(isset($_GET['titulo'])){ |
| 80 | 80 | $this->_vista->salida_campo = $_GET['titulo']; |
| 81 | 81 | } |
@@ -19,46 +19,46 @@ discard block |
||
| 19 | 19 | $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - public function index(){ |
|
| 22 | + public function index() { |
|
| 23 | 23 | $datas = $this->cargaModelo('blog'); |
| 24 | 24 | |
| 25 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
| 26 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
| 27 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
| 25 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
| 26 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
| 27 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
| 28 | 28 | $this->_vista->titulo = 'Blog Calima Framework'; |
| 29 | 29 | $this->_vista->imprimirVista('index', 'blog'); |
| 30 | 30 | |
| 31 | 31 | } |
| 32 | - public function crearpost(){ |
|
| 32 | + public function crearpost() { |
|
| 33 | 33 | $datas = $this->cargaModelo('blog'); |
| 34 | 34 | |
| 35 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
| 35 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
| 36 | 36 | $this->_vista->titulo = 'Blog Calima Framework crear post'; |
| 37 | 37 | $this->_vista->imprimirVista('crearpost', 'blog'); |
| 38 | 38 | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function wikipost(){ |
|
| 41 | + public function wikipost() { |
|
| 42 | 42 | $datas = $this->cargaModelo('blog'); |
| 43 | 43 | |
| 44 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
| 45 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
| 46 | - $this->_vista->comentarios= $datas->llamarComentarios(); |
|
| 47 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
| 48 | - $this->_vista->contar= $datas->contarComentarios($_GET['id']); |
|
| 49 | - $this->_vista->video= $datas->llamarDatosBlogId($_GET['id']); |
|
| 44 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
| 45 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
| 46 | + $this->_vista->comentarios = $datas->llamarComentarios(); |
|
| 47 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
| 48 | + $this->_vista->contar = $datas->contarComentarios($_GET['id']); |
|
| 49 | + $this->_vista->video = $datas->llamarDatosBlogId($_GET['id']); |
|
| 50 | 50 | $this->_vista->titulo = 'Blog 1 Calima Framework'; |
| 51 | 51 | $this->_vista->imprimirVista('wikipost', 'blog'); |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | $this->_vista->titulo = 'Registro CalimaFramework'; |
| 55 | - if(isset($_GET['titulo'])){ |
|
| 55 | + if (isset($_GET['titulo'])) { |
|
| 56 | 56 | $this->_vista->salida_campo = $_GET['titulo']; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $this->_vista->imprimirVista('wikipost', 'blog'); |
| 60 | 60 | //$datas = $this->cargaModelo('blog'); |
| 61 | - if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
|
| 61 | + if (isset($_POST['enviar']) && isset($_POST['option1'])) { |
|
| 62 | 62 | |
| 63 | 63 | $datas->insertarDatos( |
| 64 | 64 | $this->_ayuda->filtrarEntero($_POST['id']), |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | $this->_ayuda->filtrarTexto($_POST['comentario']) |
| 68 | 68 | ); |
| 69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
| 70 | - $_POST['option1']=false; |
|
| 70 | + $_POST['option1'] = false; |
|
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function insertarComentario(){ |
|
| 76 | + public function insertarComentario() { |
|
| 77 | 77 | |
| 78 | 78 | /*$this->_vista->titulo = 'Registro CalimaFramework'; |
| 79 | 79 | if(isset($_GET['titulo'])){ |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | |
| 40 | - if (isset($_POST['email'])) { |
|
| 40 | + if (isset($_POST['email'])) { |
|
| 41 | 41 | $para="[email protected]"; |
| 42 | 42 | $this->_ayuda->enviarCorreo( |
| 43 | 43 | $_POST['email'], |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
| 12 | 12 | |
| 13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda(); |
|
| 13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function index() |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | $this->_vista->imprimirVista('index', 'inicio'); |
| 20 | 20 | |
| 21 | 21 | if (isset($_POST['email'])) { |
| 22 | - $this->_vista->validar=1; |
|
| 23 | - $para="[email protected]"; |
|
| 22 | + $this->_vista->validar = 1; |
|
| 23 | + $para = "[email protected]"; |
|
| 24 | 24 | $this->_ayuda->enviarCorreo( |
| 25 | 25 | $_POST['email'], |
| 26 | 26 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | if (isset($_POST['email'])) { |
| 41 | - $para="[email protected]"; |
|
| 41 | + $para = "[email protected]"; |
|
| 42 | 42 | $this->_ayuda->enviarCorreo( |
| 43 | 43 | $_POST['email'], |
| 44 | 44 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -6,16 +6,16 @@ |
||
| 6 | 6 | * and open the template in the editor. |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -class errorControlador extends \Sistema\Nucleo\CFControlador{ |
|
| 9 | +class errorControlador extends \Sistema\Nucleo\CFControlador { |
|
| 10 | 10 | |
| 11 | 11 | public function __construct() { |
| 12 | 12 | parent::__construct(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - public function index(){ |
|
| 15 | + public function index() { |
|
| 16 | 16 | |
| 17 | - $this->_vista->titulo="Error detectado"; |
|
| 18 | - $this->_vista->imprimirVista('index','error'); |
|
| 17 | + $this->_vista->titulo = "Error detectado"; |
|
| 18 | + $this->_vista->imprimirVista('index', 'error'); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $this->_vista->imprimirVista('index', 'instalador'); |
| 66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
| 67 | 67 | |
| 68 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
| 68 | + } elseif (Cf_CONFIG_INICIO=='false') { |
|
| 69 | 69 | |
| 70 | 70 | $this->_vista->titulo = 'CalimaFramework'; |
| 71 | 71 | $this->_vista->imprimirVista('index', 'instalador'); |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | public function __construct() { |
| 47 | 47 | parent::__construct(); |
| 48 | 48 | |
| 49 | - $this->_ayuda= new Sisayu\CFPHPAyuda; |
|
| 49 | + $this->_ayuda = new Sisayu\CFPHPAyuda; |
|
| 50 | 50 | //$this->cargaAyudante('CfPHPAyuda'); |
| 51 | 51 | //$this->cargaAyudante('CfPHPSeguridad'); |
| 52 | - $this->_seg= new Sisayu\CFPHPSeguridad; |
|
| 52 | + $this->_seg = new Sisayu\CFPHPSeguridad; |
|
| 53 | 53 | |
| 54 | - $this->_sesion=new Sisnuc\CFSesion(); |
|
| 54 | + $this->_sesion = new Sisnuc\CFSesion(); |
|
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | |
@@ -59,13 +59,13 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | // Se verifica que en el archivo de configuracion.php la constante Cf_CONFIG_INICIO==true |
| 61 | 61 | //Si esta en True se lanza el instalador de Cf |
| 62 | - if(Cf_CONFIG_INICIO==true){ |
|
| 62 | + if (Cf_CONFIG_INICIO == true) { |
|
| 63 | 63 | |
| 64 | 64 | $this->_vista->titulo = 'CalimaFramework'; |
| 65 | 65 | $this->_vista->imprimirVista('index', 'instalador'); |
| 66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
| 67 | 67 | |
| 68 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
| 68 | + }elseif (Cf_CONFIG_INICIO == 'false') { |
|
| 69 | 69 | |
| 70 | 70 | $this->_vista->titulo = 'CalimaFramework'; |
| 71 | 71 | $this->_vista->imprimirVista('index', 'instalador'); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | //verificamos la version de php en tu servidor web o local |
| 28 | 28 | if (version_compare(PHP_VERSION, '5.3.20', '<')) |
| 29 | 29 | { |
| 30 | - die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
| 30 | + die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | //Cargamos los Espacios de nombres para el nucleo y los ayudantes |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $this->_ayuda= new Sisayu\CFPHPAyuda; |
| 50 | 50 | //$this->cargaAyudante('CfPHPAyuda'); |
| 51 | - //$this->cargaAyudante('CfPHPSeguridad'); |
|
| 51 | + //$this->cargaAyudante('CfPHPSeguridad'); |
|
| 52 | 52 | $this->_seg= new Sisayu\CFPHPSeguridad; |
| 53 | 53 | |
| 54 | 54 | $this->_sesion=new Sisnuc\CFSesion(); |
@@ -13,67 +13,67 @@ |
||
| 13 | 13 | parent::__construct(); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - public function insertarDatos($id_blog, $nombre, $email, $comentario){ |
|
| 16 | + public function insertarDatos($id_blog, $nombre, $email, $comentario) { |
|
| 17 | 17 | |
| 18 | - $post=$this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
| 19 | - $post=$this->_bd->enlace(':id_blog', $id_blog); |
|
| 20 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
| 21 | - $post=$this->_bd->enlace(':email', $email); |
|
| 22 | - $post=$this->_bd->enlace(':comentario', $comentario); |
|
| 23 | - $post=$this->_bd->ejecucion(); |
|
| 24 | - return $post=$this->_bd->resultset(); |
|
| 18 | + $post = $this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
| 19 | + $post = $this->_bd->enlace(':id_blog', $id_blog); |
|
| 20 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
| 21 | + $post = $this->_bd->enlace(':email', $email); |
|
| 22 | + $post = $this->_bd->enlace(':comentario', $comentario); |
|
| 23 | + $post = $this->_bd->ejecucion(); |
|
| 24 | + return $post = $this->_bd->resultset(); |
|
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function llamarDatosCategoria(){ |
|
| 28 | + public function llamarDatosCategoria() { |
|
| 29 | 29 | //echo DB_HOST; |
| 30 | - $cate=$this->_bd->consulta('select * from categoria '); |
|
| 31 | - return $cate=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 30 | + $cate = $this->_bd->consulta('select * from categoria '); |
|
| 31 | + return $cate = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function llamarDatosTags(){ |
|
| 36 | + public function llamarDatosTags() { |
|
| 37 | 37 | //echo DB_HOST; |
| 38 | - $post=$this->_bd->consulta('select * from tags '); |
|
| 39 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 38 | + $post = $this->_bd->consulta('select * from tags '); |
|
| 39 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - public function llamarDatosBlog(){ |
|
| 45 | + public function llamarDatosBlog() { |
|
| 46 | 46 | //echo DB_HOST; |
| 47 | - $post=$this->_bd->consulta('select * from blog '); |
|
| 48 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 47 | + $post = $this->_bd->consulta('select * from blog '); |
|
| 48 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function llamarDatosBlogId($id){ |
|
| 53 | + public function llamarDatosBlogId($id) { |
|
| 54 | 54 | //echo DB_HOST; |
| 55 | - $idvideo=$id; |
|
| 56 | - $datosQuery="select idvideo from blog where id = :idvideo"; |
|
| 57 | - $gsent=$this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
| 58 | - $gsent=$this->_bd->enlace(':idvideo', $idvideo); |
|
| 55 | + $idvideo = $id; |
|
| 56 | + $datosQuery = "select idvideo from blog where id = :idvideo"; |
|
| 57 | + $gsent = $this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
| 58 | + $gsent = $this->_bd->enlace(':idvideo', $idvideo); |
|
| 59 | 59 | //$gsent=$this->_bd->ejecucion(); |
| 60 | - $row = $gsent=$this->_bd->single(); |
|
| 60 | + $row = $gsent = $this->_bd->single(); |
|
| 61 | 61 | return $row; |
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - public function llamarComentarios(){ |
|
| 65 | + public function llamarComentarios() { |
|
| 66 | 66 | //echo DB_HOST; |
| 67 | - $post=$this->_bd->consulta('select * from comentarios '); |
|
| 68 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 67 | + $post = $this->_bd->consulta('select * from comentarios '); |
|
| 68 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function contarComentarios($id){ |
|
| 73 | + public function contarComentarios($id) { |
|
| 74 | 74 | //echo DB_HOST; |
| 75 | - $post=$this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
| 76 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 75 | + $post = $this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
| 76 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function verificarBdM($bd,$usuario,$contraseña){ |
| 18 | - try { |
|
| 18 | + try { |
|
| 19 | 19 | $gbd = new PDO("mysql:host=localhost;dbname=".$bd, $usuario, $contraseña); |
| 20 | 20 | $gbd = null; |
| 21 | 21 | return true; |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | `clave` varchar(60) NOT NULL, |
| 53 | 53 | PRIMARY KEY (`id_usuario`) |
| 54 | 54 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;'); |
| 55 | - $this->_bd->ejecucion(); |
|
| 55 | + $this->_bd->ejecucion(); |
|
| 56 | 56 | |
| 57 | - $this->_bd->consulta('CREATE TABLE IF NOT EXISTS `sesion_usuario` ( |
|
| 57 | + $this->_bd->consulta('CREATE TABLE IF NOT EXISTS `sesion_usuario` ( |
|
| 58 | 58 | `id_usuario` int(10) NOT NULL, |
| 59 | 59 | `fecha_sesion` varchar(20) NOT NULL |
| 60 | 60 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;'); |
| 61 | - $this->_bd->ejecucion(); |
|
| 61 | + $this->_bd->ejecucion(); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | parent::__construct(); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - public function verificarBdM($bd,$usuario,$contraseña){ |
|
| 17 | + public function verificarBdM($bd, $usuario, $contraseña) { |
|
| 18 | 18 | try { |
| 19 | 19 | $gbd = new PDO("mysql:host=localhost;dbname=".$bd, $usuario, $contraseña); |
| 20 | 20 | $gbd = null; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function crearTablas(){ |
|
| 29 | + public function crearTablas() { |
|
| 30 | 30 | |
| 31 | 31 | $this->_bd->consulta('CREATE TABLE IF NOT EXISTS `menu` ( |
| 32 | 32 | `id` int(5) NOT NULL, |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function seleccionUsuario($email, $clave){ |
|
| 24 | + public function seleccionUsuario($email, $clave){ |
|
| 25 | 25 | //echo DB_HOST; |
| 26 | 26 | |
| 27 | 27 | //$datosQuery="select usuario, email, nivel from usuarios where usuario = :usuario"; |
@@ -2,47 +2,47 @@ |
||
| 2 | 2 | class usuarioModelo extends Sistema\Nucleo\CFModelo |
| 3 | 3 | { |
| 4 | 4 | |
| 5 | - function ValidarUsuario($email,$password){ // Consulta Mysql para buscar en la tabla Usuario aquellos usuarios que coincidan con el mail y password ingresados en pantalla de login |
|
| 6 | - $query = $this->db->where('Usuario',$email); // La consulta se efectúa mediante Active Record. Una manera alternativa, y en lenguaje más sencillo, de generar las consultas Sql. |
|
| 7 | - $query = $this->db->where('Password',$password); |
|
| 5 | + function ValidarUsuario($email, $password) { // Consulta Mysql para buscar en la tabla Usuario aquellos usuarios que coincidan con el mail y password ingresados en pantalla de login |
|
| 6 | + $query = $this->db->where('Usuario', $email); // La consulta se efectúa mediante Active Record. Una manera alternativa, y en lenguaje más sencillo, de generar las consultas Sql. |
|
| 7 | + $query = $this->db->where('Password', $password); |
|
| 8 | 8 | $query = $this->db->get('Usuarios'); |
| 9 | - return $query->row(); // Devolvemos al controlador la fila que coincide con la búsqueda. (FALSE en caso que no existir coincidencias) |
|
| 9 | + return $query->row(); // Devolvemos al controlador la fila que coincide con la búsqueda. (FALSE en caso que no existir coincidencias) |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | - public function insertarUsuario($id_usuario, $nombre, $email, $clave){ |
|
| 12 | + public function insertarUsuario($id_usuario, $nombre, $email, $clave) { |
|
| 13 | 13 | |
| 14 | - $post=$this->_bd->consulta('INSERT INTO comentarios (id_usuario, nombre, email, clave) VALUES (:id_usuario, :nombre, :email, :clave)'); |
|
| 15 | - $post=$this->_bd->enlace(':id_usuario', $id_usuariio); |
|
| 16 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
| 17 | - $post=$this->_bd->enlace(':email', $email); |
|
| 18 | - $post=$this->_bd->enlace(':clave', $clave); |
|
| 19 | - $post=$this->_bd->ejecucion(); |
|
| 20 | - return $post=$this->_bd->resultset(); |
|
| 14 | + $post = $this->_bd->consulta('INSERT INTO comentarios (id_usuario, nombre, email, clave) VALUES (:id_usuario, :nombre, :email, :clave)'); |
|
| 15 | + $post = $this->_bd->enlace(':id_usuario', $id_usuariio); |
|
| 16 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
| 17 | + $post = $this->_bd->enlace(':email', $email); |
|
| 18 | + $post = $this->_bd->enlace(':clave', $clave); |
|
| 19 | + $post = $this->_bd->ejecucion(); |
|
| 20 | + return $post = $this->_bd->resultset(); |
|
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function seleccionUsuario($email, $clave){ |
|
| 24 | + public function seleccionUsuario($email, $clave) { |
|
| 25 | 25 | //echo DB_HOST; |
| 26 | 26 | |
| 27 | 27 | //$datosQuery="select usuario, email, nivel from usuarios where usuario = :usuario"; |
| 28 | - $gsent=$this->_bd->consulta('select nombre, email, nivel from usuarios where email = :email and clave = :clave'); |
|
| 29 | - $gsent=$this->_bd->enlace(':email', $email); |
|
| 30 | - $gsent=$this->_bd->enlace(':clave', $clave); |
|
| 28 | + $gsent = $this->_bd->consulta('select nombre, email, nivel from usuarios where email = :email and clave = :clave'); |
|
| 29 | + $gsent = $this->_bd->enlace(':email', $email); |
|
| 30 | + $gsent = $this->_bd->enlace(':clave', $clave); |
|
| 31 | 31 | //$gsent=$this->_bd->ejecucion(); |
| 32 | - $row = $gsent=$this->_bd->single(); |
|
| 32 | + $row = $gsent = $this->_bd->single(); |
|
| 33 | 33 | return $row; |
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - public function insertarRegistro($nombre, $email, $nivel, $clave){ |
|
| 37 | + public function insertarRegistro($nombre, $email, $nivel, $clave) { |
|
| 38 | 38 | |
| 39 | - $post=$this->_bd->consulta('INSERT INTO usuarios (nombre, email, nivel, clave) VALUES (:nombre, :email, :nivel, :clave)'); |
|
| 39 | + $post = $this->_bd->consulta('INSERT INTO usuarios (nombre, email, nivel, clave) VALUES (:nombre, :email, :nivel, :clave)'); |
|
| 40 | 40 | |
| 41 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
| 42 | - $post=$this->_bd->enlace(':email', $email); |
|
| 43 | - $post=$this->_bd->enlace(':nivel', $nivel); |
|
| 44 | - $post=$this->_bd->enlace(':clave', $clave); |
|
| 45 | - $post=$this->_bd->ejecucion(); |
|
| 41 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
| 42 | + $post = $this->_bd->enlace(':email', $email); |
|
| 43 | + $post = $this->_bd->enlace(':nivel', $nivel); |
|
| 44 | + $post = $this->_bd->enlace(':clave', $clave); |
|
| 45 | + $post = $this->_bd->ejecucion(); |
|
| 46 | 46 | //return $post=$this->_bd->contarFilas(); |
| 47 | 47 | |
| 48 | 48 | } |