header('Location: ./'); die; } $TITLE = 'CMS - Perfil'; $PAGE_CSS = true; $GLOBAL = true; $BOOTSTRAP = true; $JQUERY = true; $INCL = array('myconnection.php'); include "include/essentials.php"; $conex = new myconnection('cmsuser', 'pass', 'cms'); if ($conex->conx_err) { $msg = 'Hubo un error a la hora de realizar la conexion con la Base de Datos.'; } else { #Cargar la informacion del usuario $conex->execute('select * from info where id_acc=' . $_GET['id']); if ($conex->q_err) { $msg = 'No se pudo cargar la informacion de la Base de Datos.'; } else { $info = $conex->getArray(); } #Cargar las publicaciones if (isset($info)) { #4 -> act_rec1 $conex->execute("select * from post where id={$info['4']}"); if (!$conex->q_err && ($temp = $conex->getArray()) !== null) { $act_rec = array($temp); } #5 -> act_rec2 $conex->execute("select * from post where id={$info['5']}"); if (!$conex->q_err && ($temp = $conex->getArray()) !== null) {
if (!isset($_SESSION['usr'])) { header('Location: ' . Root()); die; } $TITLE = 'CMS - Tablero'; $PAGE_CSS = true; $GLOBAL = true; $BOOTSTRAP = true; $JQUERY = true; $INCL = array('myconnection.php'); include "../include/essentials.php"; $conex = new myconnection('cmsuser', 'pass', 'cms'); if ($conex->conx_err) { $msg = 'Hubo un error a la hora de realizar la conexion con la Base de Datos'; } else { $conex->execute('select * from post'); if ($conex->q_err) { $msg = 'No se pudo cargar la informacion de la Base de Datos'; } else { $table = $conex->getTable(); } $conex->close(); } unset($conex); ?> <link rel="stylesheet" type="text/css" href="<?php Root('css/dashboard.css'); ?> ">
<?php session_start(); $TITLE = 'CMS - Crear usuario'; $PAGE_CSS = true; $GLOBAL = true; $BOOTSTRAP = true; $JQUERY = true; $INCL = array('myconnection.php'); include "../include/essentials.php"; if (isset($_POST['usuario'])) { $conex = new myconnection("cmsuser", "pass", "cms"); if ($conex->conx_err) { $msg = "error al conectar a la base de datos"; } else { $conex->execute("call CreateUsers('" . $_POST['usuario'] . "," . $_POST['clave'] . "," . $_POST['email'] . "')"); } } /*if (isset($_POST)) { echo "debe llenar los campos"; } elseif ($_POST['clave']==$_POST['conclave']) { # code... $conex = new myconnection("cmsuser","pass","cms"); if ($conex->conx_err) $msg="error al conectar a la base de datos"; else{ $conex->execute("call CreateUsers('" . $_POST['usuario'] . "," . $_POST['clave'] . "," . $_POST['email'] . "')"); } }*/
break; case 'editor': $query .= "account.user like '%{$_GET['srch']}%' order by post.post_date asc"; break; case 'categoria': $query .= "post.category like '%{$_GET['srch']}%' order by post.post_date asc"; break; case 'fecha': $query .= "post.post_date like '%{$_GET['srch']}%' order by post.post_date asc"; break; } } else { $query = "select post.*,account.user from post inner join account " . "on account.id = post.id_acc order by post_date asc"; } #Cargar los posts $conex->execute($query); if ($conex->q_err) { //$msg = $conex->q_err; $msg = 'No se pudo cargar la informacion de la Base de Datos.'; } } ?> <link rel="stylesheet" href="css/indexRoot.css"> <script type="text/javascript" src="<?php Root('js/scriptMain.js'); ?> "></script> <script type="text/javascript" src="js/indexRootScript.js"></script>
$TITLE = 'CMS - Login'; $PAGE_CSS = true; $GLOBAL = true; $BOOTSTRAP = true; $JQUERY = true; $INCL = array('myconnection.php'); include "../include/essentials.php"; //Verificar si se envio una solicitud de inicio de sesion if (isset($_POST['usuario']) && isset($_POST['clave'])) { $_POST['usuario'] = strtolower($_POST['usuario']); $usr = strtolower(trim($_POST['usuario'])); $conex = new myconnection('cmsuser', 'pass', 'cms'); if ($conex->conx_err) { $msg = 'Hubo un error a la hora de realizar la conexion con la Base de Datos.'; } else { $conex->execute("call Autenticate('{$usr}','{$_POST['clave']}')"); if ($conex->q_err) { $msg = 'No se pudo cargar la informacion de la Base de Datos.'; } else { $resp = $conex->getValue(); if ($resp == -1) { $msg = 'Usuario/clave incorrecta'; } else { $_SESSION['usr'] = $usr; $_SESSION['id'] = $resp; $_SESSION['name'] = ucfirst($user); header('Location: dashboard.php'); } } } $conex->close();