<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="Cookies.asp" -->
<%
Call Check_url()

Set Rs    = Server.CreateObject("ADODB.Recordset")
set Rs2   = Server.CreateObject("ADODB.Recordset")



Ac        = Replace_Text(request("Ac"))
ID        = Replace_Text(request("ID"))
n1        = Replace_Text(request("n1"))
n2        = Replace_Text(request("n2"))
n3        = Replace_Text(request("n3"))
if n3="" then n3=0



'///////////////////////////////////////////////////////////////////////////////////////////////////
IF n2<>"" AND n2<>0 AND ID="" THEN
'///////////////////////////////////////////////////////////////////////////////////////////////////
set Rsg = Conn.execute("select * from OUCCS_MenuAll where id="&n2&"")
IF NOT Rsg.BOF THEN
GGid       = Rsg("id")
GGnid      = Rsg("nid")
GGuid      = Rsg("uid")
GGppid     = Rsg("ppid")
GGtitle    = Rsg("title")
GGinfo     = Rsg("info")
GGsys      = Rsg("sys")
GGpeo      = Rsg("peo")
GGpic      = Rsg("pic")
GGccc      = Rsg("ccc")
ELSE
 Response.write "<script language=JavaScript>alert('获取参数错误！请重新操作');location.href='"&setHistoryUrl()&"';</script>"
 Response.End()
END IF
Rsg.Close
'///////////////////////////////////////////////////////////////////////////////////////////////////
IF GGpeo="Experience" THEN

  if Cint(Cookies73)<GGccc then
   Response.write "<script language=JavaScript>alert('你的经验不足"&GGccc&"！无权在该板块发帖');location.href='"&setHistoryUrl()&"';</script>"
   Response.End()
  end if

ELSEIF  GGpeo="Rep" THEN

  if Cint(Cookies86)<GGccc then
   Response.write "<script language=JavaScript>alert('你的在线时间不足"&Days(GGccc)&"！无权在该板块发帖');location.href='"&setHistoryUrl()&"';</script>"
   Response.End()
  end if

END IF
'///////////////////////////////////////////////////////////////////////////////////////////////////
END IF
'///////////////////////////////////////////////////////////////////////////////////////////////////
n_title   = Replace_Text(request.Form("n_title"))
n_qianming = 1
n_tongzhi = Replace_Text(request.Form("n_tongzhi"))
if n_tongzhi="" then n_tongzhi=0
n_url     = Replace_Text(request.Form("n_url"))
n_from    = Cls_WebName
n_user    = Cookies2
n_brief   = Replace_Text(request.Form("n_brief"))
tableID   = Replace_Text(request.Form("tableID"))
n_sina    = Replace_Text(request.Form("n_sina"))
if n_sina="" then n_sina=0
n_tencent = Replace_Text(request.Form("n_tencent"))
if n_tencent="" then n_tencent=0

n_begindate = Replace_Text(request.Form("n_begindate"))
n_enddate   = Replace_Text(request.Form("n_enddate"))
n_pay       = Replace_Text(request.Form("n_pay"))
if n_pay="" then n_pay=0
n_payt      = Replace_Text(request.Form("n_payt"))
if n_payt="" then n_payt=0

'///////////////////////////////////////////////////////////////////
'///////////////////////////////////////////////////////////////////

if ID<>"" then


sqltext="select * from OUCCS_NewsList where n_id="&ID
rs.Open sqltext,Conn,1,1
	if not rs.EOF then

	n_id1=rs("n_id")
	n_title1=rs("n_title")
	n_content1=rs("n_content")
	n_setting1=rs("n_setting")
	n_qianming1=rs("n_qianming")
	n_tongzhi1=rs("n_tongzhi")
	n_nid1=rs("n_nid")
	n_url1=replace(rs("n_url"),"http://","")
	n11=rs("n1")
	n21=rs("n2")
	n31=rs("n3")
	n_begindate1=rs("n_begindate")
	n_enddate1=rs("n_enddate")
	n_pay1=rs("n_pay")
	n_payt1=rs("n_payt")
	
	
	end if
rs.Close







if Request.ServerVariables("REQUEST_METHOD")="POST" and Ac="Add" then


IF n_title="" Then
 Response.Write"<script>alert(""请填写内容！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if

IF Cint(n_pay)<=0 Then
 Response.Write"<script>alert(""金币数最少1枚！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if

IF Cint(n_pay)>Cint(Cookies90) Then
 Response.Write"<script>alert(""金币不足！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if

sqltext="select * from OUCCS_NewsList where n_id="&ID
rs2.Open sqltext,Conn,1,3

	rs2("n_title")=n_title
	rs2("update_time")=Now()
	'rs2("n_begindate")=n_begindate
	'rs2("n_enddate")=n_enddate
	rs2("n_pay")=n_pay
	'rs2("n_payt")=n_payt
	'rs2("n_brief")=gotTopic(n_content,200)
	'rs2("n_content")=n_content
	'rs2("n_setting")=n_setting
	'rs2("n_qianming")=n_qianming
	'rs2("n_tongzhi")=n_tongzhi
	
rs2.Update 
rs2.Close 

Response.Redirect "Moban.asp?K="&tableID&"&ID="&ID&"&TZ=0&Sina="&n_sina&"&Tencent="&n_tencent&"&Tong="&n_tongzhi&"&S=/Home/i.asp"	

end if






else





if Request.ServerVariables("REQUEST_METHOD")="POST" then


IF n_title="" Then
 Response.Write"<script>alert(""请填写内容！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if

IF Cint(n_pay)<=0 Then
 Response.Write"<script>alert(""金币数最少1枚！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if

IF Cint(n_pay)>Cint(Cookies90) Then
 Response.Write"<script>alert(""金币不足！ "");location.href=""javascript:history.go(-1)"";</script>"
 Response.end
End if

sqltext="select * from OUCCS_NewsList"
rs2.Open sqltext,Conn,1,2
rs2.AddNew

	rs2("num")=getkeyid("OUCCS_NewsList","num")
	rs2("n_distinction")=1
	rs2("n_title")=n_title
	'rs2("n_brief")=gotTopic(n_content,200)
	'rs2("n_content")=n_content
	rs2("n_from")=n_from
	rs2("n_user")=n_user
	rs2("n_pid")=19
	rs2("n_ppid")=3
	rs2("n_setting")=0
	rs2("n_qianming")=n_qianming
	rs2("n_tongzhi")=n_tongzhi
	rs2("n_url")=n_url
	rs2("n_time")=Now()
	rs2("update_time")=Now()
	rs2("n_topdate")=Now()
	rs2("n_nid")=tableID
	rs2("n_uid")=Cookies0
	if n3<>0 then
	rs2("n")=n3
	else
	rs2("n")=n2
	end if
	rs2("n1")=n1
	rs2("n2")=n2
	rs2("n3")=n3
	rs2("n4")=0
	'rs2("n_begindate")=n_begindate
	'rs2("n_enddate")=n_enddate
	rs2("n_pay")=n_pay
	'rs2("n_payt")=n_payt
	
rs2.Update 
rs2.Close 




   '发送通知消息
   tongzhi = "<font color=#BBBBBB>"&Now()&"</font> 发布了任务 <a href=""/Shtml/"&n_url&""" target=""_blank"">"&n_title&"</a> "&Cls_Webjf&"<font color=#ff6600><b>+"&Cls_Webjf8&"</b></font>"
      
   if Data_Type = 0 then
   Conn.Execute "Insert Into [OUCCS_Moneylog] (tt,uid,juid,tid,vv,times,flag,fflag,ip,nid) Values (10,"&Cookies0&","&Cookies0&",0,"&Cls_Webjf8&",now(),1,1,'"&Request.serverVariables("REMOTE_ADDR")&"','"&tableID&"')"
   Conn.Execute "Insert Into [OUCCS_NewsList] (n_distinction,n_title,n_brief,n_pid,n_ppid,n_time,n_nid,n_uid,n_juid) Values (0,'消息','"&tongzhi&"',10,10,now(),'"&tableID&"',"&Cookies0&","&Cookies0&")"
   else
   Conn.Execute "Insert Into [OUCCS_Moneylog] (tt,uid,juid,tid,vv,times,flag,fflag,ip,nid) Values (10,"&Cookies0&","&Cookies0&",0,"&Cls_Webjf8&",getdate(),1,1,'"&Request.serverVariables("REMOTE_ADDR")&"','"&tableID&"')"
   Conn.Execute "Insert Into [OUCCS_NewsList] (n_distinction,n_title,n_brief,n_pid,n_ppid,n_time,n_nid,n_uid,n_juid) Values (0,'消息','"&tongzhi&"',10,10,getdate(),'"&tableID&"',"&Cookies0&","&Cookies0&")"
   end if
   
   
   tableID2 = tableID&"1"
   tongzhi2 = "<font color=#BBBBBB>"&Now()&"</font> 发布了任务 <a href=""/Shtml/"&n_url&""" target=""_blank"">"&n_title&"</a> 悬赏 "&n_pay&" "&Cls_Webjb&" "&Cls_Webjb&"总数<font color=#4EC000><b>-"&n_pay&"</b></font>"

   Conn.Execute("Update [OUCCS_Supper] Set su_JB=su_JB-"&n_pay&" Where su_ID="&Cookies0&"") 
   
   if Data_Type = 0 then
   Conn.Execute "Insert Into [OUCCS_Moneylog] (jb,tt,uid,juid,tid,vv,times,flag,fflag,ip,nid) Values (1,10,"&Cookies0&","&Cookies0&",0,-"&n_pay&",now(),1,1,'"&Request.serverVariables("REMOTE_ADDR")&"','"&tableID2&"')"
   Conn.Execute "Insert Into [OUCCS_NewsList] (n_distinction,n_title,n_brief,n_pid,n_ppid,n_time,n_nid,n_uid,n_juid) Values (0,'消息','"&tongzhi2&"',10,10,now(),'"&tableID2&"',"&Cookies0&","&Cookies0&")"
   else
   Conn.Execute "Insert Into [OUCCS_Moneylog] (jb,tt,uid,juid,tid,vv,times,flag,fflag,ip,nid) Values (1,10,"&Cookies0&","&Cookies0&",0,-"&n_pay&",getdate(),1,1,'"&Request.serverVariables("REMOTE_ADDR")&"','"&tableID2&"')"
   Conn.Execute "Insert Into [OUCCS_NewsList] (n_distinction,n_title,n_brief,n_pid,n_ppid,n_time,n_nid,n_uid,n_juid) Values (0,'消息','"&tongzhi2&"',10,10,getdate(),'"&tableID2&"',"&Cookies0&","&Cookies0&")"
   end if  

   
Response.Redirect "Moban.asp?K="&tableID&"&ID=0&TZ=0&Sina="&n_sina&"&Tencent="&n_tencent&"&Tong="&n_tongzhi&"&S=/Home/i.asp"
end if
end if
%>