PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/includes/lstof_duedates-inc.php

http://ebpls.googlecode.com/
PHP | 302 lines | 211 code | 51 blank | 40 comment | 15 complexity | dc45af0f2be7dd845bc2bf389c5d8a36 MD5 | raw file
  1. <?php
  2. //echo $data_item;
  3. if (isset($iSubmitMonthly)){
  4. $iMonthlyDueDates=strip_tags($iMonthlyDueDates);
  5. if (checkdate($x3, $x4, $x2)){
  6. $iMonthlyDueDates=$x2.'-'.$x3.'-'.$x4;
  7. //echo "$iMonthlyDueDates";
  8. //exit;
  9. $xRecord = mysql_query("UPDATE ebpls_buss_penalty1 SET revdate=Now(), mdue='$iMonthlyDueDates' ",$dbLink);
  10. ?>
  11. <body onLoad="javascript: alert('Record Successfully Updated!!');"></body>
  12. <?
  13. }
  14. }
  15. ////////////////////////////qtrs
  16. if (isset($iSubmitMonthly1)){
  17. $year = date('Y');
  18. $date1 = intval(str_replace("-","",$qtr1iMonthlyDueDates));
  19. $date2 = intval(str_replace("-","",$qtr2iMonthlyDueDates));
  20. $date3 = intval(str_replace("-","",$qtr3iMonthlyDueDates));
  21. $date4 = intval(str_replace("-","",$qtr4iMonthlyDueDates));
  22. if ($date1 > $date2 || $date1 > $date3 || $date1 > $date4 || $date2 > $date3 || $date2 > $date4 || $date3 > $date4) {
  23. ?>
  24. <body onLoad="javascript: alert('Invalid Dates.'); "></body>
  25. <?
  26. } else {
  27. $iMonthlyDueDates=strip_tags($iMonthlyDueDates);
  28. $xRecord = mysql_query("UPDATE ebpls_buss_penalty1 SET revdate=Now(), qtrdue1='$qtr1iMonthlyDueDates', qtrdue2='$qtr2iMonthlyDueDates', qtrdue3='$qtr3iMonthlyDueDates', qtrdue4='$qtr4iMonthlyDueDates' ",$dbLink);
  29. ?>
  30. <body onLoad="javascript: alert('Record Successfully Updated!!');"></body>
  31. <?
  32. }
  33. }
  34. ////////////////////////////
  35. //echo $dbLink."==";
  36. /////////////////////////////semi
  37. if (isset($iSubmitMonthly2)){
  38. //$iMonthlyDueDates=strip_tags($iMonthlyDueDates);
  39. $year = date('Y');
  40. $date1 = intval(str_replace("-","",$sem1iMonthlyDueDates));
  41. $date2 = intval(str_replace("-","",$sem2iMonthlyDueDates));
  42. if ($date1 > $date2) {
  43. ?>
  44. <body onLoad="javascript: alert('Invalid Dates.'); "></body>
  45. <?
  46. } else {
  47. $xRecord = mysql_query("UPDATE ebpls_buss_penalty1 SET revdate=Now(), semdue1='$sem1iMonthlyDueDates', semdue2='$sem2iMonthlyDueDates'",$dbLink);
  48. ?>
  49. <body onLoad="javascript: alert('Record Successfully Updated!!');"></body>
  50. <?
  51. }
  52. }
  53. /////////////////////////////
  54. $seleRecord = mysql_query("SELECT * FROM ebpls_buss_penalty1 ",$dbLink);
  55. //$SeleRecord=th_query($seleRecord);
  56. if (mysql_affected_rows($dbLink)==1 ){
  57. $seleRecord_=mysql_fetch_array($seleRecord);
  58. $iMonthlyDueDates=$seleRecord_[mdue];
  59. $qtr1iMonthlyDueDates=$seleRecord_[qtrdue1];
  60. $qtr2iMonthlyDueDates=$seleRecord_[qtrdue2];
  61. $qtr3iMonthlyDueDates=$seleRecord_[qtrdue3];
  62. $qtr4iMonthlyDueDates=$seleRecord_[qtrdue4];
  63. $sem1iMonthlyDueDates=$seleRecord_[semdue1];
  64. $sem2iMonthlyDueDates=$seleRecord_[semdue2];
  65. }
  66. ?>
  67. <input type=hidden name=yahooo value="<?php echo $yahooo;?>">
  68. <br>
  69. <table width=90% align=center>
  70. <tr>
  71. <td colspan=2>[ <a href=index.php?part=4&class_type=Preference&selMode=ebpls_npenalty&action_=7&itemEvent=3&data_item=0&yahooo=102>Quarterly</a> | <a href=index.php?part=4&class_type=Preference&selMode=ebpls_npenalty&action_=7&itemEvent=3&data_item=0&yahooo=103>Semi-Annual</a> | <a href=<?php echo $PHP_SELF;?>?part=4&class_type=Preference&selMode=ebpls_npenalty&action_=7&itemEvent=1&data_item=0>Back to Penalty</a>]</td>
  72. </tr>
  73. <?php
  74. if ($yahooo==101){
  75. ?>
  76. <tr bgcolor="#EEEEEE">
  77. <td colspan=2><br></td>
  78. </tr>
  79. <tr>
  80. <td colspan=2><br></td>
  81. </tr>
  82. <tr>
  83. <td>Date Schedule:</td>
  84. <td>
  85. <input type="text" value="<?php echo $iRenewalDate; ?>" readonly name="iRenewalDate" onclick="displayCalendar(checkid2,'mm-dd',this);">
  86. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.iRenewalDate,'mm-dd',this);_FRM.changeondin.value=1;">
  87. <!--<select name=x3>
  88. <?php
  89. //$tbl_current
  90. //ebpls_buss_monthlyref
  91. // $Optiondata = "SELECT * FROM ebpls_buss_monthlyref ORDER BY id ";
  92. // $Optionresult=th_query($Optiondata);
  93. // while($dtarow = @mysql_fetch_array($Optionresult)){
  94. // echo "<option value=$dtarow[moid]>$dtarow[modesc]";
  95. // }
  96. // echo "<option value=$x3 SELECTED>$x2description";
  97. ?>
  98. </select> <input type=text name=x4 size=4 maxlength=2 value="<?php echo $x4;?>"> <?php echo $iLGURenYear;?><input type=text name=x2 size=4 maxlength=4 value="<?php echo $x2;?>">-->
  99. </td>
  100. </tr>
  101. <!--
  102. <tr>
  103. <td width=15%>Date :</td>
  104. <td width=75%><input type=text name=iMonthlyDueDates size=10 value="<?php echo $iMonthlyDueDates;?>"></td>
  105. </tr>
  106. -->
  107. <tr>
  108. <td colspan=2><br></td>
  109. </tr>
  110. <tr>
  111. <td colspan=2><hr size=2 width=100%></td>
  112. </tr>
  113. <tr>
  114. <td colspan=2><input type=submit name=iSubmitMonthly value=Save>&nbsp;<input type=button name=iCancelMonthly value=Cancel onClick="parent.location='<?php echo $PHP_SELF;?>?part=4&class_type=Preference&selMode=ebpls_npenalty&action_=7&itemEvent=1&data_item=0'">&nbsp;<input type=reset name=iResetMonthly value=Reset><!--<input type=reset name=iSubmitReset value=Reset>--></td>
  115. </tr>
  116. <?php
  117. }
  118. elseif ($yahooo==102){
  119. ?>
  120. <tr bgcolor="#EEEEEE">
  121. <td colspan=2><br></td>
  122. </tr>
  123. <tr>
  124. <td colspan=2><br></td>
  125. </tr>
  126. <tr>
  127. <td>Date Schedule Qtr1 :</td>
  128. <td>
  129. <input type="text" value="<?php echo $qtr1iMonthlyDueDates; ?>" readonly name="qtr1iMonthlyDueDates" onclick="displayCalendar(checkid2,'mm-dd',this);">
  130. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.qtr1iMonthlyDueDates,'mm-dd',this);_FRM.changeondin.value=1;">
  131. <!--<select name=x31>
  132. <?php
  133. //$tbl_current
  134. //ebpls_buss_monthlyref
  135. // $Optiondata = "SELECT * FROM ebpls_buss_monthlyref ORDER BY id ";
  136. // $Optionresult=th_query($Optiondata);
  137. // while($dtarow = @mysql_fetch_array($Optionresult)){
  138. // echo "<option value=$dtarow[moid]>$dtarow[modesc]";
  139. // }
  140. // echo "<option value=$x31 SELECTED>$x31description";
  141. //?>
  142. </select> <input type=text name=x41 size=4 maxlength=2 value="<?php echo $x41;?>"> <?php echo $iLGURenYear;?><input type=hidden name=x21 size=4 maxlength=4 value="<?php echo date('Y');?>">&nbsp;<font size=2><?php echo date('Y');?></font>-->
  143. </td>
  144. </tr>
  145. <!--qtr2-->
  146. <tr>
  147. <td>Date Schedule Qtr2 :</td>
  148. <td>
  149. <input type="text" value="<?php echo $qtr2iMonthlyDueDates; ?>" readonly name="qtr2iMonthlyDueDates" onclick="displayCalendar(checkid2,'mm-dd',this);">
  150. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.qtr2iMonthlyDueDates,'mm-dd',this);_FRM.changeondin.value=1;">
  151. <!--<select name=x311>
  152. <?php
  153. //$tbl_current
  154. //ebpls_buss_monthlyref
  155. // $Optiondata = "SELECT * FROM ebpls_buss_monthlyref ORDER BY id ";
  156. // $Optionresult=th_query($Optiondata);
  157. // while($dtarow = @mysql_fetch_array($Optionresult)){
  158. // echo "<option value=$dtarow[moid]>$dtarow[modesc]";
  159. // }
  160. // echo "<option value=$x311 SELECTED>$x311description";
  161. //?>
  162. </select> <input type=text name=x411 size=4 maxlength=2 value="<?php echo $x411;?>"> <?php echo $iLGURenYear;?><input type=hidden name=x211 size=4 maxlength=4 value="<?php echo date('Y');?>">&nbsp;<font size=2><?php echo date('Y');?></font>-->
  163. </td>
  164. </tr>
  165. <!--qtr3-->
  166. <tr>
  167. <td>Date Schedule Qtr3 :</td>
  168. <td>
  169. <input type="text" value="<?php echo $qtr3iMonthlyDueDates; ?>" readonly name="qtr3iMonthlyDueDates" onclick="displayCalendar(checkid2,'mm-dd',this);">
  170. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.qtr3iMonthlyDueDates,'mm-dd',this);_FRM.changeondin.value=1;">
  171. <!--<select name=x3111>
  172. <?php
  173. //$tbl_current
  174. //ebpls_buss_monthlyref
  175. $Optiondata = "SELECT * FROM ebpls_buss_monthlyref ORDER BY id ";
  176. $Optionresult=th_query($Optiondata);
  177. while($dtarow = @mysql_fetch_array($Optionresult)){
  178. echo "<option value=$dtarow[moid]>$dtarow[modesc]";
  179. }
  180. echo "<option value=$x3111 SELECTED>$x3111description";
  181. ?>
  182. </select> <input type=text name=x4111 size=4 maxlength=2 value="<?php echo $x4111;?>"> <?php echo $iLGURenYear;?><input type=hidden name=x2111 size=4 maxlength=4 value="<?php echo date('Y');?>">&nbsp;<font size=2><?php echo date('Y');?></font>-->
  183. </td>
  184. </tr>
  185. <!--qtr4-->
  186. <tr>
  187. <td width=25%>Date Schedule Qtr4 :</td>
  188. <td align=left>
  189. <input type="text" value="<?php echo $qtr4iMonthlyDueDates; ?>" readonly name="qtr4iMonthlyDueDates" onclick="displayCalendar(checkid2,'mm-dd',this);">
  190. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.qtr4iMonthlyDueDates,'mm-dd',this);_FRM.changeondin.value=1;">
  191. <!--<select name=x31111>
  192. <?php
  193. //$tbl_current
  194. //ebpls_buss_monthlyref
  195. $Optiondata = "SELECT * FROM ebpls_buss_monthlyref ORDER BY id ";
  196. $Optionresult=th_query($Optiondata);
  197. while($dtarow = @mysql_fetch_array($Optionresult)){
  198. echo "<option value=$dtarow[moid]>$dtarow[modesc]";
  199. }
  200. echo "<option value=$x31111 SELECTED>$x31111description";
  201. ?>
  202. </select> <input type=text name=x41111 size=4 maxlength=2 value="<?php echo $x41111;?>"> <?php echo $iLGURenYear;?><input type=hidden name=x21111 size=4 maxlength=4 value="<?php echo date('Y');?>">&nbsp;<font size=2><?php echo date('Y');?></font>-->
  203. </td>
  204. </tr>
  205. <tr>
  206. <td colspan=2><br></td>
  207. </tr>
  208. <tr>
  209. <td colspan=2><hr size=2 width=100%></td>
  210. </tr>
  211. <tr>
  212. <td colspan=2><input type=submit name=iSubmitMonthly1 value=Save>&nbsp;<input type=button name=iCancelMonthly value=Cancel onClick="parent.location='<?php echo $PHP_SELF;?>?part=4&class_type=Preference&selMode=ebpls_npenalty&action_=7&itemEvent=1&data_item=0'">&nbsp;<input type=reset name=iResetMonthly value=Reset><!--<input type=reset name=iSubmitReset value=Reset>--></td>
  213. </tr>
  214. <?php
  215. }
  216. elseif ($yahooo==103){
  217. ?>
  218. <tr bgcolor="#EEEEEE">
  219. <td colspan=2><br></td>
  220. </tr>
  221. <tr>
  222. <td colspan=2><br></td>
  223. </tr>
  224. <tr>
  225. <td width=25%>Date Schedule Semi-Annual 1 :</td>
  226. <td align=left>
  227. <input type="text" value="<?php echo $sem1iMonthlyDueDates; ?>" readonly name="sem1iMonthlyDueDates" onclick="displayCalendar(checkid2,'mm-dd',this);">
  228. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.sem1iMonthlyDueDates,'mm-dd',this);_FRM.changeondin.value=1;">
  229. </td>
  230. </tr>
  231. <!--qtr2-->
  232. <tr>
  233. <td>Date Schedule Semi-Annual 2 :</td>
  234. <td>
  235. <input type="text" value="<?php echo $sem2iMonthlyDueDates; ?>" readonly name="sem2iMonthlyDueDates" onclick="displayCalendar(checkid2,'mm-dd',this);">
  236. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date" onclick ="displayCalendar(_FRM.sem2iMonthlyDueDates,'mm-dd',this);_FRM.changeondin.value=1;">
  237. </td>
  238. </tr>
  239. <tr>
  240. <td colspan=2><br></td>
  241. </tr>
  242. <tr>
  243. <td colspan=2><hr size=2 width=100%></td>
  244. </tr>
  245. <tr>
  246. <td colspan=2><input type=submit name=iSubmitMonthly2 value=Save>&nbsp;<input type=button name=iCancelMonthly value=Cancel onClick="parent.location='<?php echo $PHP_SELF;?>?part=4&class_type=Preference&selMode=ebpls_npenalty&action_=7&itemEvent=1&data_item=0'">&nbsp;<input type=reset name=iResetMonthly value=Reset><!--<input type=reset name=iSubmitReset value=Reset>--></td>
  247. </tr>
  248. <?php
  249. }
  250. ?>
  251. </table>