SPPMB01002_병원달력.xfdl 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPPMB01002" position="absolute 0 0 492 373" titletext="병원달력" onload="SPPMB01002_onload">
  5. <Layouts>
  6. <Layout>
  7. <Div id="grp_calendar" position="absolute 0 0 492 40" style="">
  8. <Layouts>
  9. <Layout>
  10. <Shape id="rectangle1" anchor="default" class="calendar_header" type="rectangle" position="absolute 0 0 492 40" style=""/>
  11. <Button id="button31" class="icon_pre_year" position="absolute 151 12 167 28" style="" text="" onclick="grp_calendar_button31_onclick"/>
  12. <Button id="button32" class="icon_next_year" position="absolute 326 12 342 28" style="" text="" onclick="grp_calendar_button32_onclick"/>
  13. <Button id="btn_premonth" class="icon_pre_month" position="absolute 170 12 186 28" style="" text="" onclick="grp_calendar_btn_premonth_onclick"/>
  14. <Button id="button34" class="icon_next_month" position="absolute 307 12 323 28" style="" text="" onclick="grp_calendar_button34_onclick"/>
  15. <Edit id="opt_year" class="calendar_output" position="absolute 200 10 230 29" style="" anchor="default" readonly="true"/>
  16. <Edit id="opt_month" class="calendar_output" position="absolute 250 10 280 29" style="" anchor="default" readonly="true"/>
  17. <Static id="caption1" class="calendar_output" position="absolute 230 10 250 29" style="color:black;" text="년"/>
  18. <Static id="caption2" class="calendar_output" position="absolute 280 10 300 29" style="color:black;" text="월"/>
  19. </Layout>
  20. </Layouts>
  21. </Div>
  22. <Grid id="grd_calendar" binddataset="ds_hidden_calendar_weeklist_list" class="gridcalendar" position="absolute 0 85 492 350" style="border:1 solid #1771beff;" oncellclick="grd_calendar_oncellclick">
  23. <Formats>
  24. <Format id="default">
  25. <Columns>
  26. <Column size="70"/>
  27. <Column size="70"/>
  28. <Column size="70"/>
  29. <Column size="70"/>
  30. <Column size="70"/>
  31. <Column size="70"/>
  32. <Column size="70"/>
  33. </Columns>
  34. <Rows>
  35. <Row size="22" band="head"/>
  36. <Row size="24"/>
  37. <Row size="24"/>
  38. </Rows>
  39. <Band id="head">
  40. <Cell text="일"/>
  41. <Cell col="1" text="월"/>
  42. <Cell col="2" text="화"/>
  43. <Cell col="3" text="수"/>
  44. <Cell col="4" text="목"/>
  45. <Cell col="5" text="금"/>
  46. <Cell col="6" text="토"/>
  47. </Band>
  48. <Band id="body">
  49. <Cell style="background:EXPR(fSetProperty(currow,&quot;sun&quot;,0));background2:EXPR(fSetProperty(currow,&quot;sun&quot;,0));color:EXPR(sun_dutflag=='8'?'red':'black');color2:EXPR(sun_dutflag=='8'?'red':'black');"/>
  50. <Cell col="1" style="background:EXPR(fSetProperty(currow,&quot;mon&quot;,0));background2:EXPR(fSetProperty(currow,&quot;mon&quot;,0));color:EXPR(mon_dutflag=='8'?'red':'black');color2:EXPR(mon_dutflag=='8'?'red':'black');"/>
  51. <Cell col="2" style="background:EXPR(fSetProperty(currow,&quot;tue&quot;,0));background2:EXPR(fSetProperty(currow,&quot;tue&quot;,0));color:EXPR(tue_dutflag=='8'?'red':'black');color2:EXPR(tue_dutflag=='8'?'red':'black');"/>
  52. <Cell col="3" style="background:EXPR(fSetProperty(currow,&quot;wed&quot;,0));background2:EXPR(fSetProperty(currow,&quot;wed&quot;,0));color:EXPR(wed_dutflag=='8'?'red':'black');color2:EXPR(wed_dutflag=='8'?'red':'black');"/>
  53. <Cell col="4" style="background:EXPR(fSetProperty(currow,&quot;thu&quot;,0));background2:EXPR(fSetProperty(currow,&quot;thu&quot;,0));color:EXPR(thu_dutflag=='8'?'red':'black');color2:EXPR(thu_dutflag=='8'?'red':'black');"/>
  54. <Cell col="5" style="background:EXPR(fSetProperty(currow,&quot;fri&quot;,0));background2:EXPR(fSetProperty(currow,&quot;fri&quot;,0));color:EXPR(fri_dutflag=='8'?'red':'black');color2:EXPR(fri_dutflag=='8'?'red':'black');"/>
  55. <Cell col="6" style="background:EXPR(fSetProperty(currow,&quot;sat&quot;,0));background2:EXPR(fSetProperty(currow,&quot;sat&quot;,0));color:EXPR(sat_dutflag=='8'?'red':'black');color2:EXPR(sat_dutflag=='8'?'red':'black');"/>
  56. <Cell row="1" style="background:EXPR(fSetProperty(currow,&quot;sun&quot;,0));background2:EXPR(fSetProperty(currow,&quot;sun&quot;,0));color:EXPR(sun_dutflag=='8'?'red':'black');color2:EXPR(sun_dutflag=='8'?'red':'black');"/>
  57. <Cell row="1" col="1" style="background:EXPR(fSetProperty(currow,&quot;mon&quot;,0));background2:EXPR(fSetProperty(currow,&quot;mon&quot;,0));color:EXPR(mon_dutflag=='8'?'red':'black');color2:EXPR(mon_dutflag=='8'?'red':'black');"/>
  58. <Cell row="1" col="2" style="background:EXPR(fSetProperty(currow,&quot;tue&quot;,0));background2:EXPR(fSetProperty(currow,&quot;tue&quot;,0));color:EXPR(tue_dutflag=='8'?'red':'black');color2:EXPR(tue_dutflag=='8'?'red':'black');"/>
  59. <Cell row="1" col="3" style="background:EXPR(fSetProperty(currow,&quot;wed&quot;,0));background2:EXPR(fSetProperty(currow,&quot;wed&quot;,0));color:EXPR(wed_dutflag=='8'?'red':'black');color2:EXPR(wed_dutflag=='8'?'red':'black');"/>
  60. <Cell row="1" col="4" style="background:EXPR(fSetProperty(currow,&quot;thu&quot;,0));background2:EXPR(fSetProperty(currow,&quot;thu&quot;,0));color:EXPR(thu_dutflag=='8'?'red':'black');color2:EXPR(thu_dutflag=='8'?'red':'black');"/>
  61. <Cell row="1" col="5" style="background:EXPR(fSetProperty(currow,&quot;fri&quot;,0));background2:EXPR(fSetProperty(currow,&quot;fri&quot;,0));color:EXPR(fri_dutflag=='8'?'red':'black');color2:EXPR(fri_dutflag=='8'?'red':'black');"/>
  62. <Cell row="1" col="6" style="background:EXPR(fSetProperty(currow,&quot;sat&quot;,0));background2:EXPR(fSetProperty(currow,&quot;sat&quot;,0));color:EXPR(sat_dutflag=='8'?'red':'black');color2:EXPR(sat_dutflag=='8'?'red':'black');"/>
  63. </Band>
  64. </Format>
  65. </Formats>
  66. </Grid>
  67. <Static id="caption3" position="absolute 0 353 35 373" style="align:center ;background:#ffff99 ;" text="오전"/>
  68. <Static id="caption4" position="absolute 38 353 73 373" style="align:center ;background:#ccffff ;" text="오후"/>
  69. <Static id="caption5" position="absolute 75 353 110 373" style="align:center ;background:#ff99cc ;" text="야간"/>
  70. <Static id="caption6" position="absolute 112 353 147 373" style="align:center ;background:#ffcc99 ;" text="전일"/>
  71. <Static id="caption7" position="absolute 152 353 187 373" style="align:center ;" text="없음"/>
  72. <Div id="group1" position="absolute 67 48 427 78" style="">
  73. <Layouts>
  74. <Layout>
  75. <Button id="btn_jan" class="icon_month" position="absolute 0 3 27 30" style="" text="1" onclick="Button_onclick"/>
  76. <Button id="btn_feb" class="icon_month" position="absolute 30 3 57 30" style="" text="2" onclick="Button_onclick"/>
  77. <Button id="btn_mar" class="icon_month" position="absolute 60 3 87 30" style="" text="3" onclick="Button_onclick"/>
  78. <Button id="btn_apr" class="icon_month" position="absolute 90 3 117 30" style="" text="4" onclick="Button_onclick"/>
  79. <Button id="btn_may" class="icon_month" position="absolute 120 3 147 30" style="" text="5" onclick="Button_onclick"/>
  80. <Button id="btn_jun" class="icon_month" position="absolute 150 3 177 30" style="" text="6" onclick="Button_onclick"/>
  81. <Button id="btn_jul" class="icon_month" position="absolute 180 3 207 30" style="" text="7" onclick="Button_onclick"/>
  82. <Button id="btn_aug" class="icon_month" position="absolute 210 3 237 30" style="" text="8" onclick="Button_onclick"/>
  83. <Button id="btn_sep" class="icon_month" position="absolute 240 3 267 30" style="" text="9" onclick="Button_onclick"/>
  84. <Button id="btn_oct" class="icon_month" position="absolute 270 3 297 30" style="" text="10" onclick="Button_onclick"/>
  85. <Button id="btn_nov" class="icon_month" position="absolute 300 3 327 30" style="" text="11" onclick="Button_onclick"/>
  86. <Button id="btn_dec" class="icon_month" position="absolute 330 3 357 30" style="" text="12" onclick="Button_onclick"/>
  87. </Layout>
  88. </Layouts>
  89. </Div>
  90. </Layout>
  91. </Layouts>
  92. <Objects>
  93. <Dataset id="ds_hidden_calendar_weeklist_list" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="keep">
  94. <ColumnInfo>
  95. <Column id="sun" type="STRING" size="256"/>
  96. <Column id="mon" type="STRING" size="256"/>
  97. <Column id="tue" type="STRING" size="256"/>
  98. <Column id="wed" type="STRING" size="256"/>
  99. <Column id="thu" type="STRING" size="256"/>
  100. <Column id="fri" type="STRING" size="256"/>
  101. <Column id="sat" type="STRING" size="256"/>
  102. <Column id="sun_memo" type="STRING" size="256"/>
  103. <Column id="mon_memo" type="STRING" size="256"/>
  104. <Column id="tue_memo" type="STRING" size="256"/>
  105. <Column id="wed_memo" type="STRING" size="256"/>
  106. <Column id="thu_memo" type="STRING" size="256"/>
  107. <Column id="fri_memo" type="STRING" size="256"/>
  108. <Column id="sat_memo" type="STRING" size="256"/>
  109. </ColumnInfo>
  110. </Dataset>
  111. <Dataset id="ds_hidden_calendar" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="keep">
  112. <ColumnInfo>
  113. <Column id="year" type="STRING" size="256"/>
  114. <Column id="month" type="STRING" size="256"/>
  115. </ColumnInfo>
  116. <Rows>
  117. <Row>
  118. <Col id="year"/>
  119. <Col id="month"/>
  120. </Row>
  121. </Rows>
  122. </Dataset>
  123. <Dataset id="ds_hidden_calendar_weeklist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="keep">
  124. <ColumnInfo/>
  125. </Dataset>
  126. <Dataset id="ds_hidden" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="keep">
  127. <ColumnInfo/>
  128. </Dataset>
  129. </Objects>
  130. <Bind>
  131. <BindItem id="item0" compid="grp_calendar.opt_year" propid="value" datasetid="ds_hidden_calendar" columnid="year"/>
  132. <BindItem id="item1" compid="grp_calendar.opt_month" propid="value" datasetid="ds_hidden_calendar" columnid="month"/>
  133. </Bind>
  134. <Script type="xscript4.0"><![CDATA[include "com_commonxp::comm_main.xjs"
  135. var beforeId = "";
  136. var dayArr = ["sun","mon","tue","wed","thu","fri","sat"];
  137. var dayMemoArr = ["sun_memo","mon_memo","tue_memo","wed_memo","thu_memo","fri_memo","sat_memo"];
  138. var arErrorCode = new HashArray();
  139. function SPPMB01002_onload(obj:Form, e:LoadEventInfo) {
  140. frmf_initForm(obj);
  141. grdf_initGrid(this.grd_calendar);
  142. //grdf_setGridSort(grd_XXX);
  143. //grdf_setRowTypeIcon(grd_XXX, 0_컬럼위치값);
  144. initCalendar();
  145. //2008-10-04 이동식 추가
  146. fChangeButtonColor();
  147. //END..
  148. }
  149. //2007-10-04 이동식 추가
  150. function fChangeButtonColor(){
  151. var curMonth = ds_hidden_calendar.getColumn(0, "month");
  152. //alert( curMonth );
  153. switch( curMonth ){
  154. case '01' : //button1.attribute("class") = "btn5_letter2";
  155. group1.btn_jan.enable = false;
  156. beforeId = "group1.btn_jan";
  157. break;
  158. case '02' : //button2.attribute("class") = "btn5_letter2";
  159. group1.btn_feb.enable = false;
  160. beforeId = "group1.btn_feb";
  161. break;
  162. case '03' : //button3.attribute("class") = "btn5_letter2";
  163. group1.btn_mar.enable = false;
  164. beforeId = "group1.btn_mar";
  165. break;
  166. case '04' : //button4.attribute("class") = "btn5_letter2";
  167. group1.btn_apr.enable = false;
  168. beforeId = "group1.btn_apr";
  169. break;
  170. case '05' : //button5.attribute("class") = "btn5_letter2";
  171. group1.btn_may.enable = false;
  172. beforeId = "group1.btn_may";
  173. break;
  174. case '06' : //button6.attribute("class") = "btn5_letter2";
  175. group1.btn_jun.enable = false;
  176. beforeId = "group1.btn_jun";
  177. break;
  178. case '07' : //button7.attribute("class") = "btn5_letter2";
  179. group1.btn_jul.enable = false;
  180. beforeId = "group1.btn_jul";
  181. break;
  182. case '08' : //button8.attribute("class") = "btn5_letter2";
  183. group1.btn_aug.enable = false;
  184. beforeId = "group1.btn_aug";
  185. break;
  186. case '09' : //button9.attribute("class") = "btn5_letter2";
  187. group1.btn_sep.enable = false;
  188. beforeId = "group1.btn_sep";
  189. break;
  190. case '10' : //button10.attribute("class") = "btn5_letter2";
  191. group1.btn_oct.enable = false;
  192. beforeId = "group1.btn_oct";
  193. break;
  194. case '11' : //button11.attribute("class") = "btn5_letter2";
  195. group1.btn_nov.enable = false;
  196. beforeId = "group1.btn_nov";
  197. break;
  198. case '12' : //button12.attribute("class") = "btn5_letter2";
  199. group1.btn_dec.enable = false;
  200. beforeId = "group1.btn_dec";
  201. break;
  202. }
  203. }
  204. function initCalendar() {
  205. if( ds_hidden_calendar.getColumn(0, "year") == "" || ds_hidden_calendar.getColumn(0, "month") == "" ){
  206. var curDate = utlf_getCurrentDate().toDate();
  207. ds_hidden_calendar.setColumn( 0, "year", curDate.getDateFormat('YYYY'));
  208. ds_hidden_calendar.setColumn( 0, "month", curDate.getDateFormat('MM'));
  209. //model.refresh();
  210. setCalendar(curDate);
  211. }
  212. }
  213. function fGetHospitalCalendar(){
  214. var dd = (ds_hidden_calendar.getColumn(0, "year")).concat(ds_hidden_calendar.getColumn(0, "month"));
  215. dsf_makeValue( ds_send, "date", "string", "" );
  216. ds_send.setColumn( 0, "date",dd);
  217. //if (submit("TRPMB01001") == true) return true;
  218. var oParam = {};
  219. oParam.id = "TRPMB01001";
  220. oParam.service = "pambaseinfomngtapp.OrdSche";
  221. oParam.method = "reqGetHospitalCalendar";
  222. oParam.inds = "req=ds_send";
  223. oParam.outds = "ds_hidden_calendarinfo_calendarinfolist=caldata";
  224. oParam.async = false;
  225. oParam.callback = "cf_TRPMB01001";
  226. tranf_submit(oParam);
  227. if(arErrorCode.pop("TRPMB01001") > -1) return true
  228. else return false;
  229. }
  230. function cf_TRPMB01001(sSvcId, nErrorCode, sErrorMsg) {
  231. arErrorCode.push(sSvcId, nErrorCode);
  232. }
  233. function setCalendar(dateObj) {
  234. //서버로 자료 요청
  235. if ( fGetHospitalCalendar() != true ){
  236. sysf_messageBox("병원일정 데이터를 가져올 수", "I004");
  237. }
  238. // 그리드 초기화
  239. ds_hidden_calendar_weeklist_list.clearData();
  240. //grd_calendar.rebuild()
  241. dateObj.setDate(1);
  242. var startDay = dateObj.getDay();
  243. var days = dateObj.getMonthDay();
  244. var rows = Math.ceil( ( startDay + days ) / 7 );
  245. for( var i = 0; i < rows; i++ )
  246. ds_hidden_calendar_weeklist_list.addRow(); //.addRow(false);
  247. // grd_calendar.rebuild();
  248. // grd_calendar.rebuildStyle();
  249. var rowIndex = 0; //grd_calendar.fixedRows;
  250. var colIndex = startDay;
  251. var dutflag = '';
  252. for( var i = 0; i < days; i++ ) {
  253. //write date
  254. // grd_calendar.valueMatrix(rowIndex, colIndex) = i;
  255. // grd_calendar.cellStyle("font-weight", rowIndex, colIndex) = "bold";
  256. ds_hidden_calendar_weeklist_list.setColumn(rowIndex,dayArr[colIndex%7], i + 1);
  257. if(i == parseInt(utlf_getCurrentDate().substr(6,2))) {
  258. toRIndex = rowIndex;
  259. toCIndex = colIndex;
  260. }
  261. //write memo
  262. // grd_calendar.valueMatrix(rowIndex , colIndex + 7) = fGetCalendarMemo( i );
  263. // dutflag = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "dutflag");
  264. ds_hidden_calendar_weeklist_list.setColumn(rowIndex, dayMemoArr[colIndex%7], fGetCalendarMemo( i ));
  265. // if( dutflag == '8' ){ //'0' 평일, '4' 토요일, '8' 휴일
  266. // fSetTextColor(rowIndex, colIndex, '#ff0000');
  267. // }
  268. colIndex++;
  269. if( colIndex == 7 ) {
  270. colIndex = 0;
  271. rowIndex++;
  272. }
  273. }
  274. //grd_calendar.resizeCells();
  275. }
  276. function setCalendar2(dateObj) {
  277. // 그리드 초기화
  278. ds_hidden_calendar_weeklist_list.clearData();
  279. //grd_calendar.rebuild()
  280. dateObj.setDate(1);
  281. var startDay = dateObj.getDay();
  282. var days = dateObj.getMonthDay();
  283. var rows = Math.ceil( ( startDay + days ) / 7 );
  284. for( var i = 0; i < rows; i++ )
  285. ds_hidden_calendar_weeklist_list.addRow(); //grd_calendar.addRow(false);
  286. // grd_calendar.rebuild();
  287. // grd_calendar.rebuildStyle();
  288. var rowIndex = 0; //grd_calendar.fixedRows;
  289. var colIndex = startDay;
  290. var ampmflag = '';
  291. var dutflag = '';
  292. for( var i = 0; i < days; i++ ) {
  293. //write date
  294. // grd_calendar.valueMatrix(rowIndex, colIndex) = i;
  295. // grd_calendar.cellStyle("font-weight", rowIndex, colIndex) = "bold";
  296. ds_hidden_calendar_weeklist_list.setColumn(rowIndex,dayArr[colIndex%7], i + 1);
  297. //write memo
  298. //grd_calendar.valueMatrix(rowIndex , colIndex + 7) = fGetCalendarMemo( i );
  299. ds_hidden_calendar_weeklist_list.setColumn(rowIndex, dayMemoArr[colIndex%7], fGetCalendarMemo( i ));
  300. //expr로 처리함.
  301. // ampmflag = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "ampmflag");
  302. // dutflag = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "dutflag");
  303. //
  304. // if( ampmflag == '1' ){
  305. // fSetBGColor(rowIndex, colIndex, '#ffff99');
  306. // }else if( ampmflag == '10' ){
  307. // fSetBGColor(rowIndex, colIndex, '#ccffff');
  308. // }else if( ampmflag == '100' ) {
  309. // fSetBGColor(rowIndex, colIndex, '#ff99cc');
  310. // }else if( ampmflag == '11' || ampmflag == '110' || ampmflag == '101' || ampmflag == '111' ){
  311. // fSetBGColor(rowIndex, colIndex, '#ffcc99');
  312. // }
  313. // expr로 처리함.
  314. // if( dutflag == '8' ){
  315. // fSetTextColor(rowIndex, colIndex, '#ff0000');
  316. // }
  317. colIndex++;
  318. if( colIndex == 7 ) {
  319. colIndex = 0;
  320. rowIndex++;
  321. }
  322. }
  323. //grd_calendar.resizeCells();
  324. }
  325. function fSetProperty(currow, week, flag){
  326. var color = "";
  327. var tooltip = "";
  328. var ampmflag = utlf_transNullToEmpty(this.ds_hidden_calendar_weeklist_list.getColumn(currow, week + "_ampmflag"));
  329. if( ampmflag == "1" ){ //오전
  330. color = "#ffff99";
  331. }else if( ampmflag == "10" ){ //오후
  332. color = "#ccffff";
  333. }else if( ampmflag == "100" ){ //오후
  334. color = "#ff99cc";
  335. }else if( ampmflag == "11" || ampmflag == "110" || ampmflag == "101" || ampmflag == "111" ){ //전일, 야간포함
  336. color = "#ffcc99";
  337. }
  338. if( flag == 0 )
  339. {
  340. return color;
  341. }
  342. else if (flag == 1)
  343. {
  344. return tooltip;
  345. }
  346. }
  347. //그리드의 배경색상을 변경한다.
  348. function fSetBGColor(calRow, calCol, bgColor) {
  349. //var calRow = gridObj.row;
  350. //var calCol = gridObj.col;
  351. if( calCol < 7 ){
  352. //calCol = calCol + 7;
  353. grd_calendar.cellStyle("background-color", calRow, calCol) = bgColor;
  354. grd_calendar.cellStyle("background-color", calRow, calCol + 7) = bgColor;
  355. }else{
  356. //calCol = calCol - 7;
  357. grd_calendar.cellStyle("background-color", calRow, calCol) = bgColor;
  358. grd_calendar.cellStyle("background-color", calRow, calCol - 7) = bgColor;
  359. }
  360. //grd_calendar.rebuildStyle();
  361. //grd_calendar.cellStyle("background-color", calRow, calCol) = bgColor;
  362. }
  363. //그리드의 폰트 색상을 변경한다.
  364. function fSetTextColor(calRow, calCol, bgColor) {
  365. if( calCol < 7 ){
  366. //calCol = calCol + 7;
  367. grd_calendar.cellStyle("color", calRow, calCol) = bgColor;
  368. grd_calendar.cellStyle("color", calRow, calCol + 7) = bgColor;
  369. }else{
  370. //calCol = calCol - 7;
  371. grd_calendar.cellStyle("color", calRow, calCol) = bgColor;
  372. grd_calendar.cellStyle("color", calRow, calCol - 7) = bgColor;
  373. }
  374. //grd_calendar.rebuildStyle();
  375. }
  376. function setCellColor(calRow, calCol) {
  377. //var calRow = grdObj.row;
  378. //var calCol = grdObj.col;
  379. var isMonth = ds_hidden_calendar.getColumn(0, "month");
  380. var isYear = ds_hidden_calendar.getColumn(0, "year");
  381. var isDate = (isYear+isMonth+1).toDate();
  382. setCalendar2(isDate);
  383. if( calCol < 7 ){
  384. //calCol = calCol + 7;
  385. grd_calendar.cellStyle("background-color", calRow, calCol) = "#daa7d9";
  386. grd_calendar.cellStyle("background-color", calRow, calCol + 7) = "#daa7d9";
  387. }else{
  388. //calCol = calCol - 7;
  389. grd_calendar.cellStyle("background-color", calRow, calCol) = "#daa7d9";
  390. grd_calendar.cellStyle("background-color", calRow, calCol - 7) = "#daa7d9";
  391. }
  392. //gridObj.rebuildStyle();
  393. //gridObj.cellStyle("background-color", calRow, calCol) = "#daa7d9";
  394. }
  395. //해당 일자의 병원 일정 정보를 얻어 온다
  396. function fGetCalendarMemo( i )
  397. {
  398. var holiflag = "";
  399. var holinm = "";
  400. holiflag = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "holiflag");
  401. holinm = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "holinm");
  402. if( holinm == '-' ){
  403. holinm = "";
  404. }
  405. return holinm.substring(0,5);
  406. }
  407. function fGetCalendarMemo2( i )
  408. {
  409. var holiflag = "";
  410. var dutflag = "";
  411. var holinm = "";
  412. var ordendresn = "";
  413. var fstexamcnt = 0;
  414. var reexamcnt = 0;
  415. holiflag = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "holiflag");
  416. dutflag = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "dutflag");
  417. holinm = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "holinm");
  418. ordendresn = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "ordendresn");
  419. fstexamcnt = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "fstexamcnt");
  420. reexamcnt = ds_hidden_calendarinfo_calendarinfolist.getColumn(i, "reexamcnt");
  421. if( holinm == '-' ){
  422. holinm = "";
  423. }
  424. return holinm + "/" + ordendresn + "\n" + fstexamcnt + "/" + reexamcnt;
  425. }
  426. /*
  427. //달력을 클릭(선택) 했을 때
  428. function fClickOnCalendar(){
  429. var calRow = grd_calendar.row;
  430. var calCol = grd_calendar.col;
  431. calCol = calCol % 7;
  432. var isDay = grd_calendar.valueMatrix(calRow, calCol);
  433. if( isDay != "" ){
  434. if( isDay.length == 1 ) isDay = "0" + isDay;
  435. var dd = ( (ds_hidden_calendar.getColumn(0, "year")).concat(ds_hidden_calendar.getColumn(0, "month")) ).concat(isDay);
  436. dsf_makeValue( ds_main, "selecteddd", "string", "" );
  437. ds_main.setColumn( 0, "selecteddd", dd);
  438. }
  439. }
  440. */
  441. function fSetMonth( newMonth ){
  442. ds_hidden_calendar.setColumn( 0, "month", newMonth);
  443. var isMonth = ds_hidden_calendar.getColumn(0, "month");
  444. var isYear = ds_hidden_calendar.getColumn(0, "year");
  445. var isDate = (isYear+isMonth+1).toDate();
  446. //setCalendar(isDate);
  447. fGetCalendarData();
  448. }
  449. function grp_calendar_button31_onclick(obj:Button, e:ClickEventInfo) {
  450. var isMonth = ds_hidden_calendar.getColumn(0, "month");
  451. var isYear = ds_hidden_calendar.getColumn(0, "year");
  452. var isDate = (isYear+isMonth+1).toDate().getAddDate(-1,'Y');
  453. ds_hidden_calendar.setColumn( 0, "year", isDate.getDateFormat('YYYY'));
  454. ds_hidden_calendar.setColumn( 0, "month", isDate.getDateFormat('MM'));
  455. //model.refresh();
  456. ds_hidden_calendarinfo.clearData(); ds_hidden_calendarinfo.addRow();
  457. //setCalendar(isDate);
  458. fGetCalendarData();
  459. }
  460. function grp_calendar_button32_onclick(obj:Button, e:ClickEventInfo) {
  461. var isMonth = ds_hidden_calendar.getColumn(0, "month");
  462. var isYear = ds_hidden_calendar.getColumn(0, "year");
  463. var isDate = (isYear+isMonth+1).toDate().getAddDate(1,'Y');
  464. ds_hidden_calendar.setColumn( 0, "year", isDate.getDateFormat('YYYY'));
  465. ds_hidden_calendar.setColumn( 0, "month", isDate.getDateFormat('MM'));
  466. //model.refresh();
  467. ds_hidden_calendarinfo.clearData(); ds_hidden_calendarinfo.addRow();
  468. //setCalendar(isDate);
  469. fGetCalendarData();
  470. }
  471. function grp_calendar_btn_premonth_onclick(obj:Button, e:ClickEventInfo) {
  472. var isMonth = ds_hidden_calendar.getColumn(0, "month");
  473. var isYear = ds_hidden_calendar.getColumn(0, "year");
  474. var isDate = (isYear+isMonth+1).toDate().getAddDate(-1,'M');
  475. ds_hidden_calendar.setColumn( 0, "year", isDate.getDateFormat('YYYY'));
  476. ds_hidden_calendar.setColumn( 0, "month", isDate.getDateFormat('MM'));
  477. //model.refresh();
  478. ds_hidden_calendarinfo.clearData(); ds_hidden_calendarinfo.addRow();
  479. //setCalendar(isDate);
  480. fGetCalendarData();
  481. }
  482. function grp_calendar_button34_onclick(obj:Button, e:ClickEventInfo) {
  483. var isMonth = ds_hidden_calendar.getColumn(0, "month");
  484. var isYear = ds_hidden_calendar.getColumn(0, "year");
  485. var isDate = (isYear+isMonth+1).toDate().getAddDate(1,'M');
  486. ds_hidden_calendar.setColumn( 0, "year", isDate.getDateFormat('YYYY'));
  487. ds_hidden_calendar.setColumn( 0, "month", isDate.getDateFormat('MM'));
  488. //model.refresh();
  489. ds_hidden_calendarinfo.clearData(); ds_hidden_calendarinfo.addRow();
  490. //setCalendar(isDate);
  491. fGetCalendarData();
  492. }
  493. function grd_calendar_oncellclick(obj:Grid, e:GridClickEventInfo) {
  494. //setCellColor(grd_calendar);
  495. fClickOnCalendar();
  496. }
  497. function group1_onclick(obj:Div, e:ClickEventInfo) {
  498. var trgObj = document.controls.item(e.fromobject);
  499. for( var k in trgObj) {
  500. trace( k);
  501. }
  502. // if( trgObj.elementName == "xforms:button" ) {
  503. // var btnMark = trgObj.text;
  504. //
  505. // if(beforeId != ""){
  506. // beforeObj = document.controls(beforeId);
  507. // if(beforeObj != null) beforeObj.enable = "true";
  508. // }
  509. // trgObj.enable = "false";
  510. // beforeId = trgObj.id; //.attribute("id");
  511. //
  512. // //달력 변경
  513. // if( btnMark.length == 1 ){
  514. // btnMark = '0' + btnMark;
  515. // }
  516. // fSetMonth(btnMark);
  517. // }
  518. }
  519. function Button_onclick(obj:Button, e:ClickEventInfo)
  520. {
  521. var trgObj = obj; //document.controls.item(event.target);
  522. obj.style.backgroundColor = 'darkgray';
  523. var btnMark = String(trgObj.text);
  524. // group1.btn_jan.enable = true;
  525. // group1.btn_feb.enable = true;
  526. // group1.btn_mar.enable = true;
  527. // group1.btn_apr.enable = true;
  528. // group1.btn_may.enable = true;
  529. // group1.btn_jun.enable = true;
  530. // group1.btn_jul.enable = true;
  531. // group1.btn_aug.enable = true;
  532. // group1.btn_sep.enable = true;
  533. // group1.btn_oct.enable = true;
  534. // group1.btn_nov.enable = true;
  535. // group1.btn_dec.enable = true;
  536. if(beforeId != ""){
  537. beforeObj = eval(beforeId);
  538. if(beforeObj != null) {
  539. beforeObj.enable = true;
  540. beforeObj.style.backgroundColor = '@gradation';
  541. }
  542. }
  543. trgObj.enable = false;
  544. beforeId = "group1." + trgObj.name;
  545. //달력 변경
  546. if( btnMark.length == 1 ){
  547. btnMark = '0' + btnMark;
  548. }
  549. fSetMonth(btnMark);
  550. this.grd_calendar.setFocus();
  551. }]]></Script>
  552. </Form>
  553. </FDL>