<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
if request.QueryString("action")="save" then
  dim errmsg
  errmsg=""

dim sheng,shi,yhname,yhtime,mudi,yaoqiu,board,miaoshu,dtime

sheng=request.Form("sheng")
shi=request.Form("shi")
yhname=trim(replacebadchar(request.Form("yhname")))
yhtime=trim(replace(request.Form("yhtime"),"'",""""))
mudi=request.Form("mudi")
yaoqiu=trim(replacebadchar(request.Form("yaoqiu")))
board=convert(ReplaceBadChar(request.Form("board")))
miaoshu=convert(ReplaceBadChar(request.Form("miaoshu")))
dtime=now()
authorid=userid

''on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select * from sd_yuehui where yhname='"& yhname &"' and faim='"&mudi&"' and userid="& authorid &""
rs.open sql,conn,1
if not(rs.eof or rs.bof) then
  errmsg=errmsg+"<li><strong><font size=4>请不要重复发布约会信息！</font></strong>"
end if 
rs.close
set rs=nothing

if yhname="" then errmsg=errmsg+"<br>"+"<li>约会名称内容不能为空！"
if not isdate(yhtime) then errmsg=errmsg+"<br>"+"<li>约会时间格式不正确！"

if errmsg<>"" then 
 response.Write "错误信息：<br>"
 response.write("　　　"+ errmsg)
 response.Write "<input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'>"
 response.end
end if

set rst=server.CreateObject("adodb.recordset")   
sql1="select * from sd_yuehui where id is null"
rst.open sql1,conn,1,3
rst.addnew
rst("userid")=authorid
rst("username")=MemberName
rst("prov")=sheng
rst("city")=shi
rst("yhtime")=yhtime
rst("yhname")=yhname
rst("faim")=mudi
rst("yaoqiu")=yaoqiu
rst("qita")=board
rst("miaoshu")=miaoshu
rst("dtime")=dtime
rst("renqi")=0
rst.update
rst.close
set rst=nothing
conn.close
set conn=nothing

BackInfo("adddate.asp")
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>红嫂视屏交友情缘网</title>
<meta name="keywords" content="情感,在线,新新,照片,动感影片,诗歌,爱情,纯洁,心连心">
<meta name="description" content="红嫂视屏交友情缘 情感在线">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
}
.STYLE8 {
	color: #CC0099;
	font-size: 12px;
	font-weight: bold;
}
.STYLE31 {color: #666666; font-size: 12px;}
.STYLE81 {color: #CC0099;
	font-size: 12px;
}
-->
</style>
<script Language="JavaScript">
<!--
function CheckAll()  
{  
	if (form.sheng.value.length==0||form.shi.value.length==0)
	{alert("请填写约会所在！");
	form.sheng.focus();
	return false;   
	}
	if (form.yhname.value.length==0)
	{alert("请填写约会名称！");
	form.yhname.focus();
	return false;   
	}
	if (form.yhtime.value.length==0)
	{alert("请填写约会时间！");
	form.yhtime.focus();
	return false;   
	}
	if (form.mudi.value.length==0)
	{alert("请选择约会性质！");
	form.mudi.focus();
	return false;   
	}
	if (form.yaoqiu.value.length==0)
	{alert("请填写约会对象要求！");
	form.yaoqiu.focus();
	return false;   
	}	
	return true;  
}  
-->
</script>
<script language="javascript" src="js/area.js"></script>
</head>
<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="top.asp"--></td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="201" height="168" align="center" valign="top"><div align="left"><!--#include file="memberleft.asp"-->
        </div></td>
    <td width="597" align="center" valign="top"><div align="left"></div>
        <table width="565" border="0" align="center" cellpadding="0" cellspacing="0" >
          <tr>
            <td height="28" background="images/lg_1.gif"><TABLE width="565" border=0 
            cellPadding=0 cellSpacing=0 bgColor=white class="STYLE4" style="BORDER-BOTTOM: #9DCCF6 1px solid">
              <TBODY>
                <TR>
                  <TD align=center width="1%"><img src="image/tiao_3.gif" width="10" height="31"></TD>
                  <TD width="22%" align=center background="image/tiao_4.gif"><table width="142" height="25" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="142" align="center" class="pgd">发布同城活动信息</td>
                      </tr>
                  </table></TD>
                  <TD width="44%" height="20" align="center" background="image/tiao_4.gif">&nbsp;
</TD>
                  <TD width="32%" align="center" background="image/tiao_4.gif">&nbsp;</TD>
                  <TD width="1%" align="center"><img src="image/tiao_2.gif" width="10" height="31"></TD>
                </TR>
              </TBODY>
            </TABLE></td>
          </tr>
          <tr>
            <td height="329" style="border-left:#C7C8CC 1px solid;border-right:#C7C8CC 1px solid;border-bottom:#C7C8CC 1px solid"><br>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="339" align="center"><table width="501" height="111" border="0" cellspacing="0" class="STYLE4">
                      <form name="form" action="adddate.asp?action=save" method="post" onSubmit="return(CheckAll());">
                        <tr>
                          <td height="90"><table width="100%" height="204" border="0" cellpadding="3" cellspacing="0" class="STYLE4">
                              <tr>
                                <td height="25"><div align="right">所在地：</div></td>
                                <td height="25"><span class="white1">
                                  <select name="sheng" onChange="setField(sheng,shi);">
                                    <option value="" selected>省份</option>
                                    <%
					set rs=server.CreateObject("adodb.recordset")
					sql="select id,sheng from sheng order by id"					
					rs.open sql,conn,1
					do while not rs.eof
					  response.Write "<option value="""& rs("id") &""">"& rs("sheng")&"</option>"
					  rs.movenext
					loop
					rs.close
					set rs=nothing
					%>
                                  </select>
                                  <select name="shi">
                                    <option value="" selected>城市</option>
                                  </select>
                                </span></td>
                              </tr>
                              <tr>
                                <td height="25"><div align="right">约会名称：</div></td>
                                <td height="25"><input name="yhname" type="text" id="yhname" size="30" maxlength="50"></td>
                              </tr>
                              <tr>
                                <td height="25"><div align="right">约会时间：</div></td>
                                <td height="25"><input name="yhtime" type="text" id="yhtime" size="11" maxlength="10">
                                    <span class="STYLE1">格式：2006-10-22</span></td>
                              </tr>
                              <tr>
                                <td height="25"><div align="right">活动性质：</div></td>
                                <td height="25"><select name="mudi" id="mudi">
                                    <option value="">选择活动性质</option>
                                    <%
					set rs=server.CreateObject("adodb.recordset")
					sql="select * from friendaim order by id"
					rs.open sql,conn,1
					do while not rs.eof
					  response.Write "<option value='"& rs("faim") &"'>"& rs("faim") &"</option>"
					  rs.movenext
					loop
					rs.close
					set rs=nothing
					%>
                                </select></td>
                              </tr>
                              <tr>
                                <td height="25" width="95"><div align="right">约会对象要求：</div></td>
                                <td height="25" width="341"><input name="yaoqiu" type="text" class="put" id="yaoqiu" size="30" maxlength="50">
                                </td>
                              </tr>
                              <tr>
                                <td width="95" valign="top"><div align="right">其他要求：</div></td>
                                <td height="21" valign="top" width="341"><textarea rows="4" name="board" cols="44" class="put"></textarea></td>
                              </tr>
                              <tr>
                                <td valign="top"><div align="right">约会描述：</div></td>
                                <td height="21" valign="top"><textarea name="miaoshu" cols="44" rows="4" class="put" id="miaoshu"></textarea></td>
                              </tr>
                              <tr align="center">
                                <td height="30" colspan="2" valign="middle"><input type="submit" value="　提交　" name="B1" class="put1">
                                    <input type="reset" value="　重写　" name="B2" class="put1">
                                </td>
                              </tr>
                          </table></td>
                        </tr>
                      </form>
                  </table></td>
                </tr>
                <tr>
                  <td height="14" background="images/hline.gif"></td>
                </tr>
              </table>
            <font color="#006600">&nbsp;                                            </font></td>
          </tr>
      </table></td>
    <td width="163" align="center" valign="top"><!--#include file="fenlei.asp"-->&nbsp;</td>
  </tr>
</table>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><!--#include file="root.asp"--></td>
  </tr>
</table>
</body>
</html>
