<html>
<head>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<link href="../CSS/Base.css" rel="stylesheet" type="text/css"/>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<link href="../CSS/SurveyList.css" rel="stylesheet" type="text/css"/>
<LINK href="../CSS/Window.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="../JS/Common.js.php"></script>
<script type="text/javascript" src="../JS/Window.js.php"></script>
<link href="../CSS/SurveyList.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../JS/Browser.js.php"></script>
<script>
function refreshParent() {
   //self.location.replace(self.location.href);
   self.location.href = '{logicURL}';
}
function checkall(form) 
{
	if( form.all.checked)
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			e.checked = true;
		}
	}
	else
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			e.checked = false;
		}
    }
}
var ajax_request = false;
function HttpRequest(questionID,isLogicAnd)
{
    var url = "../System/AjaxShowQtnLogic.php?Action=SetQtnLogicRel&surveyID={surveyID}&questionID=" + questionID + "&isLogicAnd=" + isLogicAnd +"&randid="+Math.random();
	if(window.ActiveXObject){
		try{
			ajax_request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			try{
				ajax_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {}
		}
	}
	else if(window.XMLHttpRequest){
		ajax_request = new XMLHttpRequest();
		if (ajax_request.overrideMimeType){
			ajax_request.overrideMimeType('text/xml');
		}
	}
	
	if (!ajax_request){
		alert("Cannot create an XMLHTTP instance");
		return false;
	}
	ajax_request.onreadystatechange = function() {
	  if( ajax_request.readyState == 4 && ajax_request.status == 200) {
			AjaxRequest(questionID,isLogicAnd);
	   }	
	};
	ajax_request.open('GET', url, true);
	ajax_request.send(null);
}

var http_request = false;
function AjaxRequest(questionID,isLogicAnd)
{
	var theLogicObj = eval("document.getElementById('conList_"+questionID+"')");
	theLogicObj.innerHTML = "<div id=\"preloading\" style=\"background-color:#f0f0f0;width:160px;overflow:hidden;white-space:nowrap;color:black;font-weight:bold;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px;\">&nbsp;<img src=\"..\/Images\/wait.gif\" width=\"16px\" height=\"16px\">&nbsp;正在加载数据&nbsp;<\/div>";
    var url = "../System/AjaxShowQtnLogic.php?surveyID={surveyID}&questionID=" + questionID + "&isLogicAnd=" + isLogicAnd + "&randid="+Math.random();
	if(window.ActiveXObject){
		try{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			try{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {}
		}
	}
	else if(window.XMLHttpRequest){
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType){
			http_request.overrideMimeType('text/xml');
		}
	}
	
	if (!http_request){
		alert("Cannot create an XMLHTTP instance");
		return false;
	}
	http_request.onreadystatechange = function() {
	  if( http_request.readyState == 4 && http_request.status == 200) {
			theLogicObj.innerHTML = http_request.responseText;
	   }	
	};
	http_request.open('GET', url, true);
	http_request.send(null);
}
</script>
<body oncontextmenu="return false" style="background-color:#244d8f;">

<div style="line-height:10px">&nbsp;</div>
<div id="menu">
  <span style="float:left;padding-left:26px;"><div class="navmenu">我的问卷 &raquo; {surveyTitle}</div></span>
  <span style="float:right">
  <ul><li><a href="ShowMain.php">我的问卷</a></li>
      <li><a href="{questionListURL}">调查问题</a></li>
	  <li class="current"><a href="{logicURL}">逻辑关系</a></li>
	  <li><a href="{relationURL}">数值关联</a></li>
	  <li><a href="{quotaURL}">问卷配额</a></li>
	  <li><a href="{weightURL}">选项权重</a></li></ul></span>
</div>
<div class="wrap q_clear" id=wrap>
<div>
<form name="form" method="post" action="">
<div class=content>
<div class=q_clear id=mysurvey><h1>问卷中问题逻辑关系依赖</h1><p class=surveynum>[ <span class=red>{recNum}</span> 组关系 ]</p>&nbsp;
<!--<input class=inputsubmit name="qtnList" type="button" id="qtnList" value="调查问题" onclick="javascript:window.location.href='{questionListURL}';">-->
<input class=inputsubmit name="createNew" type="button" id="createNew" value="新增定义" onclick="javascript:showPopWin('{newLogicURL}', 900, 470, refreshParent, null,'新增问题逻辑关系定义')"><br/></div>
<div id=myname>所谓逻辑关系的问题关联（&nbsp;<a onmouseover="this.T_WIDTH=595;this.T_PADDING=0;this.T_BGCOLOR='#ffffff'; return escape('&nbsp;举例：若您问卷中的第6题需要依赖于第1题性别题目选择男性才会显示提供作答<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您可以在第6题上创建一个依赖于第1题性别题目的逻辑关系<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在新增逻辑关系的界面中<问卷中此问题>选择第6题<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<依赖于此问题>选择第1题性别题目，<运算关系与回复值>选择“选择”和“男性”<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这样您的问卷在初始访问时，第6题是先不显示的，只有在第1题选择男性答案时才会显示并可提供作答')" href="javascript:void(0);"><font color=red><b>?</font></a></b>&nbsp;）指问卷内的问题与其他问题中的变量之间的依赖关系。存在逻辑关系的问题是先不在问卷上显示的，只有等定义的逻辑条件成立时该问题才显示</div>
<a name="top" href="javascript:void(0);"></a>
<div class="datalist">

<table class=datatable width=100% cellspacing=0 cellpadding=0 style="border-left:0px;border-right:0px">
  <tr>
      <td width=1% noWrap style="border:0px">&nbsp;</td>
      <td width=107 nowrap style="border:0px"><b>选择逻辑关系维度</b></td>
      <td width=110 nowrap bgcolor="#244d8f" align=center style="border-left:1px #b5cfd9 solid;border-right:1px #b5cfd9 solid;border-bottom:0px"><a href="{logicURL}" style="color:white">问题关联</a><IMG SRC="../Images/list_menu_arrow.gif"></td>
	  <td width=110 nowrap bgcolor="#eeeeee" align=center style="border-right:1px #b5cfd9 solid;border-bottom:0px"><a href="{optAssURL}" style="color:#444444">选项关联</a><IMG SRC="../Images/list_menu_arrow.gif"></td>
	  <td width=110 nowrap bgcolor="#eeeeee" align=center style="border-right:1px #b5cfd9 solid;border-bottom:0px"><a href="{qtnAssURL}" style="color:#444444">矩阵行关联</a><IMG SRC="../Images/list_menu_arrow.gif"></td>
 	  <td width=* style="border:0px;border-right:0px;">&nbsp;</td>
 </tr>
</table>

 <table class=datatable id="datatable" style="border-bottom:0px;" cellspacing=0 cellpadding=0>
   <tr class=coltitle>
	  <td width=2% noWrap>&nbsp;</td>
      <td width=78%>&nbsp;<B>问题显示依赖</B></td>
      <td width=8% noWrap align=center>&nbsp;<B>题间关系</B></td>
      <td width=8% noWrap align=center><b>操 作</b> </td>
   </tr>
   <!-- BEGIN LOGIC -->
   <tr height=25 onmouseover="this.style.backgroundColor='#deefff'" onmouseout="this.style.backgroundColor='#ffffff'">
      <td align=center valign=center><input name="questionID[]" type="checkbox" id="questionID[]" value="{questionID}"></td>
      <td valign=top><b>{questionName}</b></td>
      <td noWrap align=center valign=center><input type=radio name="isLogicAnd_{questionID}" id="isLogicAnd_{questionID}" value="1" onclick="javascript:HttpRequest({questionID},1);" {isLogicAnd1}><b>与</b>&nbsp;<input type=radio name="isLogicAnd_{questionID}" id="isLogicAnd_{questionID}" value="0" onclick="javascript:HttpRequest({questionID},0);" {isLogicAnd0}><b>或</b></td>
      <td noWrap align=center valign=center>
		   <A href="{editURL}">修改</A>&nbsp;
		   <A href="{deleteURL}" onclick="return window.confirm('您真的想删除该条逻辑关系吗？本操作不可恢复！')">删除</A>
	  </td>
   </tr>
   <tr>
     <td bgcolor="#f5fafe">&nbsp;</td>
     <td colspan=3 align=left bgcolor="#f5fafe" height=25><div id="conList_{questionID}">{conList}</div></td>
   </tr>
   <!-- END LOGIC -->
</table>
<table width=100% style="border:0px;margin:0px;padding:0px;">
    <tr>
	  <td width=2% style="border:0px;margin:0px;padding:0px;" align=center><input name="all" type="checkbox" id="all" value="all" onclick="checkall(this.form)" style="background-color:#ffffff"></td>
	  <td style="border:0px;margin:0px;padding:0px;">
	  <span style="float:left"><input name="DeleteSurveyLogicSubmit" class=inputsubmit type="submit" id="DeleteSurveyLogicSubmit" value="删除定义" onclick="return window.confirm('您真的想删除当前选中的逻辑关系定义吗？本操作不可恢复！')"></span>
	  <span style="float:right">&nbsp;<a name="footer" href="#top"><img src="../Images/top.gif" align="middle" alt="TOP"></a></span>	
	</td></tr></table>
</div>
</div></div></div>
<input name="surveyID" type="hidden" id="surveyID" value="{surveyID}"> 
</form>
<script>adjustMenuWarpSize();</script>
<script language=javascript src="../JS/Example.js.php"></script>

<link href="../CSS/Notifier.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="../JS/Jquery.min.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.notifier.min.js.php"></script>
<script>
	  var mOptions = {};
	  mOptions.lifeTime = 0;
	  if( {recHaveNum} == 0 )
	  {
		  $.jnotify('逻辑关系举例', '举例：若您的问卷中的第6题需要依赖于第1题性别题目选择男性才会显示提供作答', '../Images/admin.png', mOptions);
		  $.jnotify('建立逻辑关系', '您可以建立这样的逻辑关系：<问卷中此问题>选择第6题，<依赖于此问题>选择第1题，<回复值>选择男性', '../Images/admin.png', mOptions);
		  $.jnotify('更多提示信息', '鼠标移向界面左上角的<font color=red>红色问号?</font>可得到更详细提示', '../Images/admin.png', mOptions);
	  }
</script>

</body></html>
