<html><head><title>问卷数据迁移</title>
<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"/>
<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 language=javascript src="../JS/CheckQuestion.js.php"></script>

<link href="../CSS/FileUpload.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../JS/Swfupload.js.php"></script>
<script type="text/javascript" src="../JS/Swfqueue.js.php"></script>		
<script type="text/javascript" src="../JS/Swfobject.js.php"></script>		
<script type="text/javascript" src="../JS/FileProgress.js.php"></script>
<script type="text/javascript" src="../JS/Swfhandlers.js.php"></script>

<script language=javascript>
function CheckExportSurvey()
{
	if (!CheckNotNull(exportSurveyForm.exportSurvey, "需要进行问卷迁出的调查问卷")) {return false;}
} 
function CheckImportSurvey()
{
	if (!CheckNotNull(importSurveyForm.importSurveyFile, "需要进行问卷迁入的数据文件")) {return false;}
} 
function CheckExportData()
{
	if (!CheckNotNull(exportDataForm.exportData, "需要进行回复数据迁出的调查问卷")) {return false;}
}
function CheckImportData()
{
	if (!CheckNotNull(importDataForm.importData, "需要进行回复数据迁入的调查问卷")) {return false;}
	if (!CheckNotNull(importDataForm.importDataFile, "需要进行回复数据迁入的数据文件")) {return false;}
}
</script>
<META content="MSHTML 6.00.3790.0" name=GENERATOR></HEAD>
<BODY oncontextmenu="return false" style="background-color:#244d8f;">
<div style="line-height:10px">&nbsp;</div>
<div id=nav><a href="../System/ShowMain.php">我的问卷</a> &raquo; 问卷数据迁移</div>
<div class="wrap q_clear" id=wrap>
<div>
<div class=content>
<div class=q_clear id=mysurvey><h1>调查问卷数据在不同的EnableQ服务器之间迁移</h1><br/></div>
<div id=myname></div>
<div class="datalist">
  <form action="" method="post" name="exportSurveyForm" id="exportSurveyForm"  onsubmit="return CheckExportSurvey();">
  <table style="LINE-HEIGHT: 150%;border-collapse:collapse;" cellSpacing=0 cellPadding=0 width="100%" borderColor=#b5cfd9 border=1>
       <tr><td bgcolor="#f5f5f5"><b>选择调查问卷进行问卷迁出</b></td></tr>
	   <tr><td><select name="exportSurvey" id="exportSurvey" style="width:910px;*width:920px">
		   <option value=''>请选择调查问卷...</option>
		   {exportSurveyList}
		   </select>
	   </td></tr>
  </table><table width=100% style="border:0px;">
       <tr><td style="border:0px;">
		        <input type="hidden" name="Action" value="exportSurveySubmit">
                <input type="submit" name="submit" class=stnsubmit value="开始迁出问卷"> 
          </td>
       </tr>
  </table>  
  </form>

  <form action="" method="post" name="importSurveyForm" id="importSurveyForm"  onsubmit="return CheckImportSurvey();">
  <table style="LINE-HEIGHT: 150%;border-collapse:collapse;" cellSpacing=0 cellPadding=0 width="100%" borderColor=#b5cfd9 border=1>
       <tr><td bgcolor="#f5f5f5"><b>选择调查问卷进行问卷迁入</b></td></tr>
	   <tr><td><table cellSpacing=0 cellPadding=0 width="100%" style="border:0px">
		   <tr style="border:0px"><td class="answer" style="border:0px"><b>上传数据文件：</b><input type="text" readonly id="importSurveyFile" name="importSurveyFile" size="70"/><span id="upload_importSurveyFile"></span>&nbsp;<input type="button" value="上传" onclick="fileUpload_importSurveyFile.startUpload();" class="buttonClass" /></td></tr>
		   <tr style="border:0px"><td id="fsUploadProgress_importSurveyFile" style="border:0px"></td></tr>
		   <noscript>
		   <tr style="border:0px"><td style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px;border:0px">上传控件加载失败，原因可能是：您可能未开启JavaScript支持！</td></tr>
		   </noscript>
		   <tr style="border:0px"><td id="divLoadingContent_importSurveyFile" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;border:0px">上传控件加载中，请稍候...</td></tr>
		   <tr style="border:0px"><td id="divLongLoading_importSurveyFile" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;border:0px">上传控件加载超时，原因可能是：请保证您的flash插件是开启状态，上传控件需要Flash Player 9或以上的支持！</td></tr>
		   <tr style="border:0px"><td id="divAlternateContent_importSurveyFile" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;border:0px">上传控件加载失败，原因可能是：您的Flash Player版本过低！您可以访问<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Adobe网站</a>获得最新Flash Player版本。</td></tr>
		   <tr style="border:0px"><td style="border:0px">* 上传文件扩展名限制为：{allowType}，大小限制为：{maxSize}M</td></tr>
	  </table></td></tr>

  </table><table width=100% style="border:0px;">
       <tr><td style="border:0px;">
		        <input type="hidden" name="Action" value="importSurveySubmit">
                <input type="submit" name="importSurveySubmit" id="importSurveySubmit" class=stnsubmit value="开始迁入问卷"> 
          </td>
       </tr>
  </table>  
  </form>

   <script type="text/javascript">
	var fileUpload_importSurveyFile;
	function Init_importSurveyFile() {
		var settings = {
			flash_url : "../JS/swfupload.swf",
			upload_url: "../JS/DistributionUpload.php",
			post_params: {"PHPSESSID" : "{session_id}",
			  "uploadFileName": "importSurveyFile"
			},
			file_post_name:"importSurveyFile",
			file_size_limit : "{maxSize} MB",
			file_types : "{allowType}",
			file_types_description : "{allowType}",
			file_upload_limit : 1,
			custom_settings : {
				progressTarget : "fsUploadProgress_importSurveyFile"
			},
			debug: false,
			prevent_swf_caching:true,

			//Button settings
			button_image_url: "../Images/cnfileselect.png",
			button_width: "61",
			button_height: "22",
			button_placeholder_id: "upload_importSurveyFile",
			button_action : SWFUpload.BUTTON_ACTION.SELECT_FILE,
			button_window_mode:"OPAQUE",
			
			swfupload_loaded_handler : swfUploadLoaded_importSurveyFile,
			file_dialog_start_handler:fileDialogStart_importSurveyFile,
			file_queued_handler : fileQueued,
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,
			upload_start_handler : uploadStart,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : uploadSuccess_importSurveyFile,
			upload_complete_handler : uploadComplete,
			
			//SWFObject settings
			minimum_flash_version : "9.0.28",
			swfupload_pre_load_handler : swfUploadPreLoad_importSurveyFile,
			swfupload_load_failed_handler : swfUploadLoadFailed_importSurveyFile
		};

		fileUpload_importSurveyFile= new SWFUpload(settings);
	}

	function swfUploadPreLoad_importSurveyFile() {
		var self = this;
		var loading = function () {
			document.getElementById("divLoadingContent_importSurveyFile").style.display = "";

			var longLoad = function () {
				document.getElementById("divLoadingContent_importSurveyFile").style.display = "none";
				document.getElementById("divLongLoading_importSurveyFile").style.display = "";
			};
			this.customSettings.loadingTimeout = setTimeout(function () {
					longLoad.call(self)
				},
				15 * 1000
			);
		};
		
		this.customSettings.loadingTimeout = setTimeout(function () {
				loading.call(self);
			},
			1*1000
		);
	}
	function swfUploadLoaded_importSurveyFile() {
		var self = this;
		clearTimeout(this.customSettings.loadingTimeout);
		document.getElementById("divLoadingContent_importSurveyFile").style.display = "none";
		document.getElementById("divLongLoading_importSurveyFile").style.display = "none";
		document.getElementById("divAlternateContent_importSurveyFile").style.display = "none";
	}
	   
	function swfUploadLoadFailed_importSurveyFile() {
		clearTimeout(this.customSettings.loadingTimeout);
		document.getElementById("divLoadingContent_importSurveyFile").style.display = "none";
		document.getElementById("divLongLoading_importSurveyFile").style.display = "none";
		document.getElementById("divAlternateContent_importSurveyFile").style.display = "";
	}
	//打开文件选择选择窗口时触发的事件
	function fileDialogStart_importSurveyFile() {
		var txt = document.getElementById("importSurveyFile");
		txt.value = "";
		this.cancelUpload();
	}

	//文件传输完成触发事件
	function uploadSuccess_importSurveyFile(file, serverData) {
		try {
			var progress = new FileProgress(file, this.customSettings.progressTarget);
			progress.setComplete();
			progress.setStatus("文件上传完成。");
			progress.toggleCancel(false);

			this.setButtonDisabled(true);
			
			//给文本框赋值
			var txt = document.getElementById("importSurveyFile");
			txt.value = serverData;
			if( document.getElementById('importSurveySubmit') != null ) document.getElementById('importSurveySubmit').disabled = false;
		} catch (ex) {
			this.debug(ex);
		}
	}
	//开始执行
	Init_importSurveyFile();
 </script>

 <form action="" method="post" name="exportDataForm" id="exportDataForm"  onsubmit="return CheckExportData();">
  <table style="LINE-HEIGHT: 150%;border-collapse:collapse;" cellSpacing=0 cellPadding=0 width="100%" borderColor=#b5cfd9 border=1>
       <tr><td bgcolor="#f5f5f5"><b>选择调查问卷进行回复数据迁出</b></td></tr>
	   <tr><td><select name="exportData" id="exportData" style="width:910px;*width:920px">
		   <option value=''>请选择调查问卷...</option>
		   {exportDataList}
		   </select>
	   </td></tr>
  </table><table width=100% style="border:0px;">
       <tr><td style="border:0px;">
		        <input type="hidden" name="Action" value="exportDataSubmit">
                <input type="submit" name="submit" class=stnsubmit value="开始迁出数据"> 
          </td>
       </tr>
  </table>  
  </form>

  <form action="" method="post" name="importDataForm" id="importDataForm"  onsubmit="return CheckImportData();">
  <table style="LINE-HEIGHT: 150%;border-collapse:collapse;border:0px" cellSpacing=0 cellPadding=0 width="100%" borderColor=#b5cfd9 border=0>
       <tr><td bgcolor="#f5f5f5"><b>选择调查问卷进行回复数据迁入</b></td></tr>
	   <tr><td><table cellSpacing=0 cellPadding=0 width="100%" style="border:0px">
		   <tr style="border:0px"><td style="border:0px"><select name="importData" id="importData" style="width:910px;*width:920px">
			   <option value=''>请选择调查问卷...</option>
			   {importDataList}
			   </select>
		   </td></tr>
		   <tr style="border:0px"><td class="answer" style="border:0px"><b>上传数据文件：</b><input type="text" readonly id="importDataFile" name="importDataFile" size="70"/><span id="upload_importDataFile"></span>&nbsp;<input type="button" value="上传" onclick="fileUpload_importDataFile.startUpload();" class="buttonClass" /></td></tr>
		   <tr style="border:0px"><td id="fsUploadProgress_importDataFile" style="border:0px"></td></tr>
		   <noscript>
		   <tr style="border:0px"><td style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px;border:0px">上传控件加载失败，原因可能是：您可能未开启JavaScript支持！</td></tr>
		   </noscript>
		   <tr style="border:0px"><td id="divLoadingContent_importDataFile" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;border:0px">上传控件加载中，请稍候...</td></tr>
		   <tr style="border:0px"><td id="divLongLoading_importDataFile" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;border:0px">上传控件加载超时，原因可能是：请保证您的flash插件是开启状态，上传控件需要Flash Player 9或以上的支持！</td></tr>
		   <tr style="border:0px"><td id="divAlternateContent_importDataFile" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;border:0px">上传控件加载失败，原因可能是：您的Flash Player版本过低！您可以访问<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Adobe网站</a>获得最新Flash Player版本。</td></tr>
		   <tr style="border:0px"><td style="border:0px">* 上传文件扩展名限制为：{allowType}，大小限制为：{maxSize}M</td></tr>
	  </table></td></tr>

  </table><table width=100% style="border:0px;">
       <tr><td style="border:0px;">
		        <input type="hidden" name="Action" value="importDataSubmit">
                <input type="submit" name="importDataSubmit" id="importDataSubmit" class=stnsubmit value="开始迁入数据"> 
          </td>
       </tr>
  </table>  
  </form>

  <script type="text/javascript">
	var fileUpload_importDataFile;
	function Init_importDataFile() {
		var settings = {
			flash_url : "../JS/swfupload.swf",
			upload_url: "../JS/DistributionUpload.php",
			post_params: {"PHPSESSID" : "{session_id}",
			  "uploadFileName": "importDataFile"
			},
			file_post_name:"importDataFile",
			file_size_limit : "{maxSize} MB",
			file_types : "{allowType}",
			file_types_description : "{allowType}",
			file_upload_limit : 1,
			custom_settings : {
				progressTarget : "fsUploadProgress_importDataFile"
			},
			debug: false,
			prevent_swf_caching:true,

			//Button settings
			button_image_url: "../Images/cnfileselect.png",
			button_width: "61",
			button_height: "22",
			button_placeholder_id: "upload_importDataFile",
			button_action : SWFUpload.BUTTON_ACTION.SELECT_FILE,
			button_window_mode:"OPAQUE",
			
			swfupload_loaded_handler : swfUploadLoaded_importDataFile,
			file_dialog_start_handler:fileDialogStart_importDataFile,
			file_queued_handler : fileQueued,
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,
			upload_start_handler : uploadStart,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : uploadSuccess_importDataFile,
			upload_complete_handler : uploadComplete,
			
			//SWFObject settings
			minimum_flash_version : "9.0.28",
			swfupload_pre_load_handler : swfUploadPreLoad_importDataFile,
			swfupload_load_failed_handler : swfUploadLoadFailed_importDataFile
		};

		fileUpload_importDataFile= new SWFUpload(settings);
	}

	function swfUploadPreLoad_importDataFile() {
		var self = this;
		var loading = function () {
			document.getElementById("divLoadingContent_importDataFile").style.display = "";

			var longLoad = function () {
				document.getElementById("divLoadingContent_importDataFile").style.display = "none";
				document.getElementById("divLongLoading_importDataFile").style.display = "";
			};
			this.customSettings.loadingTimeout = setTimeout(function () {
					longLoad.call(self)
				},
				15 * 1000
			);
		};
		
		this.customSettings.loadingTimeout = setTimeout(function () {
				loading.call(self);
			},
			1*1000
		);
	}
	function swfUploadLoaded_importDataFile() {
		var self = this;
		clearTimeout(this.customSettings.loadingTimeout);
		document.getElementById("divLoadingContent_importDataFile").style.display = "none";
		document.getElementById("divLongLoading_importDataFile").style.display = "none";
		document.getElementById("divAlternateContent_importDataFile").style.display = "none";
	}
	   
	function swfUploadLoadFailed_importDataFile() {
		clearTimeout(this.customSettings.loadingTimeout);
		document.getElementById("divLoadingContent_importDataFile").style.display = "none";
		document.getElementById("divLongLoading_importDataFile").style.display = "none";
		document.getElementById("divAlternateContent_importDataFile").style.display = "";
	}
	//打开文件选择选择窗口时触发的事件
	function fileDialogStart_importDataFile() {
		var txt = document.getElementById("importDataFile");
		txt.value = "";
		this.cancelUpload();
	}

	//文件传输完成触发事件
	function uploadSuccess_importDataFile(file, serverData) {
		try {
			var progress = new FileProgress(file, this.customSettings.progressTarget);
			progress.setComplete();
			progress.setStatus("文件上传完成。");
			progress.toggleCancel(false);

			this.setButtonDisabled(true);
			
			//给文本框赋值
			var txt = document.getElementById("importDataFile");
			txt.value = serverData;
			if( document.getElementById('importDataSubmit') != null ) document.getElementById('importDataSubmit').disabled = false;
		} catch (ex) {
			this.debug(ex);
		}
	}
	//开始执行
	Init_importDataFile();
 </script>
 
 </div>
</div></div></div>
<script type="text/javascript" src="../JS/CssPatch.js.php"></script>
</body></html>