<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<!--#include file="../conn/email.asp" -->
<%

D_domain=split(split("http://"&Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("URL"),"http://")(1),"/zj")(0)

F_id=request.QueryString("F_id")
action=request.QueryString("action")

if action="input" then
R_time=now()
R_rid=gen_key(15)
For Each x In Request.Form 
if x>0 then
if Request.Form(x)="" then
Response.Write"<script>alert('请填全内容后提交!');history.back();</script>"
response.end()
else
conn.execute("Insert into F_response(R_cid,R_content,R_time,R_rid,R_member) values("&x&",'"&Replace_Text(Request.Form(x))&"','"&R_time&"','"&R_rid&"','"&session("M_login")&"')")
end if
end if
Next 
response.Write("<div align=""center"" style=""font-size:36px; color:#009900; font-family:'微软雅黑';padding-top:200px;"">提交成功！</div>")
call sendmail("您的网站有新的表单提交","您的网站有新的表单提交，请进入“网站后台” - “表单系统” - “查看统计”！")
response.end()
end if

Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from F_form where F_id="&F_id
rs.open sql,conn,1,1
F_title=rs("F_title")
F_bz=rs("F_bz")
F_yz=rs("F_yz")
rs.close
set rs=nothing

if F_yz=1 and session("M_login")="" then
Response.Write"<script>alert('请先登录会员!');window.location='../member/member_login.asp';</script>"
end if
%>
<!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=gb2312" />
<title>表单系统</title>
<script type="text/javascript" src="../js/date.js"></script>
<script type="text/javascript" src="../upload/AienUpload/init.js"></script>
<style type="text/css">
			html {
				overflow:auto;
			}
			body { 
				background-color: transparent; 
				font-size:15px;
				line-height:180%;
				font-family:"微软雅黑";
				
			}
			a{ font-size:12px; color:#777777; text-decoration:none;}
			a:hover {color:#0066ff;text-decoration: underline}
			.input {border-top:1px solid #ABADB3;border-left:1px solid #ABADB3;border-right:1px solid #ddd;border-bottom:1px solid #ddd;height:24px;width:400px;padding:0 5px;}
</style>
</head>
<body>
<%
if GetBody(D_domain)="" then
%>
<embed src="F_yz.swf?domain=<%=D_domain%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="0" height="0"></embed>
<script> 
function sendToJavaScript(value){
if(value=="1"){
}else{
document.getElementById("old").innerHTML="<div align='center' style='margin:10px 10px 10px 10px;padding:5px 5px 5px 5px;border:1px solid #ff0000'><font color='red'>万能表单系统未授权！</font></div>"
}
}
</script>
<div id="old"></div>
<%
else 
if split(GetBody(D_domain),"|")(3)="1" then
%>
<%else%>
<div align='center' style='margin:10px 10px 10px 10px;padding:5px 5px 5px 5px;border:1px solid #ff0000'><font color='red'>万能表单系统未授权！</font></div>
<%
end if
end if
%>
<h2><%=F_title%></h2>
<font color="#666666"><%=F_bz%></font>
<hr>
<form id="form1" action="form.asp?action=input" method="post">
<%
Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from F_content where C_fid="&F_id&" order by C_order"
rs.open sql,conn,1,1
if not rs.eof then
Do while Not rs.eof

if rs("C_type")="text" then
C_content="<input type='text' value='' name='"&rs("C_id")&"' class='input'>"
end if

if rs("C_type")="area" then
C_content="<textarea name='"&rs("C_id")&"' cols='80' rows='3' ></textarea>"
end if

if rs("C_type")="radio" then
content=split(rs("C_content"),"|")
For i = 0 To UBound(content)
C_content=C_content&"<input type='radio' name='"&rs("C_id")&"' value='"&content(i)&"'/>"&content(i)
Next
end if

if rs("C_type")="checkbox" then
content=split(rs("C_content"),"|")
For i = 0 To UBound(content)
C_content=C_content&"<input type='checkbox' name='"&rs("C_id")&"' value='"&content(i)&"'/>"&content(i)
Next
end if

if rs("C_type")="option" then
content=split(rs("C_content"),"|")
C_content="<select name='"&rs("C_id")&"'>"
For i = 0 To UBound(content)
C_content=C_content&"<option  value='"&content(i)&"'>"&content(i)&"</option>"
Next
C_content=C_content&"</select>"
end if

if rs("C_type")="date" then
C_content="<input type='text' value='' name='"&rs("C_id")&"' onfocus='HS_setDate(this)' class='input'>"
end if

if rs("C_type")="pic" then
C_content="<input type='text' value='' name='"&rs("C_id")&"' id='"&rs("C_id")&"' class='input'> <input type='button' value='上传文件' onclick=""showUpload('"&rs("C_id")&"','"&rs("C_id")&"','',1,null,'','');"" />"
end if

if rs("C_bz")<>"" then
C_bz=rs("C_bz")&"<br>"
end if
response.Write "<b>"&rs("C_order")&"."&rs("C_title")&"</b><br><font size='-1' color='#666666'>"&C_bz&"</font>"&C_content&"<br><br>"
C_content=""
rs.movenext
		loop
	end if
set rs=nothing
%>
<hr>
<input type="submit" value="提交" style="width:80px;height:30px; border:hidden; font-family:'微软雅黑'; font-size:15px;">
</form>
</body>
</html>