<%dbs="../"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->
<%
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select id from H_page where UID="&UID&""
	rs.open sql,conn,1,1
	if rs.eof then
response.Write "<script >alert('提示：\n\n系统规定，登记商家后\n\n才可以发布打折信息...');location.href='page_add.asp';</script>"
response.End()
	end if
	if W_page=0 then
	set rs=Server.CreateObject("Adodb.Recordset")
	sql="select id from H_page where UID="&UID&" and H_union=1"
	rs.open sql,conn,1,1
	if rs.eof then
response.Write "<script >alert('提示：\n\n对不起，您不是签约联盟商家\n\n无法在本频道发布打折信息\n\n目前有两种办法帮助您发布打折...\n\n 一：进入生活频道-分类信息频道,发布打折信息\n\n 二：联系本站管理员,开通打折特约商户');history.back(-1);</script>"
response.End()
	end if
	end if 
if Uname="" or isnull(Uname)  then
response.Write "<script >alert('提示：\n\n对不起,资料还没有完善,请完善以后\n\n立即返回...');location.href='Profile_Edit.asp';</script>"
response.End()
end if
H_title=Replace(Replace(Left(request.Form("H_title"),100),"<","["),">","]")
R_date=Replace(Replace(Left(request.Form("R_date"),10),"<","["),">","]")
R_stop=Replace(Replace(Left(request.Form("R_stop"),10),"<","["),">","]")
H_txt=Left(request.Form("H_txt"),20000)
H_txt=replace(H_txt,"table","表格")
H_txt=replace(H_txt,"TABLE","表格")
H_txt=replace(H_txt,"<tr","表格")
H_txt=replace(H_txt,"<td","表格")
H_txt=replace(H_txt,"</tr","表格")
H_txt=replace(H_txt,"</td","表格")
if H_title="" then
response.Write "<script >alert('提示：\n\n对不起，请填写打折标题！...');history.back(-1);</script>"
response.End()
end if
if H_txt="" then
response.Write "<script >alert('提示：\n\n对不起，请填写详细的打折信息！...');history.back(-1);</script>"
response.End()
end if
if isdate(R_date)<>true then
response.write "<script >alert('提示：\n\n对不起，开始日期格式不对，如："&date()&"！...');history.back(-1);</script>"
response.End()
end if
if isdate(R_stop)<>true then
response.write "<script >alert('提示：\n\n对不起，结束日期格式不对，如："&date()&"！...');history.back(-1);</script>"
response.End()
end if
''开始写入数据
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_disc"
	rs.open sql,conn,1,3
	rs.addnew
	rs("UID")=UID
	rs("H_title")=H_title
	rs("H_txt")=H_txt
	rs("R_date")=R_date
	rs("R_stop")=R_stop	
	rs("RDate")=now()
	rs("H_Recommend")=0
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n添加成功,立即返回...');location.href='disc_master.asp';</script>"
	response.End()
%>