<!--#include file="WebConfig/Conn.asp"-->
<!--#include file="WebConfig/LoginYN.asp"-->
<!--#include file="WebConfig/Function.asp"-->
<html xmlns:v>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="Css/BackStyle.css" />
<title></title>
<script language="javascript" src="Js/Nor.js"></script>
<script language="javascript" src="Js/checkBaseInfo.js"></script>
</head>
<%
If Request.Form("ck")<>"" Then
Set Rs=Server.CreateObject("ADODB.Recordset")
Rs.Open     "Select *  from photo where id in ("&Request.Form("ck")&")",conn,1,3
if Rs("url")<>"" then
Set Fso = Server.CreateObject("Scripting.FilesystemObject")
Do While Not Rs.eof '循环所有满足条作记录
      ImgPathx = Server.MapPath(Rs("url"))'获取图片实际路径小图
      if fso.fileexists(Imgpathx) = true  Then'图片存在时删图片
          Fso.deletefile (Imgpathx)
      End If
Rs.MoveNext
Loop
Rs.Close
Set Rs=Nothing
conn.Execute("Delete from photo where Id in ("&Request.Form("ck")&")")
else
conn.Execute("Delete from photo where Id in ("&Request.Form("ck")&")")
end if
End If
%>
<body>
<div id="BackBg">
	<v:RoundRect id="BackCo" strokeColor="#7EB977" arcsize=".01" Filled="T">
		<div id="BackDocTitle" class="B cW">管理图片</div>
		<form id="BaseInfo" name="BaseInfor" method="post" action="">
		<div id="BackDoZone">
				<ul id="Ti" class="B">
					<p class="w5 bR"><a href="?Case=Id&yN=<%=yN%>">ID</a></p>
					<p class="w10 bR">分类</a></p>
					<p class="w20 bR">标题</a></p>					
					<p class="w30 bR">图片地址</p>
					<p class="w15 bR">添加时间</p>
					<p class="w10 bR">查看</p>
					<p class="w10">选择</p>
				</ul>
				<%
					Set rsNews=Server.CreateObject("ADODB.RecordSet")
					rsNews.Open "Select * from photo order by addtime desc ",conn,1,1
					If Not rsNews.Eof Then
						rsNews.PageSize=8
						Page=Cint(Request.QueryString("Page"))
						If Page<1 Then Page=1 End If
						If Page>rsNews.PageCount Then Page=rsNews.PageCount End If
						If rsNews.RecordCount<rsNews.PageSize Then CuPage=1 Else CuPage=Cint(rsNews.RecordCount/rsNews.PageSize) End If
						rsNews.AbsolutePage=Page
					End If
					for i=1 to rsNews.RecordCount
					If rsNews.Eof or i>rsNews.PageSize Then Exit for End If
				%>
				<ul id="Co">
					<p class="w5 bR bB"><%=rsNews("Id")%></p>
					<p class="w10 bR bB"><%=rsNews("class")%></p>
					<p class="w20 bR bB"><%=rsNews("title")%></p>					
					<p class="w30 bR bB" align="left" style="padding-left:5px"><%=right(rsNews("url"),28)%></p>
					<p class="w15 bR bB"  align="left" style="padding-left:5px"><%=rsNews("addTime")%></p>
					<p class="w10 bR bB"><input name="url" type="hidden" value="<%=rsNews("url")%>" /><a  href="<%=rsNews("url")%>" target="_blank">查看</a></p>
					<p class="w10 bB"><input name="ck" type="checkbox" value="<%=rsNews("Id")%>" onClick="selectOne();" /></p>
				</ul>
				<%
					rsNews.MoveNext
					Next
				%>
		</div>
		<div id="BackPage">当前<%=CuPage%>页 每页 <%=rsNews.PageSize%> 信息 / 共<%=rsNews.PageCount%>页 共有 <span class="Red"><%=rsNews.RecordCount%></span> 条信息 <a href="S?Page=1">首页</a> <a href="?Page=<%=Page-1%>">上一页</a> <a href="?Page=<%=Page+1%>">下一页</a> <a href="?Page=<%=rsNews.PageCount%>">尾页</a></div>
		<div id="BackBn"><input id="BnDel" disabled="disabled" type="button" value="删除所选内容"  onClick="confirmDel('BaseInfo');" /> 全选 <input name="Total" type="checkbox" onClick="selectAll(this);" /></div>	</form>
		<div id="BackBn">
		<form name="form1" method="post" action="replySM.asp" enctype="multipart/form-data" >
		 <input type="hidden" name="act" value="upload">
		<p style="margin-top:15px; ">
		标题：<input id="BnDel" type="text" name="title"/> 
		类别：<SELECT name=class> 
		<OPTION value=校园风光 selected>校园风光</OPTION> 
		<OPTION value=教师风采>园丁风采</OPTION> 
		<OPTION value=校园生活>校园生活</OPTION> 
		<OPTION value=学生荣誉>教育成果</OPTION></SELECT> 
		 上传图片：<input type="file" name="ExcelFile" style="width:300" value=""><br>
		<p style="margin-top:15px; margin-bottom:5px"><input type="submit" name="Submit" value="提交">&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置">
		</form>
		 </div>
	
		
	</v:roundrect>
</div>
<%
	rsNews.Close
	Set rsNews=Nothing
%>
</body>
</html>
