@@ -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(); |
@@ -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 |
@@ -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'); |
@@ -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'); |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | $nombre=$_POST['nombre']; |
39 | 39 | $email=$_POST['email']; |
40 | 40 | $usuario=$_POST['nombre']; |
41 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
41 | + $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
42 | 42 | |
43 | - $datas->insertarRegistro( |
|
44 | - $this->_seg->filtrarTexto($_POST['nombre']), |
|
45 | - $this->_seg->filtrarTexto($_POST['email']), |
|
46 | - '1', |
|
47 | - $clave |
|
43 | + $datas->insertarRegistro( |
|
44 | + $this->_seg->filtrarTexto($_POST['nombre']), |
|
45 | + $this->_seg->filtrarTexto($_POST['email']), |
|
46 | + '1', |
|
47 | + $clave |
|
48 | 48 | ); |
49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
50 | 50 | //$_POST['option1']=false; |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | $_SESSION['usuario']=$usuario; |
68 | 68 | $this->_ayuda->redireccionUrl('index'); |
69 | 69 | } |
70 | - $this->_ayuda->redireccionUrl('usuario'); |
|
70 | + $this->_ayuda->redireccionUrl('usuario'); |
|
71 | 71 | |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - public function cerrarSesion(){ |
|
75 | + public function cerrarSesion(){ |
|
76 | 76 | $this->_sesion->iniciarSesion('_s', false); |
77 | 77 | session_destroy(); |
78 | 78 | $this->_sesion->destruir('usuario'); |
@@ -48,8 +48,7 @@ |
||
48 | 48 | ); |
49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
50 | 50 | //$_POST['option1']=false; |
51 | - } |
|
52 | - else{ |
|
51 | + } else{ |
|
53 | 52 | $this->_ayuda->redireccionUrl('usuario/registro'); |
54 | 53 | } |
55 | 54 | } |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | parent::__construct(); |
11 | 11 | |
12 | 12 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda; |
|
14 | - $this->_seg= new Sistema\Ayudantes\CFPHPSeguridad; |
|
15 | - $this->_sesion=new Sistema\Nucleo\CFSesion(); |
|
13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda; |
|
14 | + $this->_seg = new Sistema\Ayudantes\CFPHPSeguridad; |
|
15 | + $this->_sesion = new Sistema\Nucleo\CFSesion(); |
|
16 | 16 | } |
17 | 17 | |
18 | - public function index(){ |
|
18 | + public function index() { |
|
19 | 19 | $this->_sesion->iniciarSesion('_s', Cf_SESION_PARAMETRO_SEGURO); |
20 | 20 | session_destroy(); |
21 | 21 | $this->_vista->titulo = 'CalimaFramework Login'; |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | $this->_vista->imprimirVista('index', 'usuario'); |
24 | 24 | } |
25 | 25 | |
26 | - public function registro(){ |
|
26 | + public function registro() { |
|
27 | 27 | $this->_vista->titulo = 'CalimaFramework registro'; |
28 | 28 | $this->_vista->imprimirVista('registro', 'usuario'); |
29 | 29 | |
30 | 30 | } |
31 | 31 | |
32 | - public function crearRegistro(){ |
|
32 | + public function crearRegistro() { |
|
33 | 33 | $datas = $this->cargaModelo('usuario'); |
34 | - if(isset($_POST['nombre'])){ |
|
35 | - $nombre=$_POST['nombre']; |
|
36 | - $email=$_POST['email']; |
|
37 | - $usuario=$_POST['nombre']; |
|
38 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
34 | + if (isset($_POST['nombre'])) { |
|
35 | + $nombre = $_POST['nombre']; |
|
36 | + $email = $_POST['email']; |
|
37 | + $usuario = $_POST['nombre']; |
|
38 | + $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
39 | 39 | |
40 | 40 | $datas->insertarRegistro( |
41 | 41 | $this->_seg->filtrarTexto($_POST['nombre']), |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | ); |
46 | 46 | $this->_ayuda->redireccionUrl('usuario'); |
47 | 47 | } |
48 | - else{ |
|
48 | + else { |
|
49 | 49 | $this->_ayuda->redireccionUrl('usuario/registro'); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | - public function valida(){ |
|
54 | - if(isset($_POST['usuario'])){ |
|
55 | - $usuario=$_POST['usuario']; |
|
56 | - echo $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
53 | + public function valida() { |
|
54 | + if (isset($_POST['usuario'])) { |
|
55 | + $usuario = $_POST['usuario']; |
|
56 | + echo $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
57 | 57 | |
58 | 58 | $datosUser = $this->cargaModelo('usuario'); |
59 | - $valida=$datosUser->seleccionUsuario($usuario, $clave); |
|
59 | + $valida = $datosUser->seleccionUsuario($usuario, $clave); |
|
60 | 60 | |
61 | - if(isset($valida)){ |
|
61 | + if (isset($valida)) { |
|
62 | 62 | $this->_sesion->iniciarSesion('_s', Cf_SESION_PARAMETRO_SEGURO); |
63 | - $_SESSION['usuario']=$usuario; |
|
64 | - $_SESSION['id_usuario']=$valida['id_usuario']; |
|
65 | - $_SESSION['nivel']=$valida['nivel']; |
|
63 | + $_SESSION['usuario'] = $usuario; |
|
64 | + $_SESSION['id_usuario'] = $valida['id_usuario']; |
|
65 | + $_SESSION['nivel'] = $valida['nivel']; |
|
66 | 66 | $this->_ayuda->redireccionUrl('data/index'); |
67 | 67 | } |
68 | 68 | $this->_ayuda->redireccionUrl('usuario'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - public function cerrarSesion(){ |
|
73 | + public function cerrarSesion() { |
|
74 | 74 | $this->_sesion->iniciarSesion('_s', false); |
75 | 75 | session_destroy(); |
76 | 76 | $this->_sesion->destruir('usuario'); |
@@ -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,9 +14,9 @@ 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 | - $gbd = new PDO("mysql:host=localhost;dbname=".$bd, $usuario, $contraseña); |
|
19 | + $gbd = new PDO("mysql:host=localhost;dbname=" . $bd, $usuario, $contraseña); |
|
20 | 20 | $gbd = null; |
21 | 21 | return true; |
22 | 22 | |
@@ -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 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | </script> |
21 | 21 | <!-- End Google Analytics --> |
22 | 22 | |
23 | - <title><?php if(isset($this->titulo)) echo $this->titulo; ?></title> |
|
23 | + <title><?php if (isset($this->titulo)) echo $this->titulo; ?></title> |
|
24 | 24 | |
25 | 25 | |
26 | 26 |
@@ -20,7 +20,10 @@ |
||
20 | 20 | </script> |
21 | 21 | <!-- End Google Analytics --> |
22 | 22 | |
23 | - <title><?php if(isset($this->titulo)) echo $this->titulo; ?></title> |
|
23 | + <title><?php if(isset($this->titulo)) { |
|
24 | + echo $this->titulo; |
|
25 | +} |
|
26 | +?></title> |
|
24 | 27 | |
25 | 28 | |
26 | 29 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <!-- Site footer --> |
2 | 2 | |
3 | 3 | |
4 | - <div class="footer fixedCf"> <?php echo CF_AP_CREDITOS; ?> --- Theme Inspinia </div> |
|
4 | + <div class="footer fixedCf"> <?php echo CF_AP_CREDITOS; ?> --- Theme Inspinia </div> |
|
5 | 5 | |
6 | 6 | |
7 | 7 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | { |
4 | 4 | protected $resource; |
5 | 5 | public abstract function connect($host, $user, $pass, $dbname); |
6 | - public abstract function disconnect (); |
|
6 | + public abstract function disconnect(); |
|
7 | 7 | public abstract function getErrorNo(); |
8 | 8 | public abstract function getError(); |
9 | 9 | public abstract function query($q); |
@@ -4,49 +4,49 @@ |
||
4 | 4 | |
5 | 5 | class MySqlProvider extends DatabaseProvider |
6 | 6 | { |
7 | - public function connect($host, $user, $pass, $dbname){ |
|
7 | + public function connect($host, $user, $pass, $dbname) { |
|
8 | 8 | $this->resource = new mysqli($host, $user, $pass, $dbname); |
9 | 9 | |
10 | - if ($this->resource->connect_errno){ // Connection fails |
|
10 | + if ($this->resource->connect_errno) { // Connection fails |
|
11 | 11 | error_log($this->resource->connect_error); |
12 | 12 | } |
13 | 13 | |
14 | 14 | return $this->resource; |
15 | 15 | } |
16 | - public function disconnect(){ |
|
16 | + public function disconnect() { |
|
17 | 17 | return $this->resource->close(); |
18 | 18 | } |
19 | - public function getErrorNo(){ |
|
19 | + public function getErrorNo() { |
|
20 | 20 | return $this->resource->errno; |
21 | 21 | } |
22 | - public function getError(){ |
|
22 | + public function getError() { |
|
23 | 23 | return $this->resource->error; |
24 | 24 | } |
25 | - public function query($q){ |
|
25 | + public function query($q) { |
|
26 | 26 | return $this->resource->query($q); |
27 | 27 | } |
28 | - public function numRows($resource){ |
|
28 | + public function numRows($resource) { |
|
29 | 29 | $num_rows = 0; |
30 | 30 | |
31 | - if ($resource){ |
|
31 | + if ($resource) { |
|
32 | 32 | $num_rows = $resource->num_rows; |
33 | 33 | } |
34 | 34 | |
35 | 35 | return $num_rows; |
36 | 36 | } |
37 | - public function fetchArray($result){ |
|
37 | + public function fetchArray($result) { |
|
38 | 38 | return $result->fetch_assoc(); |
39 | 39 | } |
40 | - public function isConnected(){ |
|
40 | + public function isConnected() { |
|
41 | 41 | return !is_null($this->resource); |
42 | 42 | } |
43 | - public function escape($var){ |
|
43 | + public function escape($var) { |
|
44 | 44 | return $this->resource->real_escape_string($var); |
45 | 45 | } |
46 | - public function getInsertedID(){ |
|
46 | + public function getInsertedID() { |
|
47 | 47 | return $this->resource->insert_id; |
48 | 48 | } |
49 | - public function changeDB ($database){ |
|
49 | + public function changeDB($database) { |
|
50 | 50 | return $this->resource->select_db($database); |
51 | 51 | } |
52 | 52 | public function setCharset($charset) { |