<?php
include_once('./_common.php');

if(!$member['mb_id']) alert_close('회원만 이용하실 수 있습니다.');

// 설정 저장-------------------------------------------------------
if ($w == "u") mb_photo_upload($member['mb_id'], $del_mb_icon2, $_FILES); //Save
//--------------------------------------------------------------------

?>

<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<? if (G5_IS_MOBILE) {?>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10,user-scalable=yes">
	<meta name="HandheldFriendly" content="true">
	<meta name="format-detection" content="telephone=no">
<? } ?>
<title>회원사진 등록/수정</title>
<style>
	body, table, form { margin:0; padding:0; font:normal 12px dotum; -webkit-text-size-adjust:100%; }
	body { padding:0px; margin:0px; background:#fff; }
	h2 { display:block; margin:0px; padding:15px; background:#000;font:bold 18px tahoma; color:gold; }
	p { line-height:1.8; }
	p img { border:6px solid #efefef;}
	.photo_upload { padding:10px 20px; text-align:center; line-height:1.8; font:normal 12px dotum; }
	.photo_save { cursor:pointer; padding:8px 20px; background:red; color:#ffffff; border:0px; cursor:pointer; font:bold 12px dotum; }
</style>
</head>
<body>
<h2>My Photo</h2>


<form name="fphotoform" method="post" action="./mb.photo.php" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="w" value="u">

<div class="photo_upload">
	<p><?=mb_photo('', $member['mb_id'], $xp['photo_size'], $xp['photo_size'])?></p>

	<p>
	회원사진은 이미지(gif/jpg/png) 파일만 가능하며, 등록시 <?=$xp['photo_size']?>x<?=$xp['photo_size']?> 사이즈로 자동 리사이즈됩니다.
		<? if($xp['animated_gif_photo']) { ?>
			(움직이는 GIF 등록가능. 단, 리사이즈 안됨)
		<? } else { ?>
			(단, 움직이는 GIF 등록불가)
		<? } ?>
	</p>

	<p><input type=file name='mb_icon2'></p>
	<? if (file_exists(G5_DATA_PATH.'/mb_photo/'.$member['mb_id'])) echo '<p><label><input type="checkbox" name="del_mb_icon2" value="1"> 회원사진 삭제</label></p>'; ?>

	<p><input type="submit" accesskey="s" value="저장하기" class="photo_save"></p>
</div>
</form>

<script>
$(function() {
    var sw = screen.width;
    var sh = screen.height;
    var cw = document.body.clientWidth;
    var ch = document.body.clientHeight;
    var top  = sh / 2 - ch / 2 - 100;
    var left = sw / 2 - cw / 2;
    moveTo(left, top);
});
</script>

</body>
</html>