<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=popbox}-->
<!--{include file=elements/header.js.html type=upload}-->
<!--{include file=elements/header.js.html type=swfupload}-->
<!--{include file=elements/header.js.html type=valid}-->
<script src="js/package.hd.js"></script>
<script>
window.onload = function() {
	var myupload = new SWFUpload({
		// Backend Settings
		upload_url: "index.php?r=Software.uploadpackage",
		file_post_name: "package_file",
		post_params: {
			"PHPSESSID": "<!--{$PHPSESSIONID}-->",
			"software_id": "<!--{$software.id}-->"
		},

		// File Upload Settings
		file_size_limit : "204800",	// 200MB
		file_types : "*.*",
		file_types_description : "软件包文件",
		file_upload_limit : 0,
		file_queue_limit : 0,

		// Event Handler Settings (all my handlers are in the Handler.js file)
		swfupload_preload_handler : preLoad,
		swfupload_load_failed_handler : loadFailed,
		file_dialog_start_handler : fileDialogStart,
		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,
		upload_complete_handler : uploadComplete,

		// Button Settings
		button_image_url : "js/swfupload/FullyTransparent_65x29.png",
		button_placeholder_id : "swfu",
		button_width: 80,
		button_height: 20,
		button_text: '<span class="theFont">批量上传</span>',
		button_text_style: ".theFont { cursor:pointer; }",
		button_text_left_padding: 12,
		button_window_mode:"transparent",

		// Flash Settings
		flash_url : "js/swfupload/swfupload.swf",
		flash9_url : "js/swfupload/swfupload_fp9.swf",
		custom_settings : {
			progressTarget : "fsUploadProgress1",
			cancelButtonId : "btnCancel1"
		},

		// Debug Settings
		debug: false
	});
}
</script>
<style>
div.button {color:#00f;display:inline;line-height:22px;margin-left:5px;padding:2px 0;}
div.button.hover {color:#f00;}
.typesizeinput {width:30px;}
.anchorinput {width:80px;}
</style>
</head>
<body>
<div id="outside">
	<!--{include file=frame/top.html}-->
	<div id="mainareaContent">
		<!--{include file=frame/left.html}-->
		<div id="rightContent">
			<div id="topContent">
				<div class="sitmap">
					<span class="r"><!--{include file="elements/uuadvad.html"}--></span>软件管理&nbsp;&gt;&nbsp;软件包列表 &nbsp;&gt;&nbsp;<!--{$software.title}-->
				</div>
			</div>
			<div class="tabcontent">
				<a href="index.php?r=Software.softwarelist" class="nolink">内管管理</a>
				<a href="index.php?r=SiteSet.softwareset" class="link">属性设置</a>
				<a href="index.php?r=Software.softwareListLayout" class="link">列表页布局</a>
					<a href="index.php?r=Software.softwarePageLayout" class="link">内容页布局</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent2">
					<div class="operation">
						<button type="button" class="but4font" id="li_uploadpackage">新增包</button>
						<button type="button" class="but4font" id="li_addurl">新增链接</button>
						<span class="but4font"><span id="swfu">批量上传</span></span>
						<button type="button" class="but4font" onclick="crawlsoft()">在线抓取</button>
						<button type="button" class="but4font" onclick="ftppopbox()">FTP导入</button>
					</div>
					<div style="display:none">
						<input id="input_software_id" value="<!--{$software.id}-->"/>
						<select id="slc_platform">
							<!--{foreach from=$platform item=item}-->
							<option value="<!--{$item.id}-->" universal_flag="<!--{$item.universal_flag}-->"><!--{$item.platform_name}--></option>
							<!--{/foreach}-->
						</select>
						<select id="slc_screen">
							<option value="">通用</option>
							<!--{foreach from=$screen item=item}-->
							<option value="<!--{$item.id}-->"><!--{$item.screen_size}--></option>
							<!--{/foreach}-->
						</select>
					</div>
					<form id="addForm" action="index.php?r=Software.addpackage&software_id=<!--{$software_id}-->" method="post">
						<input type="hidden" name="action" value="do"/>
						<input type="hidden" name="returnParams" value="<!--{$returnParams}-->"/>
						<table class="tbl_list" width="100%">
							<tr class="thead">
								<td width="20%">包下载地址</td>
								<td width="20%">jad下载地址</td>
								<td width="25%">平台(屏幕)</td>
								<td width="15%">类型/大小(K)</td>
								<td width="10%">排序</td>
								<td width="10%">操作</td>
							</tr>
							<tbody id="tbl_uploadpackage">
							<!--{foreach from=$datalist item=item name=list}-->
							<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
								<td style="word-break:break-all"><!--{$item.download_url}--></td>
								<td style="word-break:break-all"><!--{$item.download_additional_url}--></td>
								<td>
									<!--{foreach from=$platform item=data name=platform}-->
									<!--{if $data.id eq $item.mobile_platform_id}--><!--{$data.platform_name}--><input type="hidden" id="input_platform<!--{$item.id}-->" value="<!--{$data.id}-->"/><!--{/if}-->
									<!--{/foreach}-->
									<!--{foreach from=$screen item=data name=screen}-->
									<!--{if $data.id eq $item.mobile_screen_id}-->(<!--{$data.screen_size}-->)<input type="hidden" class="input_screen" index="<!--{$item.id}-->" value="<!--{$data.id}-->"/><!--{/if}-->
									<!--{/foreach}-->
								</td>
								<td><!--{$item.file_type}-->/<!--{$item.file_size}--></td>
								<td><!--{$item.show_order}--></td>
								<td id="td_deletePackage<!--{$item.id}-->"><a href="javascript:editPackage('<!--{$item.id}-->', '<!--{$packagelistReturnParams}-->')">修改</a>
									<a href="javascript:deleteSoftwarePackage('<!--{$item.id}-->')">删除</a></td>
							</tr>
							<!--{/foreach}-->
							</tbody>
						</table>
						<div class="submitdiv">
						<button type="button" class="butsubmit" onClick="submitPackage()">提交</button>
						<!--{if $backFlag eq 1}-->&nbsp;&nbsp;<button type="button" class="but2font" onClick="window.location.href='index.php?<!--{$returnParams}-->'" >返回</button><!--{/if}-->
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="swf-upload-cpanel" style="display:none;">
	<div class="fieldset flash" id="fsUploadProgress1">
	</div>
	<div style="padding-left: 5px;display:none;">
		<input id="btnCancel1" type="button" value="Cancel Uploads" onClick="cancelQueue(upload1);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />
	</div>
</div>
</body>
<script>
var count = 0;
//新增包
$("#li_uploadpackage").click(function(){
	count = count + 1;
	var index = count;
	var str = "<tr>";
	str += "<td><div style=\"display:inline;padding:2px 0 2px 4px;\"><span class=\"red\">*</span><input class=\"anchorinput required\" id=\"download_url"+index+"\" name=\"download_url[]\" readonly/></div><div class=\"button\" id=\"uploadclick"+index+"\">上传</div><div id=\"oldname"+index+"\" style=\"display:inline;\"></div></td>";
	str += "<td><div style=\"display:inline;padding:2px 0 2px 4px;\"><input class=\"anchorinput\" id=\"download_additional_url"+index+"\" name=\"download_additional_url[]\" readonly/></div><div class=\"button\" id=\"uploadadditionclick"+index+"\">上传</div></td>";
	str += "<td><span class=\"red\">*</span><select id=\"slc_platform"+index+"\" name=\"mobile_platform_id[]\" onchange=\"checkPlatformScreen('"+index+"')\">";
	str += $("#slc_platform").html();
	str += "</select>&nbsp;";
	str += "<select class=\"slc_screen\" id=\"slc_screen"+index+"\" name=\"mobile_screen_id[]\" index=\""+index+"\" onchange=\"checkPlatformScreen('"+index+"')\">";
	str += $("#slc_screen").html();
	str += "</select><input type=\"hidden\" id=\"universal_flag"+index+"\" name=\"universal_flag[]\"/></td>";
	str += "<td><input class=\"typesizeinput\" id=\"file_type"+index+"\" name=\"file_type[]\" readonly/>&nbsp;";
	str += "<input class=\"typesizeinput\" id=\"file_size"+index+"\" name=\"file_size[]\" readonly/></td>";
	str += "<td><input class=\"typesizeinput\" name=\"show_order[]\" value=\"99\"/></td>";
	str += "<td><a href=\"#\" id=\"deletePackage"+index+"\">删除</a><input type=\"hidden\" name=\"download_type[]\" value=\"1\"/><input id=\"old_filename"+index+"\" type=\"hidden\" name=\"old_filename[]\" value=\"\"/></td>";
	str += "</tr>";
	$("#tbl_uploadpackage").prepend(str);
	$("#universal_flag"+index).val($("#slc_platform"+index+" option:selected").attr("universal_flag"));
	//删除事件
	$("#deletePackage"+count).click(function(){
		var tdObj = $(this).parent();
		$(tdObj).parent().remove();
		/*var download_url = $("#download_url"+index).val();
		var download_additional_url = $("#download_additional_url"+index).val();
		if (download_url || download_additional_url) {
			$.get("index.php?r=Software.deletepackage&download_url="+download_url+"&download_additional_url="+download_additional_url,
			function(data){
				$(tdObj).parent().remove();
			});
		} else {
			$(tdObj).parent().remove();
		}*/
	});
	//jar上传事件
	var jarbutton = $("#uploadclick"+index);
	new AjaxUpload($("#uploadclick"+index), {
		action: "index.php?r=Software.uploadpackage&software_id="+$("#input_software_id").val(),
		name: "package_file",
		onSubmit: function(file, ext){
			/*if (!(ext && /^(jar|sis|sisx)$/i.test(ext))) {
				alert(ext+"文件不能上传 ，请重新上传！");
				return false;
			}*/
			if ((ext && /^(jad)$/i.test(ext))){
	        	alert(ext+'文件请用jad专用上传按钮上传！');
	        	return false;
			}
			jarbutton.html('<img src="images/ajax.gif"/>');
			this.disable();
		},
		onComplete: function(file, response){
			jarbutton.html('上传');
			this.enable();
			var data = eval("("+response+")");
			if (data.flag == 1) {
				$("#download_url"+index).val(data.name);
				$("#oldname"+index).html("("+data.filename+"."+data.fileext+")");
				$("#old_filename"+index).val(data.filename);
				$("#file_type"+index).val(data.fileext);
				$("#file_size"+index).val(data.size);
			} else if (data.flag == -2) {
				alert("不能上传" + data.fileext + "文件!");
			} else if (data.flag == -3) {
				alert("文件大小超出指定范围!");
			}
		}
	});
	
	//jad上传事件
	var jadbutton = $("#uploadadditionclick"+index);
	new AjaxUpload($("#uploadadditionclick"+index), {
		action: "index.php?r=Software.uploadpackage&software_id="+$("#input_software_id").val(),
		name: "package_file",
		onSubmit: function(file, ext){
			/*if (!(ext && /^(jad)$/i.test(ext))) {
				alert(ext+"文件不能上传 ，请重新上传！");
				return false;
			}*/
			if (! (ext && /^(jad)$/i.test(ext))){
	        	alert('jad专用上传按钮不能上传'+ext+'文件！');
	        	return false;
			}
			jadbutton.html('<img src="images/ajax.gif"/>');
			this.disable();
		},
		onComplete: function(file, response){
			jadbutton.html('上传');
			this.enable();
			var data = eval("("+response+")");
			if (data.flag == 1) {
				$("#download_additional_url"+index).val(data.name);
			} else if (data.flag == -2) {
				alert("不能上传" + data.fileext + "文件!");
			} else if (data.flag == -3) {
				alert("文件大小超出指定范围!");
			}
		}
	});
});

//新增链接
$("#li_addurl").click(function(){
	count = count + 1;
	var index = count;
	var str = "<tr>";
	str += "<td>&nbsp;<span class=\"red\">*</span><input class=\"anchorinput required\" id=\"download_url"+index+"\" name=\"download_url[]\"/></td>";
	str += "<td>&nbsp;<input class=\"anchorinput\" id=\"download_additional_url"+index+"\" name=\"download_additional_url[]\"/></td>";
	str += "<td><span class=\"red\">*</span><select id=\"slc_platform"+index+"\" name=\"mobile_platform_id[]\" onchange=\"checkPlatformScreen('"+index+"')\">";
	str += $("#slc_platform").html();
	str += "</select>&nbsp;";
	str += "<select class=\"slc_screen\" id=\"slc_screen"+index+"\" name=\"mobile_screen_id[]\" index=\""+index+"\" onchange=\"checkPlatformScreen('"+index+"')\">";
	str += $("#slc_screen").html();
	str += "</select><input type=\"hidden\" id=\"universal_flag"+index+"\" name=\"universal_flag[]\"/></td>";
	str += "<td><input class=\"typesizeinput\" id=\"file_type"+index+"\" name=\"file_type[]\"/>&nbsp;";
	str += "<input class=\"typesizeinput\" id=\"file_size"+index+"\" name=\"file_size[]\"/></td>";
	str += "<td><input class=\"typesizeinput\" name=\"show_order[]\" value=\"99\"/></td>";
	str += "<td><a href=\"#\" id=\"deletePackage"+index+"\">删除</a><input type=\"hidden\" name=\"download_type[]\" value=\"2\"/></td>";
	str += "</tr>";
	$("#tbl_uploadpackage").prepend(str);
	$("#universal_flag"+index).val($("#slc_platform"+index+" option:selected").attr("universal_flag"));
	//删除事件
	$("#deletePackage"+count).click(function(){
		var tdObj = $(this).parent();
		$(tdObj).parent().remove();
	});
});

function createTD(od){
	var create = true;
	$("input[name=old_filename[]]").each(function(){
		if($(this).val() == od.filename){
			if(od.fileext == 'jad'){
				$(this).parent().parent().find("input[name=download_additional_url[]]").val(od.name);
			}else{
				$(this).parent().parent().find("input[name=download_url[]]").val(od.name);
				$(this).parent().parent().find("span.oldname").html("("+od.filename+"."+od.fileext+")");
				$(this).parent().parent().find("input[name=file_type[]]").val(od.fileext);
				$(this).parent().parent().find("input[name=file_size[]]").val(od.size);
			}
			create = false;
		}
	});
	if (create) {
		count = count + 1;
		var index = count;
		var str = "<tr>";
		str += "<td>&nbsp;<span class=\"red\">*</span><input class=\"anchorinput required\" id=\"download_url"+index+"\" name=\"download_url[]\" readonly/><span id=\"oldname"+index+"\" class=\"oldname\"></span></td>";
		str += "<td>&nbsp;<input class=\"anchorinput\" id=\"download_additional_url"+index+"\" name=\"download_additional_url[]\" readonly/></td>";
		str += "<td><span class=\"red\">*</span><select id=\"slc_platform"+index+"\" name=\"mobile_platform_id[]\" onchange=\"checkPlatformScreen('"+index+"')\">";
		str += $("#slc_platform").html();
		str += "</select>&nbsp;";
		str += "<select class=\"slc_screen\" id=\"slc_screen"+index+"\" name=\"mobile_screen_id[]\" index=\""+index+"\" onchange=\"checkPlatformScreen('"+index+"')\">";
		str += $("#slc_screen").html();
		str += "</select><input type=\"hidden\" id=\"universal_flag"+index+"\" name=\"universal_flag[]\"/></td>";
		str += "<td><input class=\"typesizeinput\" id=\"file_type"+index+"\" name=\"file_type[]\" readonly/>&nbsp;";
		str += "<input class=\"typesizeinput\" id=\"file_size"+index+"\" name=\"file_size[]\" readonly/></td>";
		str += "<td><input class=\"typesizeinput\" name=\"show_order[]\" value=\"99\"/></td>";
		str += "<td><a href=\"#\" id=\"deletePackage"+index+"\">删除</a><input type=\"hidden\" name=\"download_type[]\" value=\"1\"/><input type=\"hidden\" id=\"old_filename"+index+"\" name=\"old_filename[]\"/></td>";
		str += "</tr>";
		$("#tbl_uploadpackage").prepend(str);
		$("#universal_flag"+index).val($("#slc_platform"+index+" option:selected").attr("universal_flag"));
		//删除事件
		$("#deletePackage"+count).click(function(){
			var tdObj = $(this).parent();
			$(tdObj).parent().remove();
		});
		if (od.fileext == 'jad') {
			$("#download_additional_url"+index).val(od.name);
		} else {
			$("#download_url"+index).val(od.name);
			$("#oldname"+index).html("("+od.filename+"."+od.fileext+")");
			$("#file_type"+index).val(od.fileext);
			$("#file_size"+index).val(od.size);
		}
		$("#old_filename"+index).val(od.filename);
	}
}

//平台屏幕不能重复
function checkPlatformScreen(i){
	$("#universal_flag"+i).val($("#slc_platform"+i+" option:selected").attr("universal_flag"));
	var screen = $("#slc_screen"+i);
	if (screen.val()) {
		$(".input_screen").each(function(){
			if ($(this).val() == screen.val() && $("#input_platform"+$(this).attr("index")).val() == $("#slc_platform"+i).val()) {
				alert("平台和屏幕不能重复");
				screen.val("");
			}
		});
		$(".slc_screen").each(function(){
			if ($(this).val() && $(this).val() == screen.val() && $("#slc_platform"+$(this).attr("index")).val() == $("#slc_platform"+i).val() && $(this).attr("id") != screen.attr("id")) {
				alert("平台和屏幕不能重复");
				screen.val("");
			}
		});
	}
}

//删除
function deleteSoftwarePackage(id){
	if (confirm('删除之后，信息无法恢复，是否确定删除？')) {
		var tdObj = $("#td_deletePackage"+id);
		$(tdObj).html("<img src=\"images/ajax.gif\"/>");
		$.get("index.php?r=Software.deletesoftwarepackage&id="+id, function(data){
			if (data == 1) {
				$(tdObj).parent().remove();
			} else {
				alert("删除失败");
			}
		});
	}
}

//修改
function editPackage(id, packagelistReturnParams){
	$.popbox({title:"修改软件包", content:popstr_search});
	$.ajax({
		type: "get",
		url: "index.php?r=Software.editpackage",
		data: {
			id: id,
			packagelistReturnParams: packagelistReturnParams
		},
		cache: false,
		success: function(data){
			$.popbox.setcontent({title:"修改软件包", content:data, height:420});
		}
	});
}

//在线抓取
function crawlsoft(){
	var str = "<table class=\"tbl_edit\" width=\"100%\"><tr><td>输入包地址</td></tr></table>";
	str += "<table id=\"tbl_crawlurl\" class=\"tbl_edit\" width=\"100%\"><tr><td><input type=\"text\" class=\"text\" name=\"url[]\"/></td></tr></table>";
	str += "<table class=\"tbl_edit\" width=\"100%\"><tr>";
	str += "<td class=\"noborder\"><button type=\"button\" class=\"but4font\" id=\"addcrawlbtn\">增加地址</button>&nbsp;&nbsp;<button type=\"button\" class=\"but2font\" id=\"crawlbtn\">抓取</button></td>";
	str += "</tr></table>";
	$.popbox({title:"在线抓取", content:str, height:300});
	$("#addcrawlbtn").click(function(){
		//if ($("input:text[name=url[]]").size() < 5) {
			$("#tbl_crawlurl").append("<tr><td><input type=\"text\" class=\"text\" name=\"url[]\"/></td></tr>");
		//} else {
		//	alert("一次最多只能抓取5个软件包！");
		//}
	});
	$("#crawlbtn").click(function(){
		if ($(this).text() == "重新抓取") {
			$(this).attr("class", "but2font").text("抓取");
			$("#tbl_crawlurl").html("<tr><td><input type=\"text\" class=\"text\" name=\"url[]\"/></td></tr>");
			$("#addcrawlbtn").attr("disabled", false);
		} else {
			$("input:text[name=url[]]").each(function(){
				var remoteurl = $(this).val();
				var tdobj = $(this).parent();
				if (remoteurl != "") {
					tdobj.html("抓取"+remoteurl+"<img src=\"images/spinner.gif\"/>正在抓取...");
					$.ajax({
						type: "get",
						url: "index.php?r=Software.crawl",
						cache: false,
						data: {
							url: remoteurl,
							software_id: <!--{$software.id}-->
						},
						dataType: "json",
						success: function(data){
							if (data.status == 1) {
								if (data.file.file_type == 'jad') {
									$(".ftp_filename").each(function(){
										if (data.file.filename == $(this).val()) {
											$("#download_additional_url"+$(this).attr("index")).val(data.file.download_url);
										}
									});
								} else {
									count = count + 1;
									var index = count;
									var str = "<tr>";
									str += "<td>&nbsp;<span class=\"red\">*</span><input class=\"anchorinput required\" id=\"download_url"+index+"\" name=\"download_url[]\" value=\""+data.file.download_url+"\" readonly/>&nbsp;("+data.file.filename+"."+data.file.file_type+")</td>";
									str += "<td>&nbsp;<input class=\"anchorinput\" id=\"download_additional_url"+index+"\" name=\"download_additional_url[]\" value=\""+data.file.download_additional_url+"\" readonly/></td>";
									str += "<td><span class=\"red\">*</span><select id=\"slc_platform"+index+"\" name=\"mobile_platform_id[]\" onchange=\"checkPlatformScreen('"+index+"')\">";
									str += $("#slc_platform").html();
									str += "</select>&nbsp;";
									str += "<select class=\"slc_screen\" id=\"slc_screen"+index+"\" name=\"mobile_screen_id[]\" index=\""+index+"\" onchange=\"checkPlatformScreen('"+index+"')\">";
									str += $("#slc_screen").html();
									str += "</select><input type=\"hidden\" id=\"universal_flag"+index+"\" name=\"universal_flag[]\"/></td>";
									str += "<td><input class=\"typesizeinput\" id=\"file_type"+index+"\" name=\"file_type[]\" value=\""+data.file.file_type+"\" readonly/>&nbsp;";
									str += "<input class=\"typesizeinput\" id=\"file_size"+index+"\" name=\"file_size[]\" value=\""+data.file.file_size+"\" readonly/></td>";
									str += "<td><input class=\"typesizeinput\" name=\"show_order[]\" value=\"99\"/><input type=\"hidden\" class=\"ftp_filename\" index=\""+index+"\" value=\""+data.file.filename+"\"/></td>";
									str += "<td><a href=\"#\" id=\"deletePackage"+index+"\">删除</a><input type=\"hidden\" name=\"download_type[]\" value=\"1\"/></td>";
									str += "</tr>";
									$("#tbl_uploadpackage").prepend(str);
									$("#universal_flag"+index).val($("#slc_platform"+index+" option:selected").attr("universal_flag"));
									//删除事件
									$("#deletePackage"+count).click(function(){
										var tdObj = $(this).parent();
										$(tdObj).parent().remove();
									});
								}
								tdobj.html("抓取"+remoteurl+"成功！");
							} else {
								tdobj.html("抓取"+remoteurl+"失败！");
							}
						}
					});
				} else {
					tdobj.html("没有输入地址...");
				}
			});
			$("#addcrawlbtn").attr("disabled", true);
			$(this).attr("class", "but4font").text("重新抓取");
		}
	});
}

//ftp导入
function ftppopbox(){
	var ftpstr = "<table class=\"tbl_edit\" width=\"100%\"><tr>";
	ftpstr += "<td class=\"td_name\">请输入包地址</td>";
	ftpstr += "<td class=\"td_content\"><input type=\"text\" class=\"text\" id=\"ftpinput\" value=\"/uploads/soft/\"/></td>";
	ftpstr += "</tr><tr>";
	ftpstr += "<td class=\"noborder\"></td>";
	ftpstr += "<td class=\"noborder\"><button type=\"button\" class=\"but2font\" onclick=\"ftpimport()\">导入</button></td>";
	ftpstr += "</tr></table><div id=\"ftpimport\"></div>";
	$.popbox({title:"FTP导入", content:ftpstr});
}
function ftpimport(){
	$("#ftpimport").height(50).html(popstr_import);
	$.ajax({
		url: "index.php?r=Software.ftpimport&ftppath="+$("#ftpinput").val(),
		type: "get",
		cache: false,
		success: function(data){
			$("#tbl_uploadpackage").prepend(data);
			$("#ftpimport").html("");
			$(".ftp_slc_platform").html($("#slc_platform").html());
			$(".ftp_slc_screen").html($("#slc_screen").html());
			$.fn.firesbox.close();
		}
	});
}

//提交
function submitPackage(){
	var flag = 1;
	$(".required").each(function(){
		if (!$(this).val()) {
			flag = 0;
		}
	});
	
	if (flag == 1) {
		$("#addForm").submit();
	} else {
		alert("输入有误，红色*处为必填内容！");
	}
}
</script>
</html>