<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/headpage.asp"-->
<%
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
%>

<%
if nosql(request("act"))="xs" then
if isChkInteger(request("id")) then
id=request("id")
else
response.write "<script language='javascript'>"
response.write "alert('非法操作，正在返回！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
set uppic=server.CreateObject("adodb.recordset")
uppic.open"select * from snsn_uppic_class  where username='"&session("user")&"' and id="&id&"",conn,1,3
if not uppic.eof then
if uppic("xs")=0 then
uppic("xs")=1
else
uppic("xs")=0
end if
uppic.update
response.write"<script>alert('更改成功，正在返回!!');location.href='uppic.asp';</script>"
response.End()
else
response.write"<script>alert('没有该相册，请重新输入!!');location.href='uppic.asp?act=add';</script>"
response.End()
end if

end if
if nosql(request("act"))="sadd" then
set uppic=server.CreateObject("adodb.recordset")
uppic.open"select * from snsn_uppic_class  where username='"&session("user")&"' and tclass='"&nosql(request("tt"))&"'",conn,1,1
if not uppic.eof then
response.write"<script>alert('您输入的相册名已存，请重新输入!!');location.href='uppic.asp?act=add';</script>"
response.End()
end if
conn.execute"insert into snsn_uppic_class(username,tclass,sm,xs)values('"&session("user")&"','"&nosql(request("tt"))&"','"&nosql(request("sm"))&"',"&nosql(request("xs"))&")"
response.write"<script>alert('新建相册成功');location.href='uppic.asp';</script>"
response.End()
end if
if nosql(request("act"))="del" then
if isChkInteger(request("id")) then
id=request("id")
else
response.write "<script language='javascript'>"
response.write "alert('非法操作，正在返回！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
set delpic=server.CreateObject("adodb.recordset")
delpic.open"select * from snsn_uppic_class  where username='"&session("user")&"' and id="&id&"",conn,3,3
conn.execute"delete from snsn_uppic_class where id="&id&" and username='"&session("user")&"'"
conn.execute"delete from snsn_uppic where tclass='"&delpic("tclass")&"' and username='"&session("user")&"'"

response.write"<script>alert('删除成功');location.href='uppic.asp';</script>"
response.End()
end if

if nosql(request("act"))="supd" then
if isChkInteger(request("id")) then
id=request("id")
else
response.write "<script language='javascript'>"
response.write "alert('非法操作，正在返回！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
set updpic=server.CreateObject("adodb.recordset")
updpic.open"select * from snsn_uppic_class  where username='"&session("user")&"' and tclass='"&nosql(request("tt"))&"' and id<>"&id,conn,3,3
if not updpic.eof then
response.write"<script>alert('您输入的名称相册中已存在,请重新输入!!');location.href='uppic.asp?act=upd&id="&id&"';</script>"
response.End()
end if
set updpic=server.CreateObject("adodb.recordset")
updpic.open"select * from snsn_uppic_class  where username='"&session("user")&"'  and id="&id,conn,3,3
set updpic1=server.CreateObject("adodb.recordset")
updpic1.open"select * from snsn_uppic  where username='"&session("user")&"' and tclass='"&updpic("tclass")&"'",conn,3,3
if not updpic1.eof then
conn.execute"update snsn_uppic set tclass='"&nosql(request("tt"))&"' where username='"&session("user")&"' and tclass='"&updpic("tclass")&"'"
end if
conn.execute"update snsn_uppic_class set tclass='"&nosql(request("tt"))&"',sm='"&nosql(request("sm"))&"' where username='"&session("user")&"' and id="&id
response.write"<script>alert('修改成功');location.href='uppic.asp';</script>"
response.End()
end if
%>
<html>
<head>
<title>交友中心_<%=webname%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/css.css" type="text/css">
<style type="text/css">
<!--
.z12 {
	font-size: 12px;
}
.style5 {
	font-size: 13px;
	font-weight: bold;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style6 {	font-size: 14px;
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
<!--#include file="../../top.asp"-->
</head>
<script language="Javascript" src="/minishow/js/ps_only.js"></script>
<body >
<form action="<%if request("act")="add" then%>?act=sadd<%else%>?act=supd&id=<%=request("id")%><%end if%>" method="post" name=form onsubmit="return ck()" >
<script language=javascript>
		function ck(){
		 if(form.tt.value==""){
		 alert('请输入相册名称!!!')
		 return false;}
		}
		</script>


<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
    <td width="970"><table width="970"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="10"><img src="/img/m_left.gif" width="10" height="20"></td>
          <td width="950" bgcolor="#FFFFFF"></td>
          <td width="10"><img src="/img/m_right.gif" width="10" height="20"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="188" colspan="3"><table width="950"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="1" bgcolor="efefef"></td>
                <td width="200" height="77" valign="top"><!--#include file="../left.asp"--></td>
                <td width="1" bgcolor="efefef"></td>
                <td valign="top"><table width="31%" height="16"  border="0" cellpadding="0" cellspacing="0">
                  <tr align="center">
                    <td height="31"><a href="?act=add#photo"><strong>新建我的相册</strong></a> <a href="uppic2.asp"><strong>点击上传照片</strong></a></td>
                  </tr>
                </table>
                  <table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <%x=0
  	set rs=server.CreateObject("adodb.recordset")
	rs.open"select * from snsn_uppic_class where username='"&session("user")&"' order by id desc",conn,1,3
if rs.eof or rs.bof then 
	%>
                    <tr>
                      <td height="30" colspan="2"><div align="center">未上传图片
                              <div></div>
                      </div></td>
                    </tr>
                    <%else
rs.pagesize=msg_per_page '定义分页记录集每页显示记录数
if not (rs.eof and rs.bof) then
	totalrec=rs.RecordCount'总记录条数
	if rs.recordcount mod msg_per_page=0 then'计算总页数,recordcount:数据的总记录数
		n=rs.recordcount\msg_per_page'n:总页数
	else
		n=rs.recordcount\msg_per_page+1                        
	end if                                                                
	currentpage=request("page")'currentpage:当前页
	If currentpage <> "" then
		currentpage =  cint(currentpage)
		if currentpage < 1 then  
			currentpage = 1
		end if  
		if err.number <> 0 then '错误处理
			err.clear
			currentpage=1
		end if
	else
		currentpage=1
	End if                                                                
	if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then 
		currentPage=1
	end if
	rs.absolutepage=currentpage'absolutepage：设置指针指向某页开头
	rowcount=rs.pagesize'pagesize：设置每一页的数据记录数
end if

if not isempty(request("selAnnounce")) then
idlist=replace_text(request("selAnnounce"))
if instr(idlist,",")>0 then
idArr=split(idlist)
for i = 0 to ubound(idarr)
id=cint(idarr(i))
call deleteannounce(id)
next
response.Redirect"?page="&currentpage&""
else
call deleteannounce(cint(idlist))
response.Redirect"?page="&currentpage&""
end if
end if %>
                    <%do while not rs.eof and rowcount > 0
					x=x+1%>
                    <tr align="center">
                      <td width="150" align="center" valign="middle" bgcolor="#FFFFFF"><a href="/my/love/uppic1.asp?ida=<%=rs("tclass")%>" ><img src="<%
			set rs123=server.CreateObject("adodb.recordset")
	rs123.open"select * from snsn_uppic where username='"&session("user")&"' and tclass='"&rs("tclass")&"'  and mink2=1",conn,3,3
	if not rs123.eof then
	response.Write(rs123("uppic"))	
	else
	if session("ch")="先生" then
	response.Write("/ico/101-2.gif")
	else
	response.Write("/ico/17-2.gif")
	end if
	end if
	%>
			" border="0"  name=img<%=x%> id=img<%=x%> onLoad="javascript:ImageResize(this.name);"></a><br>
                      </td>
                      <td align="center" valign="middle" bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="0" cellpadding="2">
                          <tr>
                            <td><%set updpic1=server.CreateObject("adodb.recordset")
updpic1.open"select count(id) as dd from snsn_uppic  where username='"&session("user")&"'   and tclass='"&rs("tclass")&"'",conn,3,3%>
                                <a href="/my/love/uppic1.asp?ida=<%=rs("tclass")%>" ><u><%=rs("tclass")%></u></a>(共 <span class="style6"><%=updpic1(0)%></span>&nbsp;张照片)<br>
                                <%=rs("adddate")%></td>
                          </tr>
                          <tr>
                            <td><%=rs("sm")%></td>
                          </tr>
                          <tr>
                            <td><a href="?act=del&web_id=<%=web_id%>&id=<%=rs("id")%>" onClick="return confirm('删除该相册,将删除该相册内所有的照片,您确定删除?')">删除 </a> <a href="?act=upd&web_id=<%=web_id%>&id=<%=rs("id")%>#<%=rs("id")%>">更改 </a><a href="?act=add&web_id=<%=web_id%>#photo">新建</a>
                                <%if rs("xs")=1 then%>
                                <a href="?act=xs&web_id=<%=web_id%>&id=<%=rs("id")%>">公开</a>
                                <%else%>
                                <a href="?act=xs&web_id=<%=web_id%>&id=<%=rs("id")%>">不公开</a>
                                <%end if%></td>
                          </tr>
                          <%if request("act")="upd" and cint(request("id"))=rs("id") then%>
                          <tr>
                            <td height="17">
                              <input name="tt" type="text" class="wenbenkuang" id="tt" value="<%=rs("tclass")%>" size="22" onClick="javascript:form.tt.select()">
                              <a name="#<%=rs("id")%>"></a>
                              <input name="Submit2" type="submit"  class="go-wenbenkuang" value="保存">
                              <input name="Submit22" type="button"  class="go-wenbenkuang" value="取消" onClick="javascript:location.href='?web_id=<%=web_id%>'">
                            </td>
                          </tr>
                          <tr>
                            <td height="18"><textarea name="sm" cols="36" rows="5" class="wenbenkuang" id="sm"><%=rs("sm")%></textarea></td>
                          </tr>
                          <%end if%>
                      </table></td>
                    </tr>
                    <tr>
                      <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr bgcolor="#CCCCCC" background="img/xbj.gif">
                      <td height="1" colspan="2" background="img/xbj2.gif"></td>
                    </tr>
                    <tr>
                      <td colspan="2">&nbsp;</td>
                    </tr>
                    <%
rowcount=rowcount-1
rs.movenext
loop
%>
                    <%end if%>
                    <%if nosql(request("act"))="add" then%>
                    <tr>
                      <td height="14" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><a name="#photo"></a>
                          <input name="tt" type="text" class="wenbenkuang" id="tt" value="请在此输入新相册名" size="38" onClick="javascript:form.tt.select()">
                      </td>
                    </tr>
                    <tr>
                      <td height="15" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><textarea name="sm" cols="36" rows="5" class="wenbenkuang" id="sm"></textarea></td>
                    </tr>
                    <tr>
                      <td height="30" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><select name="xs" class="wenbenkuang" id="xs">
                          <option value="0" selected>对外公开</option>
                          <option value="1">不对外公开</option>
                        </select>
                          <input name="Submit" type="submit" class="go-wenbenkuang" value="保存" >
                          <input name="Submit3" type="button" class="go-wenbenkuang" value="取消" onClick="javascript:location.href='?web_id=<%=web_id%>'"></td>
                    </tr>
                    <%end if%>
                  </table>
                  <TABLE width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#D7EBFF" bordercolordark="#D7EBFF" bgcolor="#BBD7FF" style="border-collapse: collapse">
                    <TR height=25 bgcolor="#e8f4ff">
                      <td><div align="center">
                          <%call listPages()%>
                      </div></td>
                    </tr>
                  </table>                  <p>&nbsp;
                </p>
                  </td>
              </tr>
          </table></td>
        </tr>
    </table></td>
    <td valign="top"><img src="/img/index_img.jpg" width="10"></td>
  </tr>
</table>
</form>
<!--#include file="../../end.asp"-->
</body>
</html>
