<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>
<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>
<script type="text/javascript" src="../JS/Browser.js.php"></script>

<script type="text/javascript" src="../JS/Jquery.min.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.notification.js.php"></script>
<link type="text/css" rel="stylesheet" href="../CSS/Notification.css" />
<script type="text/javascript" src="../JS/CheckQuestion.js.php"></script>
<script language="javascript"> 
function checkall(form) 
{
	if( form.all.checked)
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			if( e.disabled != true ) e.checked = true;
		}
	}
	else
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			if( e.disabled != true ) e.checked = false;
		}
    }
}
function ajax_Submit(url,postStr) {
	var ajax=false; 
	try { ajax = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { ajax = false; } }
	if (!ajax && typeof XMLHttpRequest!='undefined') ajax = new XMLHttpRequest(); 

	ajax.open("POST", url, true); 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(postStr);
	ajax.onreadystatechange = function(){
		if (ajax.readyState == 4)
		{
			if(ajax.status == 200)
			{
				var theRtnText = ajax.responseText;
				document.getElementById("quotaReCheckData").innerHTML = theRtnText;
				exeRuturnScript(theRtnText);
				//parent.document.getElementById("the_content_iframe").contentWindow.document.body.style.overflowX='auto';
				adjustMenuWarpSize();
			}
			else
			{
				$.notification('网络传输问题');
			}
		}	
	} 
}
function QuotaReCheckSubmit()
{
	var objField = document.Check_Form.quotaID;
	var theDefineIDValue = '';
	if( typeof objField != 'undefined' )
	{
		if( Check_Form_Validator() != false )
		{
			theDefineIDValue = getRadioCheckBoxValue(objField);
			var surveyID = document.getElementById('surveyID').value;
			var ParamString = "Action=QuotaReCheckSubmit";
			ParamString += "&quotaID="+theDefineIDValue;
			ParamString += "&surveyID="+surveyID;
			document.getElementById("quotaReCheckData").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>";
			ajax_Submit('QuotaReCheck.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}',ParamString);
		}
	}
	else
	{
		var strErr = "“需要检查的配额定义”必须选择一个选项或者当前问卷可能不存在配额定义！";
		$.notification(strErr);
		return false;
	}
}
function Check_Form_Validator()
{
    if (!CheckRadioNoClick(document.Check_Form.quotaID, "需要检查的配额定义")) {return false;}
}
function ResetInit()
{
	document.getElementById("quotaReCheckData").innerHTML = '' ;
}
function exeRuturnScript(html) 
{ 
	var reg = /<script[^>]*>([^\x00]+)$/i; 
	var htmlBlock = html.split("<\/script>"); 
	for (var i in htmlBlock) 
	{ 
		var blocks;
		if (blocks = htmlBlock[i].match(reg)) 
		{ 
			var code = blocks[1].replace(/[<]!--/, ''); 
			try 
			{ 
				eval(code);
			} 
			catch (e) { } 
		}
	} 
}

function ajaxOverFlagSubmit(url,postStr) {
	var ajax=false; 
	try { ajax = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { ajax = false; } }
	if (!ajax && typeof XMLHttpRequest!='undefined') ajax = new XMLHttpRequest(); 

	ajax.open("POST", url, true); 
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	ajax.send(postStr);
	ajax.onreadystatechange = function(){
		if (ajax.readyState == 4)
		{
			if(ajax.status == 200)
			{
				document.getElementById('OverFlagSubmitButton').disabled = false;
				QuotaReCheckSubmit();
				adjustMenuWarpSize();
				$.notification('设置一条或多条数据为无效回复成功');
			}
			else
			{
				$.notification('网络传输问题');
			}
		}	
	} 
}
function checkSelectData()
{
	var strErr = "操作要求必须先选择一条或多条数据！";
	objField = document.Ajax_Form.responseID;
	if( typeof objField == 'undefined' )
	{
		document.Ajax_Form.all.focus();
		$.notification(strErr);
		return false;
	}
	if( objField.length == null )
	{
		if (! objField.disabled && objField.checked) return true;
		else
		{
			document.Ajax_Form.all.focus();
			$.notification(strErr);
			return false;
		}
	}
	else
	{
		for (i=0;i<objField.length;i++){
			if ( ! objField[i].disabled && objField[i].checked) return true;
		}
		document.Ajax_Form.all.focus();
		$.notification(strErr);
		return false;
	}
}
function overFlagSubmit()
{
	if ( checkSelectData() ) 
	{
		var objField = document.Ajax_Form.responseID;
		var theResponseIDValue = '';
		var theCreateDateValue = '';
		var theOverFlagValue = '';
		var theOverFlag0Value = '';
		if( typeof objField != 'undefined' )
		{
			if( objField.length == null )
			{
				if (objField.checked){
					theResponseIDValue += objField.value + ',';
					var theCreateDateID = eval('document.Ajax_Form.createDate_'+objField.value);
					var theOverFlagID = eval('document.Ajax_Form.overFlag_'+objField.value);
					var theOverFlag0ID = eval('document.Ajax_Form.overFlag0_'+objField.value);
					theCreateDateValue += theCreateDateID.value + ',';
					theOverFlagValue += theOverFlagID.value + ',';
					theOverFlag0Value += theOverFlag0ID.value + ',';
				}
			}
			else
			{		
				for( k=0;k<objField.length;k++){
					if (objField[k].checked) {
						theResponseIDValue += objField[k].value + ',';
						var theCreateDateID = eval('document.Ajax_Form.createDate_'+objField[k].value);
						var theOverFlagID = eval('document.Ajax_Form.overFlag_'+objField[k].value);
						var theOverFlag0ID = eval('document.Ajax_Form.overFlag0_'+objField[k].value);
						theCreateDateValue += theCreateDateID.value + ',';
						theOverFlagValue += theOverFlagID.value + ',';
						theOverFlag0Value += theOverFlag0ID.value + ',';
					}
				}
			}
			theResponseIDValue = theResponseIDValue.substr(0,theResponseIDValue.length-1);
			theCreateDateValue = theCreateDateValue.substr(0,theCreateDateValue.length-1);
			theOverFlagValue = theOverFlagValue.substr(0,theOverFlagValue.length-1);
			theOverFlag0Value = theOverFlag0Value.substr(0,theOverFlag0Value.length-1);
		}
		var ParamString = "Action=OverFlagSubmit";
		ParamString += "&responseID="+theResponseIDValue;
		ParamString += "&createDate="+theCreateDateValue;
		ParamString += "&overFlag="+theOverFlagValue;
		ParamString += "&overFlag0="+theOverFlag0Value;
		ParamString += "&surveyID={surveyID}";
		document.getElementById('OverFlagSubmitButton').disabled = true;
		ajaxOverFlagSubmit('QuotaReCheck.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}',ParamString);
	}
}
</script> 
<META content="MSHTML 6.00.3790.0" name=GENERATOR></HEAD>
<body oncontextmenu="return false" style="background-color:#244d8f;" onload="javascript:adjustMenuWarpSize();">

<div style="line-height:10px">&nbsp;</div>
<div id="menu">
  <span style="float:left;padding-left:26px;"><div class="navmenu">数据报告中心 &raquo; 问卷配额检查</div></span>
  <span style="float:right">
  <ul><li><a href="../System/ShowMain.php">我的问卷</a></li>
      <li><a href="../Analytics/DataOverview.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">标准报告</a>
      <li><a href="../Analytics/DefineReport.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">自定义报告</a></li>
      <li class="current"><a href="../Analytics/DataList.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">回复数据</a></li>
      <li><a href="../Analytics/EventAward.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">调查奖励</a></li>
      <li><a href="../Analytics/PanelArea.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">样本来源</a></li>
      <li><a href="../Analytics/TaskResult.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">计划任务</a></li>
      <li><a href="../Analytics/SurveyIndexResult.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">指标分析</a></li>
	  </ul></span>
</div>

<div class="wrap q_clear" id=wrap>
<div>
<div class=content>
<div class=q_clear id=mysurvey><h1>[<font color=red>{surveyTitle}</font>] 问卷配额检查</h1><p class=surveynum>[ <span class=red>{totalResponseNum}</span> 配额 ]</p>&nbsp;<br/></div>
<div id=myname><span class=red>*</span> 按照定义的问卷配额，重新对数据进行检查，并对数据进行相应处理</div>
<a name="top" href="javascript:void(0);"></a>
<div class="datalist">
<form name="Check_Form" id="Check_Form" method="POST" action="">
<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="#eeeeee" align=center style="border-left:1px #b5cfd9 solid;border-right:1px #b5cfd9 solid;border-bottom:0px"><a href="../Analytics/DataList.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}" style="color:#444444">回复数据详细</a><IMG SRC="../Images/list_menu_arrow.gif"></td>
	  <td width=110 nowrap bgcolor="#244d8f" align=center style="border-right:1px #b5cfd9 solid;border-bottom:0px"><a href="../Analytics/QuotaReCheck.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}" style="color:white">问卷配额检查</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=3% noWrap align=center>&nbsp;</td>
      <td width=90% noWrap>&nbsp;<B>配额名称</B></td>
	  <td width=8% nowrap align=center>&nbsp;<B>配额限制</B></td>
   </tr>
   <!-- BEGIN QUOTA -->
   <tr height=25 onmouseover="this.style.backgroundColor='#deefff'" onmouseout="this.style.backgroundColor='#ffffff'"> 
      <td align=center bgcolor="#efefef"><input type="radio" name="quotaID" id="quotaID" value="{quotaID}" style="background:#efefef"></td>
      <td><b>{quotaName}</b></td>
	  <td align=center bgcolor="#efefef">&nbsp;<b>{quotaNum}</b></td>
   </tr>
   <tr>
      <td width=3% noWrap align=center>&nbsp;</td>
      <td colspan=2 align=left bgcolor="#f5fafe" height=25>{conList}</td>
   </tr>
   <!-- END QUOTA -->
</table>
<table width=100% style="border:0px;margin:0px;padding:0px;">
    <tr>
      <td style="border:0px;margin:0px;padding:0px;" width=3% noWrap align=center>&nbsp;</td>
	  <td style="border:0px;margin:0px;padding:0px;"><span style="float:left"><input class=inputsubmit name="submit" type="button" id="submit" value="开始检查" onclick="javascript:QuotaReCheckSubmit();">&nbsp;<input class=inputsubmit name="reset" type="reset" id="reset" value="&nbsp;&nbsp;重置&nbsp;&nbsp;" onclick="javascript:ResetInit();" >
	  <input type=hidden name="surveyID" id="surveyID" value="{surveyID}">
     </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>
</form>

 <table id="quotaReCheckDataTable" style="LINE-HEIGHT: 150%;border-collapse:collapse;border:0px" cellSpacing=0 cellPadding=0 width="100%" borderColor=#b5cfd9 border=0>
   <tr style="border:0px"><td id="quotaReCheckDataInner" align=left style="padding-top:15px;padding-bottom:5px;border:0px"><div id="quotaReCheckData"></div></td></tr>
 </table>

</body></html>
