<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Conn/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="../css/indexTwo.css" type="text/css">
<title>网站后台</title>
</head>
<body>
<%
SortID=request("SortID")
sql="select top 1 * from TbNewsSort where id="&SortID
rs.open sql,conn,1,1
if not rs.eof then
	SortName=rs("name")
end if
rs.close

if request.Form("submit1")="修改" then
	ID=Request.Form("ID")
	Name1=Request.Form("Name")
	order=Request.Form("order")
	Sql="Select * From TbNewsProperty Where ID="&clng(ID)
	Rs.Open Sql,Conn,1,3
	IF Not Rs.Eof Then
		Rs("Name")=Name1
		Rs("order")=order
		Rs.Update
	End IF
	Rs.Close
	response.write "<script> alert('修改成功');window.document.location.href='News_Sort_Set.asp?SortID="&SortID&"';   </script>"
	response.End()
end if


if request.Form("submit2")="删除" then
	ID=Request.Form("ID")
	Sql="DELETE  from  TbNewsProperty where ID="&clng(ID)
	conn.execute sql
	response.write "<script> alert('删除成功');window.document.location.href='News_Sort_Set.asp?SortID="&SortID&"';   </script>"
	response.End()
end if
%>
<table width="100%" border="0" cellspacing="1" class="Navi2">
  <tr>
    <th colspan="2"><%=SortName&"——"%>信息类别属性设置</th>
    <th><a href="News_Sort_List.asp" class="link2">返回</a></th>
  </tr>
</table>
  <table width="100%" border="0" cellspacing="1" class="Navi2">
    <tr>
      <th colspan="2">文本框属性</th>
	  <th><a href="News_Sort_Set_Add.asp?tag=AddText&SortID=<%=SortID%>" class="link2">添加</a></th>
    </tr>
    <tr>
      <td style="text-align:center; padding-left:8px;">属性名称</td>
      <td style="text-align:center;padding-left:8px;">属性序号</td>
      <td style="text-align:center;">操作</td>
    </tr>
	<%call getText(SortID)%>
	<tr>
      <th colspan="2">复选框属性</th>
	  <th><a href="News_Sort_Set_Add.asp?tag=AddCheckBox&SortID=<%=SortID%>" class="link2">添加</a></th>
    </tr>
	<tr>
      <td style="text-align:center; padding-left:8px;">属性名称</td>
      <td style="text-align:center;padding-left:8px;">属性序号</td>
      <td style="text-align:center;">操作</td>
    </tr>
	<%call getCheckBox(SortID)%>
	<tr>
      <th colspan="2">上传文件属性</th>
	  <th><a href="News_Sort_Set_Add.asp?tag=AddFile&SortID=<%=SortID%>" class="link2">添加</a></th>
    </tr>
	<tr>
      <td style="text-align:center; padding-left:8px;">属性名称</td>
      <td style="text-align:center;padding-left:8px;">属性序号</td>
      <td style="text-align:center;">操作</td>
    </tr>
	<%call getFile(SortID)%>
    <tr>
      <td colspan="3">&nbsp;</td>
    </tr>
  </table>
</body>
</html>
<!--#include file="../Conn/conn_close.asp"-->
<%
sub getText(SortID)
	sql="select * from TbNewsProperty where mode=1 and sortId="&SortID&" order by [order] asc"
	rs.open sql,conn,1,1
	if not rs.eof then
		do while not rs.eof
			response.Write("<FORM method='POST' name='from"&rs("ID")&"' action='?SortID="&SortID&"'>")
			response.Write("<tr  onmouseout=""style.backgroundColor=''"" onMouseover=""style.backgroundColor='#bfdfff'"">")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='text' name='Name' value='"&rs("name")&"' />")
			response.Write("<input type='hidden' name='ID' value='"&rs("ID")&"' />")
			response.Write("</td>")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='text' name='order' value='"&rs("order")&"' />")
			response.Write("</td>")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='submit' name='submit1' value='修改' class='btn'/>")
			response.Write("&nbsp;&nbsp;&nbsp;&nbsp;")
			response.Write("<input type='submit' name='submit2' value='删除' class='btn'/>")
			response.Write("</td>")
			response.Write("</tr>")
			response.Write("</Form>")
			rs.movenext
		loop
	end if
	rs.close
end sub

sub getCheckBox(SortID)
	sql="select * from TbNewsProperty where mode=2 and sortId="&SortID&" order by [order] asc"
	rs.open sql,conn,1,1
	if not rs.eof then
		do while not rs.eof
			response.Write("<FORM method='POST' name='from"&rs("ID")&"' action='?SortID="&SortID&"'>")
			response.Write("<tr  onmouseout=""style.backgroundColor=''"" onMouseover=""style.backgroundColor='#bfdfff'"">")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='text' name='Name' value='"&rs("name")&"' />")
			response.Write("<input type='hidden' name='ID' value='"&rs("ID")&"' />")
			response.Write("</td>")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='text' name='order' value='"&rs("order")&"' />")
			response.Write("</td>")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='submit' name='submit1' value='修改' class='btn'/>")
			response.Write("&nbsp;&nbsp;&nbsp;&nbsp;")
			response.Write("<input type='submit' name='submit2' value='删除' class='btn'/>")
			response.Write("</td>")
			response.Write("</tr>")
			response.Write("</Form>")
			rs.movenext
		loop
	end if
	rs.close
end sub


sub getFile(SortID)
	sql="select * from TbNewsProperty where mode=3 and sortId="&SortID&" order by [order] asc"
	rs.open sql,conn,1,1
	if not rs.eof then
		do while not rs.eof
			response.Write("<FORM method='POST' name='from"&rs("ID")&"' action='?SortID="&SortID&"'>")
			response.Write("<tr  onmouseout=""style.backgroundColor=''"" onMouseover=""style.backgroundColor='#bfdfff'"">")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='text' name='Name' value='"&rs("name")&"' />")
			response.Write("<input type='hidden' name='ID' value='"&rs("ID")&"' />")
			response.Write("</td>")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='text' name='order' value='"&rs("order")&"' />")
			response.Write("</td>")
			response.Write("<td style='text-align:center'>")
			response.Write("<input type='submit' name='submit1' value='修改' class='btn'/>")
			response.Write("&nbsp;&nbsp;&nbsp;&nbsp;")
			response.Write("<input type='submit' name='submit2' value='删除' class='btn'/>")
			response.Write("</td>")
			response.Write("</tr>")
			response.Write("</Form>")
			rs.movenext
		loop
	end if
	rs.close
end sub
%>
