<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
      
<head>
	<th:block th:replace="/web/include/head :: layout_head"></th:block>
	<th:block layout:fragment="layout_css">
</th:block>
</head>

<th:block layout:fragment="layout_top_script">
    <script src="/js/kiosk/common.js"></script>
</th:block>
<th:block th:replace="/web/include/modal :: layout_modal"></th:block>

<th:block layout:fragment="layout_content">
    
</th:block>
<th:block layout:fragment="layout_popup">
</th:block>
<th:block layout:fragment="layout_script">
   <script type="text/javascript"> 
	   $(document).ready(function() {
		    userInsertModal2.popup();
		});
        let	userInsertModal2 = {
            callback : null,
            reqParam : null,
            dataList : null,
            /* 모달 초기화 작업 */
            init : function () {
                $('#userInsertModal2').remove();
                $('body').append(this.HtmlTemplate);
                //그리드 이벤트
                this.setEvent();
            },
            /* 그리드 이벤트 설정 */
            setEvent:function() {
                $('#userInsertModal2 .btnCancle').on("click", function(){
                    history.back();
                });

                $('#userInsertModal2 .btnSave').on("click", function(){
                    userInsertModal2.save();
                });

                userInsertModal2.setTreatmentOption();
                userInsertModal2.setSelectBox(3);

                $('#userInsertModal2 input[name="modalBirthday"]').datetimepicker({
                    allowInputToggle: true,
                    format: 'YYYY-MM-DD',
                    useCurrent: false // 현재 날짜 자동 선택
                }).on("dp.change", function(e){
                    // 날짜가 변경될 때 실행
                    // console.log(e.oldDate.format("YYYY-MM-DD"));
                    // console.log(e.date.format("YYYY-MM-DD"));
                    let selectDate = e.date.format("YYYY-MM-DD");

                    let ageText = userInsertModal2.calculateAge(selectDate);
                    $("#userInsertModal2 .txtAge").text(ageText);


                    selectDate = selectDate.replaceAll("-", "");
                    $('#userInsertModal2 input[name="modalUserRrn1"]').val(selectDate.substring(2, selectDate.length));
                });

                // 국적선택에 따른 여권번호/외국인 번호 활성화 이벤트
                userInsertModal2.isForeignerEvent();

                userInsertModal2.clickEvent();

                // 연락처 형식 이벤트
                document.querySelector('#userInsertModal2 input[name="modalPhoneNumber"]').addEventListener("input", function(event) {
                    userInsertModal2.formatPhoneNumber(this);
                });

                // 보조 연락처 형식 이벤트
                document.querySelector('#userInsertModal2 input[name="modalPhoneNumber2"]').addEventListener("input", function(event) {
                    userInsertModal2.formatPhoneNumber(this);
                });

                // 외국인 등록번호 앞자리 이벤트
                document.querySelector('#userInsertModal2 input[name="modalUserArc1"]').addEventListener("input", function(event) {
                    userInsertModal2.formatRrn1(this);
                });

                // 외국인 등록번호 뒷자리 이벤트
                document.querySelector('#userInsertModal2 input[name="modalUserArc2"]').addEventListener("input", function(event) {
                    userInsertModal2.formatRrn2(this);
                });

                // 주민등록번호 앞자리 이벤트
                document.querySelector('#userInsertModal2 input[name="modalUserRrn1"]').addEventListener("input", function(event) {
                    userInsertModal2.formatRrn1(this);
                });

                // 주민등록번호 뒷자리 이벤트
                document.querySelector('#userInsertModal2 input[name="modalUserRrn2"]').addEventListener("input", function(event) {
                    userInsertModal2.formatRrn2(this);
                });

                // 추천인 이벤트
                document.querySelector('#userInsertModal2 .searchIntroUser').addEventListener("click", function(){
                    userInsertModal2.listOpen();
                });

            },
            /* 데이터 선택 */
            setSelect:function(selectNumber) {
                var checkedData = dataList[selectNumber];
                if(dataList==null||checkedData==undefined){
                    return ;
                }

                if( userInsertModal2.callback )  {
                    userInsertModal2.callback(checkedData);
                }
                userInsertModal2.close();
            },
            /* 콤보 셋팅 */
            setSelectBox:function(num){
                let category=fn_selectCategoryList();
                for(let i = 0; i < num; i++){
                    let categoryCode     = category[i].categorycode;
                    fn_selectModalOtherOption(categoryCode, "userInsertModal2");
                }
            },
            /* selectBox 이벤트 */
            clickEvent:function() {
                // 옵션 선택 이벤트
                $('#userInsertModal2 .select_box').on('click', 'li', function (e) {
                    let target = $(this);

                    // 옵션 선택 이벤트 핸들러
                    let selectedOption = target.text();
                    if ('' !== selectedOption) {
                        // 선택된 옵션의 텍스트를 .label 요소에 설정
                        target.closest('.select_box').find('.label').text(selectedOption);
                    } else {
                        // 선택된 옵션이 텍스트가 아닌 경우(예: 이미지), .html()을 사용
                        selectedOption = target.html();
                        target.closest('.select_box').find('.label').html(selectedOption);
                    }
                    target.closest('.select_box').find('input')?.val(target.attr('id')??selectedOption);
                    target.closest('.select_box').find('.option_list_item').removeClass('selected');
                    target.addClass('selected');
                });

            },
            /* 휴대폰 번호 숫자입력 제한 */
            formatPhoneNumber:function(inputElement){
                // 입력된 키가 숫자가 아닌 경우 입력을 막음
                inputElement.value = inputElement.value.replace(/\D/g, '');
                let phoneNumber = inputElement.value;

                if (phoneNumber.length > 11) {
                    inputElement.value = phoneNumber.substring(0, 11)
                }
                inputElement.value = fn_setFormatPhone(phoneNumber);
            },
            /* 주민번호 숫자입력 제한 */
            formatRrn1:function(inputElement){
                // 입력된 키가 숫자가 아닌 경우 입력을 막음
                inputElement.value = inputElement.value.replace(/\D/g, '');
                let Rrn1 = inputElement.value;

                if (Rrn1.length > 6) {
                    inputElement.value=Rrn1.substring(0, 6)
                }
            },
            /* 주민번호 숫자입력 제한 2 */
            formatRrn2:function(inputElement){
                inputElement.value = inputElement.value.replace(/\D/g, '');
                let Rrn1 = inputElement.value;

                if (Rrn1.length > 7) {
                    inputElement.value=Rrn1.substring(0, 7)
                }
            },
            /* 캘린더 날짜 변경 시 만나이 계산 */
            calculateAge:function(param){
                let birthday = param;
                let birthDate = new Date(birthday);
                let today = new Date();
                let age = today.getFullYear() - birthDate.getFullYear();
                let month = today.getMonth() - birthDate.getMonth();

                if (0 > month || (0 === month  && today.getDate() < birthDate.getDate())) {
                    age--;
                }

                return `만 ${age}세`;
            },
            /* 국적선텍에 따른 여권번호/외국인 번호 활성화 event */
            isForeignerEvent:function(){
                document.querySelectorAll('#userInsertModal2 .local').forEach(element => {
                    element.addEventListener('click', function () {
                        document.querySelectorAll('#userInsertModal2 .local_box').forEach(box => box.style.display = 'block');
                        document.querySelectorAll('#userInsertModal2 .foreigner_box').forEach(box => box.style.display = 'none');
                    });
                });

                document.querySelectorAll('#userInsertModal2 .foreigner').forEach(element => {
                    element.addEventListener('click', function () {
                    document.querySelectorAll('#userInsertModal2 .local_box').forEach(box => box.style.display = 'none');
                    document.querySelectorAll('#userInsertModal2 .foreigner_box').forEach(box => box.style.display = 'block');
                    });
                });

                document.querySelectorAll('#userInsertModal2 .passport_number_option').forEach(element => {
                    element.addEventListener('click', function () {
                        document.querySelectorAll('#userInsertModal2 .foreigner_number_box').forEach(box => {
                            box.style.display = 'none';
                            box.querySelector('input').value = '';
                        });
                        document.querySelectorAll('#userInsertModal2 .passport_number_box').forEach(box => box.style.display = 'block');
                    });
                });

                document.querySelectorAll('#userInsertModal2 .foreigner_number_option').forEach(element => {
                    element.addEventListener('click', function () {
                        document.querySelectorAll('#userInsertModal2 .passport_number_box').forEach(box => {
                            box.style.display = 'none';
                            box.querySelector('input').value = '';
                        });
                        document.querySelectorAll('#userInsertModal2 .foreigner_number_box').forEach(box => box.style.display = 'block');
                    });
                });
            },
            /* 추천인 검색 팝업 open */
            listOpen:function(selectNumber) {
                let reqParam = {};
                userIntroSelectModal.popup(function (obj, reqParam) {
                    document.querySelector("#userInsertModal2 input[name='modalRecommendId']").dataset.userid=obj.muuserid;
                    document.querySelector("#userInsertModal2 input[name='modalRecommendId']").value = obj.username;
                }, reqParam);
            },
            /* 관심진료 옵션 셋팅*/
            setTreatmentOption:function(selectedGroupId){
                let formData = new FormData();
                $.ajax({
                    url: encodeURI('/kiosk/getTreatmentOptionList.do'),
                    data: formData,
                    dataType: "json",
                    processData: false,
                    contentType: false,
                    type: 'POST',
                    async: false,
                    success: function(data){
                        if('0'==data.msgCode){
                            let listHTML = '';

                            for(let i = 0; i < data.rows.length; i++){
                                let treatmentName = data.rows[i].treatmentname;
                                let treatmentId = data.rows[i].mutreatmentid;
                                let selectedYn = '';
                                if(treatmentId === selectedGroupId) {
                                    selectedYn = 'selected';
                                    $("#userInsertModal2 .modalTreatment").parent().find('button').text(treatmentName);
                                }

                                listHTML += `<li class="option_list_item ${selectedYn}" id="${treatmentId}">${treatmentName}</li>`;
                            }
                            $("#userInsertModal2 .modalTreatment").empty().append(listHTML);

                        }else if(data.msgCode=='-1'){
                            modalEvent.warning("조회 오류", data.msgDesc);
                        }else{
                            modalEvent.danger("조회 오류", "조회 중 오류가 발생하였습니다. 잠시후 다시시도하십시오.");
                        }
                    },
                    error : function(xhr, status, error) {
                        modalEvent.danger("조회 오류", "조회 중 오류가 발생하였습니다. 잠시후 다시시도하십시오.");
                    },
                    beforeSend:function(){
                    },
                    complete:function(){
                    }
                });
            },
            /* 주민번호, 외국인 등록번호 및 생년월일, 성별 유효성검사 */
            userRrnCheck:function(idNumber){
                let year = idNumber.substring(0, 2);
                let month = idNumber.substring(2, 4);
                let day = idNumber.substring(4, 6);
                let yearPrefix;
                let genderCode = idNumber.charAt(6);

                switch (genderCode) {
                    case '1':
                    case '2':
                    case '5':
                    case '6':
                        yearPrefix = '19'
                        break;
                    case '3':
                    case '4':
                    case '7':
                    case '8':
                        yearPrefix = '20';
                        break;
                    default:
                        console.log("잘못된 주민등록번호입니다.");
                        return;
                }
                let genderInput = document.querySelector('#userInsertModal2 input[name="modalGender"]:checked').value; // 성별 입력값 ('M' 또는 'F')
                let birthDateInput = document.querySelector('#userInsertModal2 input[name="modalBirthday"]').value; // 'yyyy-mm-dd' 형식

                // 성별 검증
                let genderMatch = ((genderCode === '1' || genderCode === '3' || genderCode === '5' || genderCode === '7') && genderInput === 'M') ||
                    ((genderCode === '2' || genderCode === '4' || genderCode === '6' || genderCode === '8') && genderInput === 'F');

                let fullYear = yearPrefix + year;
                let birth = `${fullYear}-${month}-${day}`;

                // 생년월일 및 성별 일치 검증
                if (birth === birthDateInput && genderMatch) {
                    return true;
                } else {
                    return false;
                }
            },
            /****************************************************************************
             * 고객 정보 등록
             ****************************************************************************/
            //저장
            save:function() {
                let nationalitySelectYn         = $("#userInsertModal2 .nationality_pop .option_list_item.selected").length==0?"N":"Y";
                let nationalityCode             = "";
                let nationality                 = "";
                let localYn                     = "";
                if("Y" == nationalitySelectYn){
                    nationalityCode             = $("#userInsertModal2 .nationality_pop .option_list_item.selected").data('code');
                    nationality                 = $("#userInsertModal2 .nationality_pop .option_list_item.selected").attr('id').split('_')[1];
                    localYn                     = $("#userInsertModal2 .nationality_pop .option_list_item.selected").hasClass('local');
                }
                let userName                    = $('#userInsertModal2 input[name="modalUserName"]').val().trim();
                let userRrn1                    = $('#userInsertModal2 input[name="modalUserRrn1"]').val().trim();
                let userRrn2                    = $('#userInsertModal2 input[name="modalUserRrn2"]').val().trim();
                let userPno                     = $('#userInsertModal2 input[name="modalUserPno"]').val().trim();
                let userArc1                    = $('#userInsertModal2 input[name="modalUserArc1"]').val().trim();
                let userArc2                    = $('#userInsertModal2 input[name="modalUserArc2"]').val().trim();
                let phoneNumber                 = $('#userInsertModal2 input[name="modalPhoneNumber"]').val().replace(/-/g, "");
                let phoneNumber2                = $('#userInsertModal2 input[name="modalPhoneNumber2"]').val().replace(/-/g, "");
                
                let refusePhotoYn               = $("#userInsertModal2 input[name='modalRefusePhotoYn']:checked").val();
                let smsYn                       = $("#userInsertModal2 input[name='modalSmsYn']:checked").val();
                let gender                      = $("#userInsertModal2 input[name='modalGender']:checked").val()==null?"":$("#userInsertModal2 input[name='modalGender']:checked").val();
                let channelSelectYn             = $("#userInsertModal2 .channel .option_list_item.selected").length==0?"N":"Y";
                let channel                     = "";
                let channelCode                 = "";
                if("Y" == channelSelectYn){
                    channel                     = ($("#userInsertModal2 .channel .option_list_item.selected").attr("id")||'').split('_')[1]||'';
                    channelCode                 = $("#userInsertModal2 .channel .option_list_item.selected").data('code');
                }
                let muGroupIdSelectYn           = $("#userInsertModal2 .modalTreatment .option_list_item.selected").length==0?"N":"Y";
                let muGroupId                   = "";
                if("Y" == muGroupIdSelectYn){
                    muGroupId                   = $("#userInsertModal2 .modalTreatment .option_list_item.selected").attr("id");
                }
                let userTypeCodeSelectYn        = $("#userInsertModal2 .userType_pop .option_list_item.selected").length==0?"N":"Y";
                let userTypeCode                = "";
                let userType                    = "";
                if("Y" == userTypeCodeSelectYn){
                    userTypeCode                = $("#userInsertModal2 .userType_pop .option_list_item.selected").data('code');
                    userType                    = $("#userInsertModal2 .userType_pop .option_list_item.selected").attr('id').split('_')[1];
                }
                let memo                        = $('#userInsertModal2 textarea[name="modalMemo"]').val();
                let etc                         = $('#userInsertModal2 textarea[name="modalEtc"]').val();
                let birthday                    = $('#userInsertModal2 input[name="modalBirthday"]').val();
                

                let regRrn = /^[0-9]{6}-[1-4][0-9]{6}$/; // 주민등록번호 형식
                let regForeigner = /^[0-9]{6}-[5-8][0-9]{6}$/; // 외국인 등록번호 형식
                let regPhone = /^[0-9]{8,11}$/; // 전화번호 형식
                
                let identification = $("#userInsertModal2 .identification .selected").attr("id");
                let introUserId = document.querySelector("#userInsertModal2 input[name='modalRecommendId']").dataset.userId;


                if(!fn_emptyCheck(nationality)){
                    modalEvent.warning("등록", "국적을 선택하세요.");
                    return;
                }
                if(!fn_emptyCheck(userName)){
                    modalEvent.warning("등록", "고객명을 입력하세요.",()=>{
                        $('#userInsertModal2 input[name="modalUserName"]').focus();
                    });
                    return;
                }
                else{
                    if(!fn_lengthCheck(userName, 35)) {
                        modalEvent.warning("등록", "이름 정보는 35자를 넘을 수 없습니다.",()=>{
                            $('#userInsertModal2 input[name="modalUserName"]').focus();
                        });
                        return;
                    }
                }

                if(!fn_emptyCheck(channel)){
                    channel = '';
                }

                if(!fn_emptyCheck(channelCode)){
                    channelCode = '';
                }

                if(!fn_emptyCheck(muGroupId)){
                    muGroupId = '';
                }

                if(!fn_emptyCheck(introUserId)){
                    introUserId = '';
                }

                /*if(!fn_emptyCheck(userType)){
                    modalEvent.warning("등록", "고객구분을 선택하세요.");
                    return;
                }*/
                if(!fn_emptyCheck(phoneNumber)){
                    modalEvent.warning("등록", "연락처 정보를 입력하세요.",()=>{
                        $('#userInsertModal2 input[name="modalPhoneNumber"]').focus();
                    });
                    return;
                }
                else if(!regPhone.test(phoneNumber)){
                    modalEvent.warning("등록", "연락처 정보는 숫자 8~11자리여야 합니다",()=>{
                        $('#userInsertModal2 input[name="modalPhoneNumber"]').focus();
                    });
                    return;
                }
                if (phoneNumber2 && !regPhone.test(phoneNumber2)) {
                    modalEvent.warning("등록", "유효하지 않은 보조 연락처 형식입니다.",()=>{
                        $('#userInsertModal2 input[name="modalPhoneNumber2"]').focus();
                    });
                    return;
                }
                // 국적이 KR일 때 주민등록번호 검사
                if (localYn) {
                } else {
                    userRrn1 = "";
                    userRrn2 = "";

                }


                modalEvent.info("등록", "고객 정보를 등록하시겠습니까?", function(){
                    let formData = new FormData();
                    //formData.append("muUserId", muUserId);
                    formData.append("nationality", nationality);
                    formData.append("nationalityCode", nationalityCode);
                    formData.append("localYn", localYn);
                    formData.append("userName", userName);
                    formData.append("userRrn1", userRrn1);
                    formData.append("userRrn2", userRrn2);
                    formData.append("userPno", userPno);
                    formData.append("userArc1", userArc1);
                    formData.append("userArc2", userArc2);
                    formData.append("phoneNumber", phoneNumber.replace(/-/g, ""));
                    formData.append("phoneNumber2", phoneNumber2.replace(/-/g, ""));
                    // formData.append("email", email);
                    // formData.append("address", streetAddress);
                    // formData.append("addressDetails", addressDetails);
                    // formData.append("zipCode", zipCode);
                    formData.append("gender", gender);
                    formData.append("channel", channel);
                    formData.append("channelCode", channelCode);
                    formData.append("muGroupId", muGroupId);
                    formData.append("memo", memo);
                    formData.append("etc", etc);
                    formData.append("birthday", birthday);
                    formData.append("userTypeCode", userTypeCode);
                    formData.append("userType", userType);
                    formData.append("refusePhotoYn", refusePhotoYn);
                    formData.append("smsYn", smsYn);
                    // formData.append("emailYn", emailYn);
                    formData.append("identification", identification);
                    formData.append("introUserId", introUserId);

                    $.ajax({
                        url: encodeURI('/kiosk/putUser.do'),
                        data: formData,
                        dataType: "json",
                        processData: false,
                        contentType: false,
                        type: 'POST',
                        async:true,
                        success: function(data){
                            if(data.msgCode=='0'){
                                modalEvent.success("성공", data.msgDesc, function(){                                    
                                    history.back();
                                });

                            }else{
                                modalEvent.danger("오류", data.msgDesc);
                            }
                        },
                        error : function(xhr, status, error) {
                            modalEvent.danger("등록 오류", "고객 등록 중 오류가 발생하였습니다. 잠시후 다시시도하십시오.");
                        },
                        beforeSend: function () {
                        },
                        complete: function () {
                        }
                    });
                });
            },
            /*
            * 팝업
            * callback : 콜백함수, reqParam: 팝업파라미터
            */
            popup:function(callback, reqParam) {
                // 초기화 후 열기
                userInsertModal2.init();

                //콜백함수 지정.
                userInsertModal2.callback = callback;
                userInsertModal2.reqParam = reqParam;
                userInsertModal2.dataList = null;

                setTimeout(function(){
                    $('#userInsertModal2').modal({keyboard:false, backdrop:'static'});
                }, 200);

            },
            /*
            * 팝업 닫기
            */
            close:function() {
                $('#userInsertModal2').modal('hide');

                setTimeout(function(){
                    $('#userInsertModal2').remove();
                },500);
            },
            HtmlTemplate :`
                <div id="userInsertModal2" class="modal new_patient_modal fade" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <p class="title">고객 등록</p>
                            </div>

                            <div class="modal-body">
                                <div class="form_box">
                                    <div class="input_box essential">
                                        <label>국적</label>
                                        <div class="select_box dropdown">
                                            <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">국적</button>
                                            <ul class="select_option_list dropdown-menu nationality_pop">
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="input_box essential">
                                        <label>고객명</label>
                                        <input type="text" name="modalUserName" placeholder="이름"/>
                                    </div>
                                    <div class="input_box">
                                        <label>생년월일</label>
                                        <div class="date_box">
                                            <input name="modalBirthday" placeholder="연도-월-일"/>
                                            <img class="userBirthday" src="/image/web/calendar.svg" alt="calendar">
                                        </div>
                                        <p class="identity txtAge"></p>
                                    </div>
                                    <div class="input_box foreigner_box">
                                        <label>식별정보</label>
                                        <div class="select_box dropdown">
                                            <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true"
                                                    aria-expanded="false">여권번호
                                            </button>
                                            <ul class="select_option_list dropdown-menu identification">
                                                <li class="option_list_item passport_number_option selected" id="pno">여권번호</li>
                                                <li class="option_list_item foreigner_number_option" id="arc">외국인등록번호</li>
                                            </ul>
                                        </div>
                                        <div class="passport_number_box">
                                            <div class="passport_number">
                                                <input name="modalUserPno" type="text" placeholder="여권번호"/>
                                            </div>
                                        </div>
                                        <div class="foreigner_number_box">
                                            <input name="modalUserArc1" type="text" placeholder="000000"/>
                                            <span class="slash">-</span>
                                            <input type="text" name="modalUserArc2" placeholder="000000"/>
                                        </div>
                                    </div>
                                    <div class="input_box local_box">
                                        <label>주민등록번호</label>
                                        <input name="modalUserRrn1" type="text" placeholder="000000"/>
                                        <span class="slash">-</span>
                                        <input name="modalUserRrn2" type="text" placeholder="000000"/>
                                    </div>
                                    <div class="input_box">
                                        <label>성별</label>
                                        <div class="gender">
                                            <input type="radio" name="modalGender" id="modalFemale" value="F"/>
                                            <label for="modalFemale" >여자</label>
                                        </div>
                                        <div class="gender">
                                            <input type="radio" name="modalGender" id="modalMale" value="M"/>
                                            <label for="modalMale">남자</label>
                                        </div>
                                    </div>
                                    <div class="input_box">
                                        <label>고객구분</label>
                                        <div class="select_box dropdown">
                                            <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">고객구분</button>
                                            <ul class="select_option_list dropdown-menu userType_pop">
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="input_box two essential">
                                        <div class="first essential">
                                            <label>연락처</label>
                                            <input name="modalPhoneNumber" type="tel" placeholder="010-0000-0000"/>
                                        </div>
                                        <div>
                                            <label>보조연락처</label>
                                            <input name="modalPhoneNumber2" type="tel" placeholder="010-0000-0000"/>
                                        </div>
                                    </div>
                                    <div class="input_box">
                                        <label>사진 거부</label>
                                        <div class="gender">
                                            <input type="radio" name="modalRefusePhotoYn" id="modalRefusePhotoY" value="Y" checked/>
                                            <label for="modalRefusePhotoY">예</label>
                                        </div>
                                        <div class="gender">
                                            <input type="radio" name="modalRefusePhotoYn" id="modalRefusePhotoN" value="N"/>
                                            <label for="modalRefusePhotoN">아니오</label>
                                        </div>
                                    </div>
                                    
                                    <div class="input_box">
                                        <label>SMS 수신여부</label>
                                        <div class="gender">
                                            <input type="radio" name="modalSmsYn" id="modalSmsY" value="Y" checked/>
                                            <label for="modalSmsY">예</label>
                                        </div>
                                        <div class="gender">
                                            <input type="radio" name="modalSmsYn" id="modalSmsN" value="N"/>
                                            <label for="modalSmsN">아니오</label>
                                        </div>
                                    </div>

                                    <p class="title">기타 정보</p>
                                    <div class="input_box">
                                        <label>관심진료</label>
                                        <div class="select_box dropdown">
                                            <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">관심진료 선택</button>
                                            <ul class="select_option_list dropdown-menu modalTreatment"></ul>
                                        </div>
                                    </div>
                                    <div class="input_box two">
                                        <div class="first">
                                            <label>방문경로</label>
                                            <div class="select_box dropdown">
                                                <button class="label" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">방문경로</button>
                                                <ul class="select_option_list dropdown-menu channel">
                                                </ul>
                                            </div>
                                        </div>
                                        <div>
                                            <label>추천인</label>
                                            <div class="search_box searchIntroUser">
                                                <button class="search_btn"><img src="/image/web/search_B.svg" alt="search"/></button>
                                                <input type="text" name="modalRecommendId" placeholder="추천인 검색" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="textarea_box">
                                        <label>특이 사항</label>
                                        <p class="explanation">*시술 및 약물 관련 특이사항 기록</p>
                                        <textarea name="modalEtc" placeholder="내용을 입력해주세요."></textarea>
                                    </div>
                                    <div class="textarea_box">
                                        <label>고객 메모</label>
                                        <textarea name="modalMemo" placeholder="내용을 입력해주세요."></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <div class="btn_box">
                                    <button type="button" class="cancel_btn btnCancle">취소</button>
                                    <button type="button" class="registration_bth btnSave">등록</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>`
        };
        
        
</script>
</th:block>
</html>