123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>병원달력</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <hidden>
- <calendar>
- <year/>
- <month/>
- <weeklist>
- <list>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- <sun_memo/>
- <mon_memo/>
- <tue_memo/>
- <wed_memo/>
- <thu_memo/>
- <fri_memo/>
- <sat_memo/>
- </list>
- </weeklist>
- </calendar>
- </hidden>
- </root>
- </instance>
- <submission id="TRPMB01001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden/calendarinfo"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
-
- initCalendar();
- //2008-10-04 이동식 추가
- fChangeButtonColor();
- //END..
- ]]>
- </script>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript">
- <![CDATA[
- var beforeId = "";
-
- //2007-10-04 이동식 추가
- function fChangeButtonColor(){
- var curMonth = model.getValue("/root/hidden/calendar/month");
- //alert( curMonth );
- switch( curMonth ){
-
- case '01' : //button1.attribute("class") = "btn5_letter2";
- btn_jan.disabled = true;
- beforeId = 'btn_jan';
- break;
- case '02' : //button2.attribute("class") = "btn5_letter2";
- btn_feb.disabled = true;
- beforeId = 'btn_feb';
- break;
- case '03' : //button3.attribute("class") = "btn5_letter2";
- btn_mar.disabled = true;
- beforeId = 'btn_mar';
- break;
- case '04' : //button4.attribute("class") = "btn5_letter2";
- btn_apr.disabled = true;
- beforeId = 'btn_apr';
- break;
- case '05' : //button5.attribute("class") = "btn5_letter2";
- btn_may.disabled = true;
- beforeId = 'btn_may';
- break;
- case '06' : //button6.attribute("class") = "btn5_letter2";
- btn_jun.disabled = true;
- beforeId = 'btn_jun';
- break;
- case '07' : //button7.attribute("class") = "btn5_letter2";
- btn_jul.disabled = true;
- beforeId = 'btn_jul';
- break;
- case '08' : //button8.attribute("class") = "btn5_letter2";
- btn_aug.disabled = true;
- beforeId = 'btn_aug';
- break;
- case '09' : //button9.attribute("class") = "btn5_letter2";
- btn_sep.disabled = true;
- beforeId = 'btn_sep';
- break;
- case '10' : //button10.attribute("class") = "btn5_letter2";
- btn_oct.disabled = true;
- beforeId = 'btn_oct';
- break;
- case '11' : //button11.attribute("class") = "btn5_letter2";
- btn_nov.disabled = true;
- beforeId = 'btn_nov';
- break;
- case '12' : //button12.attribute("class") = "btn5_letter2";
- btn_dec.disabled = true;
- beforeId = 'btn_dec';
- break;
- }
- }
- function initCalendar() {
- if( model.getValue("/root/hidden/calendar/year") == "" || model.getValue("/root/hidden/calendar/month") == "" ){
- var curDate = getCurrentDate().toDate();
-
- model.setValue("/root/hidden/calendar/year", curDate.getDateFormat('YYYY'));
- model.setValue("/root/hidden/calendar/month", curDate.getDateFormat('MM'));
- model.refresh();
-
- setCalendar(curDate);
- }
- }
-
- function fGetHospitalCalendar(){
-
- var dd = (model.getValue("/root/hidden/calendar/year")).concat(model.getValue("/root/hidden/calendar/month"));
- model.makeNode("/root/send/date");
- model.setValue("/root/send/date",dd);
-
- if (submit("TRPMB01001") == true) return true;
- else return false;
- }
-
- function setCalendar(dateObj) {
-
- //서버로 자료 요청
- if ( fGetHospitalCalendar() != true ){
- messageBox("병원일정 데이터를 가져올 수", "I004");
- }
-
- // 그리드 초기화
- model.removeNodeset("/root/hidden/calendar/weeklist/list");
- //grd_calendar.rebuild()
-
- dateObj.setDate(1);
- var startDay = dateObj.getDay();
- var days = dateObj.getMonthDay();
-
- var rows = Math.ceil( ( startDay + days ) / 7 );
- for( var i = 0; i < rows; i++ )
- grd_calendar.addRow(false);
-
- grd_calendar.rebuild();
- grd_calendar.rebuildStyle();
-
- var rowIndex = grd_calendar.fixedRows;
- var colIndex = startDay;
- var dutflag = '';
-
- for( var i = 1; i <= days; i++ ) {
- //write date
- grd_calendar.valueMatrix(rowIndex, colIndex) = i;
- grd_calendar.cellStyle("font-weight", rowIndex, colIndex) = "bold";
- //write memo
- grd_calendar.valueMatrix(rowIndex , colIndex + 7) = fGetCalendarMemo( i );
- dutflag = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/dutflag");
-
- if( dutflag == '8' ){ //'0' 평일, '4' 토요일, '8' 휴일
- fSetTextColor(rowIndex, colIndex, '#ff0000');
- }
-
- colIndex++;
- if( colIndex == 7 ) {
- colIndex = 0;
- rowIndex++;
- }
- }
-
- grd_calendar.resizeCells();
- }
-
- function setCalendar2(dateObj) {
-
- // 그리드 초기화
- model.removeNodeset("/root/hidden/calendar/weeklist/list");
- //grd_calendar.rebuild()
-
- dateObj.setDate(1);
- var startDay = dateObj.getDay();
- var days = dateObj.getMonthDay();
-
- var rows = Math.ceil( ( startDay + days ) / 7 );
- for( var i = 0; i < rows; i++ )
- grd_calendar.addRow(false);
-
- grd_calendar.rebuild();
- grd_calendar.rebuildStyle();
- var rowIndex = grd_calendar.fixedRows;
- var colIndex = startDay;
- var ampmflag = '';
- var dutflag = '';
-
- for( var i = 1; i <= days; i++ ) {
- //write date
- grd_calendar.valueMatrix(rowIndex, colIndex) = i;
- grd_calendar.cellStyle("font-weight", rowIndex, colIndex) = "bold";
- //write memo
- grd_calendar.valueMatrix(rowIndex , colIndex + 7) = fGetCalendarMemo( i );
-
- ampmflag = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/ampmflag");
- dutflag = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/dutflag");
-
- if( ampmflag == '1' ){
- fSetBGColor(rowIndex, colIndex, '#ffff99');
- }else if( ampmflag == '10' ){
- fSetBGColor(rowIndex, colIndex, '#ccffff');
- }else if( ampmflag == '100' ) {
- fSetBGColor(rowIndex, colIndex, '#ff99cc');
- }else if( ampmflag == '11' || ampmflag == '110' || ampmflag == '101' || ampmflag == '111' ){
- fSetBGColor(rowIndex, colIndex, '#ffcc99');
- }
-
- if( dutflag == '8' ){
- fSetTextColor(rowIndex, colIndex, '#ff0000');
- }
-
- colIndex++;
- if( colIndex == 7 ) {
- colIndex = 0;
- rowIndex++;
- }
- }
-
- grd_calendar.resizeCells();
- }
-
- //그리드의 배경색상을 변경한다.
- function fSetBGColor(calRow, calCol, bgColor) {
-
- //var calRow = gridObj.row;
- //var calCol = gridObj.col;
- if( calCol < 7 ){
- //calCol = calCol + 7;
- grd_calendar.cellStyle("background-color", calRow, calCol) = bgColor;
- grd_calendar.cellStyle("background-color", calRow, calCol + 7) = bgColor;
- }else{
- //calCol = calCol - 7;
- grd_calendar.cellStyle("background-color", calRow, calCol) = bgColor;
- grd_calendar.cellStyle("background-color", calRow, calCol - 7) = bgColor;
- }
- //grd_calendar.rebuildStyle();
- //grd_calendar.cellStyle("background-color", calRow, calCol) = bgColor;
- }
-
- //그리드의 폰트 색상을 변경한다.
- function fSetTextColor(calRow, calCol, bgColor) {
-
- if( calCol < 7 ){
- //calCol = calCol + 7;
- grd_calendar.cellStyle("color", calRow, calCol) = bgColor;
- grd_calendar.cellStyle("color", calRow, calCol + 7) = bgColor;
- }else{
- //calCol = calCol - 7;
- grd_calendar.cellStyle("color", calRow, calCol) = bgColor;
- grd_calendar.cellStyle("color", calRow, calCol - 7) = bgColor;
- }
- //grd_calendar.rebuildStyle();
-
- }
-
- function setCellColor(calRow, calCol) {
-
- //var calRow = grdObj.row;
- //var calCol = grdObj.col;
-
- var isMonth = model.getValue("/root/hidden/calendar/month");
- var isYear = model.getValue("/root/hidden/calendar/year");
- var isDate = (isYear+isMonth+1).toDate();
- setCalendar2(isDate);
-
- if( calCol < 7 ){
- //calCol = calCol + 7;
- grd_calendar.cellStyle("background-color", calRow, calCol) = "#daa7d9";
- grd_calendar.cellStyle("background-color", calRow, calCol + 7) = "#daa7d9";
- }else{
- //calCol = calCol - 7;
- grd_calendar.cellStyle("background-color", calRow, calCol) = "#daa7d9";
- grd_calendar.cellStyle("background-color", calRow, calCol - 7) = "#daa7d9";
- }
- //gridObj.rebuildStyle();
-
- //gridObj.cellStyle("background-color", calRow, calCol) = "#daa7d9";
- }
-
- //해당 일자의 병원 일정 정보를 얻어 온다
- function fGetCalendarMemo( i )
- {
- var holiflag = "";
- var holinm = "";
-
- holiflag = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/holiflag");
- holinm = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/holinm");
-
- if( holinm == '-' ){
- holinm = "";
- }
-
- return holinm.substring(0,5);
- }
-
- function fGetCalendarMemo2( i )
- {
- var holiflag = "";
- var dutflag = "";
- var holinm = "";
- var ordendresn = "";
- var fstexamcnt = 0;
- var reexamcnt = 0;
-
- holiflag = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/holiflag");
- dutflag = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/dutflag");
- holinm = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/holinm");
- ordendresn = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/ordendresn");
- fstexamcnt = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/fstexamcnt");
- reexamcnt = model.getValue("/root/hidden/calendarinfo/calendarinfolist[" + i +"]/reexamcnt");
-
- if( holinm == '-' ){
- holinm = "";
- }
-
- return holinm + "/" + ordendresn + "\n" + fstexamcnt + "/" + reexamcnt;
- }
- /*
- //달력을 클릭(선택) 했을 때
- function fClickOnCalendar(){
- var calRow = grd_calendar.row;
- var calCol = grd_calendar.col;
- calCol = calCol % 7;
-
- var isDay = grd_calendar.valueMatrix(calRow, calCol);
- if( isDay != "" ){
- if( isDay.length == 1 ) isDay = "0" + isDay;
-
- var dd = ( (model.getValue("/root/hidden/calendar/year")).concat(model.getValue("/root/hidden/calendar/month")) ).concat(isDay);
- model.makeNode("/root/main/selecteddd");
- model.setValue("/root/main/selecteddd", dd);
- }
- }
- */
- function fSetMonth( newMonth ){
-
- model.setValue("/root/hidden/calendar/month", newMonth);
- var isMonth = model.getValue("/root/hidden/calendar/month");
- var isYear = model.getValue("/root/hidden/calendar/year");
- var isDate = (isYear+isMonth+1).toDate();
- //setCalendar(isDate);
-
- fGetCalendarData();
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="492" pageheight="373" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
- <group id="grp_calendar" style="left:0px; top:0px; width:492px; height:40px; ">
- <shape id="rectangle1" class="calendar_header" appearance="rectangle" style="left:0px; top:0px; width:492px; height:40px; "/>
- <button id="button31" class="icon_pre_year" style="left:151px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var isMonth = model.getValue("/root/hidden/calendar/month");
- var isYear = model.getValue("/root/hidden/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(-1,'Y');
- model.setValue("/root/hidden/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/hidden/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
-
- model.resetInstanceNode("/root/hidden/calendarinfo")
- //setCalendar(isDate);
- fGetCalendarData();
- ]]>
- </script>
- </button>
- <button id="button32" class="icon_next_year" style="left:326px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var isMonth = model.getValue("/root/hidden/calendar/month");
- var isYear = model.getValue("/root/hidden/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(1,'Y');
- model.setValue("/root/hidden/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/hidden/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
-
- model.resetInstanceNode("/root/hidden/calendarinfo")
- //setCalendar(isDate);
- fGetCalendarData();
- ]]>
- </script>
- </button>
- <button id="btn_premonth" class="icon_pre_month" style="left:170px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var isMonth = model.getValue("/root/hidden/calendar/month");
- var isYear = model.getValue("/root/hidden/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(-1,'M');
- model.setValue("/root/hidden/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/hidden/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
- model.resetInstanceNode("/root/hidden/calendarinfo")
- //setCalendar(isDate);
- fGetCalendarData();
- ]]>
- </script>
- </button>
- <button id="button34" class="icon_next_month" style="left:307px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var isMonth = model.getValue("/root/hidden/calendar/month");
- var isYear = model.getValue("/root/hidden/calendar/year");
- var isDate = (isYear+isMonth+1).toDate().getAddDate(1,'M');
- model.setValue("/root/hidden/calendar/year", isDate.getDateFormat('YYYY'));
- model.setValue("/root/hidden/calendar/month", isDate.getDateFormat('MM'));
- model.refresh();
-
- model.resetInstanceNode("/root/hidden/calendarinfo")
- //setCalendar(isDate);
- fGetCalendarData();
- ]]>
- </script>
- </button>
- <output id="opt_year" ref="/root/hidden/calendar/year" class="calendar_output" style="left:196px; top:9px; width:30px; height:19px; "/>
- <output id="opt_month" ref="/root/hidden/calendar/month" class="calendar_output" style="left:246px; top:9px; width:30px; height:19px; "/>
- <caption id="caption1" class="calendar_output" style="left:226px; top:9px; width:20px; height:19px; ">년</caption>
- <caption id="caption2" class="calendar_output" style="left:276px; top:9px; width:20px; height:19px; ">월</caption>
- </group>
- <multilinegrid id="grd_calendar" nodeset="/root/hidden/calendar/weeklist/list" class="gridcalendar" autoresize="true" backcoloralternate="transparent" caption="일^월^화^수^목^금^토" colsep="^" colwidth="70, 70, 70, 70, 70, 70, 70" focuscolor="transparent" rowsep="|" tooltip="true" selectionmode="free" mergecellsfixedrows="bycolrec" style="left:0px; top:85px; width:492px; height:265px; ">
- <row>
- <col class="color_sun" ref="sun"/>
- <col ref="mon"/>
- <col ref="tue"/>
- <col ref="wed"/>
- <col ref="thu"/>
- <col ref="fri"/>
- <col class="color_sat" ref="sat"/>
- </row>
- <row>
- <col ref="sun_memo"/>
- <col ref="mon_memo"/>
- <col ref="tue_memo"/>
- <col ref="wed_memo"/>
- <col ref="thu_memo"/>
- <col ref="fri_memo" style="height:46; "/>
- <col ref="sat_memo"/>
- </row>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- //setCellColor(grd_calendar);
-
- fClickOnCalendar();
- ]]>
- </script>
- </multilinegrid>
- <caption id="caption3" style="left:0px; top:353px; width:35px; height:20px; text-align:center; background-color:#ffff99; ">오전</caption>
- <caption id="caption4" style="left:38px; top:353px; width:35px; height:20px; text-align:center; background-color:#ccffff; ">오후</caption>
- <caption id="caption5" style="left:75px; top:353px; width:35px; height:20px; text-align:center; background-color:#ff99cc; ">야간</caption>
- <caption id="caption6" style="left:112px; top:353px; width:35px; height:20px; text-align:center; background-color:#ffcc99; ">전일</caption>
- <caption id="caption7" style="left:152px; top:353px; width:35px; height:20px; text-align:center; ">없음</caption>
- <group id="group1" style="left:67px; top:48px; width:360px; height:30px; ">
- <button id="btn_jan" class="icon_month" style="left:0px; top:3px; width:27px; height:27px; ">
- <caption>1</caption>
- </button>
- <button id="btn_feb" class="icon_month" style="left:30px; top:3px; width:27px; height:27px; ">
- <caption>2</caption>
- </button>
- <button id="btn_mar" class="icon_month" style="left:60px; top:3px; width:27px; height:27px; ">
- <caption>3</caption>
- </button>
- <button id="btn_apr" class="icon_month" style="left:90px; top:3px; width:27px; height:27px; ">
- <caption>4</caption>
- </button>
- <button id="btn_may" class="icon_month" style="left:120px; top:3px; width:27px; height:27px; ">
- <caption>5</caption>
- </button>
- <button id="btn_jun" class="icon_month" style="left:150px; top:3px; width:27px; height:27px; ">
- <caption>6</caption>
- </button>
- <button id="btn_jul" class="icon_month" style="left:180px; top:3px; width:27px; height:27px; ">
- <caption>7</caption>
- </button>
- <button id="btn_aug" class="icon_month" style="left:210px; top:3px; width:27px; height:27px; ">
- <caption>8</caption>
- </button>
- <button id="btn_sep" class="icon_month" style="left:240px; top:3px; width:27px; height:27px; ">
- <caption>9</caption>
- </button>
- <button id="btn_oct" class="icon_month" style="left:270px; top:3px; width:27px; height:27px; ">
- <caption>10</caption>
- </button>
- <button id="btn_nov" class="icon_month" style="left:300px; top:3px; width:27px; height:27px; ">
- <caption>11</caption>
- </button>
- <button id="btn_dec" class="icon_month" style="left:330px; top:3px; width:27px; height:27px; ">
- <caption>12</caption>
- </button>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- var trgObj = document.controls.item(event.target);
-
- if( trgObj.elementName == "xforms:button" ) {
- var btnMark = trgObj.label;
-
- if(beforeId != ""){
- beforeObj = document.controls(beforeId);
- if(beforeObj != null) beforeObj.disabled = "false";
- }
- trgObj.disabled = "true";
- beforeId = trgObj.attribute("id");
-
- //달력 변경
- if( btnMark.length == 1 ){
- btnMark = '0' + btnMark;
- }
- fSetMonth(btnMark);
- }
- ]]>
- </script>
- </group>
- </xhtml:body>
- </xhtml:html>
|