<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: buddy.tpl.php 68 2016-08-05 08:12:52Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<?php !defined('IN_PHPDISK') && exit('[PHPDisk] Access Denied!'); ?>
<!--#
if($action =='mybuddy' || $action =='whobuddy' || $action =='invite_success' || $action =='search' || $action =='mydepart'||$action=='corp_depart'){
#-->
<div id="container">
<h1>{$buddy_title}</h1>
<div class="tips_box_p">
<div class="tips_box"><b><?=__('tips')?>: </b><img class="img_light" src="images/light.gif" align="absmiddle"> <span class="txtgray"><?=__('tips_buddy')?></span>
</div>
</div>
<!--#if($action !='invite_success'){#-->
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0">
<tr>
	<td align="left">
	<div class="tips_box_p">
	<form action="{#urr("mydisk","item=buddy&menu=buddy")#}" method="post" onsubmit="return dosubmit(this);">
	<input type="hidden" name="action" value="{$action}" />
	<input type="hidden" name="item" value="buddy" />
	<input type="hidden" name="task" value="addbuddy" />
	<input type="hidden" name="formhash" value="{$formhash}" />
	<img src="images/addbuddy.gif" align="absmiddle" /> <?=__('add_buddy')?>: <input type="text" name="buddy_name" maxlength="30" />&nbsp;<input type="submit" class="btn_green" value="<?=__('btn_submit')?>" />
	</form>
	</div>
	</td>
	<td align="right">
	<div class="tips_box_p">
	<form action="{#urr("mydisk","")#}" method="get" onsubmit="return dosubmit2(this);">
	<input type="hidden" name="item" value="buddy" />
	<input type="hidden" name="menu" value="buddy" />
	<input type="hidden" name="action" value="search" />
	<img src="images/icon_search.gif" align="absmiddle" /> <?=__('search_buddy')?>: <input type="text" name="word" maxlength="30" value="{$word}" />
	<select name="scope">
		<option value="all" {#ifselected($scope,'all','str')#}>全部联系人</option>
		<option value="my" {#ifselected($scope,'my','str')#}><?=__('my_buddy')?></option>
		<option value="added" {#ifselected($scope,'added','str')#}><?=__('added_buddy')?></option>
	</select>
	<input type="submit" class="btn_green" value="<?=__('btn_search')?>" />
	</form>
	</div>
	</td>
</tr>
</table>	
<!--#}#-->
<!--#if(!($action=='corp_depart' && !$depart_id)){#-->
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0" class="td_line">
<tr>
	<!--#if($action =='invite_success'){#-->
	<td width="20%" class="bold"><?=__('invited_buddy')?></td>
	<td width="150" class="bold"><?=__('invite_time')?></td>
	<!--#}else{#-->
	<td width="20%" class="bold">联系人</td>
	<!--#if(!in_array($action,array('mydepart','corp_depart'))){#-->
	<td width="150" class="bold"><?=__('buddy_time')?></td>
	<!--#}#-->
	<!--#}#-->
	<td class="bold"><?=__('operation')?></td>
</tr>
<!--#
if(count($buddys_arr)){
	 foreach($buddys_arr as $k => $v){
	 	$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}">
	<td><a href="javascript:;" onclick="abox('{$v['a_viewinfo']}','查看好友资料',600,400);">{$v['username']}</a></td>
	<!--#if(!in_array($action,array('mydepart','corp_depart'))){#-->
	<td><span class="txtgray">{$v['in_time']}</span></td>
	<!--#}#-->
	<td>
	<!--#if($action =='mybuddy'){#-->
	<a href="{$v['a_sendmsg']}"><img src="images/msg.gif" align="absmiddle" border="0" /><?=__('send_msg')?></a>&nbsp;&nbsp;
	<a href="javascript:;" onclick="abox('{$v['a_delbuddy']}','<?=__('del_buddy')?>',400,200);"><img src="images/delbuddy.gif" align="absbottom" border="0" /><?=__('del_buddy')?></a>
	<!--#}else{#-->
	<a href="{$v['a_sendmsg']}"><img src="images/msg.gif" align="absmiddle" border="0" /><?=__('send_msg')?></a>&nbsp;&nbsp;
	<a href="javascript:;" onclick="abox('{$v['a_addbuddy']}','<?=__('add_buddy')?>',400,200);"><img src="images/addbuddy.gif" align="absmiddle" border="0" /><?=__('add_buddy')?></a>
	<!--#}#-->
	</td>
</tr>
<!--#	 
	 }
	 unset($buddys_arr);
}else{
#-->
<tr>
	<td colspan="4"><?=__('buddy_not_found')?></td>
</tr>
<!--#
}
#-->
<!--#if($page_nav){#-->
<tr>
	<td colspan="4">{$page_nav}</td>
</tr>
<!--#}#-->
</table>
<!--#}else{#-->
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0" class="td_line">
<tr>
	<td class="f14 txtgray" style="padding:10px;">请按左侧部门进行浏览。</td>
</tr>
</table>
<!--#}#-->
</div>
</div>
<script type="text/javascript">
function dosubmit(o){
	if(o.buddy_name.value.strtrim().length <2){
		atips("<?=__('username_not_found')?>");
		o.buddy_name.focus();
		return false;
	}
}
function dosubmit2(o){
	if(o.word.value.strtrim().length <2){
		o.word.focus();
		return false;
	}
}
</script>
<!--#}elseif($action =='delbuddy'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=buddy")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="userid" value="{$userid}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<div class="cfm_info">
<li><?=__('my_buddy')?> <span class="txtred">{$buddy_name}</span></li>
<li><?=__('delete_buddy_confirm')?></li>
<li>&nbsp;</li>
<li><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></li>
</div>
</form>
</div>
</div>
<!--#}if($action =='s_addbuddy'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=buddy")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="userid" value="{$userid}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<div class="cfm_info">
<li><?=__('add_buddy')?> <span class="txtgreen">{$buddy_name}</span></li>
<li><?=__('add_buddy_confirm')?></li>
<li>&nbsp;</li>
<li><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></li>
</div>
</form>
</div>
</div>
<!--#}if($action =='viewinfo'){#-->
<div id="container">
<div class="box_style">
<table align="center" width="98%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="10%" align="right" class="txtgray">网盘帐号: </td>
	<td>{$pa[username]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">电子邮箱: </td>
	<td>{$pa[email]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">真实姓名: </td>
	<td>{$pa[name]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">性别: </td>
	<td>{$pa[gender]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">联系电话: </td>
	<td>{$pa[phone]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">QQ/MSN: </td>
	<td>{$pa[im]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">联系地址: </td>
	<td>{$pa[address]}</td>
</tr>
<tr>
	<td align="right" class="txtgray">个人介绍: </td>
	<td>{$pa[mood]}</td>
</tr>
</table>
</div>
</div>
<!--#}elseif($action =='invite'){#-->
<div id="container">
<h1><?=__('buddy_invite')?></h1>
<div class="tips_box_p">
<div class="tips_box"><b><?=__('tips')?>: </b><img class="img_light" src="images/light.gif" align="absmiddle"> <span class="txtgray"><?=__('tips_buddy_invite')?></span>
</div>
</div>
<br /><br />
<table align="center" width="98%" cellpadding="0" cellspacing="0" border="0">
<tr>
	<td><?=__('invite_link')?>：<input type="text" id="ivt" value="{$invite_url}" onclick="getId('ivt').select();copy_text('ivt');" size="80" maxlength="100" readonly /></td>
</tr>
</table>
<br /><br /><br /><br />
</div>
<script language="javascript">
function copy_text(id){
	var field = getId(id);
	if (field){
		if (document.all){
			field.createTextRange().execCommand('copy');
			atips("<?=__('copy_success')?>");
		}else{
			atips("<?=__('alert_ie_copytext')?>");
		}	
	}
}
</script>
<!--#}#-->