严智鑫
2025-03-26 47f9d4a231a116f528f9d18d738420dba7f753bd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<%@ 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>&nbsp;&nbsp;&nbsp;&nbsp;欢迎&nbsp;&nbsp;&nbsp;<label style='color:#5CADFE;'>"+xingming+"</label>&nbsp;&nbsp;使用北玻MES系统!</span><span id='spanTime' style=''color: red'>距离自动离开本系统还有"+dengji+"分钟</span>");
         }
         
         else if("en".equals(cn)){
             
             out.println("<span>&nbsp;&nbsp;&nbsp;&nbsp;welcome&nbsp;&nbsp;&nbsp;<label style='color:red;#5CADFE'>"+xingming+"</label>&nbsp;&nbsp;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>