<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"-->
<%
dim errmsg
errmsg=""


dim uname,upass,tid,regid

uname=trim(ReplaceBadChar(request.Form("user_name")))
upass=trim(request.Form("password"))
tid=trim(request.Form("tid"))

'on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select userid from user_info where username='"& uname &"' and userpass='"& md5(upass) &"'"
rs.open sql,conn,1
if rs.eof or rs.bof then
  errmsg=errmsg+"<br><li>你的帐号或者密码填写不正确！"
else
   regid=rs("userid") 
end if 
rs.close
set rs=nothing

set rs=server.CreateObject("adodb.recordset")
sql="select yzren from sd_yuehui where id="& tid &""
rs.open sql,conn,1
if not rs.eof then
  if rs("yzren")<>"" and not isnull(rs("yzren")) then
  stra=split(rs("yzren"),",")
  for o=0 to ubound(stra)
    if stra(o)=regid&"|"&uname then 
	  errmsg=errmsg+"<br><li>你已经应征过此同城约会！"
	  exit for
	end if  
  next  
  end if
end if
rs.close
set rs=nothing

if uname="" then errmsg=errmsg+"<br>"+"<li>用户帐号不能为空！"

if errmsg<>"" then 
 response.Write "<table width=400 align=center><tr><td height=25 style='font-size:14px;color:#ff0000'><b>错误信息：</b></td></tr>"
 response.write("<tr><td style='font-size:12px'>"+ errmsg +"<br></td></tr>")
 response.Write "<tr><td align='center'><br><input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'></td></tr></table>"
 response.end
end if

set rst=server.CreateObject("adodb.recordset")   
sql1="select * from sd_yuehui where id="& tid
rst.open sql1,conn,1,3
if rst("yzren")<>"" and not isnull(rst("yzren")) then
   rst("yzren")=rst("yzren")&","&regid&"|"&uname
else
   rst("yzren")=regid&"|"&uname
end if   
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>同城约会应征成功</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta HTTP-EQUIV=refresh Content='1;url=tryst.asp'>
</head>

<table border="0" cellspacing="0" width="100%" cellpadding="0" height="418" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="418" valign="middle" align="center" class="STYLE4">
<b>您的应征信息已经提交发送！<a href="tryst.asp"><font color="#996633">返回同城约会</font></a></b></td>
</tr>
</table>
</body>
</html>