<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: pd_viewfile.tpl.php 64 2016-07-30 14:01:18Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<?php !defined('IN_PHPDISK') && exit('[PHPDisk] Access Denied!'); ?>
<script type="text/javascript">
<!--#if(!$public_file){#-->
var SysSecond; 
var InterValObj; 
  
$(document).ready(function() { 
  SysSecond = parseInt({$file['remain_time']});
  InterValObj = window.setInterval(SetRemainTime, 1000);
}); 
function SetRemainTime() { 
  if (SysSecond > 0) { 
   SysSecond = SysSecond - 1; 
   var second = Math.floor(SysSecond % 60);                 
   var minite = Math.floor((SysSecond / 60) % 60);      
   var hour = Math.floor((SysSecond / 3600) % 24);     
   var day = Math.floor((SysSecond / 3600) / 24);   
 
   $("#remainTime").html(day + "天" + hour + "小时" + minite + "分" + second + "秒"); 
  }else{
   window.clearInterval(InterValObj); 
   $("#remainTime").html('共享时间结束');
   $("#remainTime").removeClass('f18');
   $('#down_link').html('共享时间结束下载链接失效。');
   $('#down_link').addClass('txtred f18');
  } 
} 
<!--#}#-->
function down_process(file_id){
	$.ajax({
		type : 'post',
		url : 'ajax.php',
		data : 'action=down_process&file_id='+file_id+'&t='+Math.random(),
		dataType : 'text',
		success:function(msg){
			if(msg == 'true'){
				
			}else{
				atips(msg);
			}
		},
		error:function(){
		}

	});
}
</script>
<div id="container">
<div class="layout_wrap">
<div class="tit">{$file['file_name']}</div>
<div class="layout_box2">
<div class="m" style="background:#FFFFFF;padding-top:0;min-height:250px;">
<div class="file_box">
	<div class="fb_l">
		<table width="100%" cellpadding="4" cellspacing="0" align="center" class="td_line f14">
		<tr>
			<td width="50%"><?=__('uploader')?>: {$file['username']}</td>
			<td><?=__('file_size')?>: {$file['file_size']}</td>
		</tr>
		<tr>
			<td><?=__('upload_ip')?>:<span id="file_upload_ip">{#ip_encode($file['ip'])#}</span></td>
			<td><?=__('upload_time')?>: <span id="file_upload_time">{$file['file_time']}</span></td>
		</tr>
		<tr>
			<td><?=__('file_downs')?>: <span id="file_downs">{$file['file_downs']}</span> </td>
			<td><?=__('file_views')?>: <span id="file_views">{$file['file_views']}</span> </td>
		</tr>
		<!--#if(!$public_file){#-->
		<tr>
			<td>共享到期: {#date('Y-m-d H:i:s',$file['share_end_time'])#}</td>
			<td>还剩：<span id="remainTime" class="f18 txtblue">...</span></td>
		</tr>
		<!--#}else{#-->
		<tr>
			<td>共享到期: 无限制</td>
			<td>类别：<a href="{$file[a_cate]}">{$file[cate_name]}</a></td>
		</tr>
		<!--#}#-->
		</table>
		<!--#if($file['file_description']){#-->
		<div id="file_desc" class="txtgray f14"><?=__('description')?>:<br />{$file['file_description']}</div>
		<br /><br />
		<!--#}#-->
	</div>
	<div class="fb_r">
	</div>
</div>
<div class="clear"></div>
<br />
<div class="file_item">
	<li style="margin-left:20px;margin-left:0\9;"><span id="down_link"><a href="{$file['a_downfile']}" onclick="down_process('{$file['file_id']}');" target="_blank" title="打开新窗口下载文件"><img src="{$user_tpl_dir}images/down_btn.jpg" border="0" align="absbottom" alt="打开新窗口下载文件" /></a></span>
	<!--#if(!$public_file){#-->
	<!--#if($pd_gid==1){#-->&nbsp;&nbsp;<span class="txtred f14">(管理员模式共享链接时间：1小时)</span><!--#}#--><!--#}#-->
	</li>
</div>
</div>
</div>
</div>
