<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

if(!$is_me) alert("본인만 접근 가능 합니다.");
?>
<style type="text/css">
#friend_box	{ color:#A2A2A2; height:380px; overflow-y:scroll; border:0px solid; padding:2px; border:1px solid #F3F3F3; background-color:#FBFBFB; }
#admtitle	{ padding:3px 0 0 0; font-weight:bold; }
#div_box	{ padding:2px; }

.openlist	{ color:#3A3A3A; font-size:11px; }
</style>

<table width="100%" cellspacing="0">
<tr>
	<td valign="top">
	<div id=admtitle>친구관리 <img src="<?=$member_skin_path?>/img/icon_arrow_right2.gif" align="absmiddle"></div>
	<div id="friend_box">
	<img src="<?=$member_skin_path?>/img/icon_arrow_right.gif" align="absmiddle"><a href="./profile.php?mb_id=<?=$member[mb_id]?>&pcode=adm">전체</a> 
<? for($i = 0; $i < count($grouplist); $i++) : ?><img src="<?=$member_skin_path?>/img/icon_arrow_right.gif" align="absmiddle"><a href="./profile.php?mb_id=<?=$member[mb_id]?>&pcode=adm&groupname=<?=$grouplist[$i]?>"><?=$grouplist[$i]?></a> <? endfor; ?>
	<table width="100%" align="center" bgcolor="#D3D3D3" cellspacing="1" cellpadding="3">
	<tr bgcolor="#EBEBEB" align="center" style="font-weight:bold; height:25px; color:#616161;">
		<td width="50%">이름</td>
		<td width="43%">그룹</td>
		<td width="7%"></td>
	</tr>
<? for($i = 0; $i < count($friendlist); $i++) : ?>
	<form name="friendlist" method="post" action="./zm.userinfo_update.php">
	<input type="hidden" name="mode" value="friendgroup">
	<input type="hidden" name="recno" value="<?=$friendlist[$i][recno]?>">
	<tr bgcolor="#ffffff">
		<td><?=$friendlist[$i][nick]?>(<?=$friendlist[$i][mb_id]?>)</td>
<?	if($friendlist[$i][state] == "1") : ?>
		<td align="center"><div class="txtsmall">(친구 승인 대기 중입니다.)</div></td>
<?	else : ?>
		<td><input size="8" name="in_group" value="<?=$friendlist[$i][group]?>"> <input type="image" src="<?=$member_skin_path?>/img/btn_fnd_adj.gif" align="absmiddle"></td>
<?	endif; ?>
		<td align="center"><a href="#" onClick="dropfriend('<?=$friendlist[$i][recno]?>')"><img src="<?=$member_skin_path?>/img/btn_del_gray.gif"></a></td>
	</tr>
	</form>
<? endfor; ?>
	</table>
	</div>
	</td>
</tr>
</table>
<div style="padding:5px; margin:15px 0 0 0; border:1px solid #EFEFEF; background:#F7F7F7;">
	<div id=admtitle>친구신청 <img src="<?=$member_skin_path?>/img/icon_arrow_right2.gif" align="absmiddle"></div>
	<div id=div_box>
	<form name="friendrequest" method="post" action="./zm.userinfo_update.php">
	<input type="hidden" name="mode" value="friendrequest">
	ID <input name="in_friend_id" value="<?=$friend_id?>" required itemname="친구 아이디"> 메모 <input size="50" name="in_friend_memo">
	<input type="image" src="<?=$member_skin_path?>/img/btn_friend.gif" align="absmiddle">
	</form>
	</div>
</div>
<?
/* 프로필 배경 이미지 업로드, 임시 주석
$chk_flag	= array();
$chk_flag[$bginfo[db_flag]]	= "selected";
?>
<div style="padding:5px; margin:15px 0 0 0; border:1px solid #EFEFEF; background:#F7F7F7;">
	<form name="bg_form" method="post" action="./zm.userinfo_update.php" enctype="multipart/form-data">
	<input type="hidden" name="mode" value="bgimageupload">
	<div><span id=admtitle>배경이미지 <img src="<?=$member_skin_path?>/img/icon_arrow_right2.gif" align="absmiddle"></span></div>
	<div id=div_box>
		<input type="file" name="in_bg_file"><span class="txtsmall">(최대 900 x 600)</span> 
		<select name="in_repeat">
		<option value="1" <?=$chk_flag["1"]?>>한번만</option>
		<option value="2" <?=$chk_flag["2"]?>>가로 반복</option>
		<option value="3" <?=$chk_flag["3"]?>>세로 반복</option>
		<option value="4" <?=$chk_flag["4"]?>>가운데</option>
		<option value="5" <?=$chk_flag["5"]?>>반복</option>
		</select>
		<input type="checkbox" name="in_bgdel" value="1">삭제 <input type="image" src="<?=$member_skin_path?>/img/btn_background.gif" align="absmiddle">
	</div>
	</form>
</div>
<? */ ?>
<!-- edit X ↓ -->
<script language="javascript">
function dropfriend(no){
	if(!no) return false;

	if(confirm("친구를 해지 합니다.\n상대는 해지 내용을 알 수 없습니다.")) zm_gourl("./zm.userinfo_update.php?mode=frienddrop&no="+no);
	return;
}
</script>