<?php
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/publicfun.php");
include_once("conn.php");
include_once("checkuser.php");
include_once("bbsuser.php");

$userid=intval(get_cookie('clubuser_id'));
$success=$_GET["success"];
include_once("memberinfo.php");
?>
<html><head><meta http-equiv=content-type content="text/html; charset=utf-8>">
</head>
<script language="javascript">
<!--
	function chk(form)
	{	
    if (form.photo_name.value=="")
    	{
    		alert("请选择你的相册名称如没有请先创建相册！");
    		form.photo_name.focus();
    		return false;
  	}
    if (form.userfile.value=="")
    	{
    		alert("请选择你要上传的相片！");
    		form.userfile.focus();
    		return false;
  	}
    return true;
	}
//-->
</script>
<script language=javascript src="js/resizeImages.js"></script>
<body>
<center>
<title>上传相册</title>
<link rel="stylesheet" type="text/css" href="<?=$cssfile?>">
<?
include_once("usernav.php");
include_once("photohead.php");
?>
<div class="stage">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="layout">
<tr>
<td valign="top" class="c2t3">
<div id="mod_profile" class="mod" rel="drag">
<?
include_once("usercalog.php");
?>
</div>
</td>
          <td valign="top" class="c2t1"> 
            <div id="m_blog" class="modbox">
			<? if ($success==""){?>
                <table width="77%" border="0" align="center" class="maintbbg" cellspacing="1" cellpadding="2">
                  <form name="form1" method="post" action="up_photo_act.php" ENCTYPE="multipart/form-data" onsubmit="return chk(this)">
				  <tr class="f12bg"> 
                    <td height="50" colspan="2"> <div align="center"><strong>上 
                        传 相 片</strong></div></td>
                  </tr>
                  <tr class="f12bg"> 
                    <td height="30">
<div align="right">相册：</div></td>
                    <td height="25"><div class="opt">
                      <select name="photo_name" id="photo_name">
<?
$sql="select * from {$tablepre}ftblog_type where userid=".$userid." and blogphoto=1 order by id desc";
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
do{
?>
                        <option value="<?=$myrow["blogtype"]?>" selected><?=$myrow["blogtype"]?></option>
<?
}
while ($myrow = mysql_fetch_array($rs));
?>
                      </select>
                      <a href="blog_group.php?nav=a">创建相册</a></div></td>
                  </tr>
                  <tr> 
                    <td width="23%" height="11" class="maintbtr3" valign="middle"> 
                      <div align="right">相片：</div></td>
                    <td width="77%" height="30" class="maintbtr3">
                      <input NAME="userfile" TYPE="file" id="userfile">
                    </td>
                  </tr>
                  <tr> 
                    <td width="23%" height="11" class="maintbtr3" valign="middle"> 
                      <div align="right">说明：</div></td>
                    <td width="77%" height="30" class="maintbtr3"><input name="photo_note" type="text" id="photo_note" size="35" maxlength="30"> 
                    </td>
                  </tr>
                  <tr> 
                    <td height="50" colspan="2" class="maintbtr3"> <div align="center"> 
                        <input type="submit" name="Submit" value="上传相片" class=button>
                      </div></td>
                  </tr>
				  </form>
                </table>
			  <? }else{?>
              <table width="77%" border="0" align="center" class="maintbbg" cellspacing="1" cellpadding="2">
                <tr class="f12bg"> 
                  <td height="50"> <div align="center"><strong><font color="#FF0000">上传成功</font></strong></div></td>
                </tr>
                <tr class="f12bg"> 
                  <td height="30"> <div align="center"><img src="<?=$_GET["pic"]?>" border="0" resize="1"></div>
                  </td>
                </tr>
                <tr> 
                  <td height="50" class="maintbtr3"> <div align="center"><a href="up_photo.php">继续上传</a>&nbsp; &nbsp;&nbsp;
                      <a href="photomanage.php">返回相册管理</a></div></td>
                </tr>
              </table>
			  <? }?>
            </div>
</td>
</tr></table>
</div>
</div>
<br><center>
<?
include_once("tail.php");
?>
</center>
</center>
</body>
</html>