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 = '
¿¹¿¹¾àÇϱâ
'; } // ³¯Â¥°¡ ÀÖ°í ¿¹¾à°¡´É »óÅ if( ( data[ 1 ] > 0 ) && ( data[ 0 ] == 1 ) ) { //var func = function() { location.href = '?' + ( query ? query : '' ) + '&step=order&date=' + selYear + '-' + selMonth + '-' + this.firstChild.nodeValue; }; //tb.rows[ i ].cells[ j ].onclick = ( useLogin ? ( isLogin ? func : ( function() { alert( '·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù' ); } ) ) : func ); //tb.rows[ i ].cells[ j ].style.cursor = 'hand'; } // ³¯Â¥°¡ ÀÖ°í ¿¹¾àºÒ°¡´É »óÅ else { tb.rows[ i ].cells[ j ].onclick = function() {}; tb.rows[ i ].cells[ j ].style.cursor = 'normal'; msg = ''; } if( isCurYM && ( curD == data[ 1 ] ) ) { tb.rows[ i ].cells[ j ].setAttribute( 'prevClassName' , tb.rows[ i ].cells[ j ].className ); tb.rows[ i ].cells[ j ].className = 'm_today'; } else if( tb.rows[ i ].cells[ j ].className == 'm_today' ) { tb.rows[ i ].cells[ j ].className = tb.rows[ i ].cells[ j ].getAttribute( 'prevClassName' ); tb.rows[ i ].cells[ j ].removeAttribute( 'prevClassName' ); } // °øÈÞÀÏ Ç¥½Ã - ¹é¼öȯ 2009-09-15 if (data[3] == 1) { tb.rows[ i ].cells[ j ].setAttribute( 'prevPageClassName' , tb.rows[ i ].cells[ j ].className ); tb.rows[ i ].cells[ j ].className = tb.rows[ i ].cells[ j ].className + ' holiday'; }else if(tb.rows[ i ].cells[ j ].className == tb.rows[ i ].cells[ j ].getAttribute('prevPageClassName') + ' holiday') { tb.rows[ i ].cells[ j ].className = tb.rows[ i ].cells[ j ].getAttribute( 'prevPageClassName' ); tb.rows[ i ].cells[ j ].removeAttribute( 'prevPageClassName' ); } if (order > 0) { msg = msg + '
¿Ï¿¹¾à³»¿ª
'; } // ³¯Â¥°¡ ÀÖÀ» ¶§ ³¯Â¥¸¦ Ãâ·Â, ³¯Â¥°¡ ¾øÀ»¶§´Â ºóÄ­ tb.rows[ i ].cells[ j ].innerHTML = ( ( data[ 1 ] > 0 ) ? ( data[ 1 ] + ( data[ 2 ] ? ( '


' + msg ) : '' ) ) : '' ); } } } } function nextMonth() { if( selMonth > 11 ) { selYear += 1; selMonth = 0; } selMonth += 1; getCalData( selYear + '-' + selMonth ); } function prevMonth() { if( selMonth < 2 ) { selYear -= 1; selMonth = 13; } selMonth -= 1; getCalData( selYear + '-' + selMonth ); } function start() { getCalData( selYear + '-' + selMonth ); } if( window.attachEvent ) window.attachEvent( 'onload' , start ); else window.addEventListener( 'load' , start , false );