<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/count.asp"-->
<!--#include file="../page.asp"-->
<!--#include file="../count.asp"-->

<%
if isChkInteger(request("web_id")) then
web_id=request("web_id")
else
Response.Redirect ("../../index.asp")
end if

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")="" and session("id")<>cint(web_id) then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if

sql="select * from snsn_user where id="&web_id
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "<script language='javascript'>"
response.write "alert('没有此用户，请确认后或联系管理员再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
else
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 rs1=server.CreateObject("adodb.recordset")
rs1.open"select * from snsn_uppic where username='"&session("user")&"' and  id="&id,conn,1,3
%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link rel="stylesheet" href="css.css" type="text/css">
<style type="text/css">
<!--
.tmpstr21 {word-break:break-all}
-->
</style>
</head>
<body>
<script language="javascript">
function ck(){
if(form.tclass.value==""){
alert("请选择要上传到什么相册！")
form.tclass.focus()
return false
}
if(form.bt.value==""){
alert("请输入照片的标题！")
form.bt.focus()
return false
}

if(form.picurl.value==""){
alert("请先上传照片再保存！")
form.picurl.focus()
return false
}


}
</script>
<table width="420"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="22">
      <table width="420"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="1" height="1"></td>
          <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
        <tr>
          <td width="1" bgcolor="#CCCCCC"></td>
          <td width="30" bgcolor="#F1F1F1"><div align="center"><span class="M"><IMG 
                              src="img/icon_04.gif" 
                              name=image1754891 width="16" height="13" border=0></span></div></td>
          <td height="25" bgcolor="#F1F1F1"><span class="M"><FONT 
                              color=#000000><a href="web.asp?web_id=<%=web_id%>"><U><%=home%></U></a></FONT> -&gt; <FONT 
                              color=#000000><a href="photo.asp?web_id=<%=web_id%>"><U><%=xc%></U></a> -&gt; <FONT 
                              color=#000000><a href="photo2.asp?web_id=<%=web_id%>&idaa=<%=session("idaa")%>"><U><%=session("idaa")%></U></a> -&gt;</FONT> <u>修改我的相片</u></FONT></span></td>
          <td width="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td width="1" height="1"></td>
          <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
      </table></td>
  </tr><tr>
    <td height="21"></td>
  </tr>
  <tr>
    <td align="center" valign="top"><div align="center">
      <p></p>
      <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
       <form action="?web_id=<%=web_id%>&act=save&id=<%=nosql(request("id"))%>" method="post" name=form onsubmit="return ck()"> <tr>
          <td width="1" height="1"></td>
          <td height="1" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr>
        <tr>
          <td width="1" rowspan="9" bgcolor="#CCCCCC"></td>
          <td height="25" bgcolor="f9f9f9">&nbsp; 修改照片相关信息</td>
          <td width="1" rowspan="9" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td height="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td height="25">&nbsp; 相册名
            <select name="tclass" id="tclass" class="wenbenkuang">
              <option value="" >请选择上传的相册</option>
              <option value="<%=rs1("tclass")%>" selected ><%=rs1("tclass")%></option>
              <%set rs=server.CreateObject("adodb.recordset")
			rs.open"select * from snsn_uppic_class where username='"&session("user")&"'",conn,1,1
			if not rs.eof then
			do while not rs.eof %>
              <%if rs("tclass")<>rs1("tclass") then%>
              <option value="<%=rs("tclass")%>"><%=rs("tclass")%></option>
              <%end if
			rs.movenext
			loop
			else%>
              <option value="我的相册">我的相册</option>
              <%end if%>
            </select></td>
        </tr>
        <tr>
          <td height="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td height="25">&nbsp; 标　题
            <input name="bt" type="text" class="wenbenkuang" id="bt2" value="<%=rs1("bt")%>" size="40"></td>
        </tr>
        <tr>
          <td height="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td>&nbsp;
<textarea name="nr" class="wenbenkuang" cols="60" rows="5" id="textarea"><%=rs1("nr")%></textarea></td>
        </tr>
        <tr>
          <td height="1" bgcolor="#CCCCCC"></td>
        </tr>
        <tr>
          <td height="30">&nbsp;
<input type="submit" name="Submit" class="go-wenbenkuang" value="立即修改"></td>
        </tr>
        <tr>
          <td width="1" height="1"></td>
          <td height="1" bgcolor="#CCCCCC"></td>
          <td width="1" height="1"></td>
        </tr></form>
      </table>
    </div>
       <table width="120" height="146"  border="0" cellpadding="0" cellspacing="5">
         <tr>
           <td align="center" valign="middle"><img src="<%=rs1("uppic")%>" border="0" align="absmiddle" id=aaa></td>
         </tr>
       </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
if nosql(request("act"))="save" 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
conn.execute"update snsn_uppic set bt='"&nosql(request("bt"))&"',nr='"&nosql(request("nr"))&"',tclass='"&nosql(request("tclass"))&"'  where username='"&session("user")&"' and id="&id
response.write"<script>alert('修改成功!!!');window.close();window.opener.location.reload();</script>"
Response.Redirect ("photo2.asp?web_id="&web_id&"&ida="&session("idaa")&"")

end if
%>
 <%
end if%>
<script language="javascript">
function cc(){
	var style1=document.all.aaa.width	
	if(style1>400){
	document.all.aaa.style.width="400px"
	}
}
cc()
</script>