<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/char.jsp" -->
<!--#include file="../Include/const.jsp" -->
<%
mUserID = Request.Cookies("aspxnet")("CurUserID")
mUserName = Request.Cookies("aspxnet")("CurUserName")
m_AlbumID = Request.QueryString("AlbumID")

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
  mTitle = checkStr(Trim(Request.Form("txtTitle")))
  mAlbumID = checkStr(Trim(Request.Form("selAlbumID")))
  mContent = checkStr(Trim(Request.Form("txtContent")))
  if mContent="" then mContent = "该家伙很懒，什么都没留下就走了..."
  mImage = Request.Form("hidFileName")
  mImageSize = Request.Form("hidImageSize")
  if Trim(mImage) = "" then'如何没有上传图片
    mImage = "../DefaultImage.jpg"
    mImageSize = "0"
  end if
  mIPInfo = checkStr(Request.ServerVariables("REMOTE_ADDR"))
  mAddtime = Request.Form("txtAddtime")
 
  mSql = "Insert Into Photo_AlbumList(F_UserID,F_UserName,F_Title,F_AlbumID,F_Content,F_Image,F_IPInfo,F_Addtime,F_ImageSize)" 
  mSql = mSql + "Values('"&mUserID&"','"&mUserName&"','"&mTitle&"',"&mAlbumID&",'"&mContent&"','"&mImage&"','"&mIPInfo&"','"&mAddtime&"','"&mImageSize&"')"

  
  conn.Execute(mSql)

  Call CloseDatabase() 
  Call Msgbox("恭喜您，照片上传成功!","Photo_my.jsp")
End if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>相册-照片上传</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK 
href="css/index_photo.css" type=text/css rel=stylesheet>
<STYLE>TD {
	FONT-SIZE: 12px; COLOR: #151515; WORD-BREAK: break-all; FONT-FAMILY: "宋体"
}
.tdbg-dark {
	BACKGROUND: #dddddd; LINE-HEIGHT: 150%
}
.tdbg {
	BACKGROUND: #efefef; LINE-HEIGHT: 150%
}
</STYLE>
<script language="javascript">
 function check(){
   if (document.form1.txtTitle.value == "" ){
     alert("对不起，照片标题不能为空！");
     document.form1.txtTitle.focus();
	 return false;
   }
 }
</script>
<META content="MSHTML 6.00.2800.1555" name=GENERATOR></HEAD>
<BODY>
<DIV id=logo><A title=网络相册-首页 
href="photo_default.jsp"><SPAN>网络相册-首页</SPAN></A> </DIV>
	<DIV id=nav><A href="../">首页</A> | <A 
href="QQ_default.jsp">运城地带</A> | <A 
href="QQ_index.jsp">小圈子</A> | <A 
href="../blog/">运城博客</A> | <A 
href="photo_default.jsp">网络相册</A> | <A 
href="QQ_ployall.jsp">精彩活动</A> | <A 
href="friend_index.jsp">交友频道</A> | <A 
href="../bbs/" target=_blank>运城社区</A> </DIV>
<DIV id=main>
<DIV id=menu><IMG src="img/photo/photo_left.gif" name="limg" id=limg> 
<UL>
  <LI><A title=相册首页 href="photo_default.jsp"><IMG 
  src="img/photo/home.gif"></A> </LI>
  <LI><A title=我的相册 href="photo_my.jsp"><IMG 
  src="img/photo/my_album.gif"></A> </LI>
  <LI><A title=分类相册 href="photo_list.jsp"><IMG 
  src="img/photo/sort.gif"></A> </LI>
  <LI><A title=最新照片 href="photo_new.jsp"><IMG 
  src="img/photo/newPhoto.gif"></A> </LI>
  <LI><A title=相册排行 href="photo_sort.jsp"><IMG 
  src="img/photo/rank.gif"></A> </LI>
  <LI id=menuend><A title=在线大头贴 href="photo_dtt.jsp"><IMG 
  src="img/photo/dtt.gif"></A> </LI></UL></DIV>  
<DIV id=contian><!--Create start-->
<DIV id=create>
<H6><IMG src="img/nophoto_man.gif"><A class=blue 
href="photo_my.jsp">我的相册</A> / 上传照片</H6>
<FIELDSET><LEGEND>与朋友分享精彩相册！您可以在这里邀请您的家人和朋友一起欣赏您的相册！</LEGEND>
<form name="form1" method="post" action="Photo_Upload.jsp" onSubmit="return check()"><LABEL><SPAN>照片标题：</SPAN> <INPUT class=text size=32 
name=txtTitle> * </LABEL><LABEL><SPAN>选择相册：</SPAN> <select class="text" name="selAlbumID">
                      <%
					    m_AlbumID = Request.QueryString("AlbumID")
					    mSql = "Select * From Photo_Album Where F_UserID=" & mUserID &" Order by F_ID Desc"
						Set rs = conn.Execute(mSql)
						Do While Not rs.Eof
						  if cstr(m_AlbumID) = cstr(rs("F_ID")) then
						    Response.write "<option value='" & rs("F_ID") & "' selected>" & rs("F_AlbumName") & "</option>"
						  else
						    Response.write "<option value='" & rs("F_ID") & "'>" & rs("F_AlbumName") & "</option>"
                          end if
						  rs.MoveNext
						Loop
						rs.Close
					  %>
                    </select>
                    <input type="hidden" name="hidImageSize">
                    <input type="hidden" name="hidFileName"> </LABEL><LABEL><SPAN>照片描述：</SPAN><TEXTAREA name=txtContent rows=8 cols=60></TEXTAREA> 
</LABEL><LABEL><SPAN>上传文件：</SPAN> <%
				  m_Sql = "Select sum(F_ImageSize) from Photo_AlbumList where F_AlbumID="&m_AlbumID
                  set rs = conn.Execute(m_Sql)
				  if rs(0) > 50*1024*1024 then 
				    Response.write "对不起，您的相册空间已满,无法上传！"
				  else
				    Response.write "<iframe src='save_upload.jsp' name='upfile' width=80% height=22 frameborder=0 scrolling=no>此页使用了内帧，需更高版本的浏览器支持。</iframe>"
				  end if
				  rs.close
				  %> </LABEL>
				 <LABEL><SPAN>上传时间：</SPAN><input name="txtAddtime" type="text" class="text"  value="<%=now%>" size="21"> </LABEL>
<LABEL><SPAN>&nbsp;</SPAN><BUTTON class=bot1 id=divProcessing 
type=submit>提交</BUTTON><BUTTON class=bot1 type=reset>取消</BUTTON> 
</LABEL></FORM></FIELDSET> </DIV><!--Create end--></DIV>
<DIV id=foot><A class=list href="../about/?Para=Intro" target=_blank>关于我们</A> ┊ <A class=list href="../about/?Para=Contact" target=_blank>联系方式</A> ┊ <A class=list href="../about/?Para=Job" target=_blank>招贤纳士</A> ┊ <A class=list href="../about/?Para=AdService" target=_blank>广告服务</A> ┊ <A class=list href="../about/?Para=Cooperate" target=_blank>合作伙伴</A> ┊ <A class=list href="../so/Suggestion.jsp" target=_blank> 留言/投诉</A> ┊ <A class=list href="../about/?Para=Job" target=_blank></A><BR><%=Site_info(5)%> </DIV></DIV>
      <%if Request.Cookies("aspxnet")("CurUserName") = "" then%>
<DIV id=leftlist>
<H3>网络相册</H3>
<FORM name=form1 action=ChkLogin.jsp?return=photo method=post onSubmit="return checkForm()">
<H4>登陆进入您的相册</H4><LABEL for=username><SPAN>用户名:</SPAN><INPUT size=9 
name=username></LABEL> <LABEL for=password><SPAN>密码:</SPAN><INPUT 
type=password size=8 name=password></LABEL> 
<P><BUTTON class=login type=submit><SPAN>登陆</SPAN></BUTTON><BUTTON class=reg 
type=reset><SPAN>注册</SPAN></BUTTON> </P></FORM></DIV>
<%else%>
<DIV id=leftlist>
<H3>网络相册</H3>
<FORM>
<H4><%m_TempUserName = Request.Cookies("aspxnet")("CurUserName")
				  if m_TempUserName = "" then Response.write "游客" else Response.write m_TempUserName
				  %>的相册</H4>
<P style="PADDING-RIGHT: 9px; LINE-HEIGHT: 180%; TEXT-ALIGN: right">[ <A 
href="Logout.jsp">退出</A> ]<BR><A 
href="Photo_Upload.jsp?AlbumID=<%=m_AlbumID%>">上传照片</A><BR><A 
href="photo_my.jsp">我的相册</A><BR><A 
href="Photo_AddNew.jsp">新增相册</A> </P></FORM>
</DIV>
<%end if%>
<SCRIPT language=javascript>
function checkForm(){
  if (document.form1.username.value == ""){
    alert("对不起，用户名不能为空!请输入..");
	document.form1.username.focus();
	return false;
  }
  if (document.form1.password.value == ""){
    alert("对不起，密码不能为空!请输入..");
	document.form1.password.focus();
	return false;
  }

}
</SCRIPT>

</BODY></HTML>
