<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "tuzh_pri.asp"-->
<!--#include file="../setup.asp"-->
<!--#include file ="../connadmin.asp"-->
<%
act=request.QueryString("act")
select case act
    case "add"  call add()
    case "rename"  call rename()
	case "del"  call dele()
end select

'***********************************************************
sub add()
newname_lan=request.form("newname_lan")
set rs1=server.createobject("ADODB.recordset")
sql="select * from com_kind"
rs1.open sql,conn,3,3
			rs1.addnew
			rs1("yiname") = newname_lan
			rs1("yiorder") = rs1("yiid")
			rs1.update
rs1.close
response.Redirect("com_xinxilan.asp")
end sub
'***********************************************************
sub dele()
    deleid=cint(request("do_id"))
	sql="delete from [com_kind] where yiid="&deleid&""
	conn.execute sql
	response.Redirect("com_xinxilan.asp")
end sub
'***********************************************************
sub rename()
    doid=cint(request.form("lmlist"))
    newname=request.form("txt_newname")
	if newname<>"" and isnumeric(doid)=true then
		sql="update [com_kind] set yiname='"&newname&"' where yiid="&doid&""
		conn.execute sql
		response.Redirect("com_xinxilan.asp")
	end if
end sub
'***********************************************************
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../img/css.css">
<title><%=site_name%></title>
</head>

<body>

<script language="JavaScript">
function SureDel(id)
{
    if ( confirm("警告!你是否真的要删除？"))
        {
            window.location.href = "?act=del&do_id=" + id
        }
}
</script>
<table class="border" width="95%" border="0" align="center" cellpadding="1" cellspacing="0">
  <tr> 
    <td height="49" align="center" valign="top" class="bg_low"> <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center" valign="middle" class="bgtop"><font class="bgtop_title">固定信息类别管理</font> 
          </td>
        </tr>
      </table>
        <table width="409" border="5" cellpadding="3" cellspacing="0" bordercolor="#ABCEDD">
          <tr>
            <td width="403" align="center"> 
              <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#ABCEDD">
              <tr> 
                <td align="center">《类别名称》</td>
                <td>&nbsp;</td>
              </tr>
              <%if request("erid")="" then
	set rs1=server.createobject("ADODB.recordset")
	sql="select * from com_kind order by yiorder"
	rs1.open sql,conn,1,1
	lanmu=""
	do while not rs1.eof
	lanmu=lanmu& "<option value='"&rs1("yiid")&"'>"&rs1("yiname")&"</option>"
%>
              <tr> 
                <td width="174"><%=rs1("yiname")%></td>
                <td width="44"> <a class="xiahua" href="#" onClick="SureDel(<%=rs1("yiid")%>)">删除</a></td>
              </tr>
              <%
	rs1.movenext
	loop
	rs1.close
 end if			
%>
            </table>
            </td>
    </tr>
  </table>

<form name="form2" method="post" action="?act=add">
        <table width="410" border="5" cellpadding="3" cellspacing="0" bordercolor="#ABCEDD">
          <tr> 
      <td width="404">添加： 
        <input name="newname_lan" type="text" id="newname_lan2" size="12" maxlength="20"> 
        <input type="submit" name="lan_Submit" value="提交"> </td>
    </tr>
  </table>
  </form>

<form name="form3" method="post" action="?act=rename">
        <table width="409" border="5" cellpadding="3" cellspacing="0" bordercolor="#ABCEDD">
          <tr> 
      <td width="407">修改： 
        <select size="1" name="lmlist" >
          <option selected>信息分类</option>
          <%=lanmu%> 
        </select>
        改名为： 
        <input type="text" name="txt_newname" size="12" > <input type="submit" name="Submit2" value="提交"> 
      </td>
    </tr>
  </table>
</form>
</td>
  </tr>
</table>
</body>
</html>
<%
conn.close
set conn=nothing		
%>

