<!--#include virtual="inc/General.inc.asp"-->
<%
CheckManageUser()
code = replace(request("code"),"'","''")
id = clng("0"&request("id"))
set rs = server.createobject("adodb.recordset")
p = cint("0"&request("p"))
if p<1 then p=1
pagesize=8
rs.open "select count(id) from Info",conn,1,1
totalcount=rs(0)
rs.cancel:rs.close
pagecount=totalcount \ pagesize
if totalpage mod pagesize>0 then pagecount=pagecount+1
if p=1 then
strsql = "select top " & pagesize & " * from Info order by Code,AddDateTime"
else
strsql = "select top " & pagesize & " * from Info where id not in (select top " & ((p-1)*pagesize) & " id from Info order by Code,AddDateTime) order by Code,AddDateTime"
end if
rs.open strsql,conn,1,1
dim listtype(4)
listtype(0)="首页通栏广告"
listtype(1)="次页通栏广告"
listtype(2)="友情链接"
listtype(3)="相关主题"
listtype(4)="文字链接"
%>
<html>

<head>
<title>后台管理系统</title>
<link rel="stylesheet" href="../../css/main.css">
<script language="javascript" src="../../js/yzqm.js.asp"></script>
</head>

<body topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
	<td height="25" bgcolor="#EFEFEF" class="dtd" style="color:#FF6600">&nbsp;当前位置：样稿管理</td>
  </tr>
  <tr>
	<td>
	  <table border="0" cellpadding="1" cellspacing="0" width="99%" align="right">
		<form name="AddForm" method="post" enctype="multipart/form-data" action="SaveInfo.asp" onsubmit="if(this.PicPath.value==''){alert('请选择图片！');this.PicPath.focus();return false;}else{return true;}">
		<tr>
		  <td height="25">编号:&nbsp;<input type="text" name="Code" onchange="this.value=this.value.replace(/\D/gi,'')" size="3" class="inbox">&nbsp;&nbsp;姓名:&nbsp;<input type="text" name="UserName" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="5" class="inbox">&nbsp;&nbsp;密码:&nbsp;<input type="text" name="UserPass" size="5" class="inbox">&nbsp;&nbsp;款式:&nbsp;<input type="text" name="TypeOne" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="5" class="inbox">&nbsp;&nbsp;风格:&nbsp;<input type="text" name="TypeTwo" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="5" class="inbox">&nbsp;&nbsp;备注:&nbsp;<input type="text" name="Info" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="10" class="inbox">&nbsp;&nbsp;图片:&nbsp;<input type="file" name="PicPath" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="10" class="inbox"><input type="hidden" name="aduser">&nbsp;&nbsp;<input type="submit" value=" 添加 " class="in1"></td>
		</tr>
		</form>
		<tr>
		  <td height="25"></td>
		</tr>
		<tr>
		  <td>
			<table border="0" cellpadding="1" cellspacing="1" width="100%" bgcolor="#00599C">
			  <tr bgcolor="#A5CCFF">
				<td height="23" align="center">ID号</td>
				<td align="center">编号</td>
				<td align="center">姓名</td>
				<td align="center">款式</td>
				<td align="center">风格</td>
				<td align="center">备注</td>
				<td align="center">图片</td>
				<td align="center">修改</td>
				<td align="center">删除</td>
			  </tr>
			  <%while not rs.eof%>
			  <%if id&""=rs("id")&"" then%>
			  <form name="EditForm" method="post" enctype="multipart/form-data" action="SaveInfo.asp">
			  <tr bgcolor="#FFFFFF">
				<td height="25" align="center">&nbsp;<input type="hidden" name="idh" value="<%=rs("id")%>"><%=rs("id")%>&nbsp;&nbsp;</td>
				<td align="center">&nbsp;<input type="text" name="Code" onchange="this.value=this.value.replace(/\D/gi,'')" size="4" class="inbox" value="<%=rs("Code")%>">&nbsp;&nbsp;</td>
				<td align="center"><input type="text" name="UserName" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="6" class="inbox" value="<%=rs("UserName")%>"><br><input type="password" name="UserPass" size="6" class="inbox" value="jeansecool"></td>
				<td align="center"><input type="text" name="TypeOne" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="6" class="inbox" value="<%=rs("TypeOne")%>"></td>
				<td align="center"><input type="text" name="TypeTwo" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="6" class="inbox" value="<%=rs("TypeTwo")%>"></td>
				<td align="center"><input type="text" name="Info" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="6" class="inbox" value="<%=rs("Info")%>"></td>
				<td align="center"><%=ShowPicture(rs("PicPath"),200,60,"")%><br>重新上传：<input type="file" name="PicPath" size="8" onchange="this.value=this.value.replace(/(^\s*)|(\s*$)|[\']/gi,'')" size="20" class="inbox"><input type="hidden" name="aduser"></td>
				<td align="center" nowrap><a href="#" onclick="javascirpt:EditForm.submit()">确定</a></td>
				<td align="center" nowrap><a href="Info.asp?p=<%=p%>&code=<%=code%>">取消</a></td>
			  </tr>
			  </form>
			  <%else%>
			  <tr bgcolor="#FFFFFF">
				<td height="25" align="center">&nbsp;<%=rs("id")%>&nbsp;&nbsp;</td>
				<td align="center">&nbsp;<%=rs("Code")%>&nbsp;&nbsp;</td>
				<td align="center"><%=rs("UserName")%></td>
				<td align="center"><%=rs("TypeOne")%></td>
				<td align="center"><%=rs("TypeTwo")%></td>
				<td align="center"><%=rs("Info")%></td>
				<td align="center"><%=ShowPicture(rs("PicPath"),100,60,"")%></td>
				<td align="center"><a href="Info.asp?id=<%=rs("id")%>&p=<%=p%>">修改</a></td>
				<td align="center"><a href="javascript:if(confirm('你确定要删除此广告吗？')) window.location.href='DeleteInfo.asp?id=<%=rs("id")%>'">删除</a></td>
			  </tr>
			  <%end if%>
			  <%rs.movenext
			  wend%>
			</table>
			<%rs.cancel:rs.close%>
		  </td>
		</tr>
		<tr>
		  <td height="25" align="right"><%=PagerNumeric(cdbl("0"&p),cdbl(pagesize),cdbl(pagecount),cdbl(totalcount))%></td>
		</tr>
	  </table>
	</td>
  </tr>
</table>
</body>

<html>
<%CloseConnection()%>