<?

$SES_MEMBER_NAME = $this->session->userdata('C_Member_Name');
$SES_MEMBER_FIRST = $this->session->userdata('C_Member_First');
$SES_MEMBER_PASSWORD_CHANGE = $this->session->userdata('C_Member_Password_Change');
$SES_MEMBER_LOGIN = $this->session->userdata('C_Member_Login');
$SES_MEMBER_ID = $this->session->userdata('C_Member_Id');
$this->session->unset_userdata('C_Member_Login');
$this->session->unset_userdata('C_Member_First');
$this->session->unset_userdata('C_Member_Password_Change');

?>
<div class="mypage_top">
	<a href="/m/mypage/qna_add" class="pens"><img src="/img/mobile/penicon.png"></a>
	<div class="mypage_logo"><a href="/m"><img src="/img/mobile/logo_cm.jpg" alt="logo"></a>
	</div>
	<div class="mypage_title"><a href="">마이페이지</a>
	</div>
	<div class="mypage_menu"><a href=""><img src="/img/mobile/menu_list.gif" alt="menu"></a>
	</div>
</div>
<div class="account_header">
	<span class="header_tit">계정정보</span><span class="fr" style="padding-right:20px; padding-top:3px;"><a href=""><img src="/img/mobile/img_close.gif"></a></span>
</div>
<div class="account_cont">
	<p style="text-align:center; margin:60px 0 80px;; display:block; overflow:hidden;"><img src="/img/mobile/logo_cm.gif"></p>
	<div class="form-group">
		<label for="exampleInputEmail1">비밀번호 </label>
		<input type="password" id="profile_password" class="form-control mybutton_on" placeholder="설정하신 비밀번호를 입력해 주세요." style="width: 98%; cursor:auto;" onkeydown="inputSendit();">
	</div>
	<div style=" margin-top:140px; padding-left:5px;">
		<p style="font-size:16px;"><span class="beachblue" style="font-size:18px">Q.</span>  설정하신 비번이 기억 안나시나요?</p>
		<div style="margin-top:15px;">
			<span><a href="/m/member/find_id" class="btn btn-default_bb br3" style="padding:8px 12px">아이디찾기</a></span>
			<span style="margin-left:10px;"><a href="/m/member/find_pw" class="btn btn-default br3" style="padding:8px 12px">비밀번호 찾기</a></span></a></span>
		</div>
	</div>
	<div class="account_btn" style="margin-top:20px;">
		<span><a onclick="history.back(-1)" class="btn btn-default_bb br5" style="font-size: 17px;padding: 15px 0;width: 50%; margin-right:3%;">뒤로가기</a></span>
		<span><a onclick="check_password()" class="btn btn-success br5" style="font-size: 17px;padding: 15px 0;width: 45%;">다음</a></span>
	</div>
</div>

<script>


	function check_password(){

		if($("#profile_password").val()==""){
			alert("비밀번호를 입력해주세요.");
			$("#profile_password").focus();
			return false;
		}

		var form_data = {
			"member_id"     : "<?=$SES_MEMBER_ID?>",
			"member_pwd"    : $("#profile_password").val()
		};
		$.ajax({
			url: '/web/member/password_check_proc',
			async: false,
			type: 'POST',
			dataType: 'JSON',
			data: form_data,
			success: function (rtnJson) {
				console.log(rtnJson);
				console.log(rtnJson.code);
				if (rtnJson.code == "0000") {
					location.href="/m/mypage/member_edit";
				} else {
					alert(rtnJson.msg);
					return false;
				}
			},
			error: function (rtnJson) {
				alert('비밀번호 확인에 실패했습니다.');
				return false;
			}
		});
	}

	function inputSendit() {
		if (event.keyCode == 13) {
			check_password();
		}
	}

</script>
