SPANB00201_식사횟수관리.xrw 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <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">
  4. <xhtml:head>
  5. <xhtml:title>식사횟수관리</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <data>
  11. <check/>
  12. <code>1</code>
  13. <cnt>1회</cnt>
  14. </data>
  15. <data>
  16. <check/>
  17. <code>2</code>
  18. <cnt>2회</cnt>
  19. </data>
  20. <data>
  21. <check/>
  22. <code>3</code>
  23. <cnt>3회</cnt>
  24. </data>
  25. <data>
  26. <check/>
  27. <code>4</code>
  28. <cnt>4회</cnt>
  29. </data>
  30. <data>
  31. <check/>
  32. <code>5</code>
  33. <cnt>5회</cnt>
  34. </data>
  35. <data>
  36. <check/>
  37. <code>6</code>
  38. <cnt>6회</cnt>
  39. </data>
  40. </main>
  41. <send/>
  42. <init/>
  43. <temp>
  44. <receivedata/>
  45. </temp>
  46. </root>
  47. </instance>
  48. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  49. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  50. <script type="javascript" ev:event="xforms-ready">
  51. <![CDATA[
  52. var cnt = model.getValue("/root/temp/receivedata/cnt");
  53. if ( cnt != "" ) {
  54. for ( i = 0; i < cnt.length; i+=2 ) {
  55. if (cnt.substr(i,1) != "" && cnt.substr(i,1)=="1") {
  56. model.setValue("/root/main/data[1]/check", "Y");
  57. } else if (cnt.substr(i,1) != "" && cnt.substr(i,1)=="2") {
  58. model.setValue("/root/main/data[2]/check", "Y");
  59. } else if (cnt.substr(i,1) != "" && cnt.substr(i,1)=="3") {
  60. model.setValue("/root/main/data[3]/check", "Y");
  61. } else if (cnt.substr(i,1) != "" && cnt.substr(i,1)=="4") {
  62. model.setValue("/root/main/data[4]/check", "Y");
  63. } else if (cnt.substr(i,1) != "" && cnt.substr(i,1)=="5") {
  64. model.setValue("/root/main/data[5]/check", "Y");
  65. } else if (cnt.substr(i,1) != "" && cnt.substr(i,1)=="6") {
  66. model.setValue("/root/main/data[6]/check", "Y");
  67. }
  68. }
  69. model.refresh();
  70. }
  71. ]]>
  72. </script>
  73. </model>
  74. </xhtml:head>
  75. <xhtml:body pagewidth="350" pageheight="343" guideline="2,13;1,1194;2,784;2,757;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  76. <group id="grp_biz" scroll="auto" style="left:10px; top:0px; width:301px; height:206px; ">
  77. <caption id="caption1" class="tit_2" style="left:5px; top:11px; width:135px; height:13px; ">식사횟수관리</caption>
  78. <line id="line1" class="line_1" style="x1:0px; y1:26px; x2:300px; y2:26px; "/>
  79. <datagrid id="grd_data" nodeset="/root/main/data" caption="선택^코드^식사횟수" colsep="^" colwidth="40, 40, 130" dataheight="25" extendlastcol="scroll" mergecells="byrow" rowheader="seq" rowheight="25" rowsep="|" style="left:0px; top:31px; width:300px; height:175px; text-align:center; ">
  80. <col checkvalue="Y,N" ref="check" type="checkbox"/>
  81. <col ref="code" visibility="hidden"/>
  82. <col ref="cnt"/>
  83. </datagrid>
  84. </group>
  85. <group id="grp_btn" scroll="auto" style="left:0px; top:221px; width:310px; height:27px; ">
  86. <button id="btn_cfm" class="btn4_letter2" style="left:195px; top:5px; width:56px; height:22px; ">
  87. <caption>확인</caption>
  88. <script type="javascript" ev:event="onclick">
  89. <![CDATA[
  90. var check = "";
  91. var val = "";
  92. for ( i = 1; i <= 6; i++ ) {
  93. check = model.getValue("/root/main/data["+ i +"]/check");
  94. if (check=="Y") {
  95. val += model.getValue("/root/main/data["+ i +"]/code");
  96. val = val + "^";
  97. }
  98. }
  99. if ( val != "" ) {
  100. val = val.substr(0, val.length-1);
  101. }
  102. var row = opener.grd_mealprcpcd.row - 1;
  103. opener.model.setValue("/root/main/mealprcpcd/data["+ row +"]/cnt", val);
  104. //opener.model.refresh();
  105. window.close();
  106. ]]>
  107. </script>
  108. </button>
  109. <button id="btn_can" class="btn4_letter2" style="left:254px; top:5px; width:56px; height:22px; ">
  110. <caption>취소</caption>
  111. <script type="javascript" ev:event="xforms-activate">
  112. <![CDATA[
  113. window.close();
  114. ]]>
  115. </script>
  116. </button>
  117. </group>
  118. </xhtml:body>
  119. </xhtml:html>