<!--#include file="../Include/Conno.asp" -->
<!--#include file="../Include/char.asp" -->
<!--#include file="IsLogin.asp" -->
<%
m_UserID = Session("CurUserID")
If Request.ServerVariables("REQUEST_METHOD")="POST" then
  'Read Reuest
  m_Title = checkStr(Trim(Request.Form("txtTitle")))
  m_Content = checkStr(rTrim(Request.Form("txtContent")))
  m_Addtime = Request.Form("txtAddtime")
  m_Addtime = cstr(formatdatetime(m_Addtime,0))+" "+cstr(time)
  'Insert 
  m_Sql = "Insert Into NP_NotePad(F_UserID,F_Title,F_Content,F_Addtime)"
  m_Sql =  m_Sql + " Values("&m_UserID&",'"&m_Title&"','"&m_Content&"','"&m_Addtime&"')"
  conn.Execute(m_Sql)
  Response.Write "<script language=""javascript"">opener.location.reload()</script>"
end if
%>
<html>
<head>
<title>添加记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/member.css" rel="stylesheet" type="text/css">

<script language="javascript">
<!--
function isDate(str)
{var regstr=/^\d{4}-(\d{1}|11|12)-([1-2]?\d{1}|3[0-1])$/;
 return regstr.test(str);
}
function CheckData()
{
  if (document.form1.txtTitle.value=="")
  {
    alert("对不起，记录标题不能为空，请输入！");
	document.form1.txtTitle.focus();
	return false;
   }
  if (document.form1.txtContent.value=="")
  {
    alert("对不起，记录内容不能为空，请输入！");
	document.form1.txtContent.focus();
	return false;
   }
  if (!isDate(document.form1.txtAddtime.value))
	{alert('请按照规定格式输入日期！');
	 document.form1.txtAddtime.select();
	 return false;
	 }
  
}
//-->
</script>
</head>
<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0">
<SCRIPT src="../include/Calendar/date.js"></SCRIPT>
<IFRAME id=CalFrame 
style="DISPLAY: none; Z-INDEX: 100; WIDTH: 148px; POSITION: absolute; HEIGHT: 194px" 
marginWidth=0 marginHeight=0 src="../include/Calendar/calendar.htm" frameBorder=0 noResize 
scrolling=no></IFRAME>
<table width="488" border="0" cellpadding="0" cellspacing="1">
  <tr>
    <form name="form1" method="post" action="NP_AddNew.asp" onSubmit="return CheckData()">
      <td valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="f2f2f2">
          <tr align="center"> 
            <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td align="center" background="../images/mmTo.gif"><span style="CURSOR: hand; FILTER: dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1);  WIDTH: 100%"><strong>添加记录</strong></span><strong><span style="CURSOR: hand; FILTER: dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1);  WIDTH: 100%"> 
                    </span></strong></td>
                </tr>
              </table></td>
          </tr>
          <tr> 
            <td width="14%" height="8" align="right" bgcolor="#FFFFFF">记录标题：</td>
            <td width="86%" height="24" bgcolor="#FFFFFF">
			<input name="txtTitle" type="text" class="text" size="50" maxlength="28">
              *</td>
          </tr>
          <tr> 
            <td height="7" align="right" bgcolor="#FFFFFF">记录内容：</td>
            <td bgcolor="#FFFFFF"><textarea name="txtContent" cols="55" rows="16" class="text"></textarea></td>
          </tr>
          <tr> 
            <td height="27" align="right" bgcolor="#FFFFFF">记录时间：</td>
            <td bgcolor="#FFFFFF">
			<INPUT name=txtAddtime class=text style="WIDTH: 73px" value="<%=Date()%>"> 
			<A onclick=event.cancelBubble=true;href="javascript:ShowCalendar(document.form1.dimg5,document.form1.txtAddtime,null,0,330)" target=_self><IMG id=dimg5 style="POSITION: relative" height=16 src="../include/Calendar/0_cal.gif" width=16 align=absMiddle vspace=6 border=0></A>
			</td>
          </tr>
          <tr> 
            <td height="16" bgcolor="#FFFFFF">&nbsp;</td>
            <td height="35" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="提交"> 
              <input type="reset" name="Submit2" value="取消"> <input type="button" name="Submit22" value="关闭" onClick="javascript:window.close()"></td>
          </tr>
        </table></td>
    </form>
  </tr>
</table>
</body>
</html>
