<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
Function verifyNews(idstr)
    sqld = "select * from photo_info where id="&idstr
	set rsd=Server.CreateObject("ADODB.RecordSet")
	rsd.Open sqld,conn,1,3   
	if not rsd.EOF then		
	filename = Trim(rsd("photo"))	
    rsd.Delete
    rsd.Update  
   	   
    Set fdel = CreateObject("Scripting.FileSystemObject")	
          tempImageDir = Server.MapPath("Uppic/photo/"&filename)              
          If (fdel.FileExists(tempImageDir)) Then
	          fdel.DeleteFile(tempImageDir)
		  end if                              
    Set fdel=nothing			   
	end if
    set rsd=nothing  
End Function

if request("action")="del" then	
	Dim strIdList,arrIdList,iId,i
	strIdList = Trim(Request("phid"))
	If Not IsEmpty(strIdList) Then
		arrIdList = Split(strIdList,",")
		
		For i=0 To UBound(arrIdList)
			iId = clng(arrIdList(i))			
			Call verifyNews(iId)			
		Next	
		
		response.write "<script language=javascript>"
		response.write "alert('您所选定的相片信息已经成功删除！');window.location='myphoto.asp';"
		response.write "</script>"
	End If
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>红嫂视屏交友网</title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.STYLE8 {
	color: #CC0099;
	font-size: 12px;
	font-weight: bold;
}
.STYLE31 {color: #666666; font-size: 12px;}
.STYLE5 {
	font-size: 13px;
	color: #A30C78;
	font-weight: bold;
}
-->
</style>
<script language="JavaScript">
<!--
function verify(){
if (confirm("你确认要删除这些相片吗？")){
	document.frmdel.submit();
	}
}
//-->
</script>
</head>
<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="204" height="328" valign="top"><!--#include file="memberleft.asp"-->
&nbsp;</td>
    <td width="583" valign="top"><table width="565" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><TABLE width="100%" border=0 
            cellPadding=0 cellSpacing=0 bgColor=white class="STYLE4" >
              <TBODY>
                <TR>
                  <TD width="2%" align=left background="image/tiao_4.gif"><img src="image/tiao_3.gif" width="10" height="31"></TD>
                  <TD height="31" align=center background="image/tiao_4.gif"><TABLE width=530 height="27" border=0 cellPadding=0 cellSpacing=0>
                    <TBODY>
                      <TR>
                        <TD height="27" align=middle class="pgd">我的影集（共有<%=GetPhotoNum(Userid)%>张照片） </TD>
                      </TR>
                    </TBODY>
                  </TABLE></TD>
                  <TD width="2%" align="right" background="image/tiao_4.gif"><img src="image/tiao_2.gif" width="10" height="31"></TD>
                </TR>
              </TBODY>
          </TABLE></td>
        </tr>
        <tr>
          <td height="299" valign="top" style="border-left:#C7C8CC 1px solid;border-right:#C7C8CC 1px solid;border-bottom:#C7C8CC 1px solid"><br>
              <table width="520" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FEE2F5" bordercolordark="#FFFFFF" class="STYLE4">
                <tr>
                  <td height="362" valign="top"><table width="530" height="34" border="0" cellpadding="0" cellspacing="0" bgcolor="FFF1F8">
                      <tr>
                        <td width="14" height="34" bgcolor="#EDF8FE">&nbsp;</td>
                        <td width="110" bgcolor="#EDF8FE"><a href="photo.asp"><img src="ima/a1.gif" alt="上传您的照片" width="80" height="24" border="0"></a></td>
                        <td width="397" bgcolor="#EDF8FE"><img src="ima/a2.gif" width="80" height="24" onClick="verify();" style="cursor:hand "></td>
                      </tr>
                    </table>
                      <br>
                      <%
dim rcount,pmcount,pageno,mpage
set rs=server.CreateObject("adodb.recordset")
sql="select id,photo,title from photo_info where userid="& userid &""
rs.open sql,conn,1,1

rcount=rs.recordcount
pmcount=8
rs.pagesize=pmcount   	'设置每页数
mpage=rs.pagecount    	'得到总页数
pageno=clng(request("pageno"))
	
if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
	pageno=1
end if

if rs.bof and rs.eof then
	response.write "<table><tr><td width='525' class='style30'><div align='center'>您还没有上传相片</div></td></tr></table>"
else
	rs.absolutepage=pageno	'将指针移至指定页的第一条记录
	loopno=pmcount	
%>
                      <table width="523" border="0" align="center" cellpadding="0" cellspacing="0">
                        <form name="frmdel" method="post" action="myphoto.asp">
                          <input type="hidden" name="action" value="del">
                          <tr>
                            <%
i=1
do while not rs.eof and loopno>0	
%>
                            <td width="131" height="129" valign="top"><div align="center">
                                <table width="118" height="124" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td width="118" height="97" bgcolor="FCF8F9" style="border-left:#9DCCF6 1px solid;border-right:#9DCCF6 1px solid;border-top:#9DCCF6 1px solid;border-bottom:#9DCCF6 1px solid"><div align="center"><a href="uppic/photo/<%=rs("photo")%>" target="_blank"><img src="Uppic/photo/<%=rs("photo")%>" width="110" height="85" border="0"></a></div></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="middle"><div align="center">
                                        <input type="checkbox" name="phid" value="<%=rs("id")%>">
                                        <span class="STYLE88"><%=rs("title")%></span></div></td>
                                  </tr>
                                </table>
                            </div></td>
                            <%
rs.movenext
if i=4 then
  response.Write "<tr>"
  i=0
end if
i=i+1
loop
for j=i to 4
  response.Write "<td width='131' height='129'>&nbsp;</td>"
next
%>
                        </form>
                      </table>
                      <%end if%>
                  </td>
                </tr>
                <tr>
                  <form name="pageform" method=get action="myphoto.asp">
                    <td height="57" bgcolor="E8E6E7"><%if mpage>1 then%>
                        <div align="right">
                          <input type=text size=2 name="pageno" value="<%=pageno%>" class="button1">
                          <input type="submit" name="Submit" value="GO">
                &nbsp;
                          <%if cint(pageno)>1 then%>
          [<a href='myphoto.asp?pageno=<%=pageno-1%>' class="a4">上一页</a>]
          <%end if
			if cint(pageno)<cint(mpage) then
			%>
          [<a href='myphoto.asp?pageno=<%=pageno+1%>' class="a4">下一页</a>]
          <%end if%>
          共<%=cstr(pageno)&"/"&cstr(mpage)&"页 "&cstr(rcount)%>张照片</div>
                        <%end if%>
                    </td>
                  </form>
                </tr>
              </table>
</td>
        </tr>
    </table></td>
    <td width="163" valign="top"><!--#include file="fenlei.asp"--></td>
  </tr>
</table>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="root.asp"--></td>
  </tr>
</table>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
