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

if(!$is_me) alert("본인만 접근 가능 합니다.");
?>
<style type="text/css">
#friend_box	{ color:#A2A2A2; height:280px; 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>

<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>

<!-- 정보 공개 수준 -->
<div id=admtitle>공개설정 <img src="<?=$member_skin_path?>/img/icon_arrow_right2.gif" align="absmiddle"></div>
	<div id=div_box>
	<form name="openlevel" method="post" action="./zm.userinfo_update.php">
	<input type="hidden" name="mode" value="openlevel">
	<table width="98%" cellpadding="3" cellspacing="0">
	<tr>
		<td style="background-color:#F7F7F7"><input type="radio" name="openlevel" value="1" <?=$chk_open_level[1]?>>1단계</td>
	</tr>
	<tr height="40">
		<td style="background-color:#F7F7F7"><div class="openlist">프로필사진, 서명, 별명, 최종접속일</div></td>
	</tr>
	<tr>
		<td style="background-color:#EBEBEB"><input type="radio" name="openlevel" value="2" <?=$chk_open_level[2]?>>2단계</td>
	</tr>
	<tr height="40">
		<td style="background-color:#EBEBEB"><div class="openlist">한줄메모, 가입일, 접속지역, 소속, 이메일, 홈페이지, 자기소개, 미니앨범</div></td>
	</tr>
	<tr>
		<td style="background-color:#DBDBDB"><input type="radio" name="openlevel" value="3" <?=$chk_open_level[3]?>>3단계</td>
	</tr>
	<tr height="40">
		<td style="background-color:#DBDBDB"><div class="openlist">회원등급, 나이, 혈액형, 학교, 전화번호</div></td>
	</tr>
	</table>
	<div style="height:75px;">
<? if ($member[mb_open_date] <= date("Y-m-d", $g4[server_time] - ($config[cf_open_modify] * 86400))) : //-- 정보공개 수정일이 지났다면 수정가능 ?>
		<input type="radio" name="opencondition" value="1" <?=$chk_open_condition[1]?>>모두 공개
		<input type="radio" name="opencondition" value="2" <?=$chk_open_condition[2]?>>친구에게만 공개<br>
		<input type="radio" name="opencondition" value="3" <?=$chk_open_condition[3]?>>프로필 비공개
		<div style="text-align:center; padding:4px;"><input type="image" src="<?=$member_skin_path?>/img/btn_open_adj.gif"><div>
<? else : ?>
		<div class="txtsmall">정보공개는 수정후 <?=(int)$config[cf_open_modify]?>일 이내, <?=date("Y년 m월 j일", strtotime("$member[mb_open_date] 00:00:00") + ($config[cf_open_modify] * 86400))?> 까지는 변경이 안됩니다.<br>잦은 정보공개 수정으로 인하여 쪽지를 보낸 후 받지 않는 경우를 막기 위해서 입니다.</div>
<? endif; ?>
	</div>
	</form>
</div>
<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="친구 아이디"><br>메모 <input name="in_friend_memo" style="width:60%;">
	<input type="image" src="<?=$member_skin_path?>/img/btn_friend.gif" align="absmiddle">
	</form>
	</div>
</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>