<%@page import="com.dbs.mplus.MPlusConstants"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
if (request.getProtocol().equals("HTTP/1.1")){	
        response.setHeader("Cache-Control", "no-cache");
}
%>
<meta property="og:type" content="website" />
<meta property="og:title" content="대구파티마병원 MCare" />
<meta property="og:description" content="대구파티마병원 Mcare 서비스입니다." />
<meta name="format-detection" content="telephone=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=3.0" /> 
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<link rel="shortcut icon" href="<c:url value="/resources/css/images/favicon.ico" />" />
<%-- <link rel="stylesheet" type="text/css" href="<c:url value="/resources/plugins/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css" />" />
<link rel="alternate stylesheet" type="text/css" href="<c:url value="/resources/plugins/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css"/>" title="style1" media="screen"/> --%>

<html>
	<body>
		<div class="modal" tabindex="-1" role="dialog" id="settingModal" style="display: none">
	  <div class="modal-dialog" role="document" style="width: 300px">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title">설정</h4>
	      </div>
	      <div class="modal-body">
	        	<div class="text-center" style="width: 70px; margin: 0 auto;">
					<div class="radio3 radio-check">
                         <input type="radio" id="settingRadio1"  name="settingRadio" value="I" settingTab="입원">
                         <label for="settingRadio1">입원</label>
					</div>
					<div class="radio3 radio-check ">
						  <input type="radio" id="settingRadio2" name="settingRadio" value="O" settingTab="외래">
                         <label for="settingRadio2">외래</label>
					</div>
					<div class="radio3 radio-check">
						  <input type="radio" id="settingRadio3" name="settingRadio" value="E" settingTab="응급">
                         <label for="settingRadio3">응급</label>
					</div>
					<div class="radio3 radio-check">
						  <input type="radio" id="settingRadio4" name="settingRadio"  value="P" settingTab="수술">
                         <label for="settingRadio4">수술</label>
					</div>
				</div>
	      </div>
	      <div class="modal-footer">
	      	<button type="button" class="btn btn-primary" id="btnSaveSetting">저장</button>
	        <button type="button" class="btn btn-default" data-dismiss="modal">취소</button>
	      </div>
	    </div>
	  </div>
	</div>	
	
	<div class="modal" tabindex="-1" role="dialog" id="mplusAlert" style="display: none">
			<div class="modal-dialog" role="document">
			  <div class="modal-content">
			    <div class="modal-header">
			      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			      <h4 class="modal-title">알림</h4>
			    </div>
			    <div class="modal-body">
			    </div>
			    <div class="modal-footer">
			      <button type="button" class="btn btn-success alertBtn" data-dismiss="modal">확인</button>
			    </div>
			  </div>
			</div>
		</div>
		
		<div class="modal" tabindex="-1" role="dialog" id="mplusConfirm" style="display: none">
			<div class="modal-dialog" role="document">
			  <div class="modal-content">
			    <div class="modal-header">
			      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			      <h4 class="modal-title">알림</h4>
			    </div>
			    <div class="modal-body">
			    </div>
			    <div class="modal-footer">
			      <button type="button" class="btn btn-success popupCallback confirmBtn">확인</button>
			      <button type="button" class="btn btn-default popupCancel confirmBtn" data-dismiss="modal">취소</button>
			    </div>
			  </div>
			</div>
		</div>
		
		<div class="modal" tabindex="-1" role="dialog" id="mplusConsentDeleteForm" style="display: none">
			<div class="modal-dialog" role="document" style="width: 400px">
			  <div class="modal-content">
			    <div class="modal-header">
			      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			      <h4 class="modal-title">삭제사유</h4>
			    </div>
			    <div class="modal-body">
		        	<div class="text-center">
		        		<input type="text" id="txtSeq" hidden/>
						<div class="radio3 radio-check">
	                         <input type="radio" id="consentDeleteRadio1"  name="consentDeleteRadio" value="slt1" dataReason="처방 변경으로 인한 삭제" checked>
	                         <label class="text-left" for="consentDeleteRadio1">&nbsp;처방 변경으로 인한 삭제</label>
						</div>
						<div class="radio3 radio-check">
							  <input type="radio" id="consentDeleteRadio2" name="consentDeleteRadio" value="slt2" dataReason="중복 작성으로 인한 삭제">
	                         <label class="text-left" for="consentDeleteRadio2">&nbsp;중복 작성으로 인한 삭제</label>
						</div>
						<div class="radio3 radio-check">
							  <input type="radio" id="consentDeleteRadio3" name="consentDeleteRadio" value="slt3" dataReason="미해당">
	                         <label class="text-left" for="consentDeleteRadio3">&nbsp;미해당</label>
						</div>
						<div class="radio3 radio-check">
							  <input type="radio" id="consentDeleteRadio4" name="consentDeleteRadio" value="slt4">
	                         <label class="text-left" for="consentDeleteRadio4">&nbsp;직접입력</label>
						</div>
						<div>
							<textarea class="form-control" id="consentDeleteTextarea" readonly></textarea>
						</div>
					</div>
		        </div>
			    <div class="modal-footer">
			      <button type="button" class="btn btn-success" id="btnConsentDelete">확인</button>
			      <button type="button" class="btn btn-default" data-dismiss="modal">취소</button>
			    </div>
			  </div>
			</div>
		</div>
		
		<div class="modal" tabindex="-1" role="dialog" id="mplusConsentImageForm" style="display: none">
			<div class="modal-dialog" role="document" style="width: 100%">
			  <div class="modal-content">
			    <div class="modal-header">
			      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			    </div>
			    <div class="modal-body">
					<div id="consentImgBox">
						
					</div>
		        </div>
			  </div>
			</div>
		</div>
		
		
		<div class="wrap-loading" style="display: none" id="wrapLoding">
		    <div class="loader"></div>
		</div>  
	</body>
</html>


<script type="text/javascript" src="<c:url value="/resources/plugins/jquery/jquery-2.1.4.min.js" />"></script>
<script type="text/javascript">
var contextPath = '${pageContext.request.contextPath}';
var loginUserId = '${sessionScope.MP_USER_ID}';
var loginUserName = '${sessionScope.MP_USER_NAME}';
var indexPage = '${sessionScope.MP_INDEX_PAGE}';
var jobKindCd = '${sessionScope.MP_JOB_KIND_CD}';
var deptCd = '${sessionScope.MP_DEPT_CODE}';
 $(document).on('mobileinit', function() {
	$.mobile.ajaxEnabled = false;
	$.mobile.defaultPageTransition = 'none';
	$.mobile.page.prototype.options.domCache = false;
	$.mobile.selectmenu.prototype.options.nativeMenu = true;
	$.fn.buttonMarkup.defaults.corners = false;
});
$(document).on('pageloadfailed', function(e, data) {
	e.preventDefault();
    var page = $(data.xhr.responseText);
    $.mobile.pageContainer.empty();
    $.mobile.pageContainer.append(page);
    $.mobile.pageContainer.trigger('create');
});
$(document).on('pageshow', function(e, ui) {
    ui.prevPage.remove();
});
//pc 접근 제어
// $(document).ready(function(){
// 	if (/win32|win64|mac/i.test(navigator.platform.toLowerCase())) { 
// 		window.location.href = "http://www.knuh.kr/"; 
// 	} 
// });

//하단API는 추후 확인 후 제거 예정
function changeLocale(lang) {
	location.href = location.pathname + '?' + location.search.replace(/^\?|&?_locale=../g, '').concat('&_locale=' + lang);
};

/**
 * 앱 종료
 */
function exitApp() { 
	/* $(".sidemenu").parent().removeClass("active"); */
	var mcare = new mcare_mobile(); 

	mcare.confirm(mcare.getI18n("common006"), function(confirm){
		if(confirm){
			var jsonMsg = {
					type : "command", 
					functionType : "exit"
				}; 
			mcare.toNative(jsonMsg); 
		}
	});
	
};
/**
 * 이전 버튼 이벤트
 */
function triggerBackBtn(){
	var mcare = new mcare_mobile(); 
	if( mcare.isAndroid() ){
		//dialog 열려있으면 닫기
		if($('.modal').hasClass('in')){
			$('.modal').modal('hide');
			return;
		};
		//index 면 종료
		if( (window.location.href).indexOf("login.page") > 0 || (window.location.href).indexOf("first") > 0 ){
			exitApp();
			return;
		}
		history.back();
	 } 
};
/**
 * 홈버튼 이벤트
 */
function triggerSidebarBtn(){
	var mcare = new mcare_mobile();
	//헤더 백,메뉴버튼 숨어 있으면 리턴
	/* if( $("#menuBars_btn,#headerArrowLeft_btn").css("display") === "none" ){
		return;
	} */
	if( mcare.isAndroid() ){		
		/* $("a#menuBars_btn").trigger("click"); */
	}
}

/**
 * 프로그램 버전 확인
 */
function checkProgramVersion(){
	$("#sidebar .ui-listview li").removeClass("active");
	var jsonMsg = {
			type : "command", 
			functionType : "version",
			value : {
				callbackFn : "window.versionCallback"
			}
		}; 
		
		var mcare = new mcare_mobile(); 
		mcare.toNative(jsonMsg); 
};
window.versionCallback = function(data){
	var popup = $('#mplusAlert'),
		callback = popup.find(".popupCallback");		
	
	var alertMsg = $("<p></p>").text(data);
	$('#mplusAlert .modal-body').empty();
	$('#mplusAlert .modal-body').append(alertMsg);
		
	$('#mplusAlert').modal('show');
	
	
};


var strCode = "";
/**
* domain 저장
*/
function setDomain( code ){
	var strUrl = "";
	if( code === "1" ){
		strUrl = '<%=MPlusConstants.HOSPITAL.MPLUS.getDomain()+MPlusConstants.HOSPITAL.MPLUS.getContextName()%>';
		strCode = '<%=MPlusConstants.HOSPITAL.MPLUS.getCode()%>';
	} else {
		strUrl = '<%=MPlusConstants.HOSPITAL.MPLUS_COOK.getDomain()+MPlusConstants.HOSPITAL.MPLUS_COOK.getContextName()%>';
		strCode = '<%=MPlusConstants.HOSPITAL.MPLUS_COOK.getCode()%>';
	}
	var obj = {
			"type" : "command", 
		    "functionType" : "setRecentDomain",
		    "value" : {
		        "url" : strUrl,
		        "callbackFn": "window.redirectSidePage"
		    }	
	};
	try{		
		var mcare = new mcare_mobile();
		mcare.toNative( obj );
	} catch(e) {
		console.log(e);
	}
};
/**
* callback
**/
window.redirectSidePage = function(data){
	if( typeof data === "string" ){			
		data = JSON.parse( data );
	}
	
	if( data["success"] ){
		if( strCode.indexOf('031') >= 0 ){
			window.location.href = '<%=MPlusConstants.HOSPITAL.MPLUS.getDomain() + MPlusConstants.HOSPITAL.MPLUS.getContextName() + MPlusConstants.HOSPITAL.MPLUS.getStartPage()%>';
		} else {
			window.location.href = '<%=MPlusConstants.HOSPITAL.MPLUS_COOK.getDomain() + MPlusConstants.HOSPITAL.MPLUS_COOK.getContextName() + MPlusConstants.HOSPITAL.MPLUS_COOK.getStartPage()%>';
		}
	} else {
		mcare.alert( data["result"] );
	}
};



</script>
<%-- <script type="text/javascript" src="<c:url value="/resources/plugins/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"/>"></script> --%>
<link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/font-awesome.css" />" />
<link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/mobile/mcare.mobile.css" /> "/>
<script type="text/javascript" src="<c:url value="/resources/plugins/jquery-number-2.1.6/jquery.number.js" /> "></script>
<script type="text/javascript" src="<c:url value="/resources/js/core/mplus.core.js" /> "></script>



<!-- 부트스트랩 css및 스크립트 -->
<link rel="stylesheet" href="/mcare-plus/resources/plugins/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="/mcare-plus/resources/plugins/bootstrap/css/bootstrap-select.min.css">
<script src="/mcare-plus/resources/plugins/bootstrap/js/bootstrap-select.min.js"></script>
<script src="/mcare-plus/resources/plugins/bootstrap/js/bootstrap.min.js"></script>

<link href="/mcare-plus/resources/plugins/bootstrap-switch-master/css/bootstrap-switch.min.css" rel="stylesheet">
<script src="/mcare-plus/resources/plugins/bootstrap-switch-master/js/bootstrap-switch.min.js"></script>

<script src="/mcare-plus/resources/plugins/jssor-carousel-slider-for-bootstrap/js/jssor.slider.mini.js"></script>  

<link rel="stylesheet" href="/mcare-plus/resources/css/mobile/consent/common.css">
<script src="/mcare-plus/resources/js/mobile/consent/common.js"></script>

<script src="/mcare-plus/resources/plugins/bootstrap-datepicker/js/moment.js"></script>
<script src="/mcare-plus/resources/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<link rel="stylesheet" href="/mcare-plus/resources/plugins/bootstrap-datepicker/css/datepicker.css">