<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="usercookies.asp"-->
<!--#include file="foxx.asp"-->
<%
dim username,company,memo,class1,class2,dengji,jf,djf
dim rs,sql
username=trim(request("username"))
company=trim(request("company"))
memo=trim(request("memo"))
class1=trim(request("class1"))
class2=trim(request("class2"))
dengji=trim(request("dengji"))
jf=int(request("jf"))
djf=int(request("djf"))

if company="" or username="" then
response.Write "<script LANGUAGE='javascript'>alert('您的参数有误！');history.go(-1)';</script>"
response.end
end if
if int(request("jf"))>int(request("djf")) then
response.Write "<script LANGUAGE='javascript'>alert('不能设定赏分大于您的积分！');history.go(-1);</script>"
response.end
end if
if cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码！');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [FOX_xinxi] where company='"&company&"'"
rs.open sql,conn,1,3
if not rs.eof or not rs.bof then
  if trim(rs("company"))=company then
response.Write "<script LANGUAGE='javascript'>alert('对不起，您的问题已经有人提交！');this.location.href='index.asp';</script>"
 response.end
 end if
 else
rs.addnew
rs("username")=username
rs("company")=company
rs("memo")=memo
rs("class1")=class1
rs("class2")=class2
rs("dengji")=dengji
rs("jf")=jf
rs("fbsj")=now()
rs("youxiao")=youxiao
if dengji=0 then
rs("yz")=1
else
rs("yz")=0
end if
rs.update
end if
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from [FOX_user] where username='"&username&"'"
rs.open sql,conn,1,3
rs("zhidaojf")=rs("zhidaojf")+fbjf
rs.update
rs.close
set rs=nothing
response.Write "<script LANGUAGE='javascript'>alert('发布问题成功！');this.location.href='index.asp';</script>"
	Response.Write"<meta http-equiv='refresh' content='180;URL=index.asp'>"
%>