<%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<title>北 玻 MES</title>
|
<link rel="stylesheet" href="../css/shuoming.css">
|
<link rel="shortcut icon" href="../img/3.ico" />
|
</head>
|
<body style='background-color: #D5EAFF;'>
|
<div>
|
<form id='form1' name="form1" method="post">
|
<%@include file="mysqlconnect.jsp"%>
|
<%
|
String xingming=request.getParameter("xingming");
|
String bumen=request.getParameter("bumen");
|
String dengji=request.getParameter("dengji");
|
|
String anquanma=request.getParameter("anquanma");
|
String cn=request.getParameter("yuyan");
|
|
|
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
Connection con=DriverManager.getConnection( urlglass,user,password);
|
|
//通过connection数据库链接对象 创建一个statement对象数据库操作对象
|
Statement stmts=con.createStatement();
|
//执行sql语句
|
String anquan="select * from anquanbiao where anquanma = '"+anquanma+"' and cip='"+request.getLocalAddr()+"' and now()<=xiugaitime and now()>=jianlitime; ";
|
ResultSet rss = stmts.executeQuery(anquan);
|
int coun=0;
|
|
while(rss.next())
|
{
|
coun++;
|
}
|
if(coun!=0){
|
if("cn".equals(cn)){
|
out.println("<img onclick='dataOpen2()' src='../img/2.ico'; style='float:left;width:70px; height: 46px;' />");
|
out.println(" <span> 欢迎 <label style='color:#5CADFE;'>"+xingming+"</label> 使用北玻MES系统!</span><span id='spanTime' style=''color: red'>距离自动离开本系统还有"+dengji+"分钟</span>");
|
}
|
|
else if("en".equals(cn)){
|
|
out.println("<span> welcome <label style='color:red;#5CADFE'>"+xingming+"</label> Use the MES system of North China Glass!</span><span id='spanTime' style=''color: red'>Distance from automatic leave the system and"+dengji+"minute</span>");
|
}
|
|
}
|
else{
|
if("cn".equals(cn)){
|
out.print("<script type='text/javascript'>alert('请先登录后操作!');top.window.location.href='index.jsp';</script>");
|
}else if("en".equals(cn)){
|
out.print("<script type='text/javascript'>alert('Please login before operation');top.window.location.href='index.jsp';</script>");
|
}
|
|
}
|
}
|
|
|
%>
|
|
<%
|
String yuyan1=request.getParameter("yuyan");
|
String yemian="shuoming.jsp";
|
String[] group=new String[6];
|
|
/*
|
//连接数据库
|
String driverClass1 = "com.mysql.cj.jdbc.Driver";
|
String url1="jdbc:mysql://localhost/gglass?serverTimezone=GMT%2B8";
|
String user1 = "root";
|
String password1 = "root"; */
|
|
//装载一个类并且对其进行实例化的操作
|
Class.forName(driverClass);{
|
Connection con1=DriverManager.getConnection( urlglass,user,password);
|
|
//查询
|
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++;
|
}
|
}
|
%>
|
|
<input style='float:right' id='sb1' type='button' onclick='Close()' style="width: 100%; height: 100%; border: none; outline: none;background-color: #5CADFE;" value=退出>
|
<input style='float:right' id='sb' type='button' onclick='shouzhi()' style="width: 100%; height: 100%; border: none; outline: none;background-color: #5CADFE;" value='内部邮件'>
|
<input style='float:right' id='sb' type='button' onclick='shouzhi()' value='通知消息'>
|
<!-- <input style='float:right' id='sb' type='button' onclick='dataOpen()' value='传输数据'> -->
|
<input style='float:right' id='sb' type='button' onclick='dataOpen1()' value='设置'>
|
|
<div id="time" style="float:right;margin: 10px 20px;"></div>
|
|
|
|
|
|
|
</form>
|
</div>
|
</body>
|
<script>
|
//页面加载调用
|
window.onload=function(){
|
//每1秒刷新时间
|
setInterval("NowTime()",100);
|
|
|
var min =<%= dengji%>;
|
//2.声明定时器
|
var timer = null;
|
//3.开启定时器
|
timer = setInterval(show,60000);
|
//4.设置跳转路径
|
var location="index.jsp?"<%-- yhid=<% out.println("yonhuid ?"); %>;>&aqkey=<% out.println("anquankey ?"); %> --%>
|
//开启定时器后要执行的函数
|
function show(){
|
min--;
|
if(min==0){
|
//5.清除定时器
|
clearInterval(timer);
|
//6.跳转exit页面,执行退出
|
parent.parent.parent.parent.location.href = location;
|
window.alert("您已超过此次登录最大时长限制!");
|
}
|
//7.动态显示离自动退出系统的时长
|
document.getElementById('spanTime').innerHTML ="距离自动离开本系统还有" +min+"分钟";
|
/* alert(dengji); */
|
|
}
|
|
};
|
|
<%-- //1.首先声明seconds
|
var min =<% out.println("dengji"); %>;
|
//2.声明定时器
|
var timer = null;
|
//3.开启定时器
|
timer = setInterval(show,60000);
|
//4.设置跳转路径
|
var location=".jsp?"yhid=<% out.println("yonhuid ?"); %>;>&aqkey=<% out.println("anquankey ?"); %>
|
//开启定时器后要执行的函数
|
function show(){
|
min--;
|
if(min==0){
|
//5.清除定时器
|
clearInterval(timer);
|
//6.跳转exit页面,执行退出
|
parent.parent.parent.parent.location.href = location;
|
window.alert("您已超过此次登录最大时长限制!");
|
}
|
//7.动态显示离自动退出系统的时长
|
document.getElementById('spanTime').innerHTML ="距离自动离开本系统还有" +min+"分钟";
|
alert(min);
|
|
} --%>
|
|
|
|
|
|
function NowTime(){
|
//获取年月日
|
var time=new Date();
|
var year=time.getFullYear();
|
var month=time.getMonth()+1;
|
var day=time.getDate();
|
|
//获取时分秒
|
var h=time.getHours();
|
var m=time.getMinutes();
|
var s=time.getSeconds();
|
|
//检查是否小于10
|
h=check(h);
|
m=check(m);
|
s=check(s);
|
document.getElementById("time").innerHTML=year+"年"+month+"月"+day+"日 "+h+":"+m+":"+s+getWeekDate();
|
}
|
//时间数字小于10,则在之前加个“0”补位。
|
function check(i){
|
//方法一,用三元运算符
|
var num;
|
i<10?num="0"+i:num=i;
|
return num;
|
|
}
|
|
|
function Close(){
|
if(!confirm('确认退出!')){
|
return false;
|
}
|
window.opener = null
|
window.open('index.jsp', '_top').close()
|
|
|
}
|
function getWeekDate() {
|
var now = new Date();
|
var day = now.getDay();
|
var weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
|
var week = weeks[day];
|
return week;
|
}
|
|
|
function dataOpen(){
|
window.open('../SD/dingdanguanlis/html/connectorDate.jsp');
|
|
}
|
function dataOpen1(){
|
window.open('./admin/adminSet.jsp?adminid=<%out.print(request.getParameter("adminid"));%>&yuyan=<% out.print(request.getParameter("yuyan")); %>&anquanma=<% out.print(request.getParameter("anquanma")); %>');
|
|
}
|
function dataOpen2(){
|
|
let n='machinelistcontent.jsp?id=machinelistcontent'
|
n=n+'&'+window.parent.location.search.substr(1)
|
localStorage.setItem("newPage",n);
|
window.parent.document.getElementById("main").src = n
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
</html>
|