Skip to content

Commit

Permalink
Panel,Header,Menu,Pantalla usuarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew0914 committed Oct 28, 2017
1 parent 060235c commit 00493cc
Show file tree
Hide file tree
Showing 20 changed files with 256 additions and 32 deletions.
14 changes: 13 additions & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@
<html>
<head>
<title>Pagina no encontrada</title>
<link href="https://fonts.googleapis.com/css?family=Bree+Serif|Work+Sans" rel="stylesheet">
</head>
<body>
<h1 style="width: 50%;margin: 5% auto">Error: 404 Página no encontrada</h1>
<style type="text/css">
.cuerpo{
width: 50%;
margin: 5% auto;
font-family: 'Work Sans', sans-serif;
}
</style>
<h1 class="cuerpo">
Lo sentimos
<br>
Error: 404 Página no encontrada :(
</h1>
</body>
</html>
5 changes: 0 additions & 5 deletions class/Categorias.php

This file was deleted.

5 changes: 0 additions & 5 deletions class/Paginas.php

This file was deleted.

5 changes: 0 additions & 5 deletions class/Tiendas.php

This file was deleted.

14 changes: 13 additions & 1 deletion class/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function inicarSesion($correo , $contrasena){
$respuesta['estado'] = 1;
$respuesta['mensaje'] = "Bienvenido " . $resultado['usuario'] . " " . $resultado['apellido'] ;
}else{
//session_destroy();
//si no existe
$respuesta['estado'] = 0;
$respuesta['mensaje'] = "Usuario o contraseña incorrecta ";
Expand All @@ -52,6 +53,15 @@ public function inicarSesion($correo , $contrasena){
return json_encode($respuesta);
}

public function cerrarSesion(){
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
session_destroy();

header("Location: " . '../');
}


}

Expand All @@ -66,7 +76,9 @@ public function inicarSesion($correo , $contrasena){
case 'login':
echo $usuario->inicarSesion($_POST['correo'], $_POST['contrasena']);
break;

case 'logout':
echo $usuario->cerrarSesion();
break;
default:
header("Location: 404.php");
break;
Expand Down
52 changes: 52 additions & 0 deletions css/estilos.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
*{
padding: 0;
margin: 0;
}

html,body,.main-container {
height:100%;
max-width: 100%;
overflow-x: hidden;
}

.card{
box-shadow: 5px 5px 2px #0068b9;
border-radius: 2%;
Expand All @@ -13,10 +24,15 @@
background-color: #0068b9;
}

.colorSecundario{
background-color:rgb(0,147,255);
}

header{
width: 100%;
padding: 2.5%;
text-align: center;
box-shadow: 1px 1px 5px black;
}

.titulos{
Expand All @@ -32,3 +48,39 @@ footer{
padding: 2.5%
}

.menu{
background-color: rgb(0,147,255);
float: none;
display: table-cell;
box-shadow: 1px 1px 5px black;
}
.menu ul{
list-style: none;
width: 100%;
padding: 1.5%;
}
.menu ul li a{
font-weight: bold;
width: 90%;
color: white;
float: left;
margin-bottom: 5%;
padding: 2%;
}

header{
width: 100%;
padding: 1%;
color: white;
}

.body {
display: flex;
height: 100%;
}

.box-container{
float: none;
display: table-cell;
padding: 5%;
}
44 changes: 44 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
if (!isset($_SESSION)) {

session_start();
}

if(!isset($_SESSION['id'] , $_SESSION['usuario'], $_SESSION['correo'])){
echo "SI SESSION";
session_destroy();
header('Location: error');
}
?>
<div class="row">
<div class="col-md-12 colorPrimario">
<header>
<div class="row">
<div class="col-md-3" align="left">
<img src="img/logo-teCheck-home.png">
</div>
<div class="col-md-6">
<h2 class="titulos">Administrador - Comparador de precios</h2>
</div>
<div class="col-md-3">
<div class="row">
<div class="col-md-4" align="right">
<form method="post" action="class/User.php">
<input type="hidden" name="post" id="post" value="logout">
<button type="submit" style="background: none;border:none;cursor: pointer;">
<img src="img/ic_salir.png">
</button>

</form>
</div>
<div class="col-md-8" align="left" class="cuerpo">
<?php echo $_SESSION['usuario'] ."<br>". $_SESSION['correo']; ?>
</div>
</div>

</div>
</div>

</header>
</div>
</div>
13 changes: 12 additions & 1 deletion home.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@
<html>
<head>
<title>Tec-Check Web scraping</title>
<meta charset="UTF-8"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Bree+Serif|Work+Sans" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/estilos.css">
<title>ScrapCT</title>
</head>
<body>
<div class="row">
<?php
include 'header.php';
?>
<div class="row body">

<?php
include 'menu.php';
?>

<div class="col-md-9" class="box-container">

</div>
</div>
</body>
</html>
Binary file added img/ic_amazon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ic_excel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ic_historial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ic_salir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ic_scrapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ic_tienda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ic_user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
$route = new Route();

$route->add('/', 'login.php');
$route->add('/404', '404.php');
$route->add('/home', 'home.php');
$route->add('/error', '404.php');
$route->add('/tiendas', 'home.php');
$route->add('/usuarios', 'usuarios.php');



Expand Down
12 changes: 8 additions & 4 deletions js/usuario.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ function login(){
$("#confirmacion").html("<p>Iniciando sesion</p>");
},
success:function(response){
var contenido = "<p>" + response.mensaje+ "</p>";
$("#confirmacion").html(contenido);

if(response.estado == 1){
//redireccion
var contenido = "<p style='color:blue'><br>" + response.mensaje+ "<br> Iniciando ... </p>";
$("#confirmacion").html(contenido);
setTimeout(function(){
window.location.replace("tiendas");
},2000);
}else{
var contenido = "<p style='color:red'><br>" + response.mensaje+ "*** </p>";
$("#confirmacion").html(contenido);
}
},
error:function(erro) {
Expand Down
6 changes: 3 additions & 3 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<title>ScrapCT</title>
</head>
<body>
<header class="titulos">
<header class="titulos" style="color: black;box-shadow: none;">
<h1>Administrador - Web scraping</h1>
</header>
<br><br>
Expand All @@ -35,9 +34,10 @@
</form>
</div>
</div>
<br>
<footer class="cuerpo">
<img src="img/logo-teCheck-home.png">
<br>
<br><br>
Copyright 2017 | Todos los derechos reservados | Aviso Legal
</footer>
Expand Down
46 changes: 41 additions & 5 deletions menu.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
<div class="col-md-3">
<ul>
<li>Excel Amazon</li>
</ul>
<div class="col-md-3 menu colorSecundario cuerpo">
<nav>
<ul>
<li>
<a href="tiendas">
<img src="img/ic_tienda.png">
Tiendas
</a>
</li>
<li>
<a href="#">
<img src="img/ic_historial.png">
Historial de precios
</a>
</li>
<li>
<a href="#">
<img src="img/ic_amazon.png">
Proceso Amazon
</a>
</li>
<li>
<a href="usuarios">
<img src="img/ic_user.png">
Agregar Usuario
</a>
</li>
<li>
<a href="#">
<img src="img/ic_scrapping.png">
Scraping
</a>
</li>
<li>
<a href="#">
<img src="img/ic_excel.png">
Obtener Excel
</a>
</li>
</ul>
</nav>
</div>
67 changes: 67 additions & 0 deletions usuarios.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title>Tec-Check Web scraping</title>
<meta charset="UTF-8"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Bree+Serif|Work+Sans" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/estilos.css">
<title>Tec-Check</title>
</head>
<body>
<?php
include 'header.php';
?>
<div class="row body">

<?php
include 'menu.php';
?>

<div class="col-md-9 box-container">
<h3>Usuarios<br><br></h3>
<form>
<div class="row">
<div class="col-md-4" align="left">
<label for="nombre">
<b>Nombre de Usuario</b>
<input type="text" id="nombre" name="nombre" class="form-control">
</label>
<br>
<label for="apellido">
<b>Apellido</b>
<input type="text" id="apellido" name="apellido" class="form-control">
</label>
</div>
<div class="col-md-4" align="left">
<label for="correo">
<b>Correo electrónico</b>
<input type="email" id="correo" name="correo" class="form-control">
</label>
<br>
<label for="correo">
<b>Contrase&ntilde;a</b>
<input type="password" id="contrasena" name="contrasena" class="form-control">
</label>
</div>
</div>
<br>
<button class="btn btn-primary" type="button">
Guardar
</button>
</form>
<br>
<table class="table">
<thead>
<tr>
<th>Nombre</th>
<th>Apellido</th>
<th>Correo</th>
<th>&nbsp;</th>
</tr>
</thead>
</table>
</div>
</div>
</body>
</html>

0 comments on commit 00493cc

Please sign in to comment.