<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: profile.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!'); ?>
<!--#
if($action =='password'){
#-->
<div id="container">
<h1><?=__('modify_password')?></h1>
<div class="tips_box_p">
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('modify_password_tips')?></span>
</div>
</div>
<form action="{#urr("mydisk","item=profile")#}" method="post" onSubmit="return chkform(this);">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="task" value="{$action}"/>
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="15%" align="right"><?=__('current_password')?>: </td>
	<td><input type="password" name="old_pwd" maxlength="20" size="30"/>&nbsp;<span class="txtred">*</span></td>
</tr>
<tr>
	<td width="10%" align="right"><?=__('new_password')?>: </td>
	<td><input type="password" name="new_pwd" maxlength="20" size="30"/>&nbsp;<span class="txtred">*</span></td>
</tr>
<tr>
	<td width="10%" align="right"><?=__('confirm_password')?>: </td>
	<td><input type="password" name="cfm_pwd" maxlength="20" size="30"/>&nbsp;<span class="txtred">*</span></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn_green" value="<?=__('btn_submit')?>"/></td>
</tr>
</table>
</form>
</div>
<script language="javascript">
function chkform(o){
	if(o.old_pwd.value.strtrim().length <6){
		atips("<?=__('invalid_password')?>");
		o.old_pwd.focus();
		return false;
	}	
	if(o.new_pwd.value.strtrim().length <6){
		atips("<?=__('password_too_short')?>");
		o.new_pwd.focus();
		return false;
	}
	if(o.new_pwd.value != o.cfm_pwd.value){
		atips("<?=__('confirm_password_invalid')?>");
		o.cfm_pwd.focus();
		return false;
	}
}
</script>
<!--#}elseif($action=='mycontact'){#-->
<div id="container">
<h1>联系信息</h1>
<div class="tips_box_p">
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray">其他用户可以更详细地看到您的联系信息，方便大家联系。</span>
</div>
</div>
<form action="{#urr("mydisk","item=profile&menu=$menu")#}" method="post" onSubmit="return chkform(this);">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="task" value="{$action}"/>
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="98%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="15%" align="right">真实姓名: </td>
	<td><input type="text" name="name" value="{$pa[name]}" maxlength="100" size="50" /></td>
</tr>
<tr>
	<td align="right">性别: </td>
	<td>
	<input type="radio" name="gender" value="0" {#ifchecked($pa[gender],0)#} />保密
	<input type="radio" name="gender" value="1" {#ifchecked($pa[gender],1)#} />男
	<input type="radio" name="gender" value="2" {#ifchecked($pa[gender],2)#} />女
	</td>
</tr>
<tr>
	<td align="right">联系电话: </td>
	<td><input type="text" name="phone" value="{$pa[phone]}" maxlength="255" size="50" /></td>
</tr>
<tr>
	<td align="right">QQ/MSN: </td>
	<td><input type="text" name="im" value="{$pa[im]}" maxlength="255" size="50" /></td>
</tr>
<tr>
	<td align="right">联系地址: </td>
	<td><textarea name="address" style="width:600px; height:40px;">{$pa[address]}</textarea></td>
</tr>
<tr>
	<td align="right">个人介绍: </td>
	<td><textarea name="mood" style="width:600px; height:100px;">{$pa[mood]}</textarea></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn_green" value="<?=__('btn_submit')?>"/></td>
</tr>
</table>
</form>
</div>
<script language="javascript">
function chkform(o){
	if(o.old_pwd.value.strtrim().length <6){
		atips("<?=__('invalid_password')?>");
		o.old_pwd.focus();
		return false;
	}	
	if(o.new_pwd.value.strtrim().length <6){
		atips("<?=__('password_too_short')?>");
		o.new_pwd.focus();
		return false;
	}
	if(o.new_pwd.value != o.cfm_pwd.value){
		atips("<?=__('confirm_password_invalid')?>");
		o.cfm_pwd.focus();
		return false;
	}
}
</script>

<!--#}elseif($action=='stats'){#-->
<div id="container">
<h1>文件访问日志</h1>
<div class="tips_box_p">
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray">可查看您当前文件的下载及浏览记录</span>
</div>
</div>
<img src="{$admin_tpl_dir}images/it_nav.gif" align="absbottom" />
选择日志时间： 
<select id="credit_table" onchange="chg_log();">
<!--#
if($tables){
	for($i=0;$i<count($tables);$i++){
#-->
<option value="{#$tables[$i]#}" {#ifselected($tables[$i],$curr_table,'str')#}>{#$tables[$i]#}</option>
<!--#
	}
}#-->
</select>月&nbsp;&nbsp;
<script language="javascript">
function chg_log(){
	var credit_table = $('#credit_table').val();
	document.location.href = '{#urr("mydisk","item=profile&menu=profile&action=stats&log='+credit_table+'")#}';
}
</script>
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%" class="bold"><?=__('file_name')?></td>
	<td align="center" width="150" class="bold">日志行为</td>
	<td align="center" width="150" class="bold">操作时间</td>
	<td align="right" width="180" class="bold">操作人</td>
</tr>
<!--#
if(count($logs)){
	foreach($logs as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}">
	<td>{#file_icon($v[file_extension])#}{$v[file_name]}<span class="txtgray" title="文件ID">({$v[file_id]})</span></td>
	<td align="center">{#$log_action[$v[action]]#}</td>
	<td align="center" class="txtgray">{$v['file_time']}</td>
	<td align="right"><span style="cursor:pointer" id="vu_{$k}" onclick="view_user({$v[touserid]},{$k})"><u>查看用户</u></span></td>
</tr>
<!--#		
	}
	unset($logs);
}else{
#-->
<tr>
	<td colspan="6" align="center">暂无文件日志</td>
</tr>
<!--#}#-->
<!--#if($page_nav){#-->
<tr>
	<td colspan="6">{$page_nav}</td>
</tr>
<!--#}#-->
</table>
</div>
<script type="text/javascript">
function view_user(uid,id){
	$('#vu_'+id).html('<img src="images/ajax_loading.gif" align="absmiddle" border="0" />');
	$.ajax({
		type : 'post',
		url : 'ajax.php',
		data : 'action=view_user&uid='+uid+'&t='+Math.random(),
		dataType : 'text',
		success:function(msg){
			var arr = msg.split('|');
			if(arr[0] == 'true'){
				$('#vu_'+id).html(arr[1]);
				$('#vu_'+id).attr('onclick','');
				$('#vu_'+id).addClass('txtblue');
			}else{
				atips(msg);
			}
		},
		error:function(){
		}

	});
}
</script>
<!--#}else{#-->
<div id="container">
<h1><?=__('profile_title')?></h1>
<div class="tips_box_p">
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('profile_title_tips')?></span>
</div>
</div>
<script language="javascript">
$(document).ready(function(){
	$("#f_tab tr").mouseover(function(){
		$(this).addClass("alt_bg");
	}).mouseout(function(){
		$(this).removeClass("alt_bg");
	});
});
</script>
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0" class="td_line" id="f_tab">
<tr>
	<td class="bold" colspan="2"><?=__('my_disk_stat')?>:</td>
</tr>
<tr>
	<td width="30%"><?=__('total_folders')?>: </td>
	<td>{$stats['total_folders']} </td>
</tr>
<tr>
	<td><?=__('total_share_folders')?>: </td>
	<td>{$stats['total_share_folders']} </td>
</tr>
<tr>
	<td><?=__('total_files')?>: </td>
	<td>{$stats['total_files']} </td>
</tr>
<tr>
	<td><?=__('file_size_total')?>: </td>
	<td>
	<div class="tit"><?=__('disk_info')?>:</div>
	<div class="disk_info" title="<?=__('disk_remain')?>: {$nav_arr['disk_remain']}% ({$nav_arr['disk_space']})">
	<div style="background:url(images/disk_bar.gif);width:{$nav_arr['disk_fill']}px;">&nbsp;</div>
	</div>
	<div style="color:#666">{$nav_arr['now_space']}/{$nav_arr['max_storage']} (<b>{$nav_arr['disk_percent']}%</b>)</div>
	</td>
</tr>
<tr>
	<td><?=__('reg_time')?>: </td>
	<td>{$stats['reg_time']}</td>
</tr>
<tr>
	<td><?=__('last_login_time')?>: </td>
	<td>{$stats['last_login_time']}</td>
</tr>
<tr>
	<td><?=__('reg_ip')?>: </td>
	<td>{$stats['reg_ip']}</td>
</tr>
<tr>
	<td><?=__('last_login_ip')?>: </td>
	<td>{$stats['last_login_ip']}</td>
</tr>
<tr>
	<td><?=__('reg_email')?>: </td>
	<td>{$stats['email']}</td>
</tr>
<tr>
	<td colspan="2">&nbsp;</td>
</tr>	
<tr>
	<td class="bold" colspan="2"><?=__('my_power')?>:</td>
</tr>
<tr>
	<td><?=__('current_group')?>: </td>
	<td>{$pd_group_name}</td>
</tr>
<tr>
	<td><?=__('max_storage')?>: </td>
	<td>{$group_set['max_storage']}</td>
<tr>
<tr>
	<td><?=__('max_filesize')?>: </td>
	<td>{$group_set['max_filesize']}</td>
</tr>
<tr>
	<td><?=__('max_folders')?>: </td>
	<td>{$group_set['max_folders']}</td>
</tr>
<tr>
	<td><?=__('max_files')?>: </td>
	<td>{$group_set['max_files']}</td>
</tr>
<tr>
	<td><?=__('user_file_types')?>: </td>
	<td>{$group_set['user_file_types']}</td>
</tr>
</table>
<br /><br />
</div>
<!--#}#-->
