<%@page import="javax.swing.text.html.HTML"%>
|
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
<%
|
request.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
response.setContentType("text/html; charset=utf-8");
|
%>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<html>
|
<head>
|
<link rel="shortcut icon" href="../../img/2.ico" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<title>设置权限</title>
|
|
<style>
|
|
.one1,.one1 input,.one1 button
|
{
|
background-color: #A1CBED;
|
}
|
.double1,.double1 input , .double1 button
|
{
|
background-color: white;
|
}
|
iframe{
|
|
height: 100%;
|
width: 100%;
|
}
|
#i_chanpin{
|
|
z-index: 9999;
|
position:absolute;
|
top:2%;
|
left:2%;
|
cursor:pointer;
|
border-color: darkgray;
|
background-color:white;
|
border-width: 1px;
|
border-style: solid;
|
width: 96%;
|
display: none;
|
height: 92%;
|
|
|
}
|
|
#tiaojian
|
{ z-index: 9999;
|
position:fixed;
|
|
cursor:pointer;
|
border-color: #000000;
|
background-color:white;
|
border-width: 1px;
|
border-style: solid;
|
width: 100px;
|
height: 100px;
|
|
|
border: 1px solid black;
|
|
}
|
body,html{
|
width: 99%;
|
height:98%;
|
}
|
.tb_shuju thead th {
|
|
background-color:#D5EAFF;
|
z-index:9999;
|
position:relative;
|
|
}
|
|
#shuju_a
|
{
|
width: 100%;
|
height: 90%;
|
float: left;
|
margin-top: 20px;
|
overflow-y: auto;
|
}
|
|
#tb_shuju
|
{ width: 100%;
|
|
border-collapse: collapse;
|
margin-top: 0%;
|
|
}
|
#tb_shuju input
|
{
|
border: none;
|
}
|
#tb_shuju button{
|
width: 60%;height: 100%; border-color: white; box-shadow: none;outline:none;
|
}
|
#tb_shuju th
|
{
|
font-size: 15px;
|
}
|
#tb_shuju td
|
{
|
height: 20px;
|
|
white-space:nowrap
|
}
|
|
#tb_0
|
{
|
|
|
width:30%;
|
height: 100%;
|
border-collapse:collapse;
|
|
}
|
#tb_0 tr
|
{
|
height: 20px;
|
|
}
|
#tb_0 td
|
{
|
height: 20px;
|
width: 75px;
|
|
|
}
|
#tb_0 td input
|
{
|
height: 50%;
|
width: 90%;
|
border: 0;
|
outline: none;
|
background-color:#D5EAFF;
|
}
|
|
*{
|
text-align:center;
|
}
|
</style>
|
|
</head>
|
<%@include file="../mysqlconnect.jsp"%>
|
<body style='background-color:#D5EAFF'>
|
|
<%
|
String yuyan1="cn";
|
String yuyan2=request.getParameter("yuyan");
|
if(yuyan2==""||yuyan2==null){
|
|
}else{
|
yuyan1=yuyan2;
|
}
|
String yemian="shezhi.jsp";
|
String[] group=new String[6];
|
//连接数据库
|
|
//装载一个类并且对其进行实例化的操作
|
/* Class.forName(driverClass1);{
|
Connection con1=DriverManager.getConnection( url1,user1,password1);
|
|
CallableStatement cs = con1.prepareCall("{call yuyan(?,?)}");
|
cs.setString(1, yemian);
|
cs.setString(2, yuyan1);
|
ResultSet rs = cs.executeQuery();
|
int i=0;
|
while(rs.next())
|
{
|
group[i]=rs.getString(1);
|
i++;
|
}
|
} */
|
Class.forName(driverClass);{
|
Connection con=DriverManager.getConnection( urlglass,user,password);
|
|
//通过connection数据库链接对象 创建一个statement对象数据库操作对象
|
Statement stmts=con.createStatement();
|
//执行sql语句
|
String anquan="select * from anquanbiao where anquanma = '"+request.getParameter("anquanma")+"' ";
|
ResultSet rss = stmts.executeQuery(anquan);
|
int coun=0;
|
while(rss.next())
|
{
|
coun++;
|
}
|
if(coun==0){
|
|
out.print("<script type='text/javascript'>alert('请先登录后操作');window.parent.location.href='../index.jsp'; </script>");
|
}
|
con.close();
|
}
|
|
%>
|
|
|
|
|
<%
|
String chongzhibianhao=request.getParameter("shangpinbianhao");
|
|
//装载一个类并且对其进行实例化的操作
|
if(chongzhibianhao!=null){
|
Class.forName(driverClass);{
|
Connection con1=DriverManager.getConnection( urlglass,user,password);
|
|
//调用存储过程
|
CallableStatement cs = con1.prepareCall("{call mimachongzhi(?,?)}");
|
|
cs.setString(1,chongzhibianhao);
|
cs.registerOutParameter( 2, java.sql.Types.INTEGER);
|
cs.execute();
|
int fanhui=cs.getInt(2);
|
if(fanhui==5000){
|
out.print("<script type='text/javascript'>alert('重置成功');</script>");
|
|
}else{
|
out.print("<script type='text/javascript'>alert('重置失败');</script>");
|
}
|
con1.close();
|
}
|
}
|
%>
|
|
|
<div id="tb">
|
|
<form action="" method="post" autocomplete="off" >
|
|
<table id="tb_0" border="1">
|
|
|
|
<tr >
|
<td style="width:20px;">用户名:</td>
|
<td ><input id='yhm' style='background-color:#D5EAFF;' type='text' name='yhm' maxlength='255' ></td>
|
|
<td><input style="float: left;width: 100%; height: 100%;outline: 0;border: 0; background-color:#5CADFE;" type="submit" value='查询' /></td>
|
</tr>
|
</table>
|
</form>
|
|
|
</div>
|
|
|
<div id="shuju_a" class='shuju_a' style=" overflow-y: scroll;">
|
|
<table id="tb_shuju" border="1" class='tb_shuju' >
|
<thead>
|
<tr>
|
<th style="width: 15px;">序号</th>
|
<th style="width: 35px;">ID</th>
|
<th style="width: 35px;">工号</th>
|
<th style="width: 50px;">用户名</th>
|
<th style="width: 25px;">重置密码</th>
|
<th style="width: 25px;">姓名</th>
|
<th style="width: 25px;">部门</th>
|
<th style="width: 25px;">班组</th>
|
|
|
|
|
</tr>
|
</thead>
|
|
<%
|
|
String yhm =request.getParameter("yhm");
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
Connection con1=DriverManager.getConnection( urlglass,user,password);
|
|
//调用存储过程
|
CallableStatement cs = con1.prepareCall("{call yonghuchaxun(?,?,?)}");
|
if(yhm==null){
|
cs.setString(1, "");
|
|
}else{
|
cs.setString(1, yhm);
|
}
|
cs.setString(2, request.getParameter("adminid"));
|
cs.setString(3, request.getRemoteAddr());
|
|
//判断订单日期是否为null
|
|
|
ResultSet rs = cs.executeQuery();
|
//循环打印数据
|
int i=1;
|
while(rs.next())
|
{
|
if(i%2!=0){
|
out.println("<tr class='one1' >");
|
}
|
else
|
{
|
out.println("<tr class='double1' >");
|
}
|
out.println("<td style=' border: 1;outline: none;width:15px;text-align:center;' >"+i+"</td>");
|
out.println("<td style='text-align:center;' ><input readOnly='readonly' style='width:35px;border:none; border: 0;outline: none;' type='text' value='"+rs.getString(7)+"'></td>");
|
|
out.println("<td style='text-align:center;'><input readOnly='readonly' type='text' style='width:75px;border:none; border: 0;outline: none;' value='"+rs.getString(6)+"'></td>");
|
out.println("<td style='text-align:center;'><a class='a1' href='shezhiquanxian.jsp?id="+rs.getString(7)+"&anquanma="+request.getParameter("anquanma")+"'>"+rs.getString(1)+"</a></td>");
|
if(i%2!=0){
|
out.print("<td ><button class='add' type='button' onclick='return del()' >重置</button></td>");
|
}
|
else
|
{
|
out.print("<td ><button class='add' onclick='return del()' type='button' >重置</button></td>");
|
}
|
|
/* out.println("<td style='text-align:center;' ><button >重置密码 </button><input readOnly='readonly' type='text' style='width:65px;border:none; border: 0;outline: none;display:none;' value='"+rs.getString(8)+"'></td>"); */
|
out.println("<td style='text-align:center;' ><input readOnly='readonly' type='text' style='width:90%;border:none; border: 0;outline: none;' value='"+rs.getString(2)+"'></td>");
|
|
out.println("<td style='text-align:center;'><a class='a1' href='quanxianfenzu.jsp?adminid="+rs.getString(7)+"&anquanma="+request.getParameter("anquanma")+"'>"+rs.getString(4)+"</a></td>");
|
out.println("<td style='text-align:center;'><input readOnly='readonly' type='text' style='width:90%;border:none; border: 0;outline: none;' value='"+rs.getString(5)+"'></td>");
|
|
|
|
|
out.println("</tr>");
|
|
i++;
|
}
|
|
|
con1.close();
|
}
|
%>
|
|
|
|
</table>
|
|
|
<form id='form_shanchu' action="" method="post">
|
<input style="display:none;" name='shangpinbianhao' type='text'>
|
</form>
|
|
|
|
|
|
</div>
|
|
<div style="margin-left:2cm;">
|
<tfoot > <td ><font color="red">重置密码为123456</font> </td> </tfoot>
|
</div>
|
|
</body>
|
<script src="${ctx}/SD/JS/jquery-1.8.3.min.js" type="text/javascript"></script>
|
<script src="${ctx}/SD/JS/colResizable-1.6.min.js" type="text/javascript"></script>
|
<script src="${ctx}/SD/JS/jquery.table2excel.js" type="text/javascript"></script>
|
<script type="text/javascript">
|
|
$(function(){
|
|
$(".add").click(function()
|
{
|
const r =confirm("确认要重置?");
|
if(r==false){
|
/* window.event.returnValue = false; */
|
return false;
|
}
|
//获取当前行数
|
row_bt=$(this).parents("#tb_shuju").find("tr").index($(this).parents("tr"));
|
|
$('[name="shangpinbianhao"]').val($('#tb_shuju').find("tr").eq(row_bt).find('td').eq(1).children('input').val());
|
$('#form_shanchu').submit();
|
|
|
});
|
|
|
} )
|
|
$(function() {
|
// 表格列自由拖拽
|
/* $(".tb_shuju").colResizable({
|
liveDrag : true,
|
draggingClass : "dragging",
|
resizeMode : 'overflow'
|
}); */
|
// 表头固定
|
$('.shuju_a').on(
|
'scroll',
|
function() {
|
var scrollTop = $(this).scrollTop();
|
$('.tb_shuju').find('thead tr th').css(
|
{
|
'-webkit-transform' : '-webkit-translateY('
|
+ scrollTop + 'px)',
|
'-mox-transform' : '-moz-translateY('
|
+ scrollTop + 'px)',
|
'-ms-transform' : '-o-translateY(' + scrollTop
|
+ 'px)',
|
'-o-transform' : '-ms-translateY(' + scrollTop
|
+ 'px)',
|
transform : 'translateY(' + scrollTop + 'px)'
|
});
|
});
|
});
|
|
|
function close_0()
|
{
|
document.getElementById("i_chanpin").style.display="none";
|
var hangshu=document.getElementById("tb_2").rows.length-1;
|
|
for(var i=1;i<=hangshu;i++)
|
{
|
var shuru=document.getElementById("tb_2").rows[i].cells[6].getElementsByTagName('input')[0];
|
|
if(shuru.value==1)
|
{
|
|
shuru.value=chanpin_name;
|
}
|
}
|
|
}
|
function shuaxin_0()
|
{
|
$('iframe').attr('src',$('iframe').attr('src'));
|
|
}
|
function zhang(e)
|
{
|
$(e).find('button')[0].style.display='block';
|
}
|
|
function bi(e)
|
{
|
$(e).find('button')[0].style.display='none';
|
}
|
|
function chanpin_add(e)
|
{
|
var i_chanpin=document.getElementById("i_chanpin");
|
chanpin_name=$(e).prev("input").val();
|
$(e).prev("input").val("1");
|
|
|
|
i_chanpin.style.display="block";
|
|
|
}
|
|
|
$("body").on('click',function() {
|
$('#metu1').hide();
|
|
});
|
|
|
|
|
var lastTime = new Date().getTime();
|
var currentTime = new Date().getTime();
|
var timeOut = 120 * 60 * 1000; //设置超时时间: 120分
|
|
$(function(){
|
/* 鼠标移动事件 */
|
$(document).mouseover(function(){
|
lastTime = new Date().getTime(); //更新操作时间
|
|
});
|
});
|
|
function toLoginPage(){
|
currentTime = new Date().getTime(); //更新当前时间
|
if(currentTime - lastTime > timeOut){ //判断是否超时
|
window.close();//关闭当前页
|
window.parent.location.replace("../../../login/index.jsp");//刷新父级页面;
|
}
|
}
|
|
/* 定时器
|
* 间隔1秒检测是否长时间未操作页面
|
*/
|
window.setInterval(toLoginPage, 1000);
|
|
|
|
|
</script>
|
</html>
|