var request = null; var selYear = ( new Date ).getFullYear(); var selMonth = ( new Date ).getMonth() +1; function getCalData( date ) { if( !request ) { try { request = new XMLHttpRequest(); if( !request ) throw false; } catch( e ) { request = new ActiveXObject( 'Msxml2.XMLHTTP' ); if( !request ) request = new ActiveXObject( 'Microsoft.XMLHTTP' ); } } var url = ""; var p =""; if(date) p= 'year=' + date.split( '-' )[0] + '&month=' + date.split( '-' )[1]; else p = ""; var template = '/bizdemo151584'; if(template) { url = '/chtml/hospital/reservation_calender.php?template=' + template + '&'+ p ; } else { url = '/chtml/hospital/reservation_calender.php?'+p ; } request.open( "GET" , url, true ); request.onreadystatechange = setCalData; request.send(null); } // ¿¹¾àÀÚ¸®½ºÆ® ·¹À̾î function reservationList(year, month, day) { // ±â´ÉÃß°¡Àü »ç¿ëÀÚµéÀº µ¿ÀÛ¾ÈÇÔ. if (!document.getElementById('order_list')) return; if (year != undefined) { var orderListLayer = document.getElementById('order_list'); orderListLayer.style.left=document.body.scrollLeft + event.clientX + 10; orderListLayer.style.top=document.body.scrollTop + event.clientY + 10; if( !request ) { try { request = new XMLHttpRequest(); if( !request ) throw false; } catch( e ) { request = new ActiveXObject( 'Msxml2.XMLHTTP' ); if( !request ) request = new ActiveXObject( 'Microsoft.XMLHTTP' ); } } var url = ""; var p =""; p= 'year=' + year + '&month=' + month + '&day=' + day; var template = '/bizdemo151584'; if(template) { url = '/chtml/hospital/reservation_list.php?template=' + template + '&'+ p ; } else { url = '/chtml/hospital/reservation_list.php?'+p ; } request.open( "GET" , url, true ); request.onreadystatechange = viewReservationLayer; request.send(null); }else { document.getElementById( 'order_list' ).style.display = 'none'; } } function viewReservationLayer() { if( !request ) return; if( ( request.readyState == 4 ) && ( request.status == 200 ) ) { var orderList = request.responseText; var orderListLayer = document.getElementById( 'order_list' ); orderListLayer.innerHTML = orderList; orderListLayer.style.display='block'; } } function setCalData() { if( !request ) return; var query = ''; var regexStep = /&?step=([^=^&^\?]+)?/; var regexDate = /&?date=([^=^&^\?]+)?/; if( location.search ) query = location.search.split( '?' )[1]; query = query.replace( regexStep , '' ).replace( regexDate , '' ); if( ( request.readyState == 4 ) && ( request.status == 200 ) ) { var txt = request.responseText; if( !txt ) return; var txtData = txt.split( "\n" ); var calData = new Array; for( var i = 0 ; i < txtData.length ; i++ ) { calData[ i ] = txtData[ i ].split( ' ' ); } /* txtData´Â 42°³ÀÇ ¹è¿·Î ÀÌ·ç¾îÁ® ÀÖÀ¸¸ç ±¸¼º³»¿ëÀº ´ÙÀ½°ú °°´Ù. (³¯Â¥´Â 3ÀÏÀ̶ó°í °¡Á¤) ³¯Â¥°¡ ¾øÀ» ¶§ : 0 0 ³¯Â¥°¡ ÀÖ°í ¿À´Ãº¸´Ù ÀÌÀü³¯Â¥ÀÌ¸ç ¿¹¾à°¡´É»óÅ : 0 3 0/1200 ³¯Â¥°¡ ÀÖ°í ¿À´ÃÀ» Æ÷ÇÔÇÑ ¹Ì·¡ÀÌ¸ç ¿¹¾àºÒ°¡´É»óÅ (¿¹¾àºÒ°¡¿øÀÎ=ÀοøÃÊ°ú) : 0 3 0/0 ³¯Â¥°¡ ÀÖ°í ¿À´ÃÀ» Æ÷ÇÔÇÑ ¹Ì·¡ÀÌ¸ç ¿¹¾àºÒ°¡´É»óÅ (¿¹¾àºÒ°¡¿øÀÎ=ÈÞÀϼ³Á¤) : 0 3 ³¯Â¥°¡ ÀÖ°í ¿À´ÃÀ» Æ÷ÇÔÇÑ ¹Ì·¡ÀÌ¸ç ¿¹¾à°¡´É»óÅ : 1 3 0/1200 ³¯Â¥°¡ ÀÖ°í ¿À´ÃÀ» Æ÷ÇÔÇÑ ¹Ì·¡ÀÌ¸ç ¿¹¾à°¡´É»óÅÂÀÌ°í °øÈÞÀÏ : 1 3 0/1200 1 ³¯Â¥°¡ ÀÖ°í ¿À´ÃÀ» Æ÷ÇÔÇÑ ¹Ì·¡ÀÌ¸ç ¿¹¾à°¡´É»óÅÂÀÌ°í °øÈÞÀÏÀÌ ¾Æ´Ò¶§ : 1 3 0/1200 0 */ document.getElementById( 'calendarYM' ).innerHTML = selYear + '³â ' + selMonth + '¿ù'; var isCurYM = ( ( new Date ).getFullYear() == selYear ) && ( ( ( new Date ).getMonth() +1 ) == selMonth ); var curD = ( new Date ).getDate(); var tb = document.getElementById( 'calendarDisplay' ); var useLogin = ( tb.getAttribute( 'login' ) != 'X' ); var isLogin = ( tb.getAttribute( 'login' ) == 'Y' ); for( var i = 1 , dataCnt = 0 ; i < tb.rows.length ; i++ ) { for( var j = 0 , order = 0 , quantity = 0 , msg = '' ; j < tb.rows[ i ].cells.length ; j++ ) { var data = calData[ dataCnt++ ]; if( data[ 2 ] ) { order = parseInt( data[ 2 ].split( '/' )[0] ); quantity = parseInt( data[ 2 ].split( '/' )[ 1 ] ); msg = '