严智鑫
2025-03-14 c41e1c8b82b8f4c7b149e0576c9a37bc5b2dbb85
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
<%@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>