addok_admin_user.jsp
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- <%@ page contentType="text/html;charset=gb2312"%>
- <html>
- <head>
- <title>翔鹭石化企业(厦门)有限公司_权限分配</title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link rel="stylesheet" href="../include/main.css" type="text/css">
- </head>
- <body bgcolor="#FFFFFF" text="#000000">
- <%@page import="java.sql.*"%>
- <%@include file="../include/db_conn.jsp"%>
- <%@include file="../include/const.jsp"%>
- <%!String admin_dept;%>
- <%!String admin_username;%>
- <%!String admin_password;%>
- <%String admin_column=null;%>
- <%String admin_type="1";%>
- <%
- int intRowCount; //记录总数
- //判断用户名是否填写
- admin_username =request.getParameter("admin_username");
- admin_password =request.getParameter("admin_password");
- admin_dept =request.getParameter("admin_dept");
- admin_column =request.getParameter("column_id");
- admin_column="0,"+admin_column+",0";
- admin_type = "1";
- //判断用户名是否已经有人注册了
- sql="select admin_id from tbl_admin_user where admin_username='"+admin_username+"'";
- sql=getGBString(sql);
- rs=smt.executeQuery(sql);
- rs.next();
- intRowCount = rs.getRow();
- rs.close();
- if(intRowCount<1){
- //注册信息保存到数据库
- 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+"')";
- sql=getGBString(sql);
- //out.println(sql);
- smt.executeUpdate(sql);
- }else{
- out.println("<script language='javascript'>alert('该用户已经存在,请重新分配用户名!');history.back();</script>");
- }
- %>
- <%@include file="../include/header.jsp"%>
- <br>
- <table width="700" border="0" cellspacing="1" cellpadding="1" bgcolor="#f0f0f0" align="center">
- <tr>
- <td>
- <table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
- <tr align="left">
- <td height="28" > <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>
- </tr>
- <tr align="center">
- <td height="120" bgcolor="#ffffff"><b><font color=red>用户新建成功!</font></b><br><br><a href='list_admin_user_new.jsp'>返回</a></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td height="10"></td>
- </tr>
- </table>
- <br>
- <%@include file="../include/bottom.jsp"%>
- </body>
- </html>