<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="kc" uri="/WEB-INF/tlds/kcc_tld.tld"%>
<!DOCTYPE html>
<script type="text/javascript">

	function step3(){
		
		$.ajax({
            url: '/web/user/cert/kCertStep3Ajax.do',
            type: 'POST',
            processData: false,
            contentType: false,
            data: new FormData(document.kForm),
            success: function(response) {
				alert(response.msg);
				if(response.result == 'success'){
					opener.location.href = '/';
	        		window.close();
				}else if(response.result == 'requestFail'){
					window.close();
				}
            },
            error: function(error) {
            	alert("error");
            }
        });
	}

</script>

<form id="kForm" name="kForm" action="/web/user/cert/kCertStep2.do" method="post">
	<input type="hidden" name="receiptID" value="${request.receiptID}"/>

  <div class="window_popup idf" style="max-width:700px">
    <div class="title_area">
      <h1>카카오 간편인증</h1>
    </div>
    <div class="cont_area text_center">

      <p class="title gMarket_bold"><i class="icon lock"></i> 인증을 진행해주세요.</p>

      <div class="box gray_fill">
        입력하신 휴대폰으로 인증 요청 메시지를 보냈습니다.<br>
        앱에서 인증을 진행해 주세요.
      </div>

      <div class="btn_wrap center">
        <button type="button" class="btn btn_40 btn_text gray_fill" onclick="self.close();">취소</button>
        <button type="button" class="btn btn_40 btn_text darkblue_fill" onclick="step3();">인증완료</button>
      </div>
    </div>
  </div>
</form>