addok_admin_user.jsp
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:2k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

JavaScript

  1. <%@ page contentType="text/html;charset=gb2312"%> 
  2. <html>
  3. <head>
  4. <title>翔鹭石化企业(厦门)有限公司_权限分配</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  6. <link rel="stylesheet" href="../include/main.css" type="text/css">
  7. </head>
  8. <body bgcolor="#FFFFFF" text="#000000">
  9. <%@page import="java.sql.*"%>
  10. <%@include file="../include/db_conn.jsp"%>
  11. <%@include file="../include/const.jsp"%>
  12. <%!String admin_dept;%>
  13. <%!String admin_username;%>
  14. <%!String admin_password;%>
  15. <%String admin_column=null;%>
  16. <%String admin_type="1";%>
  17. <%
  18. int intRowCount; //记录总数
  19. //判断用户名是否填写
  20. admin_username   =request.getParameter("admin_username");
  21. admin_password   =request.getParameter("admin_password");
  22. admin_dept   =request.getParameter("admin_dept");
  23. admin_column =request.getParameter("column_id");
  24. admin_column="0,"+admin_column+",0";
  25. admin_type = "1";
  26. //判断用户名是否已经有人注册了
  27. sql="select admin_id from tbl_admin_user where admin_username='"+admin_username+"'";
  28. sql=getGBString(sql);
  29. rs=smt.executeQuery(sql);
  30. rs.next();
  31. intRowCount = rs.getRow();
  32. rs.close();
  33. if(intRowCount<1){
  34. //注册信息保存到数据库
  35. sql="insert into tbl_admin_user(admin_username,admin_password,admin_dept,admin_column,admin_type) values('"+admin_username+"','"+admin_password+"','"+admin_dept+"','"+admin_column+"','"+admin_type+"')";
  36. sql=getGBString(sql);
  37. //out.println(sql);
  38. smt.executeUpdate(sql);
  39. }else{
  40. out.println("<script language='javascript'>alert('该用户已经存在,请重新分配用户名!');history.back();</script>");
  41. }
  42. %>
  43. <%@include file="../include/header.jsp"%>
  44. <br>
  45. <table width="700" border="0" cellspacing="1" cellpadding="1" bgcolor="#f0f0f0" align="center">
  46.   <tr> 
  47.     <td> 
  48.       <table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
  49.         <tr align="left"> 
  50.           <td height="28" >&nbsp;&nbsp;<font face="webdings" color="#666666">8</font><a href="list_admin_user_new.jsp">返回</a> <img src="../images/pixel.gif" width="235" height="1"><span style="FONT-SIZE: 14px"><b><font color="#666666">增加新闻</font></b></span></td>
  51.         </tr>
  52.         <tr align="center"> 
  53.           <td height="120" bgcolor="#ffffff"><b><font color=red>用户新建成功!</font></b><br><br><a href='list_admin_user_new.jsp'>返回</a></td>
  54.         </tr>
  55.       </table>
  56.     </td>
  57.   </tr>
  58.   <tr> 
  59.     <td height="10"></td>
  60.   </tr>
  61. </table>
  62. <br>
  63. <%@include file="../include/bottom.jsp"%>
  64. </body>
  65. </html>