<%@ LANGUAGE = VBScript.Encode %>
<html>
<head>
<title>栏目管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../STYLE.CSS">
<script language="JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body background="../IMAGES/bbsbg.gif">
<!--#include file="link.asp"-->  <!--#include file="articleCHAR.INC"-->   <br>
<% 
if session("jaxe")<>"ok" then  'a
     Response.Redirect "admin.asp"		
	 response.end
else    'a
      if Request.QueryString("job")="" then  'b                                                                                                                                                                                                                          
           listlanmu
      elseif  Request.QueryString("job")="new" then 'b  
           newlanmu
      elseif  Request.QueryString("job")="edit" and Request.QueryString("classid")<>"" then 'b  
           editlanmu   
      elseif  Request.QueryString("job")="del" and Request.QueryString("classid")<>"" then 'b  
           dellanmu     
       elseif  Request.QueryString("job")="upnew" then 'b  
           upnew
       elseif  Request.QueryString("job")="upedit" and Request.QueryString("classid")<>"" then 'b  
           upedit
  
      end if  'b                                                                                                                                                                                                                                                                                                                                           
end if  'a   
%> 
<%sub listlanmu%>                                                                                               
<!--#include file="conn.asp"-->                                                                                               
<%                                                                                               
SQL="SELECT * FROM lanmu"                                                                                               
Set Rs=conn.Execute(SQL)                                                                                               
If Rs.Eof then%>                                                                                               
<p align="center">没有栏目</p>                                                                                            
  <%else %>                     
  <p align="center"><a href="admin_lanmu.asp?job=new">新栏目</a></p>                      
  <%                                                                                               
  do while not rs.eof                                                                                               
   %>                                                                                               
   <div align="center">栏目ID:<%=RS("id")%> ----- <a href="admin_lanmu.asp?job=edit&classid=<%=rs("id")%>"><%=rs("lanmu")%></a></div><br>                                                                                               
 <% rs.movenext                                                                                                                                                                                                                                                                                                       
 loop                                                                                                 
  rs.close                                                                                             
  end if                                                                                             
end sub%>                                                                                               
                     
                     
<%sub editlanmu%>                      
<form method="post" action="admin_lanmu.asp?job=upedit&classid=<%=Request.QueryString("classid")%>" name="edit">                     
<!--#include file="conn.asp"-->                        
<%sql="select * from lanmu where id="&Request.QueryString("classid")                     
Set Rs=conn.Execute(SQL)                                                                                               
If Rs.Eof then%>                                                                                               
<p align="center">没有栏目ID</p>                                                                                            
  <%else %>                     
                     
  <table width="770" border="0" cellspacing="0" cellpadding="0" align="center">                     
    <tr>                      
      <td>&nbsp;</td>                     
    </tr>                     
    <tr>                      
      <td height="42">                      
        <table width="85%" border="0" cellspacing="0" cellpadding="0" align="center">                     
          <tr>                      
            <td width="12%">                      
              <div align="center">栏目ID</div>                     
            </td>                     
            <td width="29%">                      
              <div align="center">栏目名字</div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">栏目相对URL </div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">栏目LOGO图相对URL</div>                     
            </td>                     
          </tr>                     
          <tr>                      
            <td width="12%">                      
              <div align="center"><%=rs("id")%></div>                     
            </td>                     
            <td width="29%">                      
              <div align="center">                      
                <input type="text" name="lanmu" value="<%=rs("lanmu")%>" size="25" maxlength="90">                     
              </div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">                      
                <input type="text" name="lanmuurl" value="<%=rs("lanmuurl")%>" size="25" maxlength="90">                     
              </div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">                      
                <input type="text" name="lanmupic" value="<%=rs("lanmupic")%>" size="25" maxlength="90">                     
              </div>                     
            </td>                     
          </tr>                     
        </table>                     
      </td>                     
    </tr>                     
    <tr>                      
      <td>                     
        <div align="center">                     
          <input type="submit" name="Subedit" value=" 修   改 ">                     
          　　                      
          <input type="button" name="subdel" value=" 删  除 " onClick="MM_goToURL('parent','admin_lanmu.asp?job=del&classid=<%=rs("id")%>');return document.MM_returnValue">                     
        </div>                     
      </td>                     
    </tr>                     
  </table>                     
</form>                   
                     
<%                   
end if                
rs.close                  
end sub%>                    
<%sub  newlanmu%>                   
<form method="post" action="admin_lanmu.asp?job=upnew">                      
  <table width="770" border="0" cellspacing="0" cellpadding="0" align="center">                     
    <tr>                      
      <td>&nbsp;</td>                     
    </tr>                     
    <tr>                      
      <td height="42">                      
        <table width="85%" border="0" cellspacing="0" cellpadding="0" align="center">                     
          <tr>                      
            <td width="12%">                      
                                 
            </td>                     
            <td width="29%">                      
              <div align="center">栏目名字</div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">栏目相对URL </div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">栏目LOGO图相对URL</div>                     
            </td>                     
          </tr>                     
          <tr>                      
            <td width="12%">                      
              <div align="center"></div>                     
            </td>                     
            <td width="29%">                      
              <div align="center">                      
                <input type="text" name="lanmu" size="25" maxlength="90">                     
              </div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">                      
                <input type="text" name="lanmuurl" size="25" maxlength="90">                     
              </div>                     
            </td>                     
            <td width="24%">                      
              <div align="center">                      
                <input type="text" name="lanmupic" size="25" maxlength="90">                     
              </div>                     
            </td>                     
          </tr>                     
        </table>                     
      </td>                     
    </tr>                     
    <tr>                      
      <td>                     
        <div align="center">                     
          <input type="submit" name="Subedit" value=" 添   加 ">                     
        </div>                     
      </td>                     
    </tr>                     
  </table>                     
</form>                   
<%end sub%>                  
<%sub upnew               
if Request.form("lanmu")="" or Request.form("lanmuurl")="" or Request.form("lanmupic")="" then               
response.write "表单没有填写完整！"               
	response.end               
end if%>                
  <!--#include file="conn.asp"-->                                                
  <%                                                                                                                                     
      set rs=server.createobject("adodb.recordset")                                       
      sql="select * from lanmu where (id is null)"                                                                                                                                                 
rs.open sql,conn,1,3             
rs.addnew                
rs("lanmu")=Request.form("lanmu")               
rs("lanmuurl")=Request.form("lanmuurl")               
rs("lanmupic")=Request.form("lanmupic")               
rs.update              
rs.close               
%>               
 <p align="center">栏目添加成功！</p>               
<%end sub%>              
           
           
<%sub upedit              
if Request.form("lanmu")="" or Request.form("lanmuurl")="" or Request.form("lanmupic")="" then               
response.write "表单没有填写完整！"               
	response.end               
end if%>                
  <!--#include file="conn.asp"-->                                                
  <%                                                                                                                                     
      set rs=server.createobject("adodb.recordset")                                       
      sql="select * from lanmu where id="&Request.QueryString("classid")                                                                                                                                                 
rs.open sql,conn,1,3                
rs("lanmu")=Request.form("lanmu")               
rs("lanmuurl")=Request.form("lanmuurl")               
rs("lanmupic")=Request.form("lanmupic")               
rs.update              
rs.close               
%>          
            
 <!--#include file="conn.asp"-->                                                
  <%                                                                                                                                     
      set rs=server.createobject("adodb.recordset")                                       
      sql="select * from article where lanmuid="&Request.QueryString("classid")                                                                                                                                                 
rs.open sql,conn,1,3          
If not Rs.Eof then                                                                                              
                                                                                            
  do while not rs.eof                
rs("lanmu")=Request.form("lanmu")               
rs("lanmuurl")=Request.form("lanmuurl")               
rs("lanmupic")=Request.form("lanmupic")               
rs.update         
rs.movenext                                                                                                                                                                                                                                                                                                       
 loop           
end if            
rs.close               
%>          
           
 <p align="center">栏目修改成功！</p>               
<%end sub%>          
<%sub dellanmu%>                                   
   <% if Request.QueryString("del")="" then %>                                
   <p align="center"><a href="admin_lanmu.asp?job=del&del=yes&classid=<%=Request.QueryString("classid")%>">确定删除</a></p>                                  
 
<%elseif Request.QueryString("del")="yes" then %> <!--#include file="conn.asp"--> <%                                                                                                                              
                                 
                                                                                                                                          
 set rs=server.createobject("adodb.recordset")                         
       sql="delete from lanmu where ID="&Request.QueryString("classid")                                                                                                                                   
rs.open sql,conn,1,3   
theurl="admin_lanmu.asp"                           
Response.Redirect theurl                             
end if                              
end sub%>  
  
</div>
</body>                                                                                                     
</html>                                                                                                     
