123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.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="">
- <main>
- <cal>
- <weeks>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- </weeks>
- <weeks>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- </weeks>
- <weeks>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- </weeks>
- <weeks>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- </weeks>
- <weeks>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- </weeks>
- <weeks>
- <sun/>
- <mon/>
- <tue/>
- <wed/>
- <thu/>
- <fri/>
- <sat/>
- </weeks>
- </cal>
- <year/>
- <month/>
- <result>
- <caldata/>
- </result>
- <selecteddd/>
- <datelist>
- <dateinfo>
- <getdate1/>
- <getdate2/>
- <getdate3/>
- <getdate4/>
- <getdate5/>
- <getdate6/>
- <getdate7/>
- <getdate8/>
- <getdate9/>
- <getdate10/>
- <getdate11/>
- <getdate12/>
- <getdate13/>
- <getdate14/>
- <getdate15/>
- <getdate16/>
- <getdate17/>
- <getdate18/>
- <getdate19/>
- <getdate20/>
- <getdate21/>
- <getdate22/>
- <getdate23/>
- <getdate24/>
- <getdate25/>
- <getdate26/>
- <getdate27/>
- <getdate28/>
- <getdate29/>
- <getdate30/>
- <getdate31/>
- <focus1/>
- <focus2/>
- <focus3/>
- <focus4/>
- <focus5/>
- <focus6/>
- <focus7/>
- <focus8/>
- <focus9/>
- <focus10/>
- <focus11/>
- <focus12/>
- <focus13/>
- <focus14/>
- <focus15/>
- <focus16/>
- <focus17/>
- <focus18/>
- <focus19/>
- <focus20/>
- <focus21/>
- <focus22/>
- <focus23/>
- <focus24/>
- <focus25/>
- <focus26/>
- <focus27/>
- <focus28/>
- <focus29/>
- <focus30/>
- <focus31/>
- <startfocus/>
- <endfocus/>
- </dateinfo>
- </datelist>
- </main>
- <!--<send>
- <date/>
- </send>-->
- <init/>
- <hidden/>
- </root>
- </instance>
- <submission id="TRPMB01001" ref="/root/send" method="post" mediatype="application/x-www-form-urlencoded" resultref="/root/main/result"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- fInitStyle();
- fInitControl();
- fCreateCalendar();
- //fInitCellColor(1,2);
- fSelGetDate();
- //fGetDate('20070402','20070410');
- ]]>
- </script>
- <script type="javascript">
- <![CDATA[
- //전체 달력에서 지정된 기간의 일자의 위치를 검색한다.
- function fGetDate(rsrvdd1,rsrvdd2){
- var dd = model.getValue("/root/send/date"); //해당 년,월
- alert(dd);
- var iValuedd, focusdd;
- for(var i=1;i<7;i++){
- for(var j=0;j<7;j++){
- //if(dd != ""){
- if(datagrid1.textmatrix(i,j)<10){
- iValuedd = "0" + datagrid1.textmatrix(i,j); //셀의 일자
- }else{
- iValuedd = datagrid1.textmatrix(i,j);
- }
- focusdd = i +" "+j; alert(dd+iValuedd);
- if((dd+iValuedd) == rsrvdd1){
- model.makeValue("/root/main/datelist/dateinfo/startfocus", focusdd); //예약시작시점의 위치값을 startdate에 넣어줌.
- }
- if((dd+iValuedd) == rsrvdd2){
- model.makeValue("/root/main/datelist/dateinfo/endfocus", focusdd); //예약종료시점의 위치값을 enddate에 넣어줌.
- }
- //}
- }
- }
- }
-
- //지정된 일자(cell색지정된 일자)를 리턴해준다.
- function fSelGetDate(i,j){
- var d=1; //getdate인덱스
- var dd = model.getValue("/root/send/date"); //해당 년,월
- var iValue, focus; //datagrid1의 값
- for(var i=1;i<7;i++){
- for(var j=0;j<7;j++){
- if(datagrid1.cellStyle("background-color", i, j) == "#cc99ff" ){
- if(datagrid1.textmatrix(i,j)<10){
- iValue = "0" + datagrid1.textmatrix(i,j); //색상 지정된 셀의 일자
- }else{
- iValue = datagrid1.textmatrix(i,j);
- }
- focus = i +" "+ j; //색상 지정된 셀의 위치값
- model.makeValue("/root/main/datelist/dateinfo/getdate"+d, dd+iValue); //색상 지정된 셀의 일자를 getdate에 넣어줌.
- model.makeValue("/root/main/datelist/dateinfo/focus"+d, focus); //색상 지정된 셀의 위치값을 focus에 넣어줌.
- d++;
- }
- }
- }
- }
-
- //지정된 일자에 해당하는 cell에 색상을 표시한다.
- function fInitCellColor(iRow,iCol){
- datagrid1.cellStyle("background-color", iRow, iCol) = "#cc99ff";
- }
-
- // 화면 open시 화면 스타일 초기화 기능을 수행한다.
- function fInitStyle() {
-
- //cell style
- // datagrid1.cellStyle("border-bottom-style",1 , 0, 1, 6) = "hidden";
- //datagrid1.cellStyle("background-color",2 , 0, 2, 6) = "#ffffff";
- // datagrid1.cellStyle("border-bottom-style",3 , 0, 3, 6) = "hidden";
- //datagrid1.cellStyle("background-color",4 , 0, 4, 6) = "#ffffff";
- // datagrid1.cellStyle("border-bottom-style",5 , 0, 5, 6) = "hidden";
- //datagrid1.cellStyle("background-color",6 , 0, 6, 6) = "#ffffff";
- // datagrid1.cellStyle("border-bottom-style",7 , 0, 7, 6) = "hidden";
- //datagrid1.cellStyle("background-color",8 , 0, 8, 6) = "#ffffff";
- // datagrid1.cellStyle("border-bottom-style",9 , 0, 9, 6) = "hidden";
- //datagrid1.cellStyle("background-color",10 , 0, 10, 6) = "#ffffff";
- // datagrid1.cellStyle("border-bottom-style",11 , 0, 11, 6) = "hidden";
- //datagrid1.cellStyle("background-color",12 , 0, 12, 6) = "#ffffff";
-
- //font style
- datagrid1.cellStyle("color",1 , 0, 6, 0) = "#ff0000";
- datagrid1.cellStyle("color",1 , 6, 6, 6) = "#0000ff";
- /*
- datagrid1.cellStyle("font-size",1 , 0, 1, 6) = "12px";
- datagrid1.cellStyle("font-size",3 , 0, 2, 6) = "12px";
- datagrid1.cellStyle("font-size",5 , 0, 3, 6) = "12px";
- datagrid1.cellStyle("font-size",7 , 0, 4, 6) = "12px";
- datagrid1.cellStyle("font-size",9 , 0, 5, 6) = "12px";
- datagrid1.cellStyle("font-size",11 , 0, 6, 6) = "12px";
- datagrid1.cellStyle("font-size",13 , 0, 13, 6) = "12px";
- //datagrid1.cellStyle("font-weight",0 , 0, 12, 6) = "bold";
- //datagrid1.cellStyle("font-family",1 , 0, 12, 6) = "가는각진제목체";
- */
- datagrid1.cellStyle("font-size",1 , 0, 1, 6) = "12px";
- datagrid1.cellStyle("font-size",2 , 0, 2, 6) = "12px";
- datagrid1.cellStyle("font-size",3 , 0, 3, 6) = "12px";
- datagrid1.cellStyle("font-size",4 , 0, 4, 6) = "12px";
- datagrid1.cellStyle("font-size",5 , 0, 5, 6) = "12px";
- datagrid1.cellStyle("font-size",6 , 0, 6, 6) = "12px";
- datagrid1.cellStyle("font-size",7 , 0, 7, 6) = "12px";
- }
- //화면 컨트롤 초기화
- function fInitControl()
- {
-
- //서버 일자로 처리
- today = new Date();
- var isYear, isMonth, ls_day;
-
- isYear = (today.getYear()).toString();
- isMonth = (today.getMonth() + 1).toString();
-
- //1~9월까지 숫자 앞에 0을 붙여준다. ex) 1 -> 01
- if ((isMonth.toString()).length == 1) isMonth = ("0".concat(isMonth.toString()));
-
- thisMonth = isYear.concat(isMonth);
- if (thisMonth < '200001')
- {
- model.setValue("/root/main/year","2000");
- model.setValue("/root/main/month","01");
- model.refresh();
- }
- else
- {
-
- model.setValue("/root/main/year",isYear);
- model.setValue("/root/main/month",isMonth);
- model.refresh();
- }
- }
- //해당 일자의 병원 일정 정보를 얻어 온다
- function fGetHospitalCalendar()
- {
- //model.setValue("/root/send/mode", "reqGetHospitalCalendar"); //Action Method
- var dd = (model.getValue("/root/main/year")).concat(model.getValue("/root/main/month"));
- model.setValue("/root/send/date",dd);
-
- //alert( model.getValue("/root/send/date") );
-
- if (submit("TRPMB01001") == true) return true;
- else return false;
- }
-
- //얻어 온 일정을 달력에 실제로 표시해 주는 함수
- function fCreateCalendar()
- {
- //TFclearNodeValue("/root/main/cal");
-
- //서버로 자료 요청
- if ( fGetHospitalCalendar() != true ){
- alert(" line 222 : 데이터를 가져오지 못했습니다.");
- //에러로 인한 초기화면으로 세팅
- fInitControl();
- //fCreateCalendar();
- return false;
- }else{
- //달력 폰트 색 설정
- datagrid1.cellStyle("color",1 , 0, 12, 6) = "#000000";
- datagrid1.cellStyle("color",1 , 0, 12, 0) = "#ff0000";
- datagrid1.cellStyle("color",1 , 6, 12, 6) = "#0000ff";
- //var cntDate = TFNodeDataCount("/root/main/result");
- var buff;
- var cnt = 1;
- var position = 1;
- //토요일( dutflag = 4 ) 위치를 찾아서 달력을 표시한다.
- while(position < 8){
- buff = model.getValue("/root/main/result/caldata[" + position + "]/dutflag");
- if(buff == "4" ) break;
- else position++;
- }
- // 달력에 날짜 쓰기~
- cnt = cnt + position - 7;
- for( var row = 1; row< 7; row = row+1){ //grid title 때문에 +1
- for( var col = 0; col < 7; col++){
- if( cnt > 0 && cnt <= 31){
- if( model.getValue("/root/main/result/caldata[" + cnt + "]/basedd") != "" ){
- datagrid1.textmatrix( row, col ) = cnt;
- buff = model.getValue("/root/main/result/caldata[" + cnt + "]/holiflag");
-
- //휴일 빨간색으로 표시
- if( buff == "1") datagrid1.cellStyle("color", row, col, row, col) = "#ff0000";
- //else datagrid1.cellStyle("color", row, col, row + 1, col) = "#000000"
- }else datagrid1.textmatrix( row, col ) = "";
- }else datagrid1.textmatrix( row, col ) = "";
-
- cnt++;
- }
- }
- //공휴일 이름을 표시한다.
- /* cnt = 1;
- cnt = cnt + position -7;
- for( var row = 2; row< 13; row = row+2){ //grid title 때문에 +1
- for( var col = 0; col < 7; col++){
- if( cnt > 0 && cnt <= 31 ) datagrid1.textmatrix( row, col ) = model.getValue("/root/main/result/caldata[" + cnt + "]/holinm");
- else datagrid1.textmatrix( row, col ) = "";
-
- cnt++;
- }
- }*/
- }
-
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="230" pageheight="220" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
- <group id="grp_biz" scroll="auto" style="left:0px; top:0px; width:230px; height:210px; ">
- <caption id="caption1" style="left:109px; top:10px; width:20px; height:19px; font-weight:bold; vertical-align:middle; ">년</caption>
- <caption id="caption2" style="left:167px; top:10px; width:20px; height:19px; font-weight:bold; vertical-align:middle; ">월</caption>
- <select1 id="combo1" ref="/root/main/year" class="combo_default" appearance="minimal" style="left:53px; top:10px; width:55px; height:19px; ">
- <choices>
- <item>
- <label>2000</label>
- <value>2000</value>
- </item>
- <item>
- <label>2001</label>
- <value>2001</value>
- </item>
- <item>
- <label>2002</label>
- <value>2002</value>
- </item>
- <item>
- <label>2003</label>
- <value>2003</value>
- </item>
- <item>
- <label>2004</label>
- <value>2004</value>
- </item>
- <item>
- <label>2005</label>
- <value>2005</value>
- </item>
- <item>
- <label>2006</label>
- <value>2006</value>
- </item>
- <item>
- <label>2007</label>
- <value>2007</value>
- </item>
- <item>
- <label>2008</label>
- <value>2008</value>
- </item>
- <item>
- <label>2009</label>
- <value>2009</value>
- </item>
- <item>
- <label>2010</label>
- <value>2010</value>
- </item>
- <item>
- <label>2011</label>
- <value>2011</value>
- </item>
- <item>
- <label>2012</label>
- <value>2012</value>
- </item>
- <item>
- <label>2013</label>
- <value>2013</value>
- </item>
- <item>
- <label>2014</label>
- <value>2014</value>
- </item>
- <item>
- <label>2015</label>
- <value>2015</value>
- </item>
- <item>
- <label>2016</label>
- <value>2016</value>
- </item>
- <item>
- <label>2017</label>
- <value>2017</value>
- </item>
- <item>
- <label>2018</label>
- <value>2018</value>
- </item>
- </choices>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- //fCreateCalendar();
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- fCreateCalendar();
- ]]>
- </script>
- </select1>
- <select1 id="combo2" ref="/root/main/month" class="combo_default" appearance="minimal" style="left:126px; top:10px; width:40px; height:19px; ">
- <choices>
- <item>
- <label>01</label>
- <value>01</value>
- </item>
- <item>
- <label>02</label>
- <value>02</value>
- </item>
- <item>
- <label>03</label>
- <value>03</value>
- </item>
- <item>
- <label>04</label>
- <value>04</value>
- </item>
- <item>
- <label>05</label>
- <value>05</value>
- </item>
- <item>
- <label>06</label>
- <value>06</value>
- </item>
- <item>
- <label>07</label>
- <value>07</value>
- </item>
- <item>
- <label>08</label>
- <value>08</value>
- </item>
- <item>
- <label>09</label>
- <value>09</value>
- </item>
- <item>
- <label>10</label>
- <value>10</value>
- </item>
- <item>
- <label>11</label>
- <value>11</value>
- </item>
- <item>
- <label>12</label>
- <value>12</value>
- </item>
- </choices>
- <script type="javascript" ev:event="xforms-select">
- <![CDATA[
- //fCreateCalendar();
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
- fCreateCalendar();
- ]]>
- </script>
- </select1>
- <datagrid id="datagrid1" nodeset="/root/main/cal/weeks" allowselection="true" allowuserresize="false" backcoloralternate="transparent" caption="일^월^화^수^목^금^토" colwidth="30, 30, 30, 30, 30, 30, 30" defaultrows="7" focuscolor="transparent" frozencols="1" mergecellsfixedrows="bycolrec" selectionmode="free" rowsep="|" colsep="^" style="left:10px; top:39px; width:212px; height:163px; ">
- <col ref="sun"/>
- <col ref="mon"/>
- <col ref="tue"/>
- <col ref="wed"/>
- <col ref="thu"/>
- <col ref="fri"/>
- <col ref="sat"/>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- /* var //지정된 일자(cell색지정된 일자)를 리턴해준다.Cells = datagrid1.selectedCells;
-
- for (var i=0; i<selectedCells.length; i++)
- {
- var cell = datagrid1.selectedCells.item(i);
-
- if (cell)
- {
- var row = cell.row;
- var col = cell.col;
- check = row%2;
-
- //alert( "row : " + cell.row + " / col : " + cell.col);
-
- if( check == 0 ){
- //선택된 필드의 색상을 바꿔준다.
- datagrid1.cellStyle("background-color",1 , 0, 12, 6) = "#ffffff";
- datagrid1.cellStyle("background-color", row , col) = "#cc99ff";
- row = row - 1;
- datagrid1.cellStyle("background-color", row , col) = "#cc99ff";
-
- //선택된 날짜 정보를 인스턴스값에 넣어준다.
- var days = datagrid1.textmatrix( row, col );
- if( days != "" ){
- if( days.length == 1 ) days = "0" + days;
-
- var dd = ( (model.getValue("/root/main/year")).concat(model.getValue("/root/main/month")) ).concat(days);
- model.setValue("/root/main/selecteddd", dd);
- }
-
- }else{
- //선택된 날짜 정보를 인스턴스값에 넣어준다.
- var days = datagrid1.textmatrix( row, col );
- if( days != "" ){
- if( days.length == 1 ) days = "0" + days;
-
- var dd = ( (model.getValue("/root/main/year")).concat(model.getValue("/root/main/month")) ).concat(days);
- model.setValue("/root/main/selecteddd", dd);
-
- }
- //선택된 필드의 색상을 바꿔준다.
- datagrid1.cellStyle("background-color",1 , 0, 12, 6) = "#ffffff";
- datagrid1.cellStyle("background-color", row , col) = "#cc99ff";
- row = row + 1;
- datagrid1.cellStyle("background-color", row , col) = "#cc99ff";
-
- }
-
- model.refresh();
- }
- }*/
- ]]>
- </script>
- <script type="javascript" ev:event="ondblclick">
- <![CDATA[
- var selectedCells = datagrid1.selectedCells;
-
- for (var i=0; i<selectedCells.length; i++)
- {
- var cell = datagrid1.selectedCells.item(i);
-
- if (cell)
- {
- var row = cell.row;
- var col = cell.col;
- check = row%2;
-
- //alert( "row : " + cell.row + " / col : " + cell.col);
-
- if( check == 0 ){
-
- //row = row + 1;
- var msg = datagrid1.textmatrix( row, col );
- if( msg == "") alert(" no message");
- else alert(msg);
-
- }else{
-
- row = row + 1;
-
- var msg = datagrid1.textmatrix( row, col );
- if( msg == "") alert(" no message");
- else alert(msg);
- }
- }
- }
-
- ]]>
- </script>
- </datagrid>
- <button id="button55" class="icon_pre_year" style="left:15px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- combo1.select(combo1.focusIndex -1);
- //fCreateCalendar();
- ]]>
- </script>
- </button>
- <button id="button56" class="icon_next_year" style="left:202px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- combo1.select(combo1.focusIndex +1);
- //fCreateCalendar();
- ]]>
- </script>
- </button>
- <button id="button57" class="icon_pre_month" style="left:34px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- combo2.select(combo2.focusIndex -1);
- //fCreateCalendar();
- ]]>
- </script>
- </button>
- <button id="button58" class="icon_next_month" style="left:183px; top:12px; width:16px; height:16px; ">
- <caption/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- combo2.select(combo2.focusIndex +1);
- //fCreateCalendar();
- ]]>
- </script>
- </button>
- <line id="line1" class="line_1" style="x1:10px; y1:34px; x2:222px; y2:34px; "/>
- </group>
- </xhtml:body>
- </xhtml:html>
|