SMAEA04200_권한관리(사이버나이프).xrw 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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. <userinfo>
  11. <userlist>
  12. <userid/>
  13. <usernm/>
  14. <pwd/>
  15. <rttmd/>
  16. <authstat/>
  17. </userlist>
  18. </userinfo>
  19. <userinfo2>
  20. <username>
  21. <usernm/>
  22. </username>
  23. </userinfo2>
  24. </main>
  25. <send>
  26. <reqdata>
  27. <userid/>
  28. <rttmd/>
  29. <rttmd1/>
  30. <rttmd2/>
  31. <rttmd3/>
  32. <rttmd4/>
  33. </reqdata>
  34. <reqdata1>
  35. <userid/>
  36. </reqdata1>
  37. </send>
  38. <senddata>
  39. <execdata>
  40. <userlist/>
  41. </execdata>
  42. </senddata>
  43. </root>
  44. </instance>
  45. <script type="javascript" ev:event="xforms-ready">
  46. <![CDATA[
  47. model.setValue("/root/send/reqdata/rttmd1", "N");
  48. model.setValue("/root/send/reqdata/rttmd2", "N");
  49. model.setValue("/root/send/reqdata/rttmd3", "N");
  50. model.setValue("/root/send/reqdata/rttmd4", "N");
  51. readfunc();
  52. ]]>
  53. </script>
  54. <submission id="TRAEA03908" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/userinfo"/>
  55. <submission id="TRAOC03302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata1" resultref="/root/main/userinfo2"/>
  56. <submission id="TXAEA03908" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/senddata/execdata" resultref="/root/hidden"/>
  57. </model>
  58. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  59. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  60. <script type="javascript">
  61. <![CDATA[
  62. function readfunc(){ // 해당 조건에 대한 사용자 권한내역을 조회한다.
  63. model.removeNodeset("/root/main/userinfo/userlist");
  64. btn_save.disabled = false;
  65. model.setValue("/root/send/reqdata/rttmd", "");
  66. var str = "";
  67. if (model.getValue("/root/send/reqdata/rttmd1") == "Y"){
  68. str = "'1'";
  69. }
  70. if (model.getValue("/root/send/reqdata/rttmd2") == "Y"){
  71. if (str == ""){
  72. str = "'2'";
  73. }else{
  74. str = str + "," + "'2'";
  75. }
  76. }
  77. if (model.getValue("/root/send/reqdata/rttmd3") == "Y"){
  78. if (str == ""){
  79. str = "'3'";
  80. }else{
  81. str = str + "," + "'3'";
  82. }
  83. }
  84. if (model.getValue("/root/send/reqdata/rttmd4") == "Y"){
  85. if (str == ""){
  86. str = "'4'";
  87. }else{
  88. str = str + "," + "'4'";
  89. }
  90. }
  91. if (str != ""){
  92. str = "(" + str + ")";
  93. }
  94. model.setValue("/root/send/reqdata/rttmd", str);
  95. if (submit("TRAEA03908")){
  96. }
  97. model.refresh();
  98. }
  99. function datacheck(){
  100. for (var i = 1; i < datagrid1.rows; i ++){
  101. if (model.getValue("/root/main/userinfo/userlist[" + i + "]/userid") == ""){
  102. messageBox("사번은 필수 입력항목입니다.", "E999", "");
  103. return false;
  104. }
  105. if (model.getValue("/root/main/userinfo/userlist[" + i + "]/usernm") == ""){
  106. messageBox(i + "번째 사번은 등록 할 수 없습니다.", "E999", "");
  107. return false;
  108. }
  109. if (model.getValue("/root/main/userinfo/userlist[" + i + "]/pwd") == ""){
  110. messageBox("PASSWORD는 필수 입력항목입니다.", "E999", "");
  111. return false;
  112. }
  113. if (model.getValue("/root/main/userinfo/userlist[" + i + "]/rttmd") == ""){
  114. messageBox("구분은 필수 선택항목입니다.", "E999", "");
  115. return false;
  116. }
  117. }
  118. return true;
  119. }
  120. function ExecData(){
  121. var update = getGridUpdateData(datagrid1);
  122. model.setValue("/root/senddata/execdata/userlist", update);
  123. if (submit("TXAEA03908")){
  124. readfunc();
  125. }
  126. }
  127. function isDate(str) { // 날짜 형식에 대한 적합여부 체크
  128. if (str == "") return true; // 빈건 체크안함
  129. if (trim(str) == "") return true; // 빈건 체크안함
  130. if (isNaN(parseInt(str))) return false; // 숫자가 아니면 false
  131. if (str.length != 8) return false; // 8자리(yyyymmdd)가 아니면 false
  132. var yy = new Number(str.substring(0, 4));
  133. var mm = new Number(str.substring(4, 6)) - 1;
  134. var dd = new Number(str.substring(6, 8));
  135. var date = new Date(yy, mm, dd);
  136. //alert(date.getFullYear() +"-" + (date.getMonth()+1) + "-" + date.getDate());
  137. if (yy != date.getFullYear() ||
  138. mm != date.getMonth() ||
  139. dd != date.getDate()) {
  140. return false; // 존재하지 않는 날짜
  141. }
  142. return true; // 존재하는 날짜
  143. }
  144. function trim(data){ // 문자에 대한 TRIM 작업
  145. return data.replace(/(^\s*)|(\s*$)/g, "");
  146. }
  147. ]]>
  148. </script>
  149. </xhtml:head>
  150. <xhtml:body pagewidth="570px" pageheight="650px" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
  151. <caption id="caption1" class="tit_1" style="left:0px; top:0px; width:252px; height:13px; ">사이버나이프 권한관리</caption>
  152. <shape id="rectangle1" appearance="roundrect" style="left:2px; top:18px; width:540px; height:67px; background-color:#fffbf2; border-color:#ffd799; "/>
  153. <caption id="caption11" class="search_name" style="left:10px; top:26px; width:67px; height:17px; ">사번:</caption>
  154. <caption id="caption2" class="search_name" style="left:190px; top:26px; width:62px; height:17px; ">구분:</caption>
  155. <input id="input13" ref="/root/send/reqdata/userid" class="input_search" style="left:71px; top:25px; width:104px; height:19px; "/>
  156. <button id="button21" class="btn1_letter2" style="left:476px; top:39px; width:56px; height:22px; ">
  157. <caption>조회</caption>
  158. <script type="javascript" ev:event="DOMActivate">
  159. <![CDATA[
  160. readfunc();
  161. ]]>
  162. </script>
  163. </button>
  164. <line id="line6" style="x1:466px; y1:24px; x2:466px; y2:46px; border-color:#ffe4bb; border-left-style:solid; "/>
  165. <line id="line7" class="line_1" style="x1:3px; y1:111px; x2:543px; y2:111px; "/>
  166. <datagrid id="datagrid1" nodeset="/root/main/userinfo/userlist" caption="사번^이름^Password^구분^권한상태" colsep="^" colwidth="100, 79, 147, 100, 71" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:2px; top:115px; width:540px; height:480px; ">
  167. <col disabled="true" ref="userid" type="input" maxlength="10" style="text-align:center; "/>
  168. <col ref="usernm" style="text-align:center; "/>
  169. <col ref="pwd" secretmark="*" secretstartposition="0" type="input" maxlength="32" style="text-align:center; "/>
  170. <col ref="rttmd" type="combo" style="text-align:center; ">
  171. <choices>
  172. <item>
  173. <label>Dometrist</label>
  174. <value>1</value>
  175. </item>
  176. <item>
  177. <label>RTT</label>
  178. <value>2</value>
  179. </item>
  180. <item>
  181. <label>Physicist</label>
  182. <value>3</value>
  183. </item>
  184. <item>
  185. <label>MD</label>
  186. <value>4</value>
  187. </item>
  188. </choices>
  189. </col>
  190. <col ref="authstat" type="combo" style="text-align:center; ">
  191. <choices>
  192. <item>
  193. <label>YES</label>
  194. <value>Y</value>
  195. </item>
  196. <item>
  197. <label>NO</label>
  198. <value>N</value>
  199. </item>
  200. </choices>
  201. </col>
  202. <script type="javascript" ev:event="xforms-value-changed">
  203. <![CDATA[
  204. if (datagrid1.colRef("userid") == datagrid1.col){
  205. var suserid = model.getValue("/root/main/userinfo/userlist[" + datagrid1.row + "]/userid");
  206. if (suserid == ""){
  207. model.setValue("/root/main/userinfo/userlist[" + datagrid1.row + "]/usernm", "");
  208. }else{
  209. model.setValue("/root/send/reqdata1/userid", suserid);
  210. submit("TRAOC03302");
  211. if (model.getValue("/root/main/userinfo2/username/usernm") == ""){
  212. model.setValue("/root/main/userinfo/userlist[" + datagrid1.row + "]/usernm", "");
  213. messageBox("등록할 수 없는 사번입니다.", "E999");
  214. }else{
  215. model.setValue("/root/main/userinfo/userlist[" + datagrid1.row + "]/usernm", model.getValue("/root/main/userinfo2/username/usernm"));
  216. }
  217. }
  218. model.refresh();
  219. }
  220. ]]>
  221. </script>
  222. </datagrid>
  223. <caption id="caption4" class="tit_2" style="left:2px; top:95px; width:113px; height:13px; ">권한 상세 정보</caption>
  224. <button id="btn_grdadd" class="btn2_letter3" style="left:433px; top:91px; width:53px; height:19px; ">
  225. <caption>행추가</caption>
  226. <script type="javascript" ev:event="DOMActivate">
  227. <![CDATA[
  228. datagrid1.addRow();
  229. var irow = datagrid1.row;
  230. model.setValue("/root/main/userinfo/userlist[" + irow + "]/authstat", "Y");
  231. datagrid1.refresh();
  232. ]]>
  233. </script>
  234. </button>
  235. <button id="btn_grddel" class="btn2_letter3" style="left:488px; top:91px; width:53px; height:19px; ">
  236. <caption>행삭제</caption>
  237. <script type="javascript" ev:event="DOMActivate">
  238. <![CDATA[
  239. datagrid1.deleteRow(datagrid1.row);
  240. ]]>
  241. </script>
  242. </button>
  243. <button id="btn_grdcopy" class="btn2_letter3" visibility="hidden" style="left:378px; top:91px; width:53px; height:19px; ">
  244. <caption>행복사</caption>
  245. </button>
  246. <button id="btn_save" class="btn4_letter2" style="left:485px; top:600px; width:56px; height:22px; ">
  247. <caption>저장</caption>
  248. <script type="javascript" ev:event="DOMActivate">
  249. <![CDATA[
  250. if (datacheck() == false){
  251. return;
  252. }
  253. ExecData();
  254. ]]>
  255. </script>
  256. </button>
  257. <line id="line1" class="line_3" style="x1:2px; y1:596px; x2:542px; y2:596px; "/>
  258. <bool id="bool1" checkvalue="Y,N" ref="/root/send/reqdata/rttmd1" style="left:250px; top:25px; width:30px; height:20px; "/>
  259. <bool id="bool2" checkvalue="Y,N" ref="/root/send/reqdata/rttmd2" style="left:360px; top:25px; width:30px; height:20px; "/>
  260. <caption id="caption3" style="left:277px; top:26px; width:67px; height:20px; font-weight:bold; ">Dometrist</caption>
  261. <caption id="caption5" style="left:387px; top:26px; width:40px; height:20px; font-weight:bold; ">RTT</caption>
  262. <bool id="bool3" checkvalue="Y,N" ref="/root/send/reqdata/rttmd4" style="left:360px; top:50px; width:30px; height:20px; "/>
  263. <caption id="caption6" style="left:387px; top:51px; width:40px; height:20px; font-weight:bold; ">MD</caption>
  264. <bool id="bool4" checkvalue="Y,N" ref="/root/send/reqdata/rttmd3" style="left:250px; top:50px; width:30px; height:20px; "/>
  265. <caption id="caption7" style="left:277px; top:51px; width:72px; height:20px; font-weight:bold; ">Physicist</caption>
  266. </xhtml:body>
  267. </xhtml:html>