<%Response.Buffer=True'不要缓存中的页面
Response.CacheControl="no-cache"   
Response.Expires=0 %>
<!--#include file="../../dbconn.asp"-->
<html>
<head>
<title>盛维在线调查系统v9.0免费版-&gt问卷调查系统后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content="盛维在线调查系统v9.0免费版" name=description>
<link rel="stylesheet" href="../../inc/manage.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<!--#include file="../../manage/checkuserflag.asp"-->
<%call CheckUserFlag("02")%>
<!--#include file="menu_edit.asp"-->
<%
openDb DataPathFile
survey_id=request("survey_id")
If Not IsNumeric(survey_id) Then
	Response.Redirect ("../../index.asp")
End If
If Request.ServerVariables("REQUEST_METHOD")="POST" Then
	response.write "<center><br><br><br><br>正在保存数据……</center>"
	Set ObjTC_DB = Server.CreateObject("dc_data100_v1_0.C_A_Config")
	save_yn=ObjTC_DB.survey_canshu_set_save(DataPathFile,survey_id)
	if save_yn=1 then
		call return_edit_list
	else
		response.write "<center><br><br>出错！保存数据失败！</center>"
	end if
end if

set myrs=DbConn.Execute("select D_T_S_ID,email_send,is_cookies,is_lz,is_ip,is_date,is_password,is_pw_same,D_T_S_password,password_send,gongkai,turnToPage,turnToPage_info,D_T_S_e_pw_str,gksign,gkmb from DC_Title_survey where D_T_S_ID=" & survey_id & "")
	if not myrs.eof then
		gk=myrs("gksign")
		mb=myrs("gkmb")
		email_send=myrs("email_send")
		is_cookies=myrs("is_cookies")
		is_lz=myrs("is_lz")
		is_ip=myrs("is_ip")
		is_date=myrs("is_date")
		is_password=myrs("is_password")
		is_pw_same=myrs("is_pw_same")
		D_T_S_password=myrs("D_T_S_password")
		password_string=myrs("D_T_S_e_pw_str")
		password_send=myrs("password_send")
		gongkai=myrs("gongkai")
		turnToPage=myrs("turnToPage")
		turnToPage_info=myrs("turnToPage_info")
		myrs.close
		set myrs=nothing
	else
		response.write "问卷不存在！"
		response.end
	end if
%>
<!--#include file="include/const.asp"-->
<script language="javascript">
  function count_checked_items() {
  var number_checked=0;
  var box_count=document.frm_list.productid.length;
  if ( box_count==null ) {
  if ( document.frm_list.productid.checked==true ) {
  number_checked=1;}else {
  number_checked=0;}}
  else {
  for ( var i=0; i < (box_count); i++ ) {
  if ( document.frm_list.productid[i].checked==true ) {
  number_checked++;}}}return number_checked;
  }

function password_same_id_display(me_value){
     if (me_value=="1"){
	 	document.all.password_same_id.style.display="";
		document.all.password_text_id.style.display="";
		document.all.password_set_id.style.display="none";
		document.all.password_send_id.style.display="";
		}
	 else if(me_value=="0"){
		document.all.password_same_id.style.display="none";
		document.all.password_text_id.style.display="none";
		document.all.password_set_id.style.display="none";
		document.all.password_send_id.style.display="none";
		}
}

function password_text_id_display(me_value){
     if (me_value=="1"){
	 	document.all.password_text_id.style.display="";
		document.all.password_set_id.style.display="none";
		document.all.password_send_id.style.display="";
		}
	 else if (me_value=="0"){
	 	document.all.password_text_id.style.display="none";
		document.all.password_set_id.style.display="";
		document.all.password_send_id.style.display="";
	 }
	 //password_set_id
}

function turnToPage_display(me_value){
     if (me_value=="2"){
	 	document.all.turnToPage2_text_id.style.display="";
		}
	 else{
	 	document.all.turnToPage2_text_id.style.display="none";
	 }
	 //password_set_id
}
function produce_password(s,s_date,o_date) //显示或关闭图层
{ //alert(s);
	if(s=="hidden"){
	document.all.new_catalog.style.visibility="hidden"; 
	window.location.href=window.location.href; //刷新页面时不弹出提示窗口
	//window.location.reload(); //刷新页面时弹出提示窗口
	}
	else{
	//document.all.surveyID.value=s;
	//document.all.startdate.value=s_date;
	//document.all.overdate.value=o_date;	
	document.all.new_catalog.style.visibility="visible"; 
	}
	//history.back(-1);
    //选择后,让第一项被选中,这样,就有Change啦. 
    //document.all.sel.options[0].selected=true; 
}
</script><br>
<table width="96%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#f0f0f0">
  <tr align="left"> 
      <td width="3%" height="25" >&nbsp;&nbsp;<font face="webdings" color="#666666">8</font></td>
      <td width="97%" align="center" ><span style="FONT-SIZE: 14px"><b><font color="#666666">修改</font><font color="#666666">问卷环境选项参数设置</font></b></span></td>
  </tr>
  <tr align="left"> 
      <td height="25" colspan="2" bgcolor="#FFFFFF" >
<form id="form1" name="form1" method="post" action="">
        <table width="99%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#cccccc" bordercolorlight="#cccccc" bordercolordark="#FFFFFF" class="p9">
          <tr height="26">
            <td align="right" bgcolor="#F0F0F0" ><strong>问卷发送方式</strong></td>
            <td width="66%" bgcolor="#F0F0F0">&nbsp;</td>
          </tr>
          <tr height="26">
            <td align="right" >是否开启E-mail发送问卷功能？</td>
            <td><input type="radio" name="email_send" id="radio31" value="1" onClick="pw_send_id.disabled=false;" <%if email_send=true then response.write "checked"%>>
是
  <input name="email_send" type="radio" id="radio32" value="0" onClick="pw_send_id.disabled=true;" <%if email_send=false then response.write "checked"%>>
否 (该功能需要Jmail组件支持)</td>
          </tr>      
          <tr>
            <td colspan="2" align="right" >&nbsp;</td>
          </tr>
          <tr height="26">
            <td align="right" bgcolor="#F0F0F0" ><strong>问卷防作弊设置</strong></td>
            <td bgcolor="#F0F0F0">&nbsp;</td>
          </tr>
          <tr height="26">
            <td align="right" >是否开启使用cookies防止重复答题？</td>
            <td><label>
              <input name="cookies_set" type="radio" id="radio" value="1" <%if is_cookies=true then response.write "checked"%>>
             是 
             <input type="radio" name="cookies_set" id="radio2" value="0" <%if is_cookies=false then response.write "checked"%>>
             否
            </label></td>
          </tr>
          <tr height="26">
            <td align="right" >答题是否需要验证码：</td>
            <td><input type="radio" name="lzm" id="radio33" value="1" <%if is_lz=true then response.write "checked"%>>
是
  <input name="lzm" type="radio" id="radio34" value="0"  <%if is_lz=false then response.write "checked"%>>
否 </td>
          </tr>
          <tr height="26"> 
            <td width="34%" align="right" >是否开启记录IP？</td>
            <td><input type="radio" name="ip_save" id="radio3" value="1"  <%if is_ip=true then response.write "checked"%>>
是
  <input name="ip_save" type="radio" id="radio4" value="0"  <%if is_ip=false then response.write "checked"%>>
否 </td>
          </tr>
          <tr height="26">
            <td align="right" >是否记录投票日期？</td>
            <td><input type="radio" name="date_save" id="radio5" value="1"  <%if is_date=true then response.write "checked"%>>
是
  <input name="date_save" type="radio" id="radio6" value="0"  <%if is_date=false then response.write "checked"%>>
否 </td>
          </tr>

          <tr height="26">
            <td align="right" >答题是否需要密码？</td>
            <td><input type="radio" name="password_yn" id="radio7" value="1" onClick="javascript:password_same_id_display('1');" <%if is_password="True" or password_string<>"" then response.write "checked"%>>
是
  <input name="password_yn" type="radio" id="radio8" value="0" onClick="javascript:password_same_id_display('0');" <%if is_password="False" then response.write "checked"%>>
否 </td>
          </tr>
          <tr height="26" id="password_same_id" <%if is_password=true then response.write "style=""display:false""" else response.write "style=""display:none""" end if%>>
            <td align="right" >所有人使用一个密码答题？</td>
            <td><input type="radio" name="password_same" id="radio11" value="1" onClick="javascript:password_text_id_display('1');" <%if is_pw_same="True" then
	response.write "checked"
end if
	%>>
是
  <input type="radio" name="password_same" id="radio12" value="0"  onclick="javascript:password_text_id_display('0');" <%
	if password_string<>"" or is_pw_same="False" then
  		response.write "checked"
	end if
  %>>
否 </td>
          </tr>
          <tr height="26" id="password_text_id" <%if is_password="True" and is_pw_same="True" then response.write "style=""display:false""" else response.write "style=""display:none""" end if%>>
            <td align="right" >答题密码设置：</td>
            <td><label>
              <input name="password_text" type="text" id="password_text" value="<%=D_T_S_password%>">
            </label></td>
          </tr>
          <tr height="26" id="password_set_id" <%if (is_password="True" and is_pw_same="False") then response.write "style=""display:false""" else response.write "style=""display:none""" end if%>>
            <td align="right" >批量配置密码：</td>
            <td><label>
              <input type="button" name="button" id="button" value="生产密码" onClick="javascript:produce_password();">
            <%if password_string<>"" then
				 	response.write "<font color=""red"">已生产密码：<b>" & ubound(split(password_string,"、"))+1 & "</b>个</font>"
					response.write "　　<a href=""survey_password_look.asp?survey_id=" & survey_id & """ target=""_blank"">查看密码</a>"
			end if%>
            <input name="h_pw_string" type="hidden" id="h_pw_string" value="<%=password_string%>" />
            </label></td>
          </tr>
          <tr height="26" id="password_send_id" <%if is_password="True" then response.write "style=""display:false""" else response.write "style=""display:none""" end if%>>
            <td align="right" >密码发送方式：</td>
            <td><label><input type="radio" name="password_send" id="radio29" value="r" <%if email_send=false or password_send="r" then response.write "checked"%>>
              通过人工发送密码</label><label id="pw_send_id" <%if email_send=false then response.write "disabled" end if%>>
                <input type="radio" name="password_send" id="radio30" value="o" <%if password_send="o" then response.write "checked"%>>
                在发送问卷时附带发送(开启Email发送功能后才能使用)</label></td>
          </tr>
          <tr>
            <td colspan="2" align="right" >&nbsp;</td>
          </tr>
          <tr height="26">
            <td align="right" bgcolor="#F0F0F0" ><strong>投票后转向设置</strong></td>
            <td bgcolor="#F0F0F0">&nbsp;</td>
          </tr><!--
          <tr height="26">
            <td align="right" >问卷结果公开程度设置：</td>
            <td><label>
              <input name="gongkai" type="checkbox" id="gongkai" value="1" onClick="if (radio14.disabled==false){ radio14.disabled=true;radio14.value='我是不能用的';} else { radio14.disabled=false;radio14.value='3';}">
显示柱状统计图</label>
<label><input name="gongkai" type="checkbox" id="gongkai" value="2" onClick="if (radio15.disabled==false){ radio15.disabled=true;radio15.value='我是不能用的';} else { radio15.disabled=false;radio15.value='4';}">
显示曲线统计图</label><label>
<input name="gongkai" type="checkbox" id="gongkai" value="3" onClick="if (radio16.disabled==false){ radio16.disabled=true;radio16.value='我是不能用的';} else { radio16.disabled=false;radio16.value='5';}">
              显示三维饼状图</label><label>
              <input name="gongkai" type="checkbox" id="gongkai" value="4" onClick="if (radio17.disabled==false){ radio17.disabled=true;radio17.value='我是不能用的';} else { radio17.disabled=false;radio17.value='6';}">
              显示统计报表</label>
            </td>
          </tr>-->
          <tr height="26">
            <td align="right" >问卷提交后显示页设置：</td>
            <td><label><input name="turnToPage" type="radio" id="turnToPage1" value="1" onClick="javascript:turnToPage_display('1');" <%if turnToPage=1 then response.write "checked" end if%>>
            提示成功投票后关闭</label>
            <label>
<input type="radio" name="turnToPage" id="turnToPage3" value="3" onClick="javascript:turnToPage_display('3');" <%if turnToPage=3 then response.write "checked" end if%>>
显示投票统计图</label><br/>
              <label>
                <input type="radio" name="turnToPage" id="turnToPage2" value="2" onClick="javascript:turnToPage_display('2');" <%if turnToPage=2 then response.write "checked" end if%>>
              显示我设置的提示信息</label>
              <br>
              <label id="turnToPage2_text_id" <%if turnToPage=2 then response.write "style=""display:false""" else response.write "style=""display:none""" end if%>>
              <textarea name="turnToPage2_text"  cols="45" rows="5"><%=turnToPage_info%></textarea>
              </label>
<!--              <label>
<input type="radio" name="turnToPage" id="radio14" value="3" disabled>
显示柱状统计图</label>
             <br> <label>
<input type="radio" name="turnToPage" id="radio15" value="4" disabled>
显示曲线统计图</label><label>
<input type="radio" name="turnToPage" id="radio16" value="5" disabled>
显示三维饼状图</label><label>
<input type="radio" name="turnToPage" id="radio17" value="6" disabled>
显示统计报表</label>--></td>
          </tr>
          
          <tr height="26">
            <td align="right" >&nbsp;</td>
            <td><label>
              <input type="submit" name="button2" id="button2" value=" 保存设置 ">
            </label></td>
          </tr>
</table>
</form>
</td>
</tr>
<tr align="left"> 
      <td height="6" colspan="2" ></td>
</tr>
</table>
<div id="new_catalog" style="background:#ffffff; position:absolute; left:expression((body.clientWidth-80)/2);top:expression((body.clientHeight-250)/2);width:380; height:200; visibility: hidden;">
 <table width="380" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#cccccc" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
          <tr> 
          <td width="100%" align="right" height="167">
<IFRAME name="p_password" src="survey_canshu_set_produce_password.asp?survey_id=<%=survey_id%>" frameBorder=0 width=380 scrolling=no height=167 style="center"></IFRAME><br><a class=text href='javascript:produce_password("hidden")' >关闭</a>
</td></tr>
</table>
</div>
<%
sub return_edit_list()%>
    <form action="survey_list.asp" method=post name="frm_back">
    <input type="hidden" name="me_page" value=<%=request.Cookies("back_page")%>>
    <input type="hidden" name="keyword" value=<%=request.Cookies("back_keyword")%>>
    <input type="hidden" name="catalogid" value=<%=request.Cookies("back_catalogid")%>>
    <input type="hidden" name="type_id" value=<%=request.Cookies("back_type_id")%>>
    </form>
    <script language="javascript">
         alert("环境选项设置保存完成！");
		 document.frm_back.submit(); 
    </script>
<%end sub%>
</body>
</html>