<!--#Include File="Connection.Asp"-->

<%
Dim JaBlog,JaDelSQL,JaDelSQL2
Dim JaCheckIsLog,B
Set JaBlog = new q_zone
B = JaBlog.JaKillStr(Request.QueryString("JaUid"))
If B="" Then
B= "2"
End If
Dim albumID
albumID = JaBlog.JaKillStr(Request.QueryString("albumID"))

JaCheckIsLog = JaBlog.JaIsUser(B)
If JaCheckIsLog <> "yes" Then
Response.Write "<script language=javascript>alert('你没有权限观看该页面!');"
Response.Write "window.document.location.href='javascript:history.go(-1)';</script>"
Else

Dim fso,ppath
Dim rrs
Set rrs = Conn.Execute("Select JaPhotoUrl From [JaPhoto] Where JaAlbumID="&albumID&" and JaUid='"&B&"' and JaPhotoUrl<>'defeat.gif' ")
If Not rrs.Eof Then
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Do While Not rrs.Eof
ppath = Server.MapPath("UpLoad\" & rrs(0))
If fso.FileExists(ppath) Then
fso.DeleteFile ppath,true
Else
Response.Write "<script language=javascript>alert('该图片不存在!');"
Response.Write "window.document.location.href='javascript:history.go(-1)';</script>"
End if
rrs.MoveNext
Loop
End if
rrs.Close
Set rrs=Nothing

JaDelSQL = "JaUid='"&SESSION("VicNum")&"' and ID="&albumID&" "
JaDelSQL2 = "JaUid='"&SESSION("VicNum")&"' and JaAlbumID="&albumID&" "
JaBlog.JaDelete "JaAlbum",JaDelSQL
JaBlog.JaDelete "JaPhoto",JaDelSQL2
Response.Write "<script language=javascript>alert('删除成功!');"
Response.Write "window.document.location.href='AlbumAll.asp?JaUid="&SESSION("VicNum")&"';</script>"
End if
Set JaBlog=Nothing
%>
