<!--#include file="conn.asp"-->
<!--#include file="inc/function.asp"-->
<%
if Request.Cookies("Muser")="" then Response.Write("请先登录，谢谢！"):Response.End()
dim action,id
action=Trim(Request.QueryString("action"))
id=Trim(Request.QueryString("id"))

opendb
if action="1" then
   call saveadd()
else
   call main()
end if
closedb

sub saveadd()
   dim rs
   set rs=conn.execute("select id from "&predb&"usertj where askid="&id&" and tjuser="&Request.Cookies("Muser"))
   if not(rs.bof and rs.eof) then
      Response.Write("您已经推荐过该问题")
   else
   conn.execute("insert into "&predb&"usertj (askid,tjuser,tjtime) values("&id&","&Request.Cookies("Muser")&",'"&now()&"')")
   Response.Write("成功推荐问题")
   end if
   set rs=nothing
%>
<input type="button" name="button2" id="button2" value="  确 定  " onClick="new parent.dialog().reset();"/>
<%
end sub


sub main()
Dim AskD
Set AskD = Server.CreateObject("KwAsk.FunAsk")
	set AskD.myConn =conn
	AskD.myPredb =predb
	AskD.Getsetting()
	AskD.GetUserRole()
	siteinfo=AskD.siteinfo
	setting=AskD.setting
	UserRole=AskD.UserRole
	set AskD.myConn =Nothing
Set AskD = Nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网友推荐</title>
<link href="Template/<%= siteInfo(11) %>/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="shortbox">
<form action="?id=<%= id %>&action=1" method="post">
		<fieldset class="a_p">
			<legend class="a_l">快问知道提示</legend>
		<div class="a_tj">如果您在这里看到有意思的问题、有实用价值的问题，欢迎您推荐给管理员或编辑，我们将进行公正的评选。
如果您的提问被选为“编辑推荐问题”，提问者将获得10分的奖励！，同时您也将获得奖励。 </div>
        </fieldset>
            <div class="a_s">
              <input type="submit" name="button" id="button" value=" 推荐问题 " /> 
               <input type="button" name="button2" id="button2" value="  取 消  " onClick="new parent.dialog().reset();"/>
            </div>
</form>
</div>
</body>
</html>
<% end sub %>