<!--#include file="../Include/Conno.asp" -->
<!--#include file="../Include/char.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="IsLogin.asp" -->
<%
m_UserID = Session("CurUserID")
if Request.ServerVariables("REQUEST_METHOD")="POST" then
  dim m_Sql
  dim m_Name,m_Content,m_SmallPic,m_BgPic
  m_Name = checkStr(Trim(Request.Form("txtName")))
  m_Content = checkStr(Trim(Request.Form("txtContent")))
  m_SmallPic = Request.Form("selSmallPic")
  m_BgPic = Request.Form("selBgPic")
  m_Addtime = now()
  m_IPInfo = Request.ServerVariables("REMOTE_ADDR")
  m_Sql = "Select * From RJ_Diary Where F_UserID=" & m_UserID
  Set rs = conn.Execute(m_Sql)
  if not rs.Eof then
    call Msgbox("对不起,你已经创建了日记本!",1)
	Response.end
  else
    m_Sql = "Insert Into RJ_Diary(F_UserID,F_DiaryName,F_DiaryContent,F_SmallPic,F_BgPic,F_Addtime,F_IPInfo)"
	m_Sql = m_Sql + "Values('"&m_UserID&"','"&m_Name&"','"&m_Content&"','"&m_SmallPic&"','"&m_BgPic&"','"&m_Addtime&"','"&m_IPInfo&"')"
    conn.Execute(m_Sql)
	call Msgbox("恭喜您，您已成功能申请了日记本,\n现在您可以在您的日记本上发表了!","RJ_DiaryList.asp")
  end if
end if
%>

<HTML><HEAD><TITLE>会员俱乐部申请日记本</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link href="../css/member.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
 function checkForm(){
   if (document.form1.txtName.value == ""){
     alert("对不起，日记名称不能为空！");
	 document.form1.txtName.focus();
	 return false;
   }
 }
</script>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<!--#include file="../include/top.asp" -->
<!--#include file="../include/member_top.asp" --><!--#include file="club_top.asp" -->
<!--#include file="Top.asp" -->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="183" height="400" align="center" valign="top"> 
      <!--#include file="left.asp" -->
    </td>
    <td width="597" align="center" valign="top"><table width="96%"  border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="100%" height="40" align="right"><img src="../Images/member/hy_c_6.gif" width="185" height="80"></td>
        </tr>
        <tr> 
          <td height="1" bgcolor="#c7c7c7"></td>
        </tr>
      </table>
      <TABLE width="95%" 
      border=0 align="center" cellPadding=0 cellSpacing=0 
      borderColor=#111111 bgcolor="#FFFFFF" id=AutoNumber7 style="BORDER-COLLAPSE: collapse">
        <TBODY>
          <TR valign="top"> 
            <TD height="370" colSpan=2 align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="6"></td>
                </tr>
              </table>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <form name="form1" method="post" action="RJ_AddNew.asp" onSubmit="return checkForm()">
                    <td height="373" align="center" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="0">
                        <tr> 
                          <td height="33">&nbsp;您还没有创建自己的个性日记本吧,快快申请吧!</td>
                        </tr>
                      </table>
                      <table width="100%" border="0" cellspacing="3" cellpadding="0">
                        <tr> 
                          <td width="13%" height="27" align="right">日记名称：</td>
                          <td width="60%"><input name="txtName" type="text" class="text" size="33" maxlength="50"></td>
                          <td width="27%" rowspan="3" align="center" valign="top"><table width="70%" border="0" cellpadding="2" cellspacing="1" bgcolor="e8e9ee">
                              <tr> 
                                <td bgcolor="e8e9ee"><font class=cha2>日记背景</font></td>
                              </tr>
                              <tr> 
                                <td align="center" bgcolor="#FFFFFF"><font class=cha2><img id=BgPic  alt=个人形象代表 src="../Diary/BgPic/000.gif" ></font></td>
                              </tr>
                            </table></td>
                        </tr>
                        <tr> 
                          <td height="28" align="right"><font class=cha2>日记背景：</font></td>
                          <td> <font class=cha2> 
                            <select name=selBgPic class=editbox2  onChange="document.images['BgPic'].src=options[selectedIndex].value;" size=1 >
                 <%
				  for i = 0 to 27
				   m_BgPic = Right("00"&cstr(i),3)
				   Response.Write "<OPTION value=../Diary/BgPic/"&m_BgPic&".gif>"&m_BgPic&"</OPTION>"
				  next
				  %>
                            </select>
                            </font> </td>
                        </tr>
                        <tr> 
                          <td height="38" align="right">日记图案：</td>
                          <td><font class=cha2> 
                            <select name=selSmallPic class=editbox1  onChange="document.images['SmallPic'].src=options[selectedIndex].value;" size=1 >
                              <%
				  for i = 0 to 16
				   m_SmallPic = right("00"&cstr(i),3)
				   Response.Write "<OPTION value=../Diary/SmallPic/"&m_SmallPic&".gif>"&m_SmallPic&"</OPTION>"
				  next
				  %>
                            </select>
                            </font></td>
                        </tr>
                        <tr> 
                          <td height="142" align="right">开篇寄语：</td>
                          <td align="left"> <textarea name="txtContent" cols="44" rows="9" class="text"></textarea> 
                          </td>
                          <td width="27%" rowspan="3" align="center" valign="top"><br> 
                            <br> <table width="70%" border="0" cellpadding="2" cellspacing="1" bgcolor="e8e9ee">
                              <tr> 
                                <td bgcolor="e8e9ee">日记图案</td>
                              </tr>
                              <tr> 
                                <td align="center" bgcolor="#FFFFFF"><font class=cha2><img id=SmallPic  alt=个人形象代表 src="../Diary/SmallPic/000.gif" ></font></td>
                              </tr>
                            </table></td>
                        </tr>
                        <tr> 
                          <td height="47" align="right">&nbsp;</td>
                          <td><input type="submit" name="Submit" class="button" value="提交"> 
                            <input type="reset" name="Submit2" class="button" value="取消"></td>
                        </tr>
                      </table></td>
                  </form>
                </tr>
              </table></TD>
          </TR>
      </TABLE> </td>
  </tr>
</table>
<!--#include file="../include/bottom.asp" -->
</BODY></HTML>
