ac.jsp

来自「叮当购物系统(ACCESS版): 主要功能: 客户在线购物, 管理员可发送」· JSP 代码 · 共 215 行

JSP
215
字号
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="conn.jsp"%>
<%
if(session.getAttribute("admin_name")==null){
	response.sendRedirect("index.jsp");;}else{%>
	
	
	<html>
<head>
<title>管理员管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../img/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url(images/background.gif);
}
-->
</style>
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>

<body>
<div align="center">
  <center>
<table width="80%" border="1" cellspacing="0" cellpadding="0" bordercolor="#808080" style="border-collapse: collapse">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="9" rowspan="2"></td>
          <td class="12v"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
                          <tr> 
                            <td bgcolor="#808080"> 
                              <div align="center"><font color="#FFFFFF">管理管理员</font></div>
                            </td>
                          </tr>
                          <tr> 
                            <td height="99" valign="top" bgcolor="#FFFFFF"><br>
                              <%
		//sql="select * from ad order by bs ";
				  rs=mdb.executeQuery("select * from admin order by admin_id ");

		%>
                              <table width="80%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
                                <tr> 
                                  <td width="26%" height="16" bgcolor="#FFFFFF">
                                    <div align="center">管理员名称</div>
                                  </td>
                                  <td width="42%" height="16" bgcolor="#FFFFFF">
                                    <div align="center">密     码</div>
                                  </td>
                                  
                                  <td width="23%" bgcolor="#FFFFFF">
                                    <div align="center">操 作</div>
                                  </td>
                                </tr>
          <%if(!rs.next())
		  out.print("还没有数据,请添加!");
		  else{    rs=mdb.executeQuery("select * from admin order by admin_id ");
			//  rs.previous();%>
			  <%! int id;
		      String admin_name,admin_pass;%>
		 <% while(rs.next()){
		  
			   id=rs.getInt("admin_id");
			   admin_name=rs.getString("admin_name");
			   admin_pass=rs.getString("admin_pass");
			  %>
                                <tr> 
                                  <form name="form1" method="post" action="saveac.jsp?action=edit&id=<%= id %>">
                                    <td height="35" bgcolor="#FFFFFF">
                                      <div align="center"> 
                                        <input name="admin_name" type="text" id="admin_name" value="<%= admin_name %>" size="20">
                                      </div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center"> 
                                        <input name="admin_pass" type="text" id="admin_pass" value="<%= admin_pass %>" size="20">
                                      </div>
                                    </td>
                                    
                                    <td bgcolor="#FFFFFF">
                                      <div align="center"> 
                                        <input type="submit" name="Submit" value="修 改">
                                        &nbsp;<a href=saveac.jsp?action=del&id=<%=id%>><font color="#FF0000">删除</font></a> 
                                      </div>
                                    </td>
                                  </form>
                                </tr>
                                <%}
		  }rs.close();
		  %>
		
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
          <td class="12v" background="../img/back_3.gif" width="9" rowspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
  </center>
</div>
<br>
<div align="center">
  <center>
<table width="80%" border="1" cellspacing="0" cellpadding="0" bordercolor="#808080" style="border-collapse: collapse">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="9"  rowspan="2"></td>
          <td class="12v"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
                          <tr> 
                            <td bgcolor="#808080"> 
                              <div align="center"><font color="#FFFFFF">添加管理员</font></div>
                            </td>
                          </tr>
                          <tr>
                            <form name="form2" method="post" action="saveac.jsp?action=add">
                              <td height="98" bgcolor="#FFFFFF"> 
                                <table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                                  <tr> 
                                    <td height="15" bgcolor="#FFFFFF">
                                      <div align="center">管理员名称</div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center">密     码</div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center">确 定 密 码</div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center">操 作</div>
                                    </td>
                                  </tr>
                                  <tr> 
                                    <td height="15" bgcolor="#FFFFFF">
                                      <div align="center"> 
                                        <input name="admin_name" type="text" id="admin_name" size="20">
                                      </div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center"> 
                                        <input name="passwordone" type="password" id="passwordone" size="20">
                                      </div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center">
                                        <input name="passwordtwo" type="password" id="passwordtwo"  size="20">
</div>
                                    </td>
                                    <td bgcolor="#FFFFFF">
                                      <div align="center"> 
                                        <input type="submit" name="Submit2" value="添 加">
                                      </div>
                                    </td>
                                  </tr>
                                </table>
                              </td>
                            </form>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
          <td class="12v" background="../img/back_3.gif" width="9" rowspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

  </center>
</div>

</body>
</html>
	<%}%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?