<!--#include file=conn.asp-->
<!--#include file=config.asp-->
<!--#include file=const.asp-->
<!--#include file=char.asp-->
<%
 '=========================================================
' File: userparty.asp
' Version:3.0
' Date: 2005-10-22
' Script Written by xmrxw
'=========================================================
' Copyright (C) 2004,2005 Xmrxw.Com All rights reserved.
' Web: http://www.xmrxw.com,http://www.xmzxw.com
' Email: info@mssky.com,super@mssky.com
' QQ：10689579　Msn：zdlmicr@hotmail.com
'=========================================================
response.buffer=true
stats="定制约会"
call nav()
if not founduser then
	Errmsg=Errmsg+"<br>"+"<li>您还没有登陆，请登陆后进行操作。"
	founderr=true
end if

if founderr=true then
	call head_var("","")
	call Mslove_error()
else
	call head_var("约会首页","party_index.asp")
conn.execute("update Ms_party set Checked=3 where datevalue(PartyDate)=date()")
%>
<table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
  <tr> 
    <th height=29 colspan="7" id=tabletitlelink>&nbsp;</th>
  </tr>
  <tr> 
    <td width="15%" height=26 class=tablebody1>&nbsp;</td>
    <td width=13% align="center" class=tablebody1><a href="Userparty.asp?action=add">定制约会</a></td>
    <td width=14% align="center" class=tablebody1><a href="userbook.asp?ClassID=1">约会留言</a></td>
    <td width=17% align="center" class=tablebody1><a href="userparty.asp?action=all&list=1">我发起的约会</a></td>
    <td width=15% align="center" class=tablebody1><a href="userparty.asp?action=Ipost">我响应的约会</a></td>
    <td width=15% align="center" class=tablebody1><a href="userparty.asp?action=all&list=3">我以前的约会</a></td>
    <td width="11%" class=tablebody1>&nbsp;</td>
  </tr>
</table>
<%
call tumppages()'翻页处理
strFileName="userparty.asp?action="&Trim(Request("action"))&"&list="&Trim(Request("list"))&""
Select Case Trim(Request("action"))
	Case "add"
		Stats="定制约会"
		Call creat_party()
	case "newsave"
		Stats="保存约会"
		Call newsave()
	case "edit"
		Stats="更新约会"
		Call edit()
	case "editsave"
		Stats="保存修改约会"
		Call editsave()
	case "执行"
		Stats="执行操作"
		Call Setpart()	
	Case "结束"
		Stats="结束约会"
		Call overdata()
	Case "清空"
		Stats="清空约会"
		Call AllDeldata()
	Case "删除"
		Stats="删除约会"
		Call Deldata()
	Case "Ipost"
		Stats="我响应的约会"
		Call listmy()
	Case "拒绝响应"
		Stats="拒绝约会"
		Call Myover()
	Case "清空响应"
		Stats="清空响应"
		Call AllDelpost()
	Case "删除响应"
		Stats="删除响应"
		Call Delpost()
	Case "拒绝约会"
		Stats="拒绝约会"
		Call overyou()
	Case "清空约会"
		Stats="清空约会"
		Call AllDelpar()
	Case "删除约会"
		Stats="删除约会"
		Call Delpar()
	Case "审核"
		Stats="审核响应"
		Call Setchecked()
	Case "power"
		Stats="报名管理"
		Call power()	
	case else
	call main()
End Select
if founderr then call Mslove_error()
end if
call activeonline()
call footer()

sub main()%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
<form action="userparty.asp" method=post name=theForm>
  <tr> 
    <td height="28" colspan="7" align="left" background="Skins/Default/party/titlebg.jpg">
	<%if Trim(Request("list"))=1 then
	response.Write("<img src=""Skins/Default/party/md_state.jpg"" width=""576"" height=""89"">")
	elseif Trim(Request("list"))=3 then
	response.Write("<img src=""Skins/Default/party/md_ed.jpg"" width=""576"" height=""89"">")
	end if%></td>
  </tr>
  <tr align="center"> 
    <td width="41%" height="27" class=tablebody2>约会名称</td>
    <td width="11%" class=tablebody2>发布日期</td>
    <td width="18%" class=tablebody2>约会日期</td>
    <td width="8%" class=tablebody2>约会类型</td>
    <td width="8%" class=tablebody2>响应人数</td>
    <td width="9%" class=tablebody2>状态</td>
    <td width="5%" class=tablebody2>操作</td>
  </tr>
  <%dim Pid,Checked
    set rs=server.createobject("adodb.recordset")
    if Trim(Request("list"))=1 then
		if master or supermaster or standmaster then
        	sql="select * from Ms_party order by pid desc"
		else
			sql="select * from Ms_party where Username='"&trim(membername)&"' order by pid desc"
		end if
    elseif Trim(Request("list"))=3 then
		if master or supermaster or standmaster then
        	sql="select * from Ms_party order by pid desc"
		else
        	sql="select * from Ms_party where Username='"&trim(membername)&"' and Checked=3 order by pid desc"
		end if
    end if
    rs.Open sql,conn,1,1
    if not (rs.eof and rs.bof) then
    call rspages()
    do while not rs.eof and page_count<Cint(MaxPerPage)
Pid=rs("Pid")
Checked=rs("Checked")
  %>
  <tr> 
    <td height="27" class=tablebody1><a href=userparty.asp?action=edit&Pid=<%=pid%> title=更新约会><%=rs("Title")%></a></td>
    <td height="27" align="center" class=tablebody1><%=datevalue(rs("Addtime"))%></td>
    <td height="27" align="center" class=tablebody1><%if datevalue(rs("PartyDate"))=date() then
	response.Write("<font color=red>"&rs("PartyDate")&"</font>")
	else
	response.Write(""&rs("PartyDate")&"")
	end if%></td>
    <td height="27" align="center" class=tablebody1><%if rs("Ispublic")=0 then
	response.Write("公开约会")
	else
	response.Write("单独约会")
	end if%></td>
    <td height="27" align="center" class=tablebody1><%=rs("Userjoin")%></td>
    <td height="27" align="center" class=tablebody1><%if Checked=0 then
	response.Write("<font color=#999999>未审核</font>")
	elseif Checked=1 then
	response.Write("<font color=red>审核</font>")
	elseif Checked=2 then
	response.Write("<font color=red>提前结束</font>")
	elseif Checked=3 then
	response.Write("<font color=blue>历史约会</font>")
	end if%></td>
    <td height="27" align="center" class=tablebody1> <input type=checkbox name=id value=<%=Pid%>></td>
  </tr>
  <%page_count=page_count+1
  rs.movenext
  loop
  end if
  %>
  <tr> 
    <td height="11" colspan="7" class=tablebody1><%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%></td>
  </tr>
    <tr align="right"> 
      <td height="12" colspan="7" class=tablebody1> 
        <input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">
        选中所有显示记录
		<input type=submit name=action onclick="{if(confirm('确定执行所选的操作吗?')){this.document.theForm.submit();return true;}return false;}" value="执行" <%if not(master or supermaster or standmaster) then response.write("disabled")%>>
        -&gt; 
        <select name="ck" id="ck">
          <option value="1">确认审核</option>
          <option value="0">撤消审核</option>
          <option value="2">提前结束</option>
          <option value="3">历史约会</option>
        </select> 
        <input type=submit name=action onclick="{if(confirm('确定提前结束所选的约会吗?')){this.document.theForm.submit();return true;}return false;}" value="结束"> 
        <input type=submit name=action onclick="{if(confirm('确定清空所有约会吗?')){this.document.theForm.submit();return true;}return false;}" value="清空">
        <input type=submit name=action onclick="{if(confirm('确定删除选定的约会吗?')){this.document.theForm.submit();return true;}return false;}" value="删除">
      </td>
  </tr>
  <tr>
      <td height="24" colspan="7" class=tablebody1>注：如果你有管理权限，可进行点击执行进行相关操作！</td>
  </tr>
  </form>
</table>
<%
rs.close
end sub


sub creat_party()
if Cint(GroupSetting(39))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有定制约会的权限，请联系管理员。"
	founderr=true
end if
if Cint(GroupSetting(47))<>0 and  dateadd("n",Cint(GroupSetting(47)),myjoinDate)>=Now() then
  	errmsg=errmsg+"<br>"+"<li>新注册用户"&Cint(GroupSetting(47))&"分钟后才能定制约会，请稍后<a href=login.asp target=_blank>登录</a>。"
	founderr=true
end if
dim UserEmail,Parcount
sql="select UserEmail from [Ms_User] where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
UserEmail=rs(0)
else
UserEmail=0
end if
rs.close
sql="select count(Pid) from [Ms_party] where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
Parcount=rs(0)
else
Parcount=0
end if
rs.close
if Cint(GroupSetting(48))<>0 and Parcount>=Cint(GroupSetting(48)) then
	errmsg=errmsg+"<br>"+"<li>您的约会数达到系统限制，请先清除过去的约会。"
	founderr=true
end if
if founderr=true then exit sub%>
<script language="JavaScript" src="inc/Mymodify.js"></script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=tableborder2>
  <tr>
    <td height="88" background="Skins/Default/party/titlebg.jpg"><img src="Skins/Default/party/make_party.jpg" width="576" height="93"></td>
  </tr>
</table>
<table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
  <form action="userparty.asp?action=newsave" method=POST name="theForm">
    <tr> 
      <td width="25%" height="13" align="right" class=tablebody2> 约会名称：</td>
      <td width="75%" align="left" class=tablebody2> <input name="Title" type="text" id="Title" size="40" maxlength="200"> 
      </td>
    </tr>
	    <%if Cint(Codeshow(4))=1 then%>
    <tr> 
      <td height="27" align="right"  class=tablebody1>检验码：</td>
      <td align="left"  class=tablebody1> <input type="text" name="codestr" maxlength="4" size="4"> 
        &nbsp;<%=GetCode()%>&nbsp;</td>
    </tr>
    <%end if%>
    <tr> 
      <td width="25%" height="14" align="right" class=tablebody1>对方会员：</td>
      <td align="left" class=tablebody1><input name="Partname" type="text" id="Partname" size="20" maxlength="20"> 
        <font color="#0000FF">(可以直接邀请对方，请输入会员注册名，约会类型为单独约会) </font></td>
    </tr>
    <tr> 
      <td width="25%" align="right" class=tablebody1>约会种类： </td>
      <td width="75%" class=tablebody1><select name="Typeid">
          <option value="1" selected>征友</option>
          <option value="2">恋人</option>
          <option value="3">节日</option>
          <option value="4">纪念</option>
          <option value="5">旅游</option>
          <option value="6">其它</option>
        </select>
        　约会类型： 
        <input name="Ispublic" type="radio" value="0" checked>
        公开约会 
        <input type="radio" name="Ispublic" value="1">
        单独约会</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>约会日期：</td>
      <td class=tablebody1><input name=Partydate type=text onfocus="show_cele_date(Partydate,'','',Partydate)" size="20">
        时间： 
        <input name="partytime" type="text" id="partytime" size="10" maxlength="20"></td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>对约会对象性别的要求：</td>
      <td class=tablebody1><select name="Usersex">
          <option value="2">无要求</option>
          <option value="1">男</option>
          <option value="0">女</option>
        </select> </td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>对约会对象年龄的要求：</td>
      <td class=tablebody1> 从 
        <select name="Minage" class="put" id="select">
          <option value="16">16 </option>
          <option value="17">17 </option>
          <option value="18" selected>18 </option>
          <option value="19">19 </option>
          <option value="20">20 </option>
          <option value="21">21 </option>
          <option value="22">22 </option>
          <option value="23">23 </option>
          <option value="24">24 </option>
          <option value="25">25 </option>
          <option value="26">26 </option>
          <option value="27">27 </option>
          <option value="28">28 </option>
          <option value="29">29 </option>
          <option value="30">30 </option>
          <option value="31">31 </option>
          <option value="32">32 </option>
          <option value="33">33 </option>
          <option value="34">34 </option>
          <option value="35">35 </option>
          <option value="36">36 </option>
          <option value="37">37 </option>
          <option value="38">38 </option>
          <option value="39">39 </option>
          <option value="40">40 </option>
          <option value="41">41 </option>
          <option value="42">42 </option>
          <option value="43">43 </option>
          <option value="44">44 </option>
          <option value="45">45 </option>
          <option value="46">46 </option>
          <option value="47">47 </option>
          <option value="48">48 </option>
          <option value="49">49 </option>
          <option value="50">50 </option>
          <option value="51">51 </option>
          <option value="52">52 </option>
          <option value="53">53 </option>
          <option value="54">54 </option>
          <option value="55">55 </option>
          <option value="56">56 </option>
          <option value="57">57 </option>
          <option value="58">58 </option>
          <option value="59">59 </option>
          <option value="60">60 </option>
        </select>
        岁到 
        <select name="Maxage" class="put" id="select2">
          <option value="16">16 </option>
          <option value="17">17 </option>
          <option value="18">18 </option>
          <option value="19">19 </option>
          <option value="20">20 </option>
          <option value="21">21 </option>
          <option value="22">22 </option>
          <option value="23">23 </option>
          <option value="24">24 </option>
          <option value="25">25 </option>
          <option value="26" selected>26 </option>
          <option value="27">27 </option>
          <option value="28">28 </option>
          <option value="29">29 </option>
          <option value="30">30 </option>
          <option value="31">31 </option>
          <option value="32">32 </option>
          <option value="33">33 </option>
          <option value="34">34 </option>
          <option value="35">35 </option>
          <option value="36">36 </option>
          <option value="37">37 </option>
          <option value="38">38 </option>
          <option value="39">39 </option>
          <option value="40">40 </option>
          <option value="41">41 </option>
          <option value="42">42 </option>
          <option value="43">43 </option>
          <option value="44">44 </option>
          <option value="45">45 </option>
          <option value="46">46 </option>
          <option value="47">47 </option>
          <option value="48">48 </option>
          <option value="49">49 </option>
          <option value="50">50 </option>
          <option value="51">51 </option>
          <option value="52">52 </option>
          <option value="53">53 </option>
          <option value="54">54 </option>
          <option value="55">55 </option>
          <option value="56">56 </option>
          <option value="57">57 </option>
          <option value="58">58 </option>
          <option value="59">59 </option>
          <option value="60">60 </option>
        </select>
        岁之间</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>对约会的描述：</td>
      <td class=tablebody1><textarea name="Content" cols="60" rows="5" id="IDContent"></textarea> 
        <a style=cursor:hand onclick="if (parseInt(IDContent.rows)-3>0)(IDContent.rows=parseInt(IDContent.rows)-3)"><img src="Skins/Default/minus.gif" unselectable="on" border='0'></a> 
        <a style=cursor:hand onclick="if (parseInt(IDContent.rows)+3>3)(IDContent.rows=parseInt(IDContent.rows)+3)"><img src="Skins/Default/plus.gif" unselectable="on" border='0'></a><br>
        描述内容不能大于200个字符。</td>
    </tr>
    <tr> 
      <td height="12" align="right" class=tablebody1>约会限制人数：</td>
      <td class=tablebody1><input name="Maxnum" type="text" id="Maxnum" value=<%=Cint(GroupSetting(55))%> size="5" maxlength="10"> 
        <font color="#0000FF">您最大的响应约会人数是：<b><%if Cint(GroupSetting(55))=0 then
		response.write(GroupSetting(55))
		else
		response.write("不限")
		end if%></b>&nbsp;人（选择单独约会，只允许一个响应）</font></td>
    </tr>
    <tr> 
      <td height="5" align="right" class=tablebody1>省　　份：</td>
      <td class=tablebody1><input type=text name=province size=12> <select name="selectp" onChange="selectcityarea('selectp','selectc','theForm');theForm.province.value=this.value;">
          <option value="0" selected>请选择..</option>
        </select> </td>
    </tr>
    <tr> 
      <td height="6" align="right" class=tablebody1>城　　市：</td>
      <td class=tablebody1><input type=text name=city size=12> <select name="selectc" onChange="theForm.city.value=this.value;">
          <option value="0" selected>请选择..</option>
        </select></td>
    </tr>
    <tr> 
      <td height="26" align="right" class=tablebody1>约会地点：</td>
      <td height="26" class=tablebody1> <input name="Address" type="text" id="Address" size="20" maxlength="100">
        最好指定一个特殊地标等等。</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>接头暗号或我的特征：</td>
      <td class=tablebody1><input name="sign" type="text" id="sign" size="20"></td>
    </tr>
    <tr align="center"> 
      <td height="26" colspan="2" class=tablebody2>请您如实填写联系方式，别担心，只有被您确定邀请的人才能看到这些信息。</td>
    </tr>
    <tr> 
      <td rowspan="3" align="right" class=tablebody1>联系方式：</td>
      <td class=tablebody1><input name="Telphone" type="text" id="Telphone" size="20" maxlength="20">
        电话</td>
    </tr>
    <tr> 
      <td class=tablebody1><input name="mobie" type="text" id="mobie" size="20">
        手机</td>
    </tr>
    <tr> 
      <td class=tablebody1><input name="UserEmail" type="text" id="UserEmail" value="<%=UserEmail%>" size="20">
        邮件</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>其他要求：</td>
      <td class=tablebody1><textarea name="Others" cols="60" rows="4" id="OthersID"></textarea> 
        <a style=cursor:hand onclick="if (parseInt(OthersID.rows)-3>0)(OthersID.rows=parseInt(OthersID.rows)-3)"><img src="Skins/Default/minus.gif" unselectable="on" border='0'></a> 
        <a style=cursor:hand onclick="if (parseInt(OthersID.rows)+3>3)(OthersID.rows=parseInt(OthersID.rows)+3)"><img src="Skins/Default/plus.gif" unselectable="on" border='0'></a><br>
        其它要求不能大于200个字符。</td>
    </tr>
    <tr> 
      <td colspan="2" align="center" class=tablebody1> <input class=2 type=Submit value="保存" name=Submit> 
        &nbsp; <input class=2 type="reset" name="Clear" value="清除"></td>
    </tr>
    <tr> 
      <td colspan="2" align="left"  class=tablebody1>　　网络拉近心和心！通过<%=webname%>同城约会系统，不费吹灰之力，找到有缘人！令您的约会万无一失... <br>
　　发布约会金钱/篇 <b><%=GroupSetting(49)%> <%=GroupSetting(50)%></b> 元　发布约会魅力/篇 <b><%=GroupSetting(51)%> <%=GroupSetting(52)%></b> 点　发布约会经验/篇 <b><%=GroupSetting(53)%> <%=GroupSetting(54)%></b> 点<br>
　　响应约会金钱/篇 <b><%=GroupSetting(41)%> <%=GroupSetting(42)%></b> 元　响应约会魅力/篇 <b><%=GroupSetting(43)%> <%=GroupSetting(44)%></b> 点　响应约会经验/篇 <b><%=GroupSetting(45)%> <%=GroupSetting(46)%></b> 点 </td>
    </tr>
  </form>
</table>
<%
end sub

sub listmy()''我响应的约会
%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
<form action="userparty.asp" method=post name=theForm>
  <tr> 
    <td height="28" colspan="7" align="left" background="Skins/Default/party/titlebg.jpg">
	<img src="Skins/Default/party/md_respond_data.jpg" width="576" height="89"></td>
  </tr>
  <tr align="center"> 
    <td width="41%" height="27" class=tablebody2>约会名称</td>
      <td width="11%" class=tablebody2>响应时间</td>
    <td width="16%" class=tablebody2>约会日期</td>
    <td width="9%" class=tablebody2>约会类型</td>
    <td width="8%" class=tablebody2>响应人数</td>
    <td width="9%" class=tablebody2>状态</td>
    <td width="6%" class=tablebody2>操作</td>
  </tr>
  <%dim Pid,Checked
  set rs=server.createobject("adodb.recordset")
sql="select p.pid,p.title,p.PartyDate,p.Ispublic,p.Userjoin,j.Checked,j.Addtime from Ms_party p inner join Ms_partyj j on p.pid=j.pid where j.Username='"&trim(membername)&"'"
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
call rspages()
do while not rs.eof and page_count<Cint(MaxPerPage)
Pid=rs("Pid")
Checked=rs("Checked")
  %>
  <tr> 
    <td height="27" class=tablebody1><a href=partyshow.asp?Pid=<%=pid%> title=查看约会><%=rs("Title")%></a></td>
    <td height="27" align="center" class=tablebody1><%=datevalue(rs("Addtime"))%></td>
    <td height="27" align="center" class=tablebody1><%if datevalue(rs("PartyDate"))=date() then
	response.Write("<font color=red>"&rs("PartyDate")&"</font>")
	else
	response.Write(""&rs("PartyDate")&"")
	end if%></td>
    <td height="27" align="center" class=tablebody1><%if rs("Ispublic")=0 then
	response.Write("公开约会")
	else
	response.Write("单独约会")
	end if%></td>
    <td height="27" align="center" class=tablebody1><%=rs("Userjoin")%></td>
    <td height="27" align="center" class=tablebody1><%if Checked=0 then
	response.Write("<font color=#999999>未审核</font>")
	elseif Checked=1 then
	response.Write("<font color=red>已审核</font>")
	elseif Checked=2 then
	response.Write("<font color=red>被拒绝</font>")
	elseif Checked=3 then
	response.Write("<font color=blue>主动拒绝</font>")
	end if%></td>
    <td height="27" align="center" class=tablebody1> <input type=checkbox name=id value=<%=Pid%>></td>
  </tr>
  <%page_count=page_count+1
  rs.movenext
  loop
  end if
  %>
  <tr> 
    <td height="11" colspan="7" class=tablebody1><%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%></td>
  </tr>
    <tr align="right"> 
      <td height="12" colspan="7" class=tablebody1> 
        <input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">
        选中所有显示记录
        <input type=submit name=action onclick="{if(confirm('确定提前结束所选的约会吗?')){this.document.theForm.submit();return true;}return false;}" value="拒绝响应"> 
        <input type=submit name=action onclick="{if(confirm('确定清空所有约会吗?')){this.document.theForm.submit();return true;}return false;}" value="清空响应">
        <input type=submit name=action onclick="{if(confirm('确定删除选定的约会吗?')){this.document.theForm.submit();return true;}return false;}" value="删除响应">
      </td>
  </tr>
  <tr>
    <td height="24" colspan="7" class=tablebody1>&nbsp;</td>
  </tr>
  </form>
</table>
<%
end sub

sub newsave()''保存入库
if Not ChkPost then'查检提交数据
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法，请不要从外部提交发言。"
   	FoundErr=True
end if
if Cint(GroupSetting(39))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有定制约会的权限，请联系管理员。"
	founderr=true
end if
if Cint(GroupSetting(47))<>0 and  dateadd("n",Cint(GroupSetting(47)),myjoinDate)>=Now() then
  	errmsg=errmsg+"<br>"+"<li>新注册用户"&Cint(GroupSetting(47))&"分钟后才能定制约会，请稍后<a href=login.asp target=_blank>登录</a>。"
	founderr=true
end if
if Cint(Codeshow(4))=1 then
	if Not CodeIsTrue() then
		errmsg=errmsg+"<br>"+"<li>验证码校验失败，请返回刷新页面后再输入验证码。"
		founderr=true
	end if
end if
if request("Title")="" or strLength(request("Title"))>200 then
	errmsg=errmsg+"<br>"+"<li>约会名称不能为空长度不大于200个字符。"
	founderr=true
end if
if request("Partydate")="" or isdate(request("Partydate"))=false then
	errmsg=errmsg+"<br>"+"<li>约会日期不能为空的日期型字符如：2005-04-23。"
	founderr=true
end if
if request("partytime")="" then
	errmsg=errmsg+"<br>"+"<li>约会时间不能为空时间字符如：14:30。"
	founderr=true
end if
if request("Content")<>"" and strLength(request("Content"))>200 then
	errmsg=errmsg+"<br>"+"<li>约会描述长度不大于200个字符。"
	founderr=true
end if
if Cint(GroupSetting(55))<>0 and (trim(request("Maxnum"))="" or not isnumeric(trim(request("Maxnum"))) or Cint(trim(request("Maxnum")))>Cint(GroupSetting(55))) then
	errmsg=errmsg+"<br>"+"<li>约会限制人数不能为空数字型不大于&nbsp;"&GroupSetting(55)&"。"
	founderr=true
end if
if request("province")="" or strLength(request("province"))>20 then
	errmsg=errmsg+"<br>"+"<li>省份不能为空长度不大于20个字符。"
	founderr=true
end if
if request("city")="" or strLength(request("city"))>20 then
	errmsg=errmsg+"<br>"+"<li>城市不能为空长度不大于20个字符。"
	founderr=true
end if
if request("Address")="" or strLength(request("Address"))>100 then
	errmsg=errmsg+"<br>"+"<li>约会具体地点不能为空长度不大于100个字符。"
	founderr=true
end if
if request("UserEmail")="" and request("Telphone")="" and request("mobie")="" then
	errmsg=errmsg+"<br>"+"<li>联系方式不能为空长度。"
	founderr=true
end if
if request("sign")<>"" and strLength(request("sign"))>100 then
	errmsg=errmsg+"<br>"+"<li>接头暗号或我的特征长度不大于100个字符。"
	founderr=true
end if
dim Others
Others=checkStr(trim(request("Others")))
if Others<>"" and strLength(Others)>200 then
	errmsg=errmsg+"<br>"+"<li>其他要求长度不大于200个字符。"
	founderr=true
end if
dim partname,chkname
Partname=checkStr(trim(request("Partname")))
if Partname<>"" and strLength(Partname)<20 then''检查对方姓名是本站会员
set rs=server.createobject("adodb.recordset")
sql="select username from [Ms_User] where username='"&Partname&"'"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
errmsg=errmsg+"<br>"+"<li>对方会员不属于本站会员，请检查是否正确。"
	founderr=true
else
chkname=rs("username")
end if
rs.close
if chkname=trim(membername) then
errmsg=errmsg+"<br>"+"<li>不能对自己发出邀约哦。"
	founderr=true
end if
elseif Partname<>"" and strLength(Partname)>20 then
errmsg=errmsg+"<br>"+"<li>对方会员姓名长度不大于20个字符。"
	founderr=true
end if
dim UserIM
UserIM=checkStr(Request.Form("Telphone"))&"|"&checkStr(Request.Form("mobie"))&"|"&checkStr(Request.Form("Useremail"))
if Chkvalue(1,GroupSetting(49),Cint(GroupSetting(50)))=false then
	errmsg=errmsg+"<br>"+"<li>对不起，您的金币不够请确认。"
	founderr=true
end if
if Chkvalue(2,GroupSetting(51),Cint(GroupSetting(52)))=false then
	errmsg=errmsg+"<br>"+"<li>对不起，您的魅力值不够请确认。"
	founderr=true
end if
if Chkvalue(3,GroupSetting(53),Cint(GroupSetting(54)))=false then
	errmsg=errmsg+"<br>"+"<li>对不起，您的经验值不够请确认。"
	founderr=true
end if
if founderr=true then exit sub
set rs=server.createobject("adodb.recordset")''保存入库
sql="select * from [Ms_party] where Username='"&trim(membername)&"' and Title='"&request("Title")&"'"
rs.open sql,conn,1,3
if not (rs.eof and rs.bof) then
		errmsg=errmsg+"<br>"+"<li>您输入的约会名称有重复，请重新输入！"
		founderr=true
		exit sub
else
rs.addnew
rs("Username")=trim(membername)
if Partname<>"" then
rs("Partname")=Partname
end if
if Partname<>"" then''如果直接邀请会员那么类型为单独约会
rs("Ispublic")=1
else
rs("Ispublic")=Request("Ispublic")
end if
rs("Title")=checkStr(Request("Title"))
rs("Typeid")=Request("Typeid")
rs("Parsex")=Request("Usersex")
rs("PartyDate")=Cdate(request("Partydate")&" "&request("partytime"))
if Request("Minage")>Request("Maxage") then
rs("minage")=Request("Maxage")
rs("maxage")=Request("Minage")
else
rs("minage")=Request("Minage")
rs("maxage")=Request("Maxage")
end if
if Request.Form("Address")<>"" then
rs("Address")=checkStr(Request.Form("Address"))
end if
rs("Content")=checkStr(Request("Content"))
rs("Province")=Request("province")
rs("city")=Request("city")
if Request("Ispublic")=1 or Partname<>"" then
rs("Maxnum")=1
else
if Cint(GroupSetting(55))<>0 then
rs("Maxnum")=Cint(trim(Request("Maxnum")))
else
rs("Maxnum")=0
end if
end if
if trim(request("sign"))<>"" then
rs("Mychara")=trim(request("sign"))
end if
rs("Conet")=UserIM
if Others<>"" then
rs("Others")=Others
end if
rs("Addtime")=Now()
if Cint(GroupSetting(59))=1 or Partname<>"" then
rs("Checked")=1
else
rs("Checked")=0
end if
rs.update
rs.close
conn.execute("update Ms_setup set Partynum=Partynum+1 where Cid=1")
conn.execute("update Ms_user set UserWealth=UserWealth "&GroupSetting(49)&Cint(GroupSetting(50))&",UserEP=UserEP "&GroupSetting(51)&Cint(GroupSetting(52))&",UserCP=UserCP "&GroupSetting(53)&Cint(GroupSetting(54))&" where Userid="&Userid&"")
sucmsg=sucmsg+"<br>"+"<li><b>恭喜您，您已成功定制约会。</b>"
call Mslove_suc()
end if
end sub

sub edit()''更新约会
dim Pid,Conet,Typeid
Pid=checkStr(Request("Pid"))
if Pid="" or not isnumeric(Pid) then
	errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
end if
if Cint(GroupSetting(57))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有编辑自己约会的权限，请联系管理员。"
	founderr=true
end if
if founderr=true then exit sub
if Supermaster or master or standmaster then
sql="select * from [Ms_party] where Pid="&Pid&""
else
sql="select * from [Ms_party] where Username='"&trim(membername)&"' and Pid="&Pid&""
end if
set rs=conn.execute(sql)
if rs.eof or rs.bof then
	errmsg=errmsg+"<br>"+"<li>参数错误，没有该约会记录。"
	founderr=true
	exit sub
else
Conet=rs("Conet")
Typeid=rs("Typeid")%>
<script language="JavaScript" src="inc/Mymodify.js"></script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=tableborder2>
  <tr>
    <td height="88" background="Skins/Default/party/titlebg.jpg"><img src="Skins/Default/party/make_party.jpg" width="576" height="93"></td>
  </tr>
</table>
<table width="100%" align=center cellpadding=3 cellspacing=1 class=tableborder1>
  <form action="userparty.asp?action=editsave" method=POST name="theForm">
    <tr> 
      <td width="25%" height="13" align="right" class=tablebody2> 约会名称：</td>
      <td width="75%" align="left" class=tablebody2> <input name="Title" type="text" id="Title" size="40" maxlength="200" value="<%=rs("Title")%>" readonly ></td>
    </tr>
	    <%if Cint(Codeshow(4))=1 then%>
    <tr> 
      <td height="27" align="right"  class=tablebody1>检验码：</td>
      <td align="left"  class=tablebody1> <input type="text" name="codestr" maxlength="4" size="4"> 
        &nbsp;<%=GetCode()%>&nbsp;</td>
    </tr>
    <%end if%>
    <tr> 
      <td width="25%" height="14" align="right" class=tablebody2>邀请对象：</td>
      <td align="left" class=tablebody2><input name="Partname" type="text" id="Partname" size="20" maxlength="20" value="<%=rs("Partname")%>"> 
        <font color="#0000FF">(可以直接邀请对方，请输入会员注册名，约会类型为单独约会) </font></td>
    </tr>
    <input name="Pid" type="hidden" id="Pid" value="<%=pid%>"  readonly>
    <tr> 
      <td width="25%" align="right" class=tablebody1>约会种类： </td>
      <td width="75%" class=tablebody1> <%dim valuet
	  if Typeid=1 then
	  valuet="征友"
	  elseif Typeid=2 then
	  valuet="恋人"
	  elseif Typeid=3 then
	  valuet="节日"
	  elseif Typeid=4 then
	  valuet="纪念"
	  elseif Typeid=5 then
	  valuet="旅游"
	  else
	  valuet="其它"
	  end if%> <input name="Typeid" type="text" id="Typeid" value="<%=valuet%>" size="20" maxlength="20"  readonly  >
        　约会类型： 
        <input name="Ispublic" type="radio" value="0" <%if rs("Ispublic")=0 then%>checked<%end if%>>
        公开约会 
        <input type="radio" name="Ispublic" value="1" <%if rs("Ispublic")=1 then%>checked<%end if%>>
        单独约会</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>约会日期：</td>
      <td class=tablebody1><input name=Partydate type=text value="<%=split(rs("PartyDate")," ")(0)%>" readonly  >
        时间： 
        <input name="partytime" type="text" id="partytime" size="10" maxlength="20" value="<%=split(rs("PartyDate")," ")(1)%>"></td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>对约会对象性别的要求：</td>
      <td class=tablebody1><select name="Usersex">
          <option value="2" <%if rs("Parsex")=2 then%>selected<%end if%>>无要求</option>
          <option value="1" <%if rs("Parsex")=1 then%>selected<%end if%>>男</option>
          <option value="0" <%if rs("Parsex")=0 then%>selected<%end if%>>女</option>
        </select> </td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>对约会对象年龄的要求：</td>
      <td class=tablebody1>从 
        <select name="Minage" class="put" id="Minage">
		<option value="<%=rs("Minage")%>" selected><%=rs("Minage")%></option>
          <option value="16">16 </option>
          <option value="17">17 </option>
          <option value="18">18 </option>
          <option value="19">19 </option>
          <option value="20">20 </option>
          <option value="21">21 </option>
          <option value="22">22 </option>
          <option value="23">23 </option>
          <option value="24">24 </option>
          <option value="25">25 </option>
          <option value="26">26 </option>
          <option value="27">27 </option>
          <option value="28">28 </option>
          <option value="29">29 </option>
          <option value="30">30 </option>
          <option value="31">31 </option>
          <option value="32">32 </option>
          <option value="33">33 </option>
          <option value="34">34 </option>
          <option value="35">35 </option>
          <option value="36">36 </option>
          <option value="37">37 </option>
          <option value="38">38 </option>
          <option value="39">39 </option>
          <option value="40">40 </option>
          <option value="41">41 </option>
          <option value="42">42 </option>
          <option value="43">43 </option>
          <option value="44">44 </option>
          <option value="45">45 </option>
          <option value="46">46 </option>
          <option value="47">47 </option>
          <option value="48">48 </option>
          <option value="49">49 </option>
          <option value="50">50 </option>
          <option value="51">51 </option>
          <option value="52">52 </option>
          <option value="53">53 </option>
          <option value="54">54 </option>
          <option value="55">55 </option>
          <option value="56">56 </option>
          <option value="57">57 </option>
          <option value="58">58 </option>
          <option value="59">59 </option>
          <option value="60">60 </option>
        </select>
        岁到 
        <select name="Maxage" class="put" id="Maxage">
		<option value="<%=rs("Maxage")%>" selected><%=rs("Maxage")%> </option>
          <option value="16">16 </option>
          <option value="17">17 </option>
          <option value="18">18 </option>
          <option value="19">19 </option>
          <option value="20">20 </option>
          <option value="21">21 </option>
          <option value="22">22 </option>
          <option value="23">23 </option>
          <option value="24">24 </option>
          <option value="25">25 </option>
          <option value="26">26 </option>
          <option value="27">27 </option>
          <option value="28">28 </option>
          <option value="29">29 </option>
          <option value="30">30 </option>
          <option value="31">31 </option>
          <option value="32">32 </option>
          <option value="33">33 </option>
          <option value="34">34 </option>
          <option value="35">35 </option>
          <option value="36">36 </option>
          <option value="37">37 </option>
          <option value="38">38 </option>
          <option value="39">39 </option>
          <option value="40">40 </option>
          <option value="41">41 </option>
          <option value="42">42 </option>
          <option value="43">43 </option>
          <option value="44">44 </option>
          <option value="45">45 </option>
          <option value="46">46 </option>
          <option value="47">47 </option>
          <option value="48">48 </option>
          <option value="49">49 </option>
          <option value="50">50 </option>
          <option value="51">51 </option>
          <option value="52">52 </option>
          <option value="53">53 </option>
          <option value="54">54 </option>
          <option value="55">55 </option>
          <option value="56">56 </option>
          <option value="57">57 </option>
          <option value="58">58 </option>
          <option value="59">59 </option>
          <option value="60">60 </option>
        </select>
        岁之间</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>对约会的描述：</td>
      <td class=tablebody1><textarea name="Content" cols="60" rows="5" id="IDContent"><%=rs("Content")%></textarea> 
        <a style=cursor:hand onclick="if (parseInt(IDContent.rows)-3>0)(IDContent.rows=parseInt(IDContent.rows)-3)"><img src="Skins/Default/minus.gif" unselectable="on" border='0'></a> 
        <a style=cursor:hand onclick="if (parseInt(IDContent.rows)+3>3)(IDContent.rows=parseInt(IDContent.rows)+3)"><img src="Skins/Default/plus.gif" unselectable="on" border='0'></a><br>
        描述内容不能大于200个字符。</td>
    </tr>
    <tr> 
      <td height="12" align="right" class=tablebody1>约会限制人数：</td>
      <td class=tablebody1><input name="Maxnum" type="text" id="Maxnum" size="5" maxlength="10" value="<%=rs("Maxnum")%>" > 
        <font color="#0000FF">您最大的响应约会人数是：<b><%if Cint(GroupSetting(55))=0 then
		response.write(GroupSetting(55))
		else
		response.write("不限")
		end if%></b>&nbsp;人（选择单独约会，只允许一个响应）</font></td>
    </tr>
    <tr> 
      <td height="5" align="right" class=tablebody1>省　　份：</td>
      <td class=tablebody1><input type=text name=province size=12 value="<%=rs("Province")%>"  readonly ></td>
    </tr>
    <tr> 
      <td height="2" align="right" class=tablebody1>城　　市：</td>
      <td class=tablebody1><input type=text name=city size=12 value="<%=rs("City")%>"  readonly ></td>
    </tr>
    <tr> 
      <td height="1" align="right" class=tablebody1>约会地点：</td>
      <td class=tablebody1><input name="Address" type="text" id="Address" size="20" maxlength="100" value="<%=rs("Address")%>">
        最好指定一个特殊地标等等。</td>
    </tr>
    <tr> 
      <td height="1" align="right" class=tablebody1>接头暗号或我的特征：</td>
      <td class=tablebody1><input name="sign" type="text" id="sign" size="20" value="<%=rs("Mychara")%>"></td>
    </tr>
    <tr> 
      <td height="26" colspan="2" align="center" class=tablebody2>请您如实填写联系方式，别担心，只有被您确定邀请的人才能看到这些信息。</td>
    </tr>
    <tr> 
      <td rowspan="3" align="right" class=tablebody1>联系方式：</td>
      <td class=tablebody1><input name="Telphone" type="text" id="Telphone" size="20" maxlength="20" value="<%=split(Conet,"|")(0)%>">
        电话</td>
    </tr>
    <tr> 
      <td class=tablebody1><input name="mobie" type="text" id="mobie" size="20" maxlength="20" value="<%=split(Conet,"|")(1)%>">
        手机</td>
    </tr>
    <tr> 
      <td class=tablebody1><input name="UserEmail" type="text" id="UserEmail"  value="<%=split(Conet,"|")(2)%>" size="20">
        邮件</td>
    </tr>
    <tr> 
      <td align="right" class=tablebody1>其他要求：</td>
      <td class=tablebody1><textarea name="Others" cols="60" rows="4" id="OthersID"><%=rs("Others")%></textarea> 
        <a style=cursor:hand onclick="if (parseInt(OthersID.rows)-3>0)(OthersID.rows=parseInt(OthersID.rows)-3)"><img src="Skins/Default/minus.gif" unselectable="on" border='0'></a> 
        <a style=cursor:hand onclick="if (parseInt(OthersID.rows)+3>3)(OthersID.rows=parseInt(OthersID.rows)+3)"><img src="Skins/Default/plus.gif" unselectable="on" border='0'></a><br>
        其它要求不能大于200个字符。</td>
    </tr>
    <tr> 
      <td colspan="2" align="center" class=tablebody1> <input class=2 type=Submit value="保存" name=Submit> 
        &nbsp; <input class=2 type="reset" name="Clear" value="清除"></td>
    </tr>
  </form>
  <tr> 
      <td colspan="3" align="align" class=tablebody1 >　　网络拉近心和心！通过<%=webname%>同城约会系统，不费吹灰之力，找到有缘人！令您的约会万无一失... <br>
　　发布约会金钱/篇 <b><%=GroupSetting(49)%> <%=GroupSetting(50)%></b> 元　发布约会魅力/篇 <b><%=GroupSetting(51)%> <%=GroupSetting(52)%></b> 点　发布约会经验/篇 <b><%=GroupSetting(53)%> <%=GroupSetting(54)%></b> 点 <br>
　　响应约会金钱/篇 <b><%=GroupSetting(41)%> <%=GroupSetting(42)%></b> 元　响应约会魅力/篇 <b><%=GroupSetting(43)%> <%=GroupSetting(44)%></b> 点　响应约会经验/篇 <b><%=GroupSetting(45)%> <%=GroupSetting(46)%></b> 点 </td>
    </tr>
</table>
<%
end if
rs.close
end sub

sub power()%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
  <form action="userparty.asp" method=post name=theForm>
    <tr align="center"> 
      <th height="28" colspan="7" class=tablebody2>响应会员列表</th>
    </tr>
    <tr align="center"> 
      <td width="17%" height="27" class=tablebody2>会员名称</td>
      <td width="16%" class=tablebody2>联系电话</td>
      <td width="17%" class=tablebody2>联系邮件</td>
      <td width="21%" class=tablebody2>响应时间</td>
      <td width="10%" class=tablebody2>状态</td>
      <td width="10%" class=tablebody2>通知</td>
      <td width="9%" class=tablebody2>操作</td>
    </tr>
    <%dim pids,Checked,pid
  	Pid=checkStr(trim(request("Pid")))'去除特殊字符
	if Pid="" or not isInteger(Pid) then
	errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
	end if	
Pid=cint(Pid)
	if master or standmaster or supermaster then
	sql="select pid from Ms_party where pid="&pid&""
	else
	sql="select pid from Ms_party where pid="&pid&" and username="&trim(membername)&""
	end if
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
pids=rs("pid")
else
	errmsg=errmsg+"<br>"+"<li>您没有管理该约会报名的权限。"
	founderr=true
	exit sub
end if
rs.close
  set rs=server.createobject("adodb.recordset")
  sql="select * from Ms_partyj where PID="&Pids&""
rs.Open sql,conn,1,1
if not (rs.eof and rs.bof) then
call rspages()
do while not rs.eof and page_count<Cint(MaxPerPage)
Checked=rs("Checked")%>
    <tr> 
      <td height="24" class=tablebody1><a href=dispuser.asp?username=<%=rs("Username")%>><%=rs("Username")%></a></td>
      <td height="24" class=tablebody1><%=rs("Telephone")%></td>
      <td height="24" class=tablebody1><%=rs("EMail")%></td>
      <td align="center" class=tablebody1><%=rs("Addtime")%></td>
      <td align="center" class=tablebody1><%if Checked=0 then
	response.Write("<font color=#999999>未审核</font>")
	elseif Checked=1 then
	response.Write("<font color=red>已审核</font>")
	elseif Checked=2 then
	response.Write("<font color=red>被拒绝</font>")
	elseif Checked=3 then
	response.Write("<font color=blue>主动拒绝</font>")
	end if%></td>
      <td align="center" class=tablebody1><a href="javascript:openScript('messanger.asp?action=new&touser=<%=htmlencode(rs("Username"))%>',500,400)">发送</a></td>
      <td align="center" class=tablebody1><input type=checkbox name=id value=<%=Pid%>></td>
    </tr>
    <%page_count=page_count+1
  rs.movenext
  loop
  end if
  %>
    <tr> 
      <td height="26" colspan="7" class=tablebody2><%if totalrec>0 then
		  	call showpage(strFileName)
		  end if%></td>
    </tr>
    <tr align="right"> 
      <td colspan="7" class=tablebody1> <input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">
        选中所有显示记录 
        <input name=action type=submit id="action" onclick="{if(confirm('确定审核所选的约会对象吗?')){this.document.theForm.submit();return true;}return false;}" value="审核"> 
        <input name=action type=submit id="action" onclick="{if(confirm('确定拒绝所选的约会对象吗?')){this.document.theForm.submit();return true;}return false;}" value="拒绝约会"> 
        <input name=action type=submit id="action" onclick="{if(confirm('确定清空所有约会吗?')){this.document.theForm.submit();return true;}return false;}" value="清空约会"> 
        <input name=action type=submit id="action" onclick="{if(confirm('确定删除选定的约会吗?')){this.document.theForm.submit();return true;}return false;}" value="删除约会"></td>
    </tr>
  </form>
</table>

<%end sub


sub editsave()''修改保存入库
if Not ChkPost then'查检提交数据
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法，请不要从外部提交发言。"
   	FoundErr=True
end if
if Cint(Codeshow(4))=1 then
	if Not CodeIsTrue() then
		errmsg=errmsg+"<br>"+"<li>验证码校验失败，请返回刷新页面后再输入验证码。"
		founderr=true
	end if
end if
dim Pid
Pid=checkStr(Request("Pid"))
if Pid="" or not isnumeric(Pid) then
	errmsg=errmsg+"<br>"+"<li>参数错误。"
	founderr=true
end if
if Cint(GroupSetting(57))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有编辑自己约会的权限，请联系管理员。"
	founderr=true
end if
if request("Content")<>"" and strLength(request("Content"))>200 then
	errmsg=errmsg+"<br>"+"<li>约会描述长度不大于200个字符。"
	founderr=true
end if
if Cint(GroupSetting(55))<>0 and (trim(request("Maxnum"))="" or not isnumeric(trim(request("Maxnum"))) or Cint(trim(request("Maxnum")))>Cint(GroupSetting(55))) then
	errmsg=errmsg+"<br>"+"<li>约会限制人数不能为空数字型不大于&nbsp;"&GroupSetting(55)&"。"
	founderr=true
end if
if request("Address")="" or strLength(request("Address"))>100 then
	errmsg=errmsg+"<br>"+"<li>约会具体地点不能为空长度不大于100个字符。"
	founderr=true
end if
if request("UserEmail")="" and request("Telphone")="" and request("mobie")="" then
	errmsg=errmsg+"<br>"+"<li>联系方式不能为空长度。"
	founderr=true
end if
if request("sign")<>"" and strLength(request("sign"))>100 then
	errmsg=errmsg+"<br>"+"<li>接头暗号或我的特征长度不大于100个字符。"
	founderr=true
end if
dim Others
Others=checkStr(trim(request("Others")))
if Others<>"" and strLength(Others)>200 then
	errmsg=errmsg+"<br>"+"<li>其他要求长度不大于200个字符。"
	founderr=true
end if
dim partname
Partname=checkStr(trim(request("Partname")))
if Partname<>"" and strLength(Partname)<20 then''检查对方姓名是本站会员
set rs=server.createobject("adodb.recordset")
sql="select username from [Ms_User] where username='"&Partname&"'"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
errmsg=errmsg+"<br>"+"<li>对方会员不属于本站会员，请检查是否正确。"
	founderr=true
else
chkname=rs("username")
end if
rs.close
if chkname=trim(membername) then''查检是否是自己
errmsg=errmsg+"<br>"+"<li>不能对自己发出邀约哦。"
	founderr=true
end if
elseif Partname<>"" and strLength(Partname)>20 then
errmsg=errmsg+"<br>"+"<li>对方会员姓名长度不大于20个字符。"
	founderr=true
end if
dim UserIM
UserIM=checkStr(Request.Form("Telphone"))&"|"&checkStr(Request.Form("mobie"))&"|"&checkStr(Request.Form("Useremail"))
if founderr=true then exit sub
set rs=server.createobject("adodb.recordset")''保存入库
sql="select * from [Ms_party] where Username='"&trim(membername)&"' and Pid="&Pid&""
rs.open sql,conn,1,3
if rs.eof or rs.bof then
		errmsg=errmsg+"<br>"+"<li>对不起，数据库中没有该记录！"
		founderr=true
		exit sub
else
if Partname<>"" then
rs("Partname")=Partname
end if
if Request("Minage")>Request("Maxage") then
rs("minage")=Request("Maxage")
rs("maxage")=Request("Minage")
else
rs("minage")=Request("Minage")
rs("maxage")=Request("Maxage")
end if
if Request.Form("Address")<>"" then
rs("Address")=checkStr(Request.Form("Address"))
end if
rs("Content")=checkStr(Request("Content"))
if trim(request("sign"))<>"" then
rs("Mychara")=trim(request("sign"))
end if
rs("Conet")=UserIM
if Others<>"" then
rs("Others")=Others
end if
if Cint(GroupSetting(59))=1 or Partname<>"" then
rs("Checked")=1
else
rs("Checked")=0
end if
if Request("Ispublic")=1 or Partname<>"" then
rs("Maxnum")=1
else
if Cint(GroupSetting(55))<>0 then
rs("Maxnum")=Cint(trim(Request("Maxnum")))
else
rs("Maxnum")=0
end if
end if
rs.update
rs.close
sucmsg=sucmsg+"<br>"+"<li><b>恭喜您，您已成功修改约会。</b>"
call Mslove_suc()
end if
end sub

sub AllDeldata()''清空记录
dim userpartnum
if Cint(GroupSetting(58))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有删除自己约会的权限，请升级等级。"
	founderr=true
	exit sub
end if
set rs=server.createobject("adodb.recordset")
sql="select count(PID) from [Ms_party] where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
userpartnum=rs(0)
else
userpartnum=0
end if
rs.close
set rs=server.createobject("adodb.recordset")
sql="select PID from [Ms_party] where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
do while not rs.eof
conn.execute("delete from Ms_partyj where Pid ="&rs("PID")&"")
rs.movenext
loop
end if
rs.close
conn.execute("Update Ms_setup set Partynum=Partynum-"&userpartnum&" where Cid=1")
conn.execute("update Ms_user set UserWealth=UserWealth-("&GroupSetting(49)&(Cint(GroupSetting(50))*(userpartnum))&"),UserEP=UserEP-("&GroupSetting(51)&(Cint(GroupSetting(52))*(userpartnum))&"),UserCP=UserCP-("&GroupSetting(53)&(Cint(GroupSetting(54))*(userpartnum))&") where Username='"&trim(membername)&"'")''扣除约会金钱点数
conn.execute("delete from Ms_party where Username='"&trim(membername)&"'")
sucmsg=sucmsg+"<br>"+"<li>您已成功清空所有约会。"
	call Mslove_suc()
end sub

sub Deldata()''删除记录
if Cint(GroupSetting(48))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有删除自己约会的权限，请升级等级。"
	founderr=true
	exit sub
end if
dim delid,FixID,Splitnum,Maxnum
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
Splitnum=split(delid,",")
Maxnum=ubound(Splitnum)
if founderr=true then exit sub
conn.execute("Update Ms_setup set Partynum=Partynum-"&(Maxnum+1)&" where Cid=1")
if Cint(GroupSetting(120))=0 then''删除权限
conn.execute("delete from Ms_party where Username='"&trim(membername)&"' and Pid in("&delid&")")
else
conn.execute("delete from Ms_party where Pid in("&delid&")")
end if
conn.execute("delete from Ms_partyj where Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功删除所选定的记录。"
	call Mslove_suc()
end sub

sub overdata()''提前结束约会
dim delid,FixID
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_party set Checked=2 where Username='"&trim(membername)&"' and Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功提前结束所选定的记录。"
	call Mslove_suc()
end sub


sub Myover()''拒绝响应约会
dim delid,FixID,Splitnum,Maxnum
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_partyj set Checked=3 where Username='"&trim(membername)&"' and Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功拒绝响应所选定的记录。"
	call Mslove_suc()
end sub

sub AllDelpost()''清空所有响应
dim mypartnum
set rs=server.createobject("adodb.recordset")
sql="select count(PID) from Ms_partyj where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
mypartnum=rs(0)
else
mypartnum=0
end if
rs.close
set rs=server.createobject("adodb.recordset")
sql="select PID from Ms_partyj where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
do while not rs.eof
conn.execute("Update Ms_party set Userjoin=Userjoin-1 where Pid="&rs("Pid")&"")
rs.movenext
loop
rs.close
end if
conn.execute("delete from Ms_partyj where Username='"&trim(membername)&"'")
sucmsg=sucmsg+"<br>"+"<li>您已成功清空所有响应。"
	call Mslove_suc()
end sub

sub Delpost()''删除选定的响应约会
dim delid,FixID,Splitnum,Maxnum
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
Splitnum=split(delid,",")
Maxnum=ubound(Splitnum)
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_party set Userjoin=Userjoin-"&(Maxnum+1)&" where Pid in("&delid&")")
conn.execute("delete from Ms_partyj where Username='"&trim(membername)&"' and Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功删除响应所选定的记录。"
	call Mslove_suc()
end sub


sub overyou()''拒绝别人响应约会
dim delid,FixID
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_partyj set Checked=2 where Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功拒绝响应所选定的记录。"
	call Mslove_suc()
end sub

sub AllDelpar()''清空所有响应
dim mypartnum
sql="select PID from Ms_party where Username='"&trim(membername)&"'"
set rs=conn.execute(sql)
if not (rs.eof and rs.bof) then
do while not rs.eof 
conn.execute("delete from Ms_partyj where pid="&rs("Pid")&"")
rs.movenext
loop
rs.close
end if
conn.execute("Update Ms_party set Userjoin=0 where Username='"&trim(membername)&"'")
sucmsg=sucmsg+"<br>"+"<li>您已成功清空所有响应。"
	call Mslove_suc()
end sub

sub Delpost()''删除选定的响应约会
dim delid,FixID,Splitnum,Maxnum
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
Splitnum=split(delid,",")
Maxnum=ubound(Splitnum)
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_party set Userjoin=Userjoin-"&(Maxnum+1)&" where Pid in("&delid&")")
conn.execute("delete from Ms_partyj where Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功删除响应所选定的记录。"
	call Mslove_suc()
end sub

sub Setchecked()''审核响应约会
dim delid,FixID
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_partyj set Checked=1 where Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功审核所选定的记录。"
	call Mslove_suc()
end sub

sub Setpart()''受限制操作
dim delid,FixID,ck
if not (master and supermaster and standmaster) then
if Cint(GroupSetting(56))=0 then
	errmsg=errmsg+"<br>"+"<li>您没有审核撤消约会的权限，请联系管理员。"
	founderr=true
end if
end if
ck=checkStr(Request("ck"))
if ck="" or not isnumeric(ck) then
	errmsg=errmsg+"<br>"+"<li>请选择执行操作的项目。"
	founderr=true
end if
delid=replace(request("id"),"'","")
delid=replace(delid,";","")
delid=replace(delid,"--","")
delid=replace(delid,")","")
fixid=replace(delid,",","")
fixid=Trim(replace(fixid," ",""))
If Not IsNumeric(fixid) Then
	Errmsg=Errmsg+"<br><li>错误的参数。"
	founderr=true
End If
if delid="" or isnull(delid) then
Errmsg=Errmsg+"<li>"+"错误的参数。"
Founderr=true
end if
if founderr=true then exit sub
conn.execute("update Ms_party set Checked="&ck&" where Pid in("&delid&")")
sucmsg=sucmsg+"<br>"+"<li>您已成功执行所选定的记录。"
	call Mslove_suc()
end sub%> 
<script>
first("selectp","selectc","theForm",0,0)
</script>
</body>
</html>