<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: admin.tpl.php 121 2014-03-04 12:38:05Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="{$settings[phpdisk_url]}" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<title>{$title}</title>
<script type="text/javascript" src="includes/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="includes/js/common.js"></script>
<meta name="copyright" content="Powered by PHPDisk Team, {PHPDISK_EDITION} {PHPDISK_VERSION} build{PHPDISK_RELEASE}" />
<meta name="generator" content="PHPDisk {PHPDISK_VERSION}" />
<link href="{$admin_tpl_dir}images/admincp.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function alertLeave() {
    return '程序正在把您FTP上传的文件入库，关闭后将无法入库队列中的文件，请确认全部文件队列已入库完成!';
}
</script>
</head>

<!--#if($action=='import'){#-->
<body onbeforeunload="return alertLeave();">
<script type="text/javascript">
document.onkeydown = function(){
	if(event.keyCode==116||event.ctrlKey){event.keyCode=0;event.returnValue=false;} 
}
</script>
<div id="container"  style="padding:5px; margin-top:10px;min-height:500px;">
<div style="padding-left:20px">
<h1 id="title">文件 <span id="fn"></span> 入库中...请勿关闭此页!</h1>

<div style="font-size:18px;">总进度: <span id="total">..</span></div>
<div style="padding:5px 0;">当前文件: <span class="f14 txtblue" id="fn2"></span> , 文件进度:<span id="donefile" class="txtred">0</span>/<span id="filesize">统计中..</span>(字节)</div>
<div style="width:500px; border:1px solid; height:18px;">
<div id="progressbar" style="float:left;text-align:center;color:#FFFFFF;background-color:#9EB6D8; width:1px; height:18px;"></div>
<div id="progressText" style=" float:left">0%</div>
</div>
<div id="fl_list"></div>
</div>

</div>
<script type="text/javascript">
var filesize = 0;
function setFileSize(fsize) {
	filesize = fsize;
	$("#filesize").html(fsize);
}
function setDone() {
	$("#fl_list").html($("#fl_list").html()+'<li><input type="button" class="btn" onclick="javascript:self.close();" value="入库成功,关闭此页" /></li>');
}
function setTitle(fn) {
	$("#title").html(fn);
}
function setFileName(fn,total) {
	$("#fn").html(fn);
	$("#fn2").html(fn);
	$("#total").html(total);
}
function setFlist(fn,txt) {
	$("#fl_list").html($("#fl_list").html()+'<li>'+fn+txt+'</li>');
}

function setProgress(fsize) {
	$("#donefile").html(fsize);
	if (filesize > 0) {
		var percent = Math.round(fsize * 100 / filesize);
		$("#progressbar").width(percent + "%");
		if (percent > 0) {
			$("#progressbar").html(percent + "%");
			$("#progressText").html("");
		} else {
			$("#progressText").html(percent + "%");
		}
	}
}
</script>
<!--#}else{#-->
<body>
<script type="text/javascript">
$(document).ready(function(){
	$("#btn_submit").click(function(){ 
	var file_names=""; 
		$("input[name='file_names[]']:checkbox:checked").each(function(){ 
			file_names += $(this).val()+','; 
		}); 
		if(file_names){
		$('#file_frm').submit();
		}else{
		alert('请选择需要入库的文件。');
		}
	}) ;
	$("#cb_select_all").click(function(){
		 $("input[name='file_names[]']").each(function(){
			if($(this).attr("checked")){
				$(this).attr("checked",false);
			}else{
				$(this).attr("checked",true);
			}
		 });
	});
	$("#cb_select_cancel").click(function(){
		 $("input[name='file_names[]']").attr("checked",false);
	});
});
</script>	
<div id="container" style="padding:5px; margin-top:10px">
<h1><!--#if($job=='view'){#-->【{$username}】<!--#}#--> 待入库文件</h1>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b>提示: </b>
<span class="txtgray">选定相应的文件，可以导入到网盘中</span>
</div>
<!--#if($job=='import'){#-->
<form id="file_frm" action="{$php_self}" method="post">
<input type="hidden" name="action" value="import" />
<input type="hidden" name="uid" value="{$uid}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<!--#}#-->
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0" class="td_line">
<!--#
if(count($files)){
#-->
<tr>
	<td width="30%" class="bold">文件名</td>
	<!--#if($pd_gid==1){#-->
	<td class="bold">完整文件路径名</td>
	<!--#}#-->
	<td class="bold">大小</td>
	<td width="150" class="bold">上传时间</td>
</tr>
<!--#
	foreach($files as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}">
	<td><!--#if($job=='import'){#--><input type="checkbox" name="file_names[]" value="{$v[file_name_s]}" /><!--#}#-->{$v[file_icon]}{$v[file_name_s]}</td>
	<!--#if($pd_gid==1){#-->
	<td>{$v['file_name2']}</td>
	<!--#}#-->
	<td>{$v['file_size']}</td>
	<td>{$v['file_time']}</td>
</tr>	
<!--#
	}
	unset($files);
#-->
<!--#if($job=='import'){#-->
<tr>
	<td colspan="4"><a href="javascript:;" id="cb_select_all">全选/反选</a>&nbsp;
	<a href="javascript:;" id="cb_select_cancel">取消选择</a>&nbsp;
	入库目录：<select name="folder_id">
	<option value="0"> - 根目录 - </option>
	{#get_folder_option();#}
	</select>
	<input type="button" class="btn" id="btn_submit" value="提交入库" /></td>
</tr>
<!--#}#-->	
<!--#	
}else{	
#-->
<tr>
	<td align="center" colspan="6">暂无待入库文件，请使用FTP软件进行文件上传</td>
</tr>
<!--#
}
#-->
</table>
<!--#if($job=='import'){#-->
</form><!--#}#-->
</div>
<!--#}#-->
<br/><br/>
<div style="border-bottom:1px #ccc solid">&nbsp;</div>
<br/>
<div align="center" class="f10">{$pageinfo}</div>
<div align="center" class="f10">Powered by <a href="http://www.phpdisk.com/" target="_blank">PHPDisk Team</a> {PHPDISK_EDITION} {PHPDISK_VERSION} &copy; 2008-{NOW_YEAR} All Rights Reserved.</div>
<br/><br/><br/>	
</body>
</html>
