specialuserman.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page import="com.runzhixing.constant.Constant"%>
  3. <%@ page import="com.runzhixing.bean.User"%>
  4. <%@ page import="com.runzhixing.bean.Announcement"%>
  5. <%@ page import="java.util.List"%>
  6. <%@ page import="com.runzhixing.packageProcedure.InformationAnnouncementProcedure"%>
  7. <%@ page import="com.runzhixing.filter.MyFilter"%>
  8. <%
  9. User uu = (User) session.getAttribute(Constant.userMark);
  10. String s = uu.getPrivilegeCode();
  11. if (s.length() > 6) {
  12. s = s.substring(0, 6);
  13. }
  14. s = s.replaceAll("(00)*$", "");//// 一直过滤到最高行政地域(删去尾部的 00 )
  15. String path = request.getContextPath();
  16. String basePath = request.getScheme() + "://"
  17. + request.getServerName() + ":" + request.getServerPort()
  18. + path + "/";
  19. String username = (String) session.getAttribute("username");
  20. String place = (String) session.getAttribute("place");
  21. String place1 = place;
  22. if (place != null && !place.trim().equals("")) {
  23. String end = place
  24. .substring(place.length() - 1, place.length());
  25. if (end.equals("市") || end.equals("县"))
  26. place = place.substring(0, place.length() - 1);
  27. //if (place.equals("四川省")) {
  28. // place1 += "市场监督管理局";
  29. //} else {
  30. // place1 += "质量技术监督局";
  31. //}
  32. if(s.equals("64")){
  33. place1 += "市场监督管理厅";
  34. }else{
  35. place1 += "市场监督管理局";
  36. }
  37. }
  38. List<Announcement> list = new InformationAnnouncementProcedure()
  39. .areatedmachinerunningstate1(5000, 1, -1, s, s, null, null,
  40. null, 0);
  41. int id = -1;
  42. String title = "";
  43. String anTime = "";
  44. if (list.size() > 0) {
  45. for (Announcement an : list) {
  46. if (an.getId() > id) {
  47. id = an.getId();
  48. title = an.getTitle();
  49. anTime = an.getPublishTime1();
  50. }
  51. }
  52. }
  53. //查询各部门有效期
  54. List<Announcement> list1 = new ArrayList<Announcement>();
  55. String PrivilegeCode = (String)request.getSession().getAttribute("PrivilegeCode");
  56. if(PrivilegeCode!=null&&!PrivilegeCode.trim().equals("")){
  57. if(PrivilegeCode.length()>=4&&PrivilegeCode.substring(0,4).equals("1502")){//包头市
  58. list1 = new InformationAnnouncementProcedure()
  59. .checkValidity((String)request.getSession().getAttribute("PrivilegeCode"),(String)request.getSession().getAttribute("sOperatorNo"),s,Integer.parseInt((String)session.getAttribute(Constant.moudel)));
  60. }
  61. }
  62. String validity="";
  63. if (list1.size() > 0) {
  64. Announcement an = new Announcement();
  65. an=list1.get(0);
  66. if(an.getL()>0){
  67. validity+="<span style='color: yellow;'>证书快过期!";
  68. }else{
  69. validity+="<span style='color: red;'>证书已过期!";
  70. }
  71. validity+= "<br/>站点编号:"+an.getStationNo()+" <br/>站点名:"+an.getStationName()+" <br/>有效期:"+an.getValidity()+" <br/>联系人:"+an.getManager()+" <br/>电话:"+an.getPhone();
  72. validity+="</span>";
  73. }
  74. if (list1.size() > 1) {
  75. validity+="<br/><a href='CheckValidity' target='_blank'>还有"+(list1.size()-1)+"条过期信息,点击查询&gt;&gt;</a>";
  76. }
  77. %>
  78. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html xmlns="http://www.w3.org/1999/xhtml">
  79. <html xmlns="http://www.w3.org/1999/xhtml">
  80. <head id="Head1">
  81. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  82. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  83. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  84. <title><%=MyFilter.man_prefix %></title>
  85. <link href="css/default.css" rel="stylesheet" type="text/css" />
  86. <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
  87. <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
  88. <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
  89. <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
  90. <script type="text/javascript" src="css/easyui/jquery.easyui.min.js"></script>
  91. <script type="text/javascript" src="js/easyui/XiuCai.index.js"> </script>
  92. <style type="text/css">
  93. .hzb a:HOVER{
  94. color: red;
  95. text-decoration: underline;
  96. }
  97. .hzb a{
  98. color: #f08300;
  99. text-decoration: underline;
  100. }
  101. </style>
  102. <script type="text/javascript">
  103. var info_publish = '<%=MyFilter.info_publish %>';
  104. $(document).ready(function(){
  105. var newAnnTitle = document.getElementById("newAnnTitle").value;
  106. var newAnnID = document.getElementById("newAnnID").value;
  107. var newAnnTIME = document.getElementById("newAnnTIME").value;
  108. if(info_publish=="0"){}else{
  109. if(!newAnnID){
  110. show1("暂时没有公告!");
  111. }else{
  112. if(newAnnID=="-1"){
  113. show1("暂时没有公告!");
  114. }else{
  115. if(!newAnnTitle){
  116. show1("有新公告,标题:"+'<span class="hzb"><a href="Detailbyid?hiddenID='+newAnnID+'" target="_blank">'+无标题+'('+newAnnTIME+')'+'</span></a>');
  117. }else{
  118. show1("有新公告,标题:"+'<span class="hzb"><a href="Detailbyid?hiddenID='+newAnnID+'" target="_blank">'+newAnnTitle+'('+newAnnTIME+')'+'</span></a>');
  119. }
  120. }
  121. }
  122. }
  123. });
  124. var _menus = {
  125. "menus": [
  126. {
  127. "menuid": "56",
  128. "icon": "icon-search",
  129. "menuname": "数据查询",
  130. "menus": [
  131. {
  132. "menuid": "175",
  133. "menuname": "改装数据查询",
  134. "icon": "icon-search",
  135. "url": "jsp/rzx/dataQuery/ModifieddataQuery.jsp"
  136. }]
  137. }]
  138. };
  139. //设置登录窗口
  140. function openlogin() {
  141. $('#l').window({
  142. title: '登陆',
  143. width: 300,
  144. modal: true,
  145. shadow: true,
  146. closed: true,
  147. height: 160,
  148. resizable:false
  149. });
  150. }
  151. function openPwd() {
  152. $('#w').window({
  153. title: '修改密码',
  154. width: 300,
  155. modal: true,
  156. shadow: true,
  157. closed: true,
  158. height: 'auto',
  159. resizable:false
  160. });
  161. }
  162. //关闭修改密码窗口
  163. function closePwd() {
  164. $('#w').window('close');
  165. }
  166. //关闭登录窗口
  167. function closelogin() {
  168. $('#l').window('close');
  169. }
  170. //登陆
  171. function serverLogin() {
  172. var $name = $('#txtName');
  173. var $pass = $('#txtPass');
  174. if ($name.val() == '') {
  175. msgShow('系统提示', '请输入用户名!', 'warning');
  176. return false;
  177. }
  178. if ($pass.val() == '') {
  179. msgShow('系统提示', '请输入密码!', 'warning');
  180. return false;
  181. }
  182. $.post('ajax/ajax_login?name=' + $name.val()+'&pass='+$pass.val(), function(msg) {
  183. msgShow('系统提示', '恭喜,登陆成功!<br>欢迎您:' + msg, 'info');
  184. $name.val('');
  185. $pass.val('');
  186. $('#l').window('close');
  187. })
  188. }
  189. function checkPwd(pwd)
  190. {
  191. var regNumber = /\d+/; //验证0-9的任意数字最少出现1次。
  192. var regString = /[a-zA-Z]+/; //验证大小写26个字母任意字母最少出现1次。
  193. if (regNumber.test(pwd) && regString.test(pwd)) {
  194.     return true;
  195. }else{
  196.     return false;
  197. }
  198. }
  199. //修改密码
  200. function serverAlterpass() {
  201. var $oldpass = $('#txtOldPass').val().replace(/\s+/g,"");;
  202. var $newpass = $('#txtNewPass').val().replace(/\s+/g,"");;
  203. var $rePass = $('#txtRePass').val().replace(/\s+/g,"");;
  204. if ($oldpass == '') {
  205. msgShow('系统提示', '请输入旧密码!', 'warning');
  206. return false;
  207. }
  208. if ($newpass == '') {
  209. msgShow('系统提示', '请输入新密码!', 'warning');
  210. return false;
  211. }else if($newpass.length<8){
  212. msgShow('系统提示', '密码长度不能低于8位!且须包含数字和字母!!!', 'warning');
  213. return false;
  214. }
  215. if($newpass.match(/^.*[A-Z]+.*$/)==null){
  216. alert("密码必须包含数字和大小写字母!!!且长度不能低于8位");
  217. return false;
  218. }
  219. if($newpass.match(/^.*[a-z]+.*$/)==null){
  220. alert("密码必须包含数字和大小写字母!!!且长度不能低于8位");
  221. return false;
  222. }
  223. if($newpass.match(/^.*[0-9]+.*$/)==null){
  224. alert("密码必须包含数字和大小写字母!!!且长度不能低于8位");
  225. return false;
  226. }
  227. if ($rePass == '') {
  228. msgShow('系统提示', '请再一次输入新密码!', 'warning');
  229. return false;
  230. }
  231. if ($newpass != $rePass) {
  232. msgShow('系统提示', '两次密码不一至!请重新输入', 'warning');
  233. return false;
  234. }
  235. $.ajax({
  236. type:"POST",
  237. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  238. data:$('#alterpasswordform').serialize(),
  239. url:"ajax/alterpassword",
  240. success:function (data){
  241. var obj=eval("(" + data + ")");
  242. $.each(obj.rows, function(i,item){
  243. if(item.sresult=="0"){
  244. $('#txtOldPass').val('');
  245. $('#txtNewPass').val('');
  246. $('#txtRePass').val('');
  247. $('#w').window('close');
  248. // msgShow('系统提示', '恭喜,密码修改成功!<br>您的新密码为:' + item.pass, 'info');
  249. show("修改成功您的新密码为:"+item.pass.substring(0,1)+"********");
  250. }else if(item.sresult=="2"){
  251. show("修改错误");
  252. }else if(item.sresult=="3"){
  253. show("用户不存在");
  254. }else if(item.sresult=="4"){
  255. show("旧密码错误");
  256. }
  257. });
  258. }
  259. });
  260. }
  261. function show(message) {
  262. $.messager.show({
  263. title: '提示信息',
  264. msg: message,
  265. timeout: 2000,
  266. showType: 'slide'
  267. });
  268. }
  269. function show1(message) {
  270. $.messager.show({
  271. title: '提示信息',
  272. msg: message,
  273. timeout: 15000,
  274. showType: 'slide'
  275. });
  276. }
  277. $(function() {
  278. openlogin();
  279. openPwd();
  280. $('#login').click(function() {
  281. $('#l').window('open');
  282. });
  283. $('#btnlogin').click(function() {
  284. serverLogin();
  285. })
  286. $('#btnloginCancel').click(function(){closelogin();})
  287. $('#editpass').click(function() {
  288. $('#w').window('open');
  289. });
  290. $('#btnEp').click(function() {
  291. serverAlterpass();
  292. })
  293. $('#btnCancel').click(function(){closePwd();})
  294. $('#loginOut').click(function() {
  295. $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function(r) {
  296. if (r) {
  297. window.location.href = 'jsp/login/loginre.jsp';
  298. }
  299. });
  300. })
  301. });
  302. function sExit(){
  303. $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function(r) {
  304. if (r) {
  305. $.ajax({
  306. type:"POST",
  307. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  308. url:"safeExit",
  309. success:function (data){
  310. window.location.href = 'jsp/login/loginre.jsp';
  311. //IE6
  312. window.event.returnValue = false;
  313. }
  314. });
  315. }
  316. });
  317. }
  318. </script>
  319. </head>
  320. <body class="easyui-layout" style="overflow-y: hidden" fit="true" scroll="no">
  321. <noscript>
  322. <div style=" position:absolute; z-index:100000; height:2046px;top:0px;left:0px; width:100%; background:white; text-align:center;">
  323. <img src="images/noscript.gif" alt='抱歉,请开启脚本支持!' />
  324. </div></noscript>
  325. <div id="loading-mask" style="position:absolute;top:0px; left:0px; width:100%; height:100%; background:#D2E0F2; z-index:20000">
  326. <div id="pageloading" style="position:absolute; top:50%; left:50%; margin:-120px 0px 0px -120px; text-align:center; border:2px solid #8DB2E3; width:200px; height:40px; font-size:14px;padding:10px; font-weight:bold; background:#fff; color:#15428B;">
  327. <img src="images/loading.gif" align="absmiddle" /> 正在加载中,请稍候...</div>
  328. </div>
  329. <div region="north" split="true" border="false" style="overflow: hidden; height: 30px;
  330. background: url(images/rzx/layout-browser-hd-bg12.gif) #817865 repeat-x center 50%;
  331. line-height: 20px;color: #fff; font-family: Verdana, 微软雅黑,黑体">
  332. <span style="float:right; padding-right:20px;" class="head">欢迎您 <%=username%> <a href="#" id="editpass">修改密码</a> <a href="javaScript:void(0);" onclick="sExit();return false;">安全退出</a></span>
  333. <span style="padding-left:10px; font-size: 16px; "><img src="images/rzx/blocks.gif" width="20" height="20" align="absmiddle" /><%=MyFilter.man_prefix %>-<%=place1%></span>
  334. <span style="padding-left:100px; font-size: 12px; ">
  335. <marquee scrollAmount=2 width="780px">
  336. <span style="font-size: 12px;">
  337. 为了确保系统安全,请使用包含数字、字母、大写字符等内容的密码,遇到系统不能正常登录,数据异常等情况,及时与客服联系!
  338. </span>
  339. </marquee>
  340. </span>
  341. </div>
  342. <div region="south" split="true" style="height: 30px; background: #D2E0F2; ">
  343. <div class="footer"> </div>
  344. </div>
  345. <div region="west" split="true" title="导航菜单" style="width:180px;" id="west">
  346. <div id="nav">
  347. <!-- 导航内容 -->
  348. </div>
  349. </div>
  350. <div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden;" >
  351. <div id="tabs" class="easyui-tabs" fit="true" border="false" >
  352. <div title="欢迎使用" style="padding:20px;overflow:hidden; color:#f08300; " >
  353. <center><h1 style="font-size:24px;">* <%=MyFilter.man_prefix %>-<%=place1%></h1></center>
  354. </div>
  355. </div>
  356. </div>
  357. <!--修改密码窗口-->
  358. <div id="w" class="easyui-window" title="修改密码" collapsible="false" minimizable="false"
  359. maximizable="false" icon="icon-save" style="width: 300px; height: auto; padding: 5px;
  360. background: #fafafa;">
  361. <form id="alterpasswordform">
  362. <div fit="true" >
  363. <div region="center" border="false" style="padding: 0px; background: #fff; border: 1px solid #ccc;height: auto;">
  364. <table cellpadding=3>
  365. <tr>
  366. <td>旧密码:</td>
  367. <td><input id="txtOldPass" name="txtOldPass" type="Password" class="txt01" /></td>
  368. </tr>
  369. <tr>
  370. <td>新密码:</td>
  371. <td><input id="txtNewPass" name="txtNewPass" type="Password" class="txt01" /></td>
  372. </tr>
  373. <tr>
  374. <td>确认密码:</td>
  375. <td><input id="txtRePass" type="Password" name="txtRePass" class="txt01" /></td>
  376. </tr>
  377. </table>
  378. </div>
  379. <div region="south" border="false" style="text-align: right; height: 30px; line-height: 30px;">
  380. <a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" >
  381. 确定</a> <a id="btnCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)">取消</a>
  382. </div>
  383. </div>
  384. </form>
  385. </div>
  386. <!--登陆窗口-->
  387. <div id="l" class="easyui-window" title="登陆窗口" collapsible="false" minimizable="false"
  388. maximizable="false" icon="icon-save" style="width: 300px; height: 150px; padding: 15px;
  389. background: #fafafa;">
  390. <div class="easyui-layout" fit="true">
  391. <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
  392. <table cellpadding=3>
  393. <tr>
  394. <td>用户名:</td>
  395. <td><input id="txtName" type="text" class="txt01" /></td>
  396. </tr>
  397. <tr>
  398. <td>密码:</td>
  399. <td><input id="txtPass" type="Password" class="txt01" /></td>
  400. </tr>
  401. </table>
  402. </div>
  403. <div region="south" border="false" style="text-align: right; ">
  404. <a id="btnlogin" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" >
  405. 确定</a> <a id="btnloginCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)">取消</a>
  406. </div>
  407. </div>
  408. </div>
  409. <div id="mm" class="easyui-menu" style="width:150px;">
  410. <div id="tabupdate">刷新</div>
  411. <div class="menu-sep"></div>
  412. <div id="close">关闭</div>
  413. <div id="closeall">全部关闭</div>
  414. <div id="closeother">除此之外全部关闭</div>
  415. <div class="menu-sep"></div>
  416. <div id="closeright">当前页右侧全部关闭</div>
  417. <div id="closeleft">当前页左侧全部关闭</div>
  418. <div class="menu-sep"></div>
  419. <div id="exit">退出</div>
  420. </div>
  421. <input type="hidden" value="<%=title%>" name="newAnnTitle" id="newAnnTitle"/>
  422. <input type="hidden" value="<%=id%>" name="newAnnID" id="newAnnID"/>
  423. <input type="hidden" value="<%=anTime%>" name="newAnnTIME" id="newAnnTIME"/>
  424. <input type="hidden" value="<%=validity%>" name="validity" id="validity"/>
  425. </body>
  426. </html>