Comm_monthCalendar.xfdl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\default_typedef.xml"/>
  4. <Form id="dl_monthCalendar" classname="CommonBtn" inheritanceid="" position="absolute 0 0 170 180" titletext="monthCalendar" scrollbars="none">
  5. <Layouts>
  6. <Layout>
  7. <Static id="stc_31" class="St_popupBg02" enable="false" position="absolute 0 0 171 180"/>
  8. <Button id="btnM1" taborder="1" onclick="btnM_onclick" class="btn_m01" position="absolute 14 45 49 85" tabstop="false"/>
  9. <Button id="btnM2" taborder="1" onclick="btnM_onclick" class="btn_m02" position="absolute 50 45 85 85" tabstop="false"/>
  10. <Button id="btnM3" taborder="1" onclick="btnM_onclick" class="btn_m03" position="absolute 86 45 121 85" tabstop="false"/>
  11. <Button id="btnM4" taborder="1" onclick="btnM_onclick" class="btn_m04" position="absolute 122 45 157 85" tabstop="false"/>
  12. <Button id="btnM8" taborder="1" onclick="btnM_onclick" class="btn_m08" position="absolute 122 86 157 126" tabstop="false"/>
  13. <Button id="btnM7" taborder="1" onclick="btnM_onclick" class="btn_m07" position="absolute 86 86 121 126" tabstop="false"/>
  14. <Button id="btnM6" taborder="1" onclick="btnM_onclick" class="btn_m06" position="absolute 50 86 85 126" tabstop="false"/>
  15. <Button id="btnM5" taborder="1" onclick="btnM_onclick" class="btn_m05" position="absolute 14 86 49 126" tabstop="false"/>
  16. <Button id="btnM9" taborder="1" onclick="btnM_onclick" class="btn_m09" position="absolute 14 127 49 167" tabstop="false"/>
  17. <Button id="btnM10" taborder="1" onclick="btnM_onclick" class="btn_m10" position="absolute 50 127 85 167" tabstop="false"/>
  18. <Button id="btnM11" taborder="1" onclick="btnM_onclick" class="btn_m11" position="absolute 86 127 121 167" tabstop="false"/>
  19. <Button id="btnM12" taborder="1" onclick="btnM_onclick" class="btn_m12" position="absolute 122 127 157 167" tabstop="false"/>
  20. <Static id="Static05" class="sta_Month" position="absolute 1 1 170 33"/>
  21. <Button id="btn_PreYear" taborder="1" onclick="btn_PreYear_onclick" class="btn_MonthP" position="absolute 33 7 53 27" tabstop="false"/>
  22. <Button id="btn_NextYear" taborder="1" onclick="btn_NextYear_onclick" class="btn_MonthN" position="absolute 118 7 138 27" tabstop="false"/>
  23. <Static id="stcYear" text="2012" class="sta_Month_Year" position="absolute 55 9 115 24"/>
  24. </Layout>
  25. </Layouts>
  26. <Objects>
  27. <Dataset id="dstMonth" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  28. <ColumnInfo>
  29. <Column id="code" type="INT" size="2"/>
  30. <Column id="name" type="STRING" size="256"/>
  31. </ColumnInfo>
  32. <Rows>
  33. <Row>
  34. <Col id="code">1</Col>
  35. <Col id="name">Jan</Col>
  36. </Row>
  37. <Row>
  38. <Col id="code">2</Col>
  39. <Col id="name">Feb</Col>
  40. </Row>
  41. <Row>
  42. <Col id="code">3</Col>
  43. <Col id="name">Mar</Col>
  44. </Row>
  45. <Row>
  46. <Col id="code">4</Col>
  47. <Col id="name">Apr</Col>
  48. </Row>
  49. <Row>
  50. <Col id="code">5</Col>
  51. <Col id="name">May</Col>
  52. </Row>
  53. <Row>
  54. <Col id="code">6</Col>
  55. <Col id="name">Jun</Col>
  56. </Row>
  57. <Row>
  58. <Col id="code">7</Col>
  59. <Col id="name">Jul</Col>
  60. </Row>
  61. <Row>
  62. <Col id="code">8</Col>
  63. <Col id="name">Aug</Col>
  64. </Row>
  65. <Row>
  66. <Col id="code">9</Col>
  67. <Col id="name">Sep</Col>
  68. </Row>
  69. <Row>
  70. <Col id="code">10</Col>
  71. <Col id="name">Oct</Col>
  72. </Row>
  73. <Row>
  74. <Col id="code">11</Col>
  75. <Col id="name">Nov</Col>
  76. </Row>
  77. <Row>
  78. <Col id="code">12</Col>
  79. <Col id="name">Dec</Col>
  80. </Row>
  81. </Rows>
  82. </Dataset>
  83. </Objects>
  84. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  85. * System Name : KMTC
  86. * Job Name : Composite to Div
  87. * File Name : dl_monthCalendar.xfdl
  88. * Creator : TOBESOFT
  89. * Make Date : 2013.01.18
  90. *
  91. * Description : Calendar Month Select Composite
  92. *---------------------------------------------------------------------------------------
  93. * Modify Date Modifier Modify Description
  94. *---------------------------------------------------------------------------------------
  95. * 2013.01.18 TOBESOFT Initial Make Program
  96. *
  97. *---------------------------------------------------------------------------------------
  98. ****************************************************************************************/
  99. //=======================================================================================
  100. // Common Lib Include
  101. //---------------------------------------------------------------------------------------
  102. //include "Lib::xCommon.xjs";
  103. //=======================================================================================
  104. // Global Form Variable
  105. //---------------------------------------------------------------------------------------
  106. var iv_mvArgValue;
  107. var iv_msPreMonth;
  108. /****************************************************************************************
  109. * Description : Form Initialization
  110. * Argument : obj : Object Event has occurred
  111. * : e : Event Object
  112. * return :
  113. ****************************************************************************************/
  114. //=======================================================================================
  115. // Event
  116. //---------------------------------------------------------------------------------------
  117. /****************************************************************************************
  118. * Components : Button
  119. * Event : onclick
  120. * Argument : 01.obj : Object Event has occurred
  121. * : 02.e : Event Object
  122. * Description : Selected month
  123. ****************************************************************************************/
  124. function btnM_onclick(obj:Button, e:ClickEventInfo)
  125. {
  126. var aDate = new Array(3);
  127. var strDate = stcYear.text + obj.name.replace("btnM","").padLeft(2, "0");
  128. aDate[0] = strDate;
  129. aDate[1] = strDate + "01";
  130. aDate[2] = strDate + ufn_getMonthLastDay(strDate);
  131. closePopup(aDate);
  132. }
  133. /****************************************************************************************
  134. * Components : Button
  135. * Event : onclick
  136. * Argument : 01.obj : Object Event has occurred
  137. * : 02.e : Event Object
  138. * Description : Selected next year
  139. ****************************************************************************************/
  140. function btn_NextYear_onclick(obj:Button, e:ClickEventInfo)
  141. {
  142. var strYY = stcYear.text;
  143. stcYear.text = (parseInt(strYY) + 1).toString();
  144. strYY = stcYear.text;
  145. fn_SetCalendar(strYY,"");
  146. }
  147. /****************************************************************************************
  148. * Components : Button
  149. * Event : onclick
  150. * Argument : 01.obj : Object Event has occurred
  151. * : 02.e : Event Object
  152. * Description : Selected prev year
  153. ****************************************************************************************/
  154. function btn_PreYear_onclick(obj:Button, e:ClickEventInfo)
  155. {
  156. var strYY = stcYear.text;
  157. stcYear.text = (parseInt(strYY) - 1).toString();
  158. strYY = stcYear.text;
  159. fn_SetCalendar(strYY,"");
  160. }
  161. /****************************************************************************************
  162. * Components : Button
  163. * Event : onclick
  164. * Argument : 01.obj : Object Event has occurred
  165. * : 02.e : Event Object
  166. * Description : Selected close Button
  167. ****************************************************************************************/
  168. function btn_Close_onclick(obj:Button, e:ClickEventInfo)
  169. {
  170. closePopup();
  171. }
  172. //=======================================================================================
  173. // User Function
  174. //---------------------------------------------------------------------------------------
  175. /****************************************************************************************
  176. * Description : Last day of the month
  177. * Argument : sMonth 'yyyyMMdd'
  178. * return : 'yyyyMMdd'
  179. ****************************************************************************************/
  180. function ufn_getMonthLastDay(sMonth)
  181. {
  182. var iLastDay;
  183. var iYear = parseInt(String(sMonth).substr(0, 4),10) ;
  184. var iMonth = parseInt(String(sMonth).substr(4, 2),10);
  185. switch(iMonth)
  186. {
  187. case 2 :
  188. if( ((iYear%4)==0) && ((iYear%100)!=0) || ((iYear%400)==0) )
  189. iLastDay = 29;
  190. else
  191. iLastDay = 28;
  192. break;
  193. case 4 :
  194. case 6 :
  195. case 9 :
  196. case 11 :
  197. iLastDay = 30;
  198. break;
  199. default:
  200. iLastDay = 31;
  201. break;
  202. }
  203. return iLastDay;
  204. }
  205. /****************************************************************************************
  206. * Description : Load calendar of day
  207. * Argument : none
  208. * return : none
  209. ****************************************************************************************/
  210. function fn_SetCalendar(strYY,strMM)
  211. {
  212. var obj;
  213. var strId;
  214. if(strMM.trim().length == 0) return;
  215. // Set color
  216. stcYear.text = strYY;
  217. obj = eval("btnM" + parseInt(strMM));
  218. var nRow = dstMonth.findRow("code", parseInt(strMM));
  219. if(nRow == 0){
  220. obj.style.background.image = "URL('theme://images/img_Month01_S.png')";
  221. } else if(nRow == 1){
  222. obj.style.background.image = "URL('theme://images/img_Month02_S.png')";
  223. } else if(nRow == 2){
  224. obj.style.background.image = "URL('theme://images/img_Month03_S.png')";
  225. } else if(nRow == 3){
  226. obj.style.background.image = "URL('theme://images/img_Month04_S.png')";
  227. } else if(nRow == 4){
  228. obj.style.background.image = "URL('theme://images/img_Month05_S.png')";
  229. } else if(nRow == 5){
  230. obj.style.background.image = "URL('theme://images/img_Month06_S.png')";
  231. } else if(nRow == 6){
  232. obj.style.background.image = "URL('theme://images/img_Month07_S.png')";
  233. } else if(nRow == 7){
  234. obj.style.background.image = "URL('theme://images/img_Month08_S.png')";
  235. } else if(nRow == 8){
  236. obj.style.background.image = "URL('theme://images/img_Month09_S.png')";
  237. } else if(nRow == 9){
  238. obj.style.background.image = "URL('theme://images/img_Month10_S.png')";
  239. } else if(nRow == 10){
  240. obj.style.background.image = "URL('theme://images/img_Month11_S.png')";
  241. } else if(nRow == 11){
  242. obj.style.background.image = "URL('theme://images/img_Month12_S.png')";
  243. }
  244. iv_msPreMonth = parseInt(strMM);
  245. }
  246. function fn_CrCal(strDate)
  247. {
  248. iv_mvArgValue = strDate;
  249. var strYY = iv_mvArgValue.substr(0,4);
  250. var strMM = iv_mvArgValue.substr(4,2);
  251. fn_SetCalendar(strYY,strMM);
  252. }
  253. ]]></Script>
  254. </Form>
  255. </FDL>