<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<LINK href="../CSS/Base.css" rel=stylesheet>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<style>
  td { padding:2px 5px 2px 5px;}
</style>
<script language=javascript src="../JS/CheckQuestion.js.php"></script>
<script language=javascript src="../JS/HighLight.js.php"></script>
<link rel="stylesheet" type="text/css" href="../CSS/Calendar.css">
<script type="text/javascript" src="../Calendar/Calendar.js.php"></script>
<script type="text/javascript" src="../Calendar/Calendar.lang.js.php"></script>
<script type="text/javascript" src="../Calendar/Calendar.init.js.php"></script>
<script language=javascript>
function Check_Form_Validator()
{
	if (!CheckNotNull(Check_Form.assessTitle, "评教问卷的标题")) {return false;}
	if (!CheckSpecicalChar(Check_Form.assessTitle, "评教问卷的标题")) {return false;}
	if (document.Check_Form.isWaiting.checked )
	{
		if (!CheckNumber(Check_Form.waitingTime,"评教问卷要求最短回复时间",1,200)) {return false;}
    }
}
function CheckSpecicalChar(objField, strText)
{
	var strErr = "“" + strText + "”不能包含单引号、双引号、反斜线、小于号、大于号、和符号等非法字符！";
	var Re = /[\x22\x27\x5C\x3C\x3E\x26]+/ig;
	if ( Re.test(objField.value))
	{
		alert(strErr);
        objField.focus();
		return false;
	}
	return true;
}
function Ajax_Request(url)
{
	http_request = false;
	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)
		{
			if(http_request.responseText == "false")
			   document.getElementById("checkInfo").innerHTML = "<img src=../Images/check_no.gif border=0> <span class=red>已存在对应的评教问卷类型或适用的课程&nbsp;</span>";
			else if(http_request.responseText == "true")
			   document.getElementById("checkInfo").innerHTML = "";
		}
	}
	;
  	http_request.open('GET', url, true);
	http_request.send(null);
}
function ChangeSurveyType()
{
	if (document.Check_Form.surveyType.value == "1" )
	{
		document.getElementById("surveyCourses").style.display = "";
	}
	else
	{
		document.getElementById("surveyCourses").style.display = "none";
	}	
	var URL = 'AjaxCheckSurveyType.php?surveyID={surveyID}&oldAssessID={assessID}&surveyType=' + document.getElementById("surveyType").value + '&surveyCoursesID=' + document.getElementById("surveyCoursesID").value;
	Ajax_Request(URL);
}
function ChangeSurveyCourse()
{
	var URL = 'AjaxCheckSurveyType.php?surveyID={surveyID}&oldAssessID={assessID}&surveyType=' + document.getElementById("surveyType").value + '&surveyCoursesID=' + document.getElementById("surveyCoursesID").value;
	Ajax_Request(URL);
}
function checkWaiting()
{
	if (document.Check_Form.isWaiting.checked )
	{
		document.getElementById("waitingTime").disabled = false;
    }
	else
	{
		document.getElementById("waitingTime").disabled = true;
	}
}
function Init()
{
	checkWaiting();
	ChangeSurveyType();
}
</script>
<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false" style="margin-top:0px" onload="javascript:Init();">
   <form action="" style="margin:0px;" method="post" name="Check_Form" onsubmit="return Check_Form_Validator()" >
    <table class=datatable style="line-height: 150%;border-collapse:collapse;" cellspacing=0 cellpadding=0 bordercolor=#b5cfd9 border=1 width=100%>
     <div class=position>位置：&nbsp; 我的问卷 &raquo; 编辑调查问卷属性 &raquo; 编辑调查问卷属性</div>
      <tr><td bgcolor="#f5f5f5" colspan=2><b>编辑调查问卷属性 &raquo; {assessTitle}</b></td></tr>
      <tr><td align=right colspan=2><SPAN style="PADDING-RIGHT: 16px">注：以下带“<SPAN  class=red>*</SPAN>”的为必填项</SPAN></td></tr>
      <tr height=25 bgcolor="#e9e9e9"><td colspan=2><span class=red>&nbsp;修改评教类问卷标题</span>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
      <tr> 
           <td height="25" width=27%><SPAN class=red>*</SPAN> 评教问卷的标题：</td>
           <td><input class="textInput" name="assessTitle" type="text" id="assessTitle" size="87" maxlength="200" value="{assessTitle}">
		   <br/><span class=red>*</span> 可使用诸如“语文学科2011-2012学年下学期评教问卷”类此的主题</td>
      </tr>
      <tr height=25 bgcolor="#e9e9e9"><td colspan=2><span class=red>&nbsp;修改该评教问卷的类型</span>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
	  <tr><td><SPAN class=red>*</SPAN> 评教问卷的类型：</td>
	      <td><select name="surveyType" id="surveyType" onchange="javascript:ChangeSurveyType();">
		      <option value="1" {surveyType_1}>学生评教问卷</option>
			  <option value="2" {surveyType_2}>教师评教问卷</option>
			  <option value="3" {surveyType_3}>领导评教问卷</option>
			  <option value="4" {surveyType_4}>督导评教问卷</option>
			  </select>&nbsp;&nbsp;&nbsp;&nbsp;
			  <span id="checkInfo"></span>
		  </td>
	  </tr>
	  <tr id="surveyCourses">
	      <td><SPAN class=red>*</SPAN> 适用评教问卷的课程：</td>
		  <td><select name="surveyCoursesID" id="surveyCoursesID" onchange="javascript:ChangeSurveyCourse();">
			  <option value=0 {surveyCoursesID_0}>全部课程</option>
			  {coursesList}
			  </select>
		  </td>
	  </tr>
      <tr height=25 bgcolor="#e9e9e9"><td colspan=2><span class=red>&nbsp;问卷最短回复时间与意见反馈的必填</span>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
      <tr> 
         <td colspan=2>&nbsp;&nbsp;&nbsp;<input type=checkbox name="isWaiting" value="1" onclick="javascript:checkWaiting()" {isWaiting}>开启最短回复时间限制：该问卷要求最短回复时间 <input name="waitingTime" type="text" id="waitingTime" value="{waitingTime}" size="6"> 秒</td>
      </tr>
      <tr> 
         <td colspan=2>&nbsp;&nbsp;&nbsp;<input type=checkbox name="isRequired" value="1" {isRequired}>该评教问卷内的意见反馈字段设置为必填</td>
      </tr>
   </table>
   <table width=100%>
      <tr><td width=27%></td>
	      <td height="23" align="left">
 		  <input name="oldAssessID" type="hidden" value="{assessID}"> 
 		  <input name="surveyID" type="hidden" value="{surveyID}"> 
 		  <input name="assessID" type="hidden" value="{assessID}"> 
 		  <input name="Action" type="hidden" id="Action" value="{Action}"> 
	      <input type=submit class=inputsubmit value="确定">&nbsp;<input class=inputsubmit type="button" name="close" value="关闭" onClick="javascript:parent.hidePopWin();">
           </td>
       </tr>
    </table>       
    </form>       
 <script type="text/javascript">initInputHighlightScript();</script> 
</body></html>
