<% on error resume next dirs = "../" PID = Request("PID") CatID = Request("CatID") if CatID = "" then CatID = 148 flag = Request("flag") Photo_CatID = Request("Photo_CatID") if Photo_CatID = "" then Photo_CatID = 5 FID = Request("FID") OrderNo = Request("OrderNo") flagPre = true flagNext = true if FID = "" then photo.close set photo = nothing response.Redirect("/index.asp") end if if flag = "first" then sql = "select top 1 FID from tblFC where CatID = '" & Photo_CatID & "' Order by OrderNo " set rs = server.CreateObject("ADODB.Recordset") rs.Open sql, photo, 3, 1 FID = rs("FID") flagPre = false elseif flag = "previous" then sql = "select top 2 FID from tblFC where CatID = '" & Photo_CatID & "' and OrderNo < '" & OrderNo & "' order by OrderNo desc " set rs = server.CreateObject("ADODB.Recordset") rs.Open sql, photo, 3, 1 if not rs.EOF then FID = rs("FID") rs.MoveNext if rs.EOF then flagPre = false else flagPre = false end if elseif flag = "next" then sql = "select top 2 FID from tblFC where CatID = '" & Photo_CatID & "' and OrderNo > '" & OrderNo & "' order by OrderNo" set rs = server.CreateObject("ADODB.Recordset") rs.Open sql, photo, 3, 1 if not rs.EOF then FID = rs("FID") rs.MoveNext if rs.EOF then flagNext = false else flagNext = false end if elseif flag = "last" then sql = "select top 1 FID from tblFC where CatID = '" & Photo_CatID & "' order by OrderNo desc" set rs = server.CreateObject("ADODB.Recordset") rs.Open sql, photo, 3, 1 if not rs.EOF then FID = rs("FID") flagNext = false else rs.close set rs = nothing photo.close set photo = nothing response.End() end if end if sql = "select CatPIDList from Category where CatID = " & Photo_CatID set rs_photo = server.CreateObject("ADODB.Recordset") rs_photo.Open sql,photo, 3, 1 if rs_photo("CatPIDList") <> "" then CatPIDList = rs_photo("CatPIDList") CatArray = Split(CatPIDList,",",-1,1) For each i in CatArray if Trim(i) <> "" then if cint(i) >= 5 then sql = "select CatName, CatDescription from Category where CatID = " & i set rn = server.CreateObject("ADODB.Recordset") rn.Open sql, photo, 3, 1 photoDir = photoDir & "" & rn("CatName") & " > " CatDescription= rn("CatDescription") photoCatName = rn("CatName") rn.close set rn = nothing end if end if Next end if sql = "select f.FID, f.PID, p.PPIDList, f.FileScript1, c.OrderNo, r.Photoer from tblFile f, tblFC c, tblPhoto p, tblPhotoer r where p.PID = f.PID and f.FID = c.FID and f.PhID = r.PhID and c.CatID = " & Photo_CatID & " and f.FID = '" & FID & "'" set rs_photo = server.CreateObject("ADODB.Recordset") rs_photo.Open sql, photo, 3, 1 %> ¾¿©~¬Ûï-<%=photoCatName%>
      <%=Cascade%>
 
<%=photoDir %>
<%=rs_photo("FileScript1")%><% if Trim(rs_photo("photoer") & " ") <> "¥¼©w" then response.Write("¡]Äá¼v¡G" & rs_photo("photoer") & "¡^") %>
<%if flagPre then%> &flag=first&Photo_CatID=<%=Photo_CatID%>&FID=<%=FID%>#a">     &flag=previous&Photo_CatID=<%=Photo_CatID%>&FID=<%=FID%>#a"> <% else %>     <% end if if flagNext then %>     &flag=next&Photo_CatID=<%=Photo_CatID%>&FID=<%=FID%>#a">     &flag=last&Photo_CatID=<%=Photo_CatID%>&FID=<%=FID%>#a"> <% else %>     <% end if%>
<% rs.close set rs = nothing rn.close set rn = nothing photo.close set photo = nothing %>