Commit 45cff5a4 by Percy Quispe

[EDIT]

parent dddd3ba6
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package demojsoncrud.config;
/**
*
* @author Percy Oliver Quispe Huarcaya
* Esta clase esta encargada de definir las URLs
* con las peticiones.
*/
public final class PathRequest {
/*URLS REST*/
// private static final String BASE="http://172.16.2.53:8080/security-rest/api/"; //base path;
// public static final String LOG_OUT = BASE+"user/logout";
// public static final String ENVIAR_NUEVO_TOKEN = BASE+"proyecto/enviarNuevoToken";
// public static final String VERIFICAR_LOGIN = BASE+"user/verificarLogin";
/*URLS REST PRODUCCION*/
private static final String BASE="http://app8.sacooliveros.edu.pe:8080/security-rest/api/"; //base path;
public static final String LOG_OUT = BASE+"user/logout";
public static final String ENVIAR_NUEVO_TOKEN = BASE+"proyecto/enviarNuevoToken";
public static final String VERIFICAR_LOGIN = BASE+"user/verificarLogin";
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package demojsoncrud.servlets;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
*
* @author Percy Oliver Quispe Huarcaya
*/
public class AddSession extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String codigo = request.getParameter("codigoUsuario");
String menu = request.getParameter("menu");
HttpSession session = request.getSession();
session.setAttribute("codigo", codigo);
session.setAttribute("menu", menu);
session.setMaxInactiveInterval(120*60); //Tiempo en segundos
System.out.println("-----------------------------");
System.out.println("codigo : : "+codigo);
System.out.println("menu : : "+menu);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package demojsoncrud.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author Percy Oliver Quispe Huarcaya
* Este servlet está encargado de interceptar la petición de redirección
* El objetivo de este servlet es comprar sí tiene una session vigente,
* de tener una session
*/
public class InterceptarRedireccionServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if(request.getSession().getAttribute("codigo")!=null){
String token = request.getParameter("t");
String page = request.getParameter("p");
response.sendRedirect(page+"?t="+token);
}else{
request.getRequestDispatcher("/vistas/index.jsp").forward(request, response);
}
}
}
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
package demojsoncrud.servlets; package demojsoncrud.servlets;
import demojsoncrud.config.PathRequest;
import demojsoncrud.utilities.PostRequest; import demojsoncrud.utilities.PostRequest;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
...@@ -22,19 +23,15 @@ public class LogOut extends HttpServlet { ...@@ -22,19 +23,15 @@ public class LogOut extends HttpServlet {
@Override @Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
final String LOG_OUT = "http://172.16.2.53:8080/security-rest/api/user/logout"; //Cambiar por la URL del servidor de produccion
String auth = request.getHeader("Cookie"); String auth = request.getHeader("Cookie");
if (auth.contains("Bearer")) { if (auth.contains("Bearer")) {
int indiceBearer = 0; int indiceBearer = 0;
int indiceToken = 0; int indiceToken = 0;
Cookie cookieAuth = new Cookie("Authorization", ""); Cookie cookieAuth=null;
Cookie cookieMenu = new Cookie("menu", ""); Cookie cookieMenu=null;
cookieAuth.setMaxAge(0); PostRequest postRequest = new PostRequest(PathRequest.LOG_OUT);
cookieMenu.setMaxAge(0);
response.addCookie(cookieAuth);
response.addCookie(cookieMenu);
PostRequest postRequest = new PostRequest(LOG_OUT);
String respuesta = ""; String respuesta = "";
String[] parts = auth.split(";"); String[] parts = auth.split(";");
for (int i = 0; i < parts.length - 1; i++) { for (int i = 0; i < parts.length - 1; i++) {
...@@ -57,6 +54,13 @@ public class LogOut extends HttpServlet { ...@@ -57,6 +54,13 @@ public class LogOut extends HttpServlet {
} }
auth = "Bearer " + parts[indiceToken]; auth = "Bearer " + parts[indiceToken];
respuesta = postRequest.getRespueta(auth.replaceAll("\"", "")); respuesta = postRequest.getRespueta(auth.replaceAll("\"", ""));
cookieAuth = new Cookie("Authorization", "");
cookieMenu = new Cookie("menu", "");
cookieAuth.setMaxAge(0);
cookieMenu.setMaxAge(0);
response.addCookie(cookieAuth);
response.addCookie(cookieMenu);
request.getSession().removeAttribute("codigo");//
request.getRequestDispatcher("/vistas/login.jsp").forward(request, response); request.getRequestDispatcher("/vistas/login.jsp").forward(request, response);
} else { } else {
request.getRequestDispatcher("/vistas/login.jsp").forward(request, response); request.getRequestDispatcher("/vistas/login.jsp").forward(request, response);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*/ */
package demojsoncrud.servlets; package demojsoncrud.servlets;
import demojsoncrud.config.PathRequest;
import demojsoncrud.utilities.PostRequest; import demojsoncrud.utilities.PostRequest;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
...@@ -13,76 +14,49 @@ import javax.servlet.http.Cookie; ...@@ -13,76 +14,49 @@ import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* *
* @author sistem08user * @author Percy Oliver Quispe Huarcaya
*/ */
public class RedireccionarServlet extends HttpServlet { public class RedireccionarServlet extends HttpServlet {
@Override @Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
final String URL = "http://172.16.2.53:8080/security-rest/api/proyecto/enviarNuevoToken";
String auth = request.getParameter("t"); String auth = request.getParameter("t");
if (auth.contains("Bearer ")) { if (auth.contains("Bearer ")) {
// int indiceBearer = 0; PostRequest sendPost = new PostRequest(PathRequest.ENVIAR_NUEVO_TOKEN);
// String[] parts = auth.split(";");
// HttpSession session = request.getSession();
// for (int i = 0; i < parts.length - 1; i++) {
// if (parts[i].contains("Bearer")) {
// indiceBearer = i;
// break;
// }
// }
// String authorization = parts[indiceBearer];
// parts = authorization.split("%20");
// auth = "Bearer " + parts[1];
PostRequest sendPost = new PostRequest(URL);
String respuesta = sendPost.getRespueta(auth);//Crearia una sesion con el codigo usuario String respuesta = sendPost.getRespueta(auth);//Crearia una sesion con el codigo usuario
JSONObject obj = new JSONObject(respuesta); JSONObject getRespuesta = new JSONObject(respuesta);
JSONObject menu = new JSONObject(obj.get("menu")); if(getRespuesta.getBoolean("status")){
Cookie cookieAuth = new Cookie("Authorization", "Bearer "+obj.getString("token")); JSONObject obj = new JSONObject(respuesta);
Cookie cookieMenu =new Cookie("menu", menu.toString()); JSONObject menu = new JSONObject(obj.get("menu").toString());
System.out.println("Menu de la cookie ;: "+menu.toString());
cookieAuth.setMaxAge(36000);//10horas Cookie cookieAuth = new Cookie("Authorization", "Bearer "+obj.getString("token"));
cookieMenu.setMaxAge(36000);//10horas System.out.println("Menu de la cookie ;: "+menu.toString());
response.addCookie(cookieAuth);
response.addCookie(cookieMenu);
request.getRequestDispatcher("/vistas/main.jsp").forward(request, response);
} else {
Cookie cookieAuth = new Cookie("Authorization", "");
Cookie cookieMenu = new Cookie("menu", "");
cookieAuth.setMaxAge(0);
cookieMenu.setMaxAge(0);
response.addCookie(cookieAuth);
response.addCookie(cookieMenu);
request.getRequestDispatcher("/vistas/index.jsp").forward(request, response);
}
}
private void listarPersona(HttpServletRequest request, HttpServletResponse response) throws ServletException { cookieAuth.setMaxAge(36000);//10horas
// response.setContentType("application/json"); response.addCookie(cookieAuth);
// PrintWriter pw = null;
// JSONObject salida = new JSONObject(); System.out.println("Redireccionar Servlet : Codigo Usuario ::: "+obj.getString("codigoUsuario"));
// try { session.setAttribute("codigo", obj.getString("codigoUsuario"));
// pw = response.getWriter(); session.setAttribute("menu", menu.toString());
// String authorization =request.getHeader("Authorization"); session.setMaxInactiveInterval(120*60); //Tiempo en segundos
// if(authorization!=null && authorization.contains("Bearer ")){ request.getRequestDispatcher("/vistas/main.jsp").forward(request, response);
// }
// PostRequest sendPost = new PostRequest(URL); }
// String respuesta = sendPost.getRespueta(authorization); Cookie cookieAuth = new Cookie("Authorization", "");
// JSONObject obj = new JSONObject(respuesta); cookieAuth.setMaxAge(0);
// salida=obj; response.addCookie(cookieAuth);
// }else{ request.getRequestDispatcher("/vistas/index.jsp").forward(request, response);
// salida.put("status", false);
// salida.put("message", "Credenciales incorrectas.");
// }
// } catch (Exception e) {
// salida.put("status", false);
// salida.put("message", e.getMessage());
// }
// pw.print(salida);
} }
} }
...@@ -19,6 +19,14 @@ ...@@ -19,6 +19,14 @@
<servlet-name>RedireccionarServlet</servlet-name> <servlet-name>RedireccionarServlet</servlet-name>
<servlet-class>demojsoncrud.servlets.RedireccionarServlet</servlet-class> <servlet-class>demojsoncrud.servlets.RedireccionarServlet</servlet-class>
</servlet> </servlet>
<servlet>
<servlet-name>AddSession</servlet-name>
<servlet-class>demojsoncrud.servlets.AddSession</servlet-class>
</servlet>
<servlet>
<servlet-name>InterceptarRedireccionServlet</servlet-name>
<servlet-class>demojsoncrud.servlets.InterceptarRedireccionServlet</servlet-class>
</servlet>
<servlet-mapping> <servlet-mapping>
<servlet-name>PersonaServlet</servlet-name> <servlet-name>PersonaServlet</servlet-name>
<url-pattern>/PersonaServlet</url-pattern> <url-pattern>/PersonaServlet</url-pattern>
...@@ -35,6 +43,14 @@ ...@@ -35,6 +43,14 @@
<servlet-name>RedireccionarServlet</servlet-name> <servlet-name>RedireccionarServlet</servlet-name>
<url-pattern>/vistas/RedireccionarServlet</url-pattern> <url-pattern>/vistas/RedireccionarServlet</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet-mapping>
<servlet-name>AddSession</servlet-name>
<url-pattern>/addsession</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>InterceptarRedireccionServlet</servlet-name>
<url-pattern>/vistas/interceptar</url-pattern>
</servlet-mapping>
<session-config> <session-config>
<session-timeout> <session-timeout>
30 30
......
// reusable ajax promise // reusable ajax promise
const ajaxRequest = obj => { const ajaxRequest = obj => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
$.ajax({ $.ajax({
url: obj.url, url: obj.url,
type: obj.type, type: obj.type,
headers: obj.headers, headers: obj.headers,
data: JSON.stringify(obj.body), data: JSON.stringify(obj.body),
beforeSend: (xhr, settings) => { beforeSend: (xhr, settings) => {
}, success: (response, textStatus, jqXHR) => { }, success: (response, textStatus, jqXHR) => {
resolve(response) resolve(response)
}, error: (jqXHR, textStatus, errorThrown) => { }, error: (jqXHR, textStatus, errorThrown) => {
reject({ reject({
status: textStatus, status: textStatus,
message: `Error making request`, message: `Error making request`,
request: obj request: obj
})
}
}) })
}
}) })
})
} }
/*Envio de datos al servicio REST*/ /*Envio de datos al servicio REST*/
// http request // http request
const httpRequest = { const httpRequest = {
login(params) { login(params) {
return ajaxRequest({ return ajaxRequest({
url: 'http://172.16.2.53:8080/security-rest/api/user/login', // url: 'http://172.16.2.53:8080/security-rest/api/user/login',
type: 'POST', url: 'http://app8.sacooliveros.edu.pe:8080/security-rest/api/user/login',
headers: { type: 'POST',
"Content-type": 'application/json', headers: {
"Accept": 'application/json' "Content-type": 'application/json',
}, "Accept": 'application/json'
body: params },
}) body: params
}, })
verify() { },
return ajaxRequest({ verify() {
url: 'http://172.16.2.53:8080/security-rest/api/user/verificarLogin', return ajaxRequest({
type: 'POST', url: 'http://172.16.2.53:8080/security-rest/api/user/verificarLogin',
headers: { type: 'POST',
"Content-type": 'application/json', headers: {
"Accept": 'application/json', "Content-type": 'application/json',
"Accept": 'application/json',
// "Authorization": window.localStorage.getItem('Authorization') // "Authorization": window.localStorage.getItem('Authorization')
"Authorization": Cookies.get('Authorization') "Authorization": Cookies.get('Authorization')
} }
}) })
} },
// , addSession(params) {
// getNewToken() { return new Promise((resolve, reject) => {
// return ajaxRequest({ $.ajax({
// url: '../RedireccionarServlet', url: 'http://172.16.2.53:8080/proyecto-estandar/addsession',
// type: 'POST', type: 'POST',
// headers: { data: params,
// "Authorization":"Bearer "+getToken() beforeSend: (xhr, settings) => {
// } }, success: (response, textStatus, jqXHR) => {
// }) resolve(response)
// } }, error: (jqXHR, textStatus, errorThrown) => {
reject({
status: textStatus,
message: `Error making request ${jqXHR}`
})
}
})
})
}
} }
// domevents // domevents
const DOMEvents = { const DOMEvents = {
init() { init() {
this.signIn() this.signIn()
this.verify() this.verify()
}, },
signIn() { signIn() {
document.querySelector('#signIn').addEventListener('click', (e) => { document.querySelector('#signIn').addEventListener('click', (e) => {
let params = { let params = {
usuario: document.querySelector('#usuario').value.trim(), usuario: document.querySelector('#usuario').value.trim(),
pass: document.querySelector('#pass').value, pass: document.querySelector('#pass').value,
codigoProyecto: "2", // codigoProyecto: "2",
path: `${location.origin}/${location.pathname.split('/')[1]}/` codigoProyecto: "5"
} }
httpRequest.login(params)
.then(data => {
if (data.status) {
delete data["status"]
// window.localStorage.setItem('Authorization', 'Bearer ' + data.token)
// window.localStorage.setItem('menu', JSON.stringify(data.menu))
Cookies.set('Authorization', `Bearer ${data.token}`, {expiry: 36000000})
console.log("mnenu"+data.menu)
localStorage.setItem("menu",JSON.stringify(data.menu))
window.location.href = 'main.jsp'
} else { httpRequest.login(params)
alert('No tienes autorización') .then(data => {
} if (data.status) {
console.log(data) delete data["status"]
Cookies.set('Authorization', `Bearer ${data.token}`, {expiry: 36000000})
console.log("mnenu" + data.menu)
// localStorage.setItem("menu", JSON.stringify(data.menu))
return data;
} else {
return alert('No tienes autorización');
}
console.log(data)
}).then(data => {
if (data !== undefined) {
debugger
let body = {
codigoUsuario: data.codigoUsuario,
menu: JSON.stringify(data.menu)
}
httpRequest.addSession(body)
.then(() => {
window.location.href = 'main.jsp'
})
.catch(err => console.log(err))
}
console.log("data :::::: " + data);
})
.catch(err => console.log(err))
}) })
.catch(err => console.log(err)) },
}) verify() {
}, document.querySelector('#verify').addEventListener('click', (e) => {
verify() { httpRequest.verify()
document.querySelector('#verify').addEventListener('click', (e) => { .then(data => console.log(data))
httpRequest.verify() .catch(err => console.log(err))
.then(data => console.log(data)) })
.catch(err => console.log(err)) }
})
}
}
let getToken=()=>{
let authorization;
let auth = window.location.search;
if(auth!==null && auth.includes('%20')){
authorization =auth.split('%20');
}else{
authorization[1] ="";
}
return authorization[1];
} }
//let obtenerToken=()=>{
// debugger
// let token = getToken();
// if(token!==null && token!==""){
// httpRequest.getNewToken()
// .then(data => {
// if (data.status) {
// delete data["status"]
// Cookies.set('Authorization', `Bearer ${data.token}`, {expiry: 36000000})
// Cookies.set('menu', `${JSON.stringify(data.menu)}`, {expiry: 36000000})
// console.log("MENU main.js"+data.menu);
// window.location.href = 'main.jsp';
//// window.history.replaceState( {} , '', 'main.jsp' );
// } else {
// alert('No tienes autorización')
// }
// console.log(data)
// })
// // .then(()=>{
// // promiseSqrt();
// // })
// .catch(err => console.log(err))
// }
//
//}
DOMEvents.init() DOMEvents.init()
\ No newline at end of file
...@@ -46,7 +46,7 @@ let obtenerToken=()=>{ ...@@ -46,7 +46,7 @@ let obtenerToken=()=>{
// }) // })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
window.location.href = "index.jsp"; // window.location.href = "index.jsp";
}) })
} }
...@@ -84,4 +84,4 @@ let obtenerToken=()=>{ ...@@ -84,4 +84,4 @@ let obtenerToken=()=>{
// //
//getNewToken(); //getNewToken();
obtenerToken(); //obtenerToken();
\ No newline at end of file \ No newline at end of file
...@@ -35,7 +35,7 @@ let setProyecto = () => { ...@@ -35,7 +35,7 @@ let setProyecto = () => {
urls += proyectos[i].url+";"; urls += proyectos[i].url+";";
// let url = proyectos[i].url;//produccion // let url = proyectos[i].url;//produccion
let url = 'http://172.16.2.53:8080/proyecto-estandar/';//Pruebas let url = 'http://172.16.2.53:8080/proyecto-estandar/';//Pruebas
html+='<li><a href="'+url+'vistas/RedireccionarServlet?t='+auth.replace("\"","")+'" class="redirect" class="deutsch" ><img src="assets/images/flags/de.png" alt=""> ' html+='<li><a target="_blank" href="../vistas/interceptar?p='+url+'vistas/RedireccionarServlet&t='+auth.replace("\"","")+'" class="redirect" class="deutsch" ><img src="assets/images/flags/de.png" alt=""> '
+ '<i class="glyphicon glyphicon-arrow-right"></i>'+proyectos[i].nombre+'</a></li>'; + '<i class="glyphicon glyphicon-arrow-right"></i>'+proyectos[i].nombre+'</a></li>';
} }
/*Pruebas*/ /*Pruebas*/
...@@ -45,7 +45,7 @@ let setProyecto = () => { ...@@ -45,7 +45,7 @@ let setProyecto = () => {
urls +=url3; urls +=url3;
let url4 = 'http://172.16.2.53:8080/aplicaciones/';//Pruebas let url4 = 'http://172.16.2.53:8080/aplicaciones/';//Pruebas
Cookies.set("urls",urls,{expiry: 36000000}); Cookies.set("urls",urls,{expiry: 36000000});
html+='<li><a href="'+url4+'vistas/RedireccionarServlet?t='+auth.replace("\"","")+'" class="redirect" class="deutsch" ><img src="assets/images/flags/de.png" alt=""> ' html+='<li><a target="_blank" href="../vistas/interceptar?p='+url4+'vistas/RedireccionarServlet&t='+auth.replace("\"","")+'" class="redirect" class="deutsch" ><img src="assets/images/flags/de.png" alt=""> '
+ '<i class="glyphicon glyphicon-arrow-right"></i>Test</a></li>'; + '<i class="glyphicon glyphicon-arrow-right"></i>Test</a></li>';
/*Pruebas*/ /*Pruebas*/
document.getElementById("proyectos").innerHTML = html; document.getElementById("proyectos").innerHTML = html;
......
...@@ -57,8 +57,10 @@ let setMenu = () => { ...@@ -57,8 +57,10 @@ let setMenu = () => {
let position = getUrl(location.pathname, "/"); let position = getUrl(location.pathname, "/");
let path = location.pathname.substring(position + 1);//obtiene el nombre de la vista jsp para activar la clase .active let path = location.pathname.substring(position + 1);//obtiene el nombre de la vista jsp para activar la clase .active
let menu = document.getElementById("MENU"); let menu = document.getElementById("MENU");
let contenido = JSON.parse(JSON.parse(localStorage.getItem("menu"))); // let contenido = JSON.parse(localStorage.getItem("menu"));
debugger;
let contenido = sidebar;
// console.log("sidebar "+JSON.stringify(sidebar));
let html = ""; let html = "";
let active = ""; let active = "";
console.log(contenido) console.log(contenido)
......
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css-->
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<!-- content -->
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-flat border-top-xlg border-top-primary">
<div class="panel-heading">
<h6 class="panel-title text-semibold"><i class="icon-cog3 position-left"></i> Consulta de fichas</h6>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label display-block">Ingresar criterio de búsqueda: </label>
<div class="input-group input-group-xlg">
<span class="input-group-addon"><i class="icon-search4"></i></span>
<input id="txt-busqueda" type="text" class="form-control" placeholder="Ingresar criterio">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<button id="btn_buscar_criterio" type="button" class="btn btn-primary"><i class="icon-search4 position-left"></i> Buscar</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-flat border-top-xlg border-top-primary">
<div class="panel-heading">
<h6 class="panel-title text-semibold"><i class=" icon-list3 position-left"></i> Consulta de fichas</h6>
</div>
<div class="table-responsive">
<table class="table table-striped table-sm" id="tbl-persona">
<thead>
<tr>
<th>#</th>
<th>DNI</th>
<th>APELLIDOS Y NOMBRES</th>
<th>EDAD</th>
<th>CORREO ELECTRONICO</th>
<th>ESTADO</th>
<th>ACCIONES</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- / content -->
<%@include file="templates/footer-body.jsp" %>
<!--js plantilla-->
<!--jQueryValidator-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/validation/validate.min.js"></script>
<!--jQueryValidator-->
<!--form-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/inputs/touchspin.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/pages/form_input_groups.js"></script>
<!--form-->
<!--modal-->
<script type="text/javascript" src="../plantilla/assets/js/pages/components_modals.js"></script>
<!--modal-->
<!--sweetalerts-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/notifications/bootbox.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/notifications/sweet_alert.min.js"></script>
<!--sweetalerts-->
<!--datatable-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/tables/datatables/datatables.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<!--datatable-->
<!--js plantilla-->
<!--mi js-->
<script src="../js/lib/validate_inputs.js" type="text/javascript"></script>
<script src="../js/pages/sidebar.js" type="text/javascript"></script>
<!--mi js-->
</body>
</html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css-->
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<!-- content -->
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-flat border-top-xlg border-top-primary">
<div class="panel-heading">
<h6 class="panel-title text-semibold"><i class="icon-cog3 position-left"></i> Consulta de Lotes</h6>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label display-block">Ingresar criterio de búsqueda: </label>
<div class="input-group input-group-xlg">
<span class="input-group-addon"><i class="icon-search4"></i></span>
<input id="txt-busqueda" type="text" class="form-control" placeholder="Ingresar criterio">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<button id="btn_buscar_criterio" type="button" class="btn btn-primary"><i class="icon-search4 position-left"></i> Buscar</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-flat border-top-xlg border-top-primary">
<div class="panel-heading">
<h6 class="panel-title text-semibold"><i class=" icon-list3 position-left"></i> Consulta de Lotes</h6>
</div>
<div class="table-responsive">
<table class="table table-striped table-sm" id="tbl-persona">
<thead>
<tr>
<th>#</th>
<th>DNI</th>
<th>APELLIDOS Y NOMBRES</th>
<th>EDAD</th>
<th>CORREO ELECTRONICO</th>
<th>ESTADO</th>
<th>ACCIONES</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- / content -->
<%@include file="templates/footer-body.jsp" %>
<!--js plantilla-->
<!--jQueryValidator-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/validation/validate.min.js"></script>
<!--jQueryValidator-->
<!--form-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/inputs/touchspin.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/pages/form_input_groups.js"></script>
<!--form-->
<!--modal-->
<script type="text/javascript" src="../plantilla/assets/js/pages/components_modals.js"></script>
<!--modal-->
<!--sweetalerts-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/notifications/bootbox.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/notifications/sweet_alert.min.js"></script>
<!--sweetalerts-->
<!--datatable-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/tables/datatables/datatables.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<!--datatable-->
<!--js plantilla-->
<!--mi js-->
<script src="../js/lib/validate_inputs.js" type="text/javascript"></script>
<script src="../js/pages/sidebar.js" type="text/javascript"></script>
<!--mi js-->
</body>
</html>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</div> </div>
<div class="form-group has-feedback has-feedback-left"> <div class="form-group has-feedback has-feedback-left">
<input type="password" id="pass" class="form-control" placeholder="Contraseña" value="123"> <input type="password" id="pass" class="form-control" placeholder="Contraseña" value="75441247">
<div class="form-control-feedback"> <div class="form-control-feedback">
<i class="icon-lock2 text-muted"></i> <i class="icon-lock2 text-muted"></i>
</div> </div>
...@@ -99,7 +99,13 @@ ...@@ -99,7 +99,13 @@
</div> </div>
<!-- /page container --> <!-- /page container -->
<script>
((window) => {
window.history.replaceState( {} , '', 'index.jsp' );
})(window);
</script>
<!--javascript template--> <!--javascript template-->
<!-- Core JS files --> <!-- Core JS files -->
<script type="text/javascript" src="../plantilla/assets/js/plugins/loaders/pace.min.js"></script> <script type="text/javascript" src="../plantilla/assets/js/plugins/loaders/pace.min.js"></script>
...@@ -117,6 +123,7 @@ ...@@ -117,6 +123,7 @@
<!--javascript template--> <!--javascript template-->
<script src="../js/lib/cookies.js" type="text/javascript"></script> <script src="../js/lib/cookies.js" type="text/javascript"></script>
<script src="../js/pages/index.js" type="text/javascript"></script> <script src="../js/pages/index.js" type="text/javascript"></script>
</body> </body>
</html> </html>
<%-- <%--
Document : index Document : index
Created on : 05-ene-2018, 20:49:32 Created on : 05-may-2018, 12:27:05
Author : Alonso Author : POQH
--%> --%>
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- / content --> <!-- / content -->
<%@include file="templates/footer-body.jsp" %> <%@include file="templates/footer-body.jsp" %>
......
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css-->
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<!-- content -->
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-flat border-top-xlg border-top-primary">
<div class="panel-heading">
<h6 class="panel-title text-semibold"><i class="icon-cog3 position-left"></i> Mantenimiento personal</h6>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="control-label display-block">Ingresar criterio de búsqueda: </label>
<div class="input-group input-group-xlg">
<span class="input-group-addon"><i class="icon-search4"></i></span>
<input id="txt-busqueda" type="text" class="form-control" placeholder="Ingresar criterio">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<button id="btn_buscar_criterio" type="button" class="btn btn-primary"><i class="icon-search4 position-left"></i> Buscar</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-flat border-top-xlg border-top-primary">
<div class="panel-heading">
<h6 class="panel-title text-semibold"><i class=" icon-list3 position-left"></i> Listado personal</h6>
</div>
<div class="table-responsive">
<table class="table table-striped table-sm" id="tbl-persona">
<thead>
<tr>
<th>#</th>
<th>DNI</th>
<th>APELLIDOS Y NOMBRES</th>
<th>EDAD</th>
<th>CORREO ELECTRONICO</th>
<th>ESTADO</th>
<th>ACCIONES</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- / content -->
<%@include file="templates/footer-body.jsp" %>
<!--js plantilla-->
<!--jQueryValidator-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/validation/validate.min.js"></script>
<!--jQueryValidator-->
<!--form-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/inputs/touchspin.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/pages/form_input_groups.js"></script>
<!--form-->
<!--modal-->
<script type="text/javascript" src="../plantilla/assets/js/pages/components_modals.js"></script>
<!--modal-->
<!--sweetalerts-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/notifications/bootbox.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/notifications/sweet_alert.min.js"></script>
<!--sweetalerts-->
<!--datatable-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/tables/datatables/datatables.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<!--datatable-->
<!--js plantilla-->
<!--mi js-->
<script src="../js/lib/validate_inputs.js" type="text/javascript"></script>
<script src="../js/pages/sidebar.js" type="text/javascript"></script>
<!--mi js-->
</body>
</html>
...@@ -14,4 +14,7 @@ ...@@ -14,4 +14,7 @@
<!-- /global stylesheets --> <!-- /global stylesheets -->
<script src="../js/lib/cookies.js" type="text/javascript"></script> <script src="../js/lib/cookies.js" type="text/javascript"></script>
<script src="../js/pages/validate.js" type="text/javascript"></script> <script src="../js/pages/validate.js" type="text/javascript"></script>
<script>
var sidebar = <%=(String)request.getSession().getAttribute("menu")%>
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment