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

/ebpls5502.php

http://ebpls.googlecode.com/
PHP | 2180 lines | 1866 code | 153 blank | 161 comment | 181 complexity | 56facd19080ab682903326f69bcaf9cb MD5 | raw file
  1. <?php
  2. include'lib/phpFunctions-inc.php';
  3. dbConnect();
  4. $link2db = $dbLink;
  5. if ($cbut=='Add New Record') {
  6. setUrlRedirect('index.php?part=4&class_type=Preference&pref_type=Business&selMode=ebpls_nbusiness&action_=1&reftype=bus');
  7. }
  8. if ($updatetfo=='true') {
  9. echo "<div align=center><font color=red><b><i>Updated Successfully</i></b></font></div>";
  10. }
  11. if ($reqbut=='Add New Record') {
  12. setUrlRedirect('index.php?part=4&class_type=Preference&selMode=ebpls_nbusiness&action_=21&reftype=req');
  13. }
  14. if ($psicbut=='ADD') {
  15. setUrlRedirect('<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=91&reftype=$reftype');
  16. }
  17. if ($tfobut=='Add New Record') {
  18. setUrlRedirect('index.php?part=4&class_type=Preference&pref_type=Business&selMode=ebpls_nbusiness&action_=3&reftype=tfo');
  19. }
  20. //if ($searchnat=='Search Nature') {
  21. //setUrlRedirect('index.php?part=4&class_type=Preference&pref_type=Business&selMode=ebpls_nbusiness&action_=0&orderbyasdes=1&reftype=bus&ssnat=on&snat=$searcheenat');
  22. //}
  23. if (!empty($compEvent) and $compEvent=='Delete'){
  24. /*echo "1yahoo....<br>";
  25. echo "2$natureid<br>";
  26. echo "3$aTFOID<br>";
  27. echo "4$aTAXFEEid";*/
  28. if (!empty($compEvent1)){
  29. //echo "yayayayayayayayaayayayayayayayaayayayayayayaayayayya $oidof_complex";
  30. $deleComplex = "DELETE FROM ebpls_buss_complex WHERE compid = '$oidof_complex'";
  31. $deleComplex1=th_query($deleComplex) or die("Cannot delete...");
  32. $compEvent1="";
  33. }
  34. else {
  35. $compEvent1=1;
  36. }
  37. }
  38. if (isset($iSubmitComplex)){
  39. //echo "yahhhhhhhooooooo";
  40. //echo "$iComplexOption<br>";
  41. $explodeKey=explode("-",$iComplexOption);
  42. //echo "1. $explodeKey[0]<br>"; // tfoid
  43. //echo "2. $explodeKey[1]"; // taxfeeid
  44. //exit;
  45. $iAmountFormula=strip_tags($iAmountFormula);
  46. /*
  47. echo "litotototototo $iAmountFormula<br>";
  48. echo "1$natureid<br>";
  49. echo "2$aTFOID<br>";
  50. echo "3$aTAXFEEid<br>";
  51. echo "=Option: $iOption<br>";
  52. echo "=type: $itfotype<br>";*/
  53. //exit;
  54. $iAddOns=strip_tags($iAddOns);
  55. $insertComplex=mysql_query("INSERT INTO ebpls_buss_complex (taxfeeid,tfoid,coptr,revdate,addons,taxfeeid1,natureid) VALUES ('$aTAXFEEid','$explodeKey[0]','$iOperator',Now(),'$iAddOns','$explodeKey[1]','$natureid' )",$link2db);
  56. //, taxfeeoption='$iOption', itfotype='$itfotype'
  57. $updateMe = mysql_query("UPDATE ebpls_buss_taxfeeother SET taxfeeamtfor='$iAmountFormula', taxfeeoption='$iOption', uom='$iuom',defamt=$iMinAmount WHERE natureid = '$natureid' and tfo_id='$aTFOID' and taxfeeid='$aTAXFEEid' ",$link2db);
  58. //$tbl_DeleRecord_123=th_query($tbl_DeleRecord123)// or die("Cannot Update...");;
  59. $validateID=0;
  60. include'validate-inc.php';
  61. $compEvent1="";
  62. //$eventComplex=1;
  63. }
  64. if (isset($iCancelTFO)){
  65. header("location:index.php?part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&action_=5");
  66. }
  67. if (isset($iCancelPSIC)){
  68. header("location:index.php?part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&action_=9");
  69. }
  70. if (isset($iCancelREQ)){
  71. header("location:index.php?part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&action_=2");
  72. }
  73. if (isset($iCancelNature)){
  74. header("location:index.php?part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&action_=0");
  75. }
  76. if (isset($iCancelRange)){
  77. header("location:index.php?part=$part&class_type=$class_type&pref_type=Business&natureid=$natureid&action_=1&actionID=1&selMode=$selMode&natureaction=Edit ");
  78. }
  79. if (!empty($valueof_tfoid)){ // delete mode for taxfeeother module listing
  80. //echo "development academy of the philippines";
  81. // this must be given confirmation page first before deletion...(subject for enhancement)
  82. $chkRecord=mysql_query("Select * from ebpls_buss_taxfeeother where taxfeeid='$valueof_tfoid' and tfo_id='$aTFOID' and natureid='$natureid' ",$link2db);
  83. $mychkRow=mysql_num_rows($chkRecord);
  84. if ($mychkRow==1){
  85. $chkData=mysql_fetch_array($chkRecord);
  86. $cnatureid=$chkData[natureid];
  87. $ctaxfeeid=$chkData[taxfeeid];
  88. $ctaxfeeind=$chkData[taxfeeind];
  89. $cMinAmount=$chkData[defamt];
  90. $ctfoid=$chkData[tfoid];
  91. $deleteRec = "DELETE FROM ebpls_buss_taxfeeother WHERE taxfeeid = '$valueof_tfoid' and natureid='$cnatureid' and tfo_id='$ctfoid' ";
  92. $deleteRec_=th_query($deleteRec) or die("Cannot delete...");
  93. if ($ctaxfeeind==3){
  94. $updateNature=mysql_query("UPDATE ebpls_buss_nature SET natureoption=Null WHERE natureid='$cnatureid'",$link2db); // update both nature with L flag for range link.
  95. // check for raxfeeid record in taxfeeother table
  96. $seleTaxFeeOther=mysql_query("Select * from ebpls_buss_taxfeeother WHERE taxfeeid='$ctaxfeeid'",$link2db);
  97. $rowtfother=mysql_num_rows($seleTaxFeeOther);
  98. if ($rowtfother==1){
  99. $cdeleteRec = "DELETE FROM ebpls_buss_taxrange WHERE taxfeeid = '$ctaxfeeid' ";
  100. $cdeleteRec_=th_query($cdeleteRec) or die("Cannot delete...");
  101. } // delete only data with one record...NOT applicable to the multi link range
  102. }
  103. $validateID=3;
  104. include'validate-inc.php';
  105. }
  106. else {
  107. $validateID=1;
  108. include'validate-inc.php';
  109. }
  110. }
  111. // Range Deletion
  112. if (!empty($OkforDelete) and $OkforDelete=='RangeValue'){
  113. $tbl_DeleRecord = "UPDATE ebpls_buss_taxrange SET rangestatus='X' WHERE rangeid = '$rangeid' ";
  114. $tbl_DeleRecord_=th_query($tbl_DeleRecord) or die("Cannot delete...");;
  115. $validateID=3;
  116. include'validate-inc.php';
  117. }
  118. // //////////////
  119. if (isset($iSubmitApplytoNature)){
  120. /*echo "hello.....new...... $iCopytoNature....... old $Xnatureid<br>";
  121. echo "hello.....$aTAXFEEid<br>";
  122. echo "hello.....$aTFOID<br>";*/
  123. $getData=mysql_query("Select * FROM ebpls_buss_taxfeeother WHERE natureid='$Xnatureid' and tfo_id='$aTFOID' and taxfeeid='$aTAXFEEid'",$link2db);
  124. $rowGet=mysql_num_rows($getData);
  125. if ($rowGet==1){
  126. $ngetData=mysql_fetch_array($getData);
  127. $xOption=$ngetData[taxfeeoption];
  128. $xInd=$ngetData[taxfeeind];
  129. $xMode=$ngetData[taxfeemode];
  130. $xAmt=$ngetData[taxfeeamtfor];
  131. $xTax=$ngetData[taxtype];
  132. $niMinAmount=$ngetData[defamt];
  133. $xuom=$ngetData[uom];
  134. $xgetData=mysql_query("Select * FROM ebpls_buss_taxfeeother WHERE natureid='$iCopytoNature' and tfo_id='$aTFOID' and taxfeeid='$aTAXFEEid'",$link2db);
  135. $xrowGet=mysql_num_rows($xgetData);
  136. if ($xrowGet==0){
  137. $selectDistinct=mysql_query("Select DISTINCT taxfeeid FROM ebpls_buss_taxrange order by taxfeeid DESC",$link2db);
  138. $rowDistinct=mysql_numrows($selectDistinct);
  139. if ($rowDistinct>0){
  140. $newgetData=mysql_fetch_array($selectDistinct);
  141. $varnewTaxFeeId=$newgetData[taxfeeid] + 1;
  142. }
  143. else {
  144. exit; // should have a routine here or message for IT support
  145. }
  146. $insertGetdata = mysql_query("INSERT INTO ebpls_buss_taxfeeother (natureid,tfo_id,taxfeeid,taxfeeoption,taxfeeind,taxfeemode,taxfeeamtfor,datecreated,taxtype,uom,defamt) VALUES ($iCopytoNature,$aTFOID,$varnewTaxFeeId,'$xOption','$xInd','$xMode','$xAmt',Now(),'$xTax','$xuom',$niMinAmount)",$link2db) or die("1".mysql_error());
  147. $selectRange=mysql_query("Select * from ebpls_buss_taxrange WHERE taxfeeid='$aTAXFEEid' and rangestatus='A' ORDER BY rangeid",$link2db);
  148. $rowSelectRange=mysql_num_rows($selectRange);
  149. //echo "number of rows... $rowSelectRange";
  150. if ($rowSelectRange>0){
  151. $ctr=0;
  152. //echo "hi to all<br>";
  153. while ($ctr < $rowSelectRange){
  154. $recngetData=mysql_fetch_array($selectRange);
  155. $insertIntoDb=mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$varnewTaxFeeId','$recngetData[rangelow]','$recngetData[rangehigh]','$recngetData[rangeamount]','$recngetData[rangeind]','$recngetData[rangestatus]',Now())",$link2db);
  156. $ctr++;
  157. }
  158. $updateNature=mysql_query("UPDATE ebpls_buss_nature SET natureoption='C' WHERE natureid='$Xnatureid' or natureid='$iCopytoNature'",$link2db); // update both nature with L flag for range link.
  159. }
  160. $validateID=0;
  161. }
  162. else {
  163. $validateID=6;
  164. }
  165. include'validate-inc.php';
  166. }
  167. else {
  168. $validateID=1;
  169. include'validate-inc.php';
  170. }
  171. }
  172. if (isset($iSubmitCopytoNature)){
  173. $getData=mysql_query("Select * FROM ebpls_buss_taxfeeother WHERE natureid='$Xnatureid' and tfo_id='$aTFOID' and taxfeeid='$aTAXFEEid'",$link2db);
  174. $rowGet=mysql_num_rows($getData);
  175. if ($rowGet==1){
  176. $ngetData=mysql_fetch_array($getData);
  177. $xOption=$ngetData[taxfeeoption];
  178. $xInd=$ngetData[taxfeeind];
  179. $xMode=$ngetData[taxfeemode];
  180. $xAmt=$ngetData[taxfeeamtfor];
  181. $xMinAmount=$ngetData[defamt];
  182. $xTax=$ngetData[taxtype];
  183. $xuom=$ngetData[uom];
  184. $xgetData=mysql_query("Select * FROM ebpls_buss_taxfeeother WHERE natureid='$iCopytoNature' and tfo_id='$aTFOID' and taxfeeid='$aTAXFEEid'",$link2db);
  185. $xrowGet=mysql_num_rows($xgetData);
  186. if ($xrowGet==0){
  187. //echo "hahahahaahhahaahahahahahaha....";
  188. $insertGetdata = mysql_query("INSERT INTO ebpls_buss_taxfeeother (natureid,tfo_id,taxfeeid,taxfeeoption,taxfeeind,taxfeemode,taxfeeamtfor,datecreated,taxtype,uom) VALUES ('$iCopytoNature','$aTFOID','$aTAXFEEid','$xOption','$xInd','$xMode','$xAmt',Now(),'$xTax','$uom',xMinAmount)",$link2db);
  189. $updateNature=mysql_query("UPDATE ebpls_buss_nature SET natureoption='L' WHERE natureid='$Xnatureid' or natureid='$iCopytoNature'",$link2db); // update both nature with L flag for range link.
  190. $validateID=0;
  191. }
  192. else {
  193. $validateID=6;
  194. }
  195. include'validate-inc.php';
  196. }
  197. else {
  198. $validateID=1;
  199. include'validate-inc.php';
  200. }
  201. }
  202. //business nature
  203. if (!empty($actionDeleteStatus) and $actionDeleteStatus=='Ok'){
  204. //$xmyid = mysql_query("UPDATE $tbl_current SET naturestatus='X' WHERE natureid = '$natureid' ",$link2db);
  205. $tbl_DeleRecord = "UPDATE $tbl_current SET naturestatus='X' WHERE natureid = '$natureid' ";
  206. $tbl_DeleRecord_=th_query($tbl_DeleRecord) or die("Cannot delete...");;
  207. $validateID=3;
  208. include'validate-inc.php';
  209. }
  210. if (!empty($natureid) and $natureaction=='Delete'){ //must be cascaded but should check first the link tables...before deletion
  211. $action_=80;
  212. }
  213. else {
  214. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE natureid = '$natureid' ",$link2db);
  215. if (mysql_affected_rows($link2db)==1 ){
  216. $nidescription_=mysql_fetch_array($xmyid);
  217. $nidescription=$nidescription_[naturedesc];
  218. $niPsicCode=$nidescription_[psiccode];
  219. }
  220. }
  221. //tfo
  222. if ($reftype=='tfo' and $tfoaction=='Activate') {
  223. $tbl_DeleRecord = "UPDATE ebpls_buss_tfo SET tfostatus='A' WHERE tfoid = '$tfoid' ";
  224. $tbl_DeleRecord_=th_query($tbl_DeleRecord);
  225. }
  226. if (!empty($actionDeleteTfo) and $actionDeleteTfo=='Ok'){
  227. $tbl_DeleRecord = "UPDATE ebpls_buss_tfo SET tfostatus='X' WHERE tfoid = '$tfoid' ";
  228. $tbl_DeleRecord_=th_query($tbl_DeleRecord) or die("Cannot delete...");;
  229. //echo "tama naman $tfoid";
  230. $validateID=9;
  231. include'validate-inc.php';
  232. //$action_=5;
  233. }
  234. if (!empty($tfoid) and $tfoaction=='Delete'){ //must be cascaded but should check first the link tables...before deletion
  235. $action_=81;
  236. }
  237. else {
  238. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE tfoid = '$tfoid' ",$link2db);
  239. //$tbl_ResultId="SELECT * FROM $tbl_current WHERE tfoid = '$tfoid' ";
  240. //$tbl_ResultId_=th_query($tbl_ResultId);
  241. if (mysql_affected_rows($link2db)==1 ){
  242. $nitfodescription_=mysql_fetch_array($xmyid);
  243. $nitfodescription=$nitfodescription_[tfodesc];
  244. $nitfoindicator=$nitfodescription_[tfoindicator];
  245. $nitfotype=$nitfodescription_[taxfeetype];
  246. $nilangtaon=$nitfodescription_[or_print];
  247. $nubert = $nitfodescription_[counter];
  248. $DBtype_=mysql_query("SELECT * FROM ebpls_buss_taxfeetype WHERE taxfeetype = $nitfotype ",$link2db);
  249. if (mysql_affected_rows($link2db)==1 ){
  250. $ntype_=mysql_fetch_array($DBtype_);
  251. $ntypedesc=$ntype_[typedesc];
  252. }
  253. }
  254. }
  255. //requirements
  256. if (!empty($actionDeleteReq) and $actionDeleteReq=='Ok'){
  257. $check_rec = @mysql_query("select count(*) from havereq WHERE reqid = '$bbo' ");
  258. $get_num_rec = @mysql_fetch_array($check_rec);
  259. if ($get_num_rec[0] > 0) {
  260. ?>
  261. print "<div align='center'><font color='red' size='2'>Cannot Delete! Existing Record Found</font></div>";
  262. <?
  263. } else {
  264. $tbl_DeleRecord = mysql_query("Delete from ebpls_buss_requirements WHERE reqid = '$bbo' ");
  265. //echo "tama naman $tfoid";
  266. ?>
  267. <body onload='javascript:alert ("Record Successfully Deleted!");'></body>
  268. <?
  269. //$action_=5;
  270. }
  271. }
  272. if (!empty($reqid) and $reqaction=='Delete'){ //must be cascaded but should check first the link tables...before deletion
  273. //$xmyid = mysql_query("DELETE FROM $tbl_current WHERE tfoid = '$tfoid' ",$link2db);
  274. //$tbl_DeleRecord = "DELETE FROM $tbl_current WHERE reqid = '$reqid' ";
  275. //$tbl_DeleRecord_=th_query($tbl_DeleRecord) or die("Cannot delete...");;
  276. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE reqid = '$reqid' ",$link2db);
  277. //$tbl_ResultId="SELECT * FROM $tbl_current WHERE tfoid = '$tfoid' ";
  278. //$tbl_ResultId_=th_query($tbl_ResultId);
  279. if (mysql_affected_rows($link2db)==1 ){
  280. $nitfodescription_=mysql_fetch_array($xmyid);
  281. $nireqdescription=$nitfodescription_[reqdesc];
  282. $nireqindicator=$nitfodescription_[reqindicator];
  283. $niPermitType=$nitfodescription_[permit_type];
  284. }
  285. $action_=82;
  286. }
  287. else {
  288. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE reqid = '$reqid' ",$link2db);
  289. //$tbl_ResultId="SELECT * FROM $tbl_current WHERE tfoid = '$tfoid' ";
  290. //$tbl_ResultId_=th_query($tbl_ResultId);
  291. if (mysql_affected_rows($link2db)==1 ){
  292. $nitfodescription_=mysql_fetch_array($xmyid);
  293. $nireqdescription=$nitfodescription_[reqdesc];
  294. $nireqindicator=$nitfodescription_[reqindicator];
  295. $niPermitType=$nitfodescription_[permit_type];
  296. }
  297. }
  298. ////////////////////////////
  299. if (isset($ISubmitBussNature)){
  300. $nidescription=strip_tags(strtoupper($idescription));
  301. $niPsicCode=strip_tags(strtoupper($iPsicCode));
  302. if (!empty($nidescription)){
  303. if ($natureaction=='Edit'){
  304. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE naturedesc = '$nidescription' and natureid <> '$natureid'",$link2db);
  305. }
  306. else {
  307. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE naturedesc = '$nidescription' and naturestatus='A'",$link2db);
  308. }
  309. if (mysql_affected_rows($link2db)==0 ){
  310. $action_=1;
  311. $actionID=1;
  312. if ($natureaction=='Edit'){
  313. $myid = mysql_query("UPDATE $tbl_current set naturedesc = '$nidescription', psiccode = '$niPsicCode' where natureid = '$natureid'");
  314. $naedit = 'true';
  315. } else {
  316. $myid = mysql_query("INSERT INTO $tbl_current (naturedesc,naturestatus,psiccode) VALUES ('$nidescription','A','$niPsicCode')",$link2db);
  317. $naedit = 'false';
  318. ?>
  319. <body onload="AddRec(); _FRM.submit();"></body>
  320. <?php
  321. }
  322. if ($myid == TRUE){
  323. // get natureID//likeoperationiferrorisencountered...
  324. $mynatureID=mysql_query("SELECT natureid FROM $tbl_current WHERE naturedesc='$nidescription'",$link2db);
  325. if (mysql_affected_rows($link2db)==1){
  326. $nidescriptionrec_=mysql_fetch_array($mynatureID);
  327. $natureid=$nidescriptionrec_[natureid];
  328. //$natureid=$nidescriptionrec_[psiccode];
  329. $natureaction='Edit';
  330. }
  331. else {
  332. $validateID=1;
  333. //include'validate-inc.php';
  334. }
  335. // end here
  336. if ($naedit=='true'){
  337. $validateID=5;
  338. } else {
  339. $validateID=0;
  340. }
  341. include'validate-inc.php';
  342. }
  343. else {
  344. //echo "fhfhfhfhjosel";
  345. $validateID=1;
  346. include'validate-inc.php';
  347. }
  348. }
  349. elseif (mysql_affected_rows($link2db)==1 ){
  350. ?>
  351. <body onload='javascript:alert ("Existing Record Found!!");_FRM.idescription.focus();'></body>
  352. <?
  353. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription', psiccode='$niPsicCode' WHERE natureid='$natureid' ",$link2db);
  354. //$validateID=5;
  355. //include'validate-inc.php';
  356. }
  357. } // EndIf for not empty description...
  358. else {
  359. ?>
  360. <body onload='javascript:alert ("Enter Valid Description!!");_FRM.idescription.focus();'></body>
  361. <?
  362. }
  363. }
  364. // requirements
  365. if ($ISubmitREQ=="Submit"){
  366. $nireqdescription=strip_tags($ireqdescription);
  367. if ($ireqindicator==1){
  368. $ireqindicator=1;
  369. }
  370. else {
  371. $ireqindicator=0;
  372. }
  373. if (!empty($nireqdescription)){
  374. if ($reqaction=='Edit'){
  375. $dtaReq = mysql_query("SELECT * FROM $tbl_current WHERE reqid = '$reqid' ",$link2db);
  376. }
  377. else {
  378. $dtaReq = mysql_query("SELECT * FROM $tbl_current WHERE reqdesc = '$nireqdescription' and permit_type='$iPermitType'",$link2db);
  379. }
  380. if (mysql_affected_rows($link2db)==0 ){
  381. $dtaReq1 = mysql_query("INSERT INTO $tbl_current (reqdesc,recstatus,reqindicator,datecreated,revdate,permit_type) VALUES ('$nireqdescription','A','$ireqindicator',Now(),Now(),'$iPermitType')",$link2db);
  382. //echo "INSERT INTO $tbl_current (reqdesc,recstatus,reqindicator,datecreated,revdate) VALUES ('$nireqdescription','A','$ireqindicator',Now(),Now(),'$iPermitType') $link2db";
  383. if ($dtaReq1 == TRUE){
  384. ?>
  385. <body onload='javascript:alert ("Data is successfully added to the database.");'></body>
  386. <?
  387. $nireqdescription = "";
  388. $iPermitType = "";
  389. }
  390. else {
  391. $validateID=1;
  392. include'validate-inc.php';
  393. }
  394. }
  395. elseif (mysql_affected_rows($link2db)==1) {
  396. if ($reqaction=='Edit'){
  397. $DBupdatereq = mysql_query("UPDATE $tbl_current SET reqdesc='$nireqdescription', reqindicator='$ireqindicator', revdate=Now(), permit_type='$iPermitType' WHERE reqid = '$reqid' ",$link2db);
  398. ?>
  399. <body onload='javascript:alert ("Record Successfully Updated");'></body>
  400. <?
  401. $nireqdescription = "";
  402. $iPermitType = "";
  403. }
  404. else {
  405. ?>
  406. <body onload='javascript:alert ("Duplicate Record is not accepted!!");'></body>
  407. <?php
  408. }
  409. }
  410. } // EndIf for not empty description...
  411. else {
  412. $validateID=2;
  413. include'validate-inc.php';
  414. }
  415. }
  416. // end of requriements
  417. // taxes,fees and other charges...
  418. if (isset($ISubmitTFO)){
  419. if ($itfoindicator==1) {
  420. $nitfodescription=strip_tags(strtoupper($itfodescription));
  421. } else {
  422. $nitfodescription=strip_tags(strtoupper($itfodescription));
  423. $defamt=$defamt;
  424. $itfotype=$itfotype;
  425. }
  426. if ($itfoindicator==1){
  427. $itfoindicator=1;
  428. }
  429. else {
  430. $itfoindicator=0;
  431. }
  432. $nitfoindicator=$itfoindicator;
  433. if (!empty($nitfodescription)){
  434. if ($tfoaction=='Edit'){
  435. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE tfoid = '$tfoid' ",$link2db);
  436. }
  437. else {
  438. $xmyid = mysql_query("SELECT * FROM $tbl_current WHERE tfodesc = '$nitfodescription' ",$link2db);
  439. }
  440. if ($nitfoindicator==1) {
  441. if ($defamt=='' or $defamt==0) {
  442. echo "<div align=center><font color=red><b><i>Enter Default Amount</i></b></font></div>";
  443. $nitfodescription=$itfodescription;
  444. $nitfoindicator=$itfoindicator;
  445. $defamt=$defamt;
  446. $itfotype=$itfotype;
  447. } else {
  448. $nitfodescription=strip_tags(strtoupper($itfodescription));
  449. if (mysql_affected_rows($link2db)==0 ){
  450. $myid = mysql_query("INSERT INTO $tbl_current (tfodesc,tfostatus,tfoindicator,taxfeetype,datecreated,defamt,or_print,counter) VALUES ('$nitfodescription','A','$itfoindicator','$itfotype',Now(),$defamt,'$ilangtaon','$nubert')",$link2db) or die(mysql_error());
  451. if ($myid == TRUE){
  452. $validateID=0;
  453. include'validate-inc.php';
  454. //setURLRedirect("index.php?tfoid=5&action_=3&class_type=Preference&pref_type=Business&actionID=1&part=4&class_type=Preference&selMode=ebpls_nbusiness&tfoaction=Edit&orderbyasdes=1&reftype=tfo&updatetfo=true");
  455. }
  456. else {
  457. $validateID=1;
  458. include'validate-inc.php';
  459. }
  460. }
  461. elseif (mysql_affected_rows($link2db)==1) {
  462. if ($tfoaction=='Edit'){
  463. $DBupdatetfo = mysql_query("UPDATE $tbl_current SET tfodesc='$nitfodescription', tfoindicator='$itfoindicator', taxfeetype='$itfotype', defamt=$defamt, or_print='$ilangtaon', counter='$ubert' WHERE tfoid = '$tfoid' ",$link2db);
  464. $action_=5;
  465. $validateID=5;
  466. setURLRedirect("index.php?tfoid=5&action_=3&class_type=Preference&pref_type=Business&actionID=1&part=4&class_type=Preference&selMode=ebpls_nbusiness&tfoaction=Edit&orderbyasdes=1&reftype=tfo&updatetfo=true&nitfodescription=$nitfodescription&nitfoindicator=$nitfoindicator&defamt=$defamt&itfotype=$itfotype&tfoid=$tfoid");
  467. }
  468. else {
  469. $validateID=6;
  470. }
  471. }
  472. //$nitfodescription='';
  473. //$nitfoindicator='';
  474. //$defamt='';
  475. //$itfotype='';
  476. }
  477. } else {
  478. $nitfodescription=strip_tags(strtoupper($itfodescription));
  479. if (mysql_affected_rows($link2db)==0 ){
  480. $myid = mysql_query("INSERT INTO $tbl_current (tfodesc,tfostatus,tfoindicator,taxfeetype,datecreated,defamt,or_print,counter) VALUES ('$nitfodescription','A','$itfoindicator','$itfotype',Now(),$defamt,'$ilangtaon','$nubert')",$link2db)
  481. or die(mysql_error());
  482. if ($myid == TRUE){
  483. $validateID=0;
  484. include'validate-inc.php';
  485. // setURLRedirect("index.php?tfoid=5&action_=3&class_type=Preference&pref_type=Business&actionID=1&part=4&class_type=Preference&selMode=ebpls_nbusiness&tfoaction=Edit&reftype=tfo&updatetfo=true&nitfodescription=$nitfodescription&nitfoindicator=$nitfoindicator&defamt=$defamt&itfotype=$itfotype");
  486. }
  487. else {
  488. $validateID=1;
  489. include'validate-inc.php';
  490. }
  491. }
  492. elseif (mysql_affected_rows($link2db)==1) {
  493. if ($tfoaction=='Edit'){
  494. $DBupdatetfo = mysql_query("UPDATE $tbl_current SET tfodesc='$nitfodescription', tfoindicator='$itfoindicator', taxfeetype='$itfotype', defamt=$defamt, or_print='$ilangtaon', counter='$ubert' WHERE tfoid = '$tfoid' ",$link2db);
  495. $action_=5;
  496. $validateID=5;
  497. setURLRedirect("index.php?tfoid=5&action_=3&class_type=Preference&pref_type=Business&actionID=1&part=4&class_type=Preference&selMode=ebpls_nbusiness&tfoaction=Edit&reftype=tfo&updatetfo=true&nitfodescription=$nitfodescription&nitfoindicator=$nitfoindicator&defamt=$defamt&itfotype=$itfotype&tfoid=$tfoid");
  498. }
  499. else {
  500. $validateID=6;
  501. }
  502. }
  503. }
  504. } // EndIf for not empty description...
  505. else {
  506. $validateID=2;
  507. include'validate-inc.php';
  508. }
  509. }
  510. /***********/
  511. if (isset($ISubmitTax)){
  512. $counterTaxFeeID=mysql_query("Select DISTINCT taxfeeid FROM ebpls_buss_taxfeeother order
  513. by taxfeeid DESC",$link2db);
  514. $rowCounter=mysql_num_rows($counterTaxFeeID);
  515. if ($rowCounter==0){
  516. $ctrtaxfeeid=1;
  517. }
  518. else {
  519. ///////////////////////////////////
  520. /*$xselectDistinct=mysql_query("Select DISTINCT taxfeeid FROM ebpls_buss_taxrange order by taxfeeid DESC",$link2db);
  521. $xrowDistinct=mysql_numrows($xselectDistinct);
  522. if ($xrowDistinct>0){
  523. $xnewgetData=mysql_fetch_array($xselectDistinct);
  524. $ctrtaxfeeid=$newgetData[taxfeeid] + 1;
  525. }*/
  526. //////////////////////////////////
  527. $xnewgetData=mysql_fetch_array($counterTaxFeeID);
  528. $ctrtaxfeeid=$xnewgetData[taxfeeid] + 1;
  529. //$ctrtaxfeeid=$rowCounter + 1;
  530. }
  531. if ($iMode==2){
  532. $eventComplex=2;
  533. }
  534. elseif ($iMode==1){
  535. $eventComplex=1;
  536. }
  537. $niAmountFormula=strip_tags($iAmountFormula);
  538. if (!empty($niAmountFormula)){
  539. if (empty($aTFOID) and empty($aTAXFEEid)){
  540. $checkRecord=mysql_query("Select * from ebpls_buss_taxfeeother WHERE natureid=$natureid and tfo_id=$itfotype and taxfeeid=$ctrtaxfeeid ",$link2db); // and taxfeeind='$iIndicator' and taxtype='$itype' and taxfeeoption='$iOption' no duplicate additional
  541. $rowchkRecord=mysql_num_rows($checkRecord);
  542. if ($rowchkRecord==0){
  543. $seleDuplicate=mysql_query("select * from ebpls_buss_taxfeeother where tfo_id='$itfotype' and taxfeeind='$iIndicator' and taxtype='$iType' and taxfeeoption='$iOption' and natureid='$natureid'",$link2db);
  544. $rowDuplicate=mysql_num_rows($seleDuplicate);
  545. //echo "doble daw... $rowDuplicate<br>";
  546. /*
  547. echo "orignatureid $natureid<br>";
  548. echo "origtfoid $aTFOID<br>";
  549. echo "origtaxfeeid $aTAXFEEid<br>";
  550. echo "doble daw... $rowDuplicate<br>";
  551. echo "option $iOption<br>";
  552. echo "type $iType<br>";
  553. echo "indicator $iIndicator<br>";
  554. echo "tfotype $itfotype<br>";
  555. */
  556. //exit;
  557. if ($rowDuplicate==0){
  558. if ($iMinAmount=='') {
  559. $iMinAmount=0;
  560. }
  561. //echo "lito frrrerreererreerererer";
  562. if ($iIndicator==3){
  563. $valueof_ResultId=1;
  564. $checkRange=1;
  565. $iAmountFormula=1;
  566. $niAmountFormula=1;
  567. if ($iMinAmount=='') {
  568. $iMinAmount=0;
  569. }
  570. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxfeeother (taxfeeid,natureid,tfo_id,taxfeeoption,taxfeeind,taxfeemode,taxfeeamtfor,datecreated,taxtype,uom,defamt) VALUES ($ctrtaxfeeid,$natureid,$itfotype,'$iOption','$iIndicator','$iMode',$niAmountFormula,Now(),'$iType','$iuom',$iMinAmount)",$link2db) or die("die".mysql_error());
  571. }
  572. if ($iIndicator=='2') {
  573. $openpar = substr_count($niAmountFormula, '(');
  574. $closepar = substr_count($niAmountFormula, ')');
  575. $closepar1 = $closepar-2;
  576. if ($openpar==$closepar1) {
  577. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxfeeother (taxfeeid,natureid,tfo_id,taxfeeoption,taxfeeind,taxfeemode,taxfeeamtfor,datecreated,taxtype,uom,defamt) VALUES ('$ctrtaxfeeid','$natureid','$itfotype','$iOption','$iIndicator','$iMode','$niAmountFormula',Now(),'$iType','$iuom',$iMinAmount)",$link2db) or die("die".mysql_error());
  578. } else {
  579. echo "<div align=center><font color=red<b><i>Invalid Formula ($niAMountFormula)</i></b></font></div>";
  580. }
  581. }
  582. if ($iIndicator=='1') {
  583. if (is_numeric($niAmountFormula)) {
  584. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxfeeother (taxfeeid,natureid,tfo_id,taxfeeoption,taxfeeind,taxfeemode,taxfeeamtfor,datecreated,taxtype,uom,defamt) VALUES ('$ctrtaxfeeid','$natureid','$itfotype','$iOption','$iIndicator','$iMode','$niAmountFormula',Now(),'$iType','$iuom',$iMinAmount)",$link2db) or die("die".mysql_error());
  585. } else {
  586. echo "<div align=center><font color=red<b><i>Invalid Amount ($niAmountFormula)</i></b></font></div>";
  587. }
  588. }
  589. if ($INSERTdata == True){
  590. $RecordtaxID_ = mysql_query("SELECT * FROM ebpls_buss_taxfeeother WHERE natureid = '$natureid' and tfo_id='$itfotype' and taxfeeoption='$iOption' and taxfeeind='$iIndicator' and taxfeemode='$iMode' and taxfeeamtfor='$niAmountFormula' and taxtype='$iType' and taxfeeid='$ctrtaxfeeid'",$link2db);
  591. if (mysql_affected_rows($link2db)==1 ){
  592. $nRecordId_=mysql_fetch_array($RecordtaxID_);
  593. $aTAXFEEid=$nRecordId_[taxfeeid];
  594. $aTFOID=$nRecordId_[tfoid];
  595. }
  596. $validateID=0;
  597. include'validate-inc.php';
  598. }
  599. else {
  600. $validateID=1;
  601. include'validate-inc.php';
  602. }
  603. } // duplicate record next line...
  604. // else {
  605. // echo "<p align=center>Duplicate entry is NOT accepted...</p>";
  606. // }
  607. }// no duplicate record found...
  608. else { // $rowchkRecord==1
  609. $validateID=1;
  610. include'validate-inc.php';
  611. }
  612. }
  613. else { // check for range flag here...
  614. $DBupdateRec_ = mysql_query("UPDATE ebpls_buss_taxfeeother SET taxfeeoption='$iOption', taxfeeind='$iIndicator', taxfeemode='$iMode', taxfeeamtfor='$niAmountFormula',defamt=$iMinAmount, datecreated=Now(), taxtype='$iType', tfo_id='$itfotype', uom='$iuom' WHERE natureid='$natureid' and tfoid = '$aTFOID' and taxfeeid='$aTAXFEEid' ",$link2db);
  615. // if error or not correct in process remove tfoid='$itfotype'!!!
  616. $validateID=5;
  617. include'validate-inc.php';
  618. }
  619. } // Not empty
  620. else {
  621. $validateID=2;
  622. include'validate-inc.php';
  623. }
  624. }
  625. if (!empty($bussEvent)){
  626. $taxfeeAmtFor = mysql_query("SELECT * FROM ebpls_buss_taxfeeother WHERE natureid = '$natureid' and tfo_id='$aTFOID' and taxfeeid='$aTAXFEEid' ",$link2db);
  627. if (mysql_affected_rows($link2db)==1 ){
  628. $niAmountFormula_=mysql_fetch_array($taxfeeAmtFor);
  629. $niAmountFormula=$niAmountFormula_[taxfeeamtfor];
  630. $niMinAmount=$niAmountFormula_[defamt];
  631. $niOption=$niAmountFormula_[taxfeeoption];
  632. $niIndicator=$niAmountFormula_[taxfeeind];
  633. $niTaxMode=$niAmountFormula_[taxfeemode];
  634. $niType=$niAmountFormula_[taxtype];
  635. $niuom=$niAmountFormula_[uom];
  636. //$niTaxMode=$niAmountFormula_[taxfeemode];
  637. $iTFO_data = mysql_query("SELECT * FROM ebpls_buss_tfo WHERE tfoid = '$aTFOID'",$link2db);
  638. if (mysql_affected_rows($link2db)==1 ){
  639. $niTFO_data=mysql_fetch_array($iTFO_data);
  640. $ni_typedesc=$niTFO_data[tfodesc];
  641. $ni_taxfeetype=$niTFO_data[tfoid];
  642. }
  643. }
  644. }
  645. // range maintenance
  646. // Save routine
  647. if (isset($iSaveRange)){
  648. $chkindi = mysql_query("select * from ebpls_buss_taxfeeother where natureid='$natureid' and tfo_id = '$aTFOID' and taxfeeid='$aTAXFEEid'",$link2db);
  649. $chkindic1=mysql_fetch_array($chkindi);
  650. $chkiIndicator = $chkindic1[taxfeeind];
  651. if ($chkiIndicator != $iIndicator) {
  652. $valueof_ResultId='';
  653. $eventComplex='';
  654. $niIndicator=$iIndicator;
  655. //$deleterange = mysql_query("delete from ebpls_buss_taxrange where taxfeeid='$aTAXFEEid'",$link2db);
  656. $upDateDbrec1=mysql_query("UPDATE ebpls_buss_taxfeeother SET taxfeeoption='$iOption', taxfeeind='$iIndicator', taxfeemode='$iMode', taxfeeamtfor='$niAmountFormula',defamt=$iMinAmount, datecreated=Now(), taxtype='$iType', tfo_id='$itfotype', uom='$iuom' WHERE natureid='$natureid' and tfo_id = '$aTFOID' and taxfeeid='$aTAXFEEid' ",$link2db);
  657. }
  658. $ctr=0;
  659. $varIDreSult_=0;
  660. while ($ctr < $lastRecord_){
  661. if ($rangelow[$ctr]==Null || $rangehigh[$ctr]==Null || $rangeamount[$ctr]==Null ){
  662. }
  663. else {
  664. if ($editRange==1){ // for edit range use only
  665. //echo "for edit range ito ";
  666. if ($rangeind[$ctr]=='1') {
  667. if (is_numeric($rangeamount[$ctr])) {
  668. $upDateDbrec=mysql_query("UPDATE ebpls_buss_taxrange SET rangelow='$rangelow[$ctr]', rangehigh='$rangehigh[$ctr]', rangeamount='$rangeamount[$ctr]', rangeind='$rangeind[$ctr]', datecreated=Now() WHERE taxfeeid='$aTAXFEEid' and rangeid='$rangeID[$ctr]' ",$link2db);
  669. // and rangeid='$rangeID[$ctr]'
  670. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  671. $validateID=5;
  672. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  673. //include'validate-inc.php';
  674. } else {
  675. echo "<div align=center><font color=red><b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  676. }
  677. }
  678. if ($rangeind[$ctr]=='2') {
  679. $openpar = substr_count($rangeamount[$ctr], '(');
  680. $closepar = substr_count($rangeamount[$ctr], ')');
  681. $closepar1 = $closepar-2;
  682. if ($openpar==$closepar1) {
  683. $upDateDbrec=mysql_query("UPDATE ebpls_buss_taxrange SET rangelow='$rangelow[$ctr]', rangehigh='$rangehigh[$ctr]', rangeamount='$rangeamount[$ctr]', rangeind='$rangeind[$ctr]', datecreated=Now() WHERE taxfeeid='$aTAXFEEid' and rangeid='$rangeID[$ctr]' ",$link2db);
  684. // and rangeid='$rangeID[$ctr]'
  685. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  686. $validateID=5;
  687. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  688. //include'validate-inc.php';
  689. } else {
  690. echo "<div align=center><font color=red><b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  691. }
  692. }
  693. //Robert
  694. if (!empty($eventAddRow) and $eventAddRow=='PlusOne'){
  695. $taddr=0;
  696. $ctr=0;
  697. while ($taddr < $noofloop) {
  698. $AddRangeLow[$ctr]=strip_tags($AddRangeLow[$ctr]);
  699. $AddRangeHigh[$ctr]=strip_tags($AddRangeHigh[$ctr]);
  700. $AddRangeAmount[$ctr]=strip_tags($AddRangeAmount[$ctr]);
  701. $AddRangeInd[$ctr]=strip_tags($AddRangeInd[$ctr]);
  702. if (is_numeric($AddRangeLow[$ctr]) and is_numeric($AddRangeHigh[$ctr])){
  703. if ($AddRangeInd[$ctr]=='1') {
  704. if (is_numeric($AddRangeAmount[$ctr])) {
  705. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$aTAXFEEid','$AddRangeLow[$ctr]','$AddRangeHigh[$ctr]','$AddRangeAmount[$ctr]','$AddRangeInd[$ctr]','A',Now())",$link2db);
  706. // and rangeid='$rangeID[$ctr]'
  707. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  708. //$validateID=5;
  709. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  710. //include'validate-inc.php';
  711. } else {
  712. echo "<div align=center><font color=red<b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  713. }
  714. }
  715. if ($AddRangeInd[$ctr]=='2') {
  716. $openpar = substr_count($AddRangeAmount[$ctr], '(');
  717. $closepar = substr_count($AddRangeAmount[$ctr], ')');
  718. $closepar1 = $closepar-2;
  719. if ($openpar==$closepar1) {
  720. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$aTAXFEEid','$AddRangeLow[$ctr]','$AddRangeHigh[$ctr]','$AddRangeAmount[$ctr]','$AddRangeInd[$ctr]','A',Now())",$link2db);
  721. // and rangeid='$rangeID[$ctr]'
  722. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  723. //$validateID=5;
  724. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  725. //include'validate-inc.php';
  726. } else {
  727. echo "<div align=center><font color=red<b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  728. }
  729. }
  730. $valueof_ResultId=1;
  731. $eventAddRow='';
  732. }
  733. else {
  734. echo "<br><font color=#ff0033><p align=center>Invalid entry!!! Please check your entry.</p></font>";
  735. $nofrow=$noofloop;
  736. }
  737. $ctr++;
  738. $taddr++;
  739. }
  740. }
  741. //Robert
  742. }
  743. else {
  744. if ($aTAXFEEid==0){
  745. echo "<p align=center>Error encountered... Please report immediately to your IT personnel.</p>";
  746. }
  747. else {
  748. //echo "tama naman...";
  749. if ($rangeind[$ctr]=='1') {
  750. if (is_numeric($rangeamount[$ctr])) {
  751. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$aTAXFEEid','$rangelow[$ctr]','$rangehigh[$ctr]','$rangeamount[$ctr]','$rangeind[$ctr]','A',Now())",$link2db);
  752. // and rangeid='$rangeID[$ctr]'
  753. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  754. //$validateID=5;
  755. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  756. //include'validate-inc.php';
  757. $ctrtaxfeeid='';
  758. setUrlRedirect("index.php?natureid=$natureid&action_=1&actionID=1&part=4&class_type=Preference&pref_type=Business&selMode=ebpls_nbusiness&natureaction=Edit&orderbyasdes=1&reftype=bus");
  759. } else {
  760. echo "<div align=center><font color=red><b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  761. }
  762. }
  763. if ($rangeind[$ctr]=='2') {
  764. $openpar = substr_count($rangeamount[$ctr], '(');
  765. $closepar = substr_count($rangeamount[$ctr], ')');
  766. $closepar1 = $closepar-2;
  767. if ($openpar==$closepar1) {
  768. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$aTAXFEEid','$rangelow[$ctr]','$rangehigh[$ctr]','$rangeamount[$ctr]','$rangeind[$ctr]','A',Now())",$link2db);
  769. // and rangeid='$rangeID[$ctr]'
  770. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  771. $validateID=5;
  772. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  773. //include'validate-inc.php';
  774. } else {
  775. echo "<div align=center><font color=red><b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  776. }
  777. }
  778. }
  779. //echo "$rangelow[$ctr]..........$rangehigh[$ctr].........$rangeamount[$ctr] <br>";
  780. }
  781. }
  782. $varIDreSult_++;
  783. $ctr++;
  784. }
  785. //echo "Record TaxFeeID# =>>$aTAXFEEid";
  786. //exit;
  787. if (!empty($eventAddRow) and $eventAddRow=='PlusOne'){
  788. $taddr=0;
  789. $ctr=0;
  790. while ($taddr < $noofloop) {
  791. $AddRangeLow[$ctr]=strip_tags($AddRangeLow[$ctr]);
  792. $AddRangeHigh[$ctr]=strip_tags($AddRangeHigh[$ctr]);
  793. $AddRangeAmount[$ctr]=strip_tags($AddRangeAmount[$ctr]);
  794. $AddRangeInd[$ctr]=strip_tags($AddRangeInd[$ctr]);
  795. if (is_numeric($AddRangeLow[$ctr]) and is_numeric($AddRangeHigh[$ctr])){
  796. if ($AddRangeInd[$ctr]=='1') {
  797. if (is_numeric($AddRangeAmount[$ctr])) {
  798. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$aTAXFEEid','$AddRangeLow[$ctr]','$AddRangeHigh[$ctr]','$AddRangeAmount[$ctr]','$AddRangeInd[$ctr]','A',Now())",$link2db);
  799. // and rangeid='$rangeID[$ctr]'
  800. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  801. //$validateID=5;
  802. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  803. //include'validate-inc.php';
  804. } else {
  805. echo "<div align=center><font color=red<b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  806. }
  807. }
  808. if ($AddRangeInd[$ctr]=='2') {
  809. $openpar = substr_count($AddRangeAmount[$ctr], '(');
  810. $closepar = substr_count($AddRangeAmount[$ctr], ')');
  811. $closepar1 = $closepar-2;
  812. if ($openpar==$closepar1) {
  813. $INSERTdata = mysql_query("INSERT INTO ebpls_buss_taxrange (taxfeeid,rangelow,rangehigh,rangeamount,rangeind,rangestatus,datecreated) VALUES ('$aTAXFEEid','$AddRangeLow[$ctr]','$AddRangeHigh[$ctr]','$AddRangeAmount[$ctr]','$AddRangeInd[$ctr]','A',Now())",$link2db);
  814. // and rangeid='$rangeID[$ctr]'
  815. //$myid = mysql_query("UPDATE $tbl_current SET naturedesc='$nidescription' WHERE natureid='$natureid' ",$link2db);
  816. //$validateID=5;
  817. //echo "<p align=center><font color=#ff0033><b><i>Record successfully updated!!!</font></i></b></p>";
  818. //include'validate-inc.php';
  819. } else {
  820. echo "<div align=center><font color=red<b><i>Invalid Amount ($rangeamount[$ctr])</i></b></font></div>";
  821. }
  822. }
  823. $valueof_ResultId=1;
  824. $eventAddRow='';
  825. }
  826. else {
  827. echo "<br><font color=#ff0033><p align=center>Invalid entry!!! Please check your entry.</p></font>";
  828. $nofrow=$noofloop;
  829. }
  830. $ctr++;
  831. $taddr++;
  832. }
  833. }
  834. //else {
  835. //} // endif for eventAddrow
  836. if (!empty($aTAXFEEid) and !empty($aTFOID) and !empty($natureid)){
  837. /*echo "Ok to update...";
  838. echo "$natureid<br>";
  839. echo "$aTAXFEEid<br>";
  840. echo "$aTFOID<br>";
  841. echo "$iOption<br>";
  842. //echo "$iIndicator<br>";
  843. echo "$iMode<br>";
  844. echo "$iType<br>";
  845. echo "$niAmountFormula */
  846. //taxfeeind='$iIndicator', taxfeemode='$iMode', taxfeeamtfor='$niAmountFormula', for Range only!
  847. $DBupdateRec_ = mysql_query("UPDATE ebpls_buss_taxfeeother SET taxfeeoption='$iOption', datecreated=Now(), taxtype='$iType', tfo_id='$itfotype', uom='$iuom', defamt=$iMinAmount WHERE natureid='$natureid' and tfo_id = '$aTFOID' and taxfeeid='$aTAXFEEid' ",$link2db);
  848. $aTFOID=$itfotype;
  849. $niOption=$iOption;
  850. $niType=$iType;
  851. $niMinAmount=$iMinAmount;
  852. $niuom=$iuom;
  853. $iTFO_data = mysql_query("SELECT * FROM ebpls_buss_tfo WHERE tfoid = '$aTFOID'",$link2db);
  854. if (mysql_affected_rows($link2db)==1 ){
  855. $niTFO_data=mysql_fetch_array($iTFO_data);
  856. $ni_typedesc=$niTFO_data[tfodesc];
  857. $ni_taxfeetype=$niTFO_data[tfoid];
  858. }
  859. }
  860. }
  861. if (isset($iRows)){
  862. $lastRecord_=$lastRecord_ + 3;
  863. }
  864. else {
  865. if (empty($varIDreSult_)){
  866. $lastRecord_=3; // original line of code (1)
  867. }
  868. else {
  869. $lastRecord_=$varIDreSult_;
  870. }
  871. }
  872. // end here for range maintenance
  873. ?>
  874. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  875. <html>
  876. <head>
  877. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  878. <title>eBPLS Business Permit and Licensing System</title>
  879. <meta name="Author" content=" FourJ's ">
  880. <link href="includes/eBPLS.css" rel="stylesheet" type="text/css">
  881. <title></title>
  882. </head>
  883. <body>
  884. <form name="_FRM">
  885. <?php
  886. if ($addingrow=='Add Row') {
  887. //$natureid=$natureid;
  888. $class_type=Preference;
  889. $pref_type=Business;
  890. $action_=1;
  891. $actionID=1;
  892. //$part=$part;
  893. $class_type=Preference;
  894. $pref_type=Business;
  895. //$selMode=$selMode;
  896. $natureaction=Edit;
  897. //$bussEvent=$bussEvent;
  898. //$aTFOID=$aTFOID;
  899. $valueof_ResultId=1;
  900. $aTAXFEEid=$aTAXFEEid;
  901. //$rangeid=$rangeid;
  902. $eventAddRow=PlusOne;
  903. //$nofrow=$nofrow;
  904. }
  905. ?>
  906. <input type=hidden name=part value="<?php echo $part;?>">
  907. <input type=hidden name=class_type value="<?php echo $class_type;?>">
  908. <input type=hidden name=noofloop value="<?php echo $nofrow;?>">
  909. <input type=hidden name=pref_type value="Business">
  910. <input type=hidden name=selMode value="<?php echo $selMode;?>">
  911. <input type=hidden name=action_ value="<?php echo $action_;?>">
  912. <input type=hidden name=actionID value="<?php echo $actionID;?>">
  913. <input type=hidden name=natureid value="<?php echo $natureid;?>">
  914. <input type=hidden name=natureaction value="<?php echo $natureaction;?>">
  915. <input type=hidden name=tfoid value="<?php echo $tfoid;?>">
  916. <input type=hidden name=reqid value="<?php echo $reqid;?>">
  917. <input type=hidden name=aTFOID value="<?php echo $aTFOID;?>">
  918. <input type=hidden name=aTAXFEEid value="<?php echo $aTAXFEEid;?>">
  919. <input type=hidden name=tfoaction value="<?php echo $tfoaction;?>">
  920. <input type=hidden name=reqaction value="<?php echo $reqaction;?>">
  921. <input type="hidden" name="actionDeleteReq">
  922. <input type="hidden" name="bbo">
  923. <!--Requirements-->
  924. <input type=hidden name=compEvent value="<?php echo $compEvent;?>">
  925. <input type=hidden name=compEvent1 value="<?php echo $compEvent1;?>">
  926. <input type=hidden name=oidof_complex value="<?php echo $oidof_complex;?>">
  927. <input type=hidden name=bussEvent value="<?php echo $bussEvent;?>">
  928. <input type=hidden name=valueof_ResultId value="<?php echo $valueof_ResultId;?>">
  929. <input type=hidden name=eventComplex value="<?php echo $eventComplex;?>">
  930. <input type=hidden name=reftype value="<?php echo $reftype;?>">
  931. <!--
  932. <input type=hidden name=lastRecord_ value="<?php echo $lastRecord_;?>">
  933. <input type=hidden name=rangelow[<?php echo $ctr;?>] value="<?php echo $rangelow[$ctr];?>">
  934. <input type=hidden name=rangehigh[<?php echo $ctr;?>] value="<?php echo $rangehigh[$ctr];?>">
  935. <input type=hidden name=rangeamount[<?php echo $ctr;?>] value="<?php echo $rangeamount[$ctr];?>">
  936. <input type=hidden name=rangeformula[<?php echo $ctr;?>] value="<?php echo $rangeformula[$ctr];?>">
  937. -->
  938. <input type=hidden name=rangelow[] value="<?php echo $rangelow[$ctr];?>">
  939. <input type=hidden name=rangehigh[] value="<?php echo $rangehigh[$ctr];?>">
  940. <input type=hidden name=rangeamount[] value="<?php echo $rangeamount[$ctr];?>">
  941. <input type=hidden name=rangeformula[] value="<?php echo $rangeformula[$ctr];?>">
  942. <input type=hidden name=rangeind[] value="<?php echo $rangeind[$ctr];?>">
  943. <input type=hidden name=eventAddRow value="<?php echo $eventAddRow;?>">
  944. <input type=hidden name=AddRangeLow value="<?php echo $AddRangeLow;?>">
  945. <input type=hidden name=AddRangeHigh value="<?php echo $AddRangeHigh;?>">
  946. <input type=hidden name=AddRangeAmount value="<?php echo $AddRangeAmount;?>">
  947. <input type=hidden name=AddRangeInd value="<?php echo $AddRangeInd;?>">
  948. <table width=100% align=center cellspacing=0 cellpadding=0>
  949. <tr><td colspan=2 class=header align=center width=100%>REFERENCES</td></tr>
  950. <tr>
  951. <td colspan=2 align=center>
  952. </td>
  953. </tr>
  954. <?php
  955. if ($action_==0){
  956. if ($confx==1) {
  957. include_once 'class/TaxFeeOtherChargesClass.php';
  958. $DelNat = new TaxFee;
  959. $DelNat->CheckTaxFee($bcode);
  960. if ($DelNat->outnumrow > 0) {
  961. ?>
  962. <body onload='javascript:alert ("Cannot Delete, Record exists in other table(s)!!");'></body>
  963. <?
  964. } else {
  965. $strwhere = "natureid='$bcode'";
  966. $DelNat->DeleteTax('ebpls_buss_nature',$strwhere);
  967. ?>
  968. <body onload='javascript:alert ("Record Deleted!!");'></body>
  969. <?
  970. }
  971. }
  972. if ($donfx==1) {
  973. include_once 'class/TaxFeeOtherChargesClass.php';
  974. $DelNat = new TaxFee;
  975. $strvalues = "naturestatus='A'";
  976. $strwhere = "natureid='$bcode'";
  977. $DelNat->UpdateNature($strvalues,$strwhere);
  978. }
  979. ?>
  980. <body onload="javascript: _FRM.searcheenat.focus();"></body>
  981. <tr><td colspan=2 class=header2 align=center width=100%>Masterlist of Business Nature</td></tr>
  982. <tr>
  983. <td colspan=2><br><br>&nbsp;<!--To add new record click here.-->
  984. &nbsp;<input type=text name=searcheenat size=20 maxlength=255>&nbsp;<input type = submit name=searchnat value ='Search Nature'><br><br>
  985. <input type = submit name=cbut value ='Add New Record'><br><br> <!--LEO RENTON.-->
  986. </td>
  987. </tr>
  988. <tr>
  989. <td colspan=2 valign=top align=left><br>
  990. <!--first table within a cell-->
  991. <table width=100%>
  992. <tr bgcolor="#EEEEEE">
  993. <td width=5%>&nbsp;No.</td>
  994. <!--<td width=5%>ID#</td>-->
  995. <td width=60%><a href='index.php?part=4&class_type=Preference&pref_type=Business&selMode=ebpls_nbusiness&action_=0&valueofdesc=desc&orderbyasdes=<?php echo $orderbyasdes;?>&reftype=<?php echo $reftype;?>&searcheenat=<?php echo $searcheenat;?>'>Description</a></td>
  996. <td width=5% align=center>PSIC Code</td>
  997. <td width=20% align=center>Action</td>
  998. </tr>
  999. <input type=hidden name=bcode>
  1000. <input type=hidden name=confx>
  1001. <input type=hidden name=donfx>
  1002. <script language='javascript'>
  1003. function DelNature(cc)
  1004. {
  1005. var _FRM = document._FRM;
  1006. doyou = confirm("Record Will Be Deleted, Continue?");
  1007. if (doyou==true) {
  1008. _FRM.bcode.value = cc;
  1009. _FRM.confx.value = 1;
  1010. } else {
  1011. _FRM.confx.value=0;
  1012. alert("Transaction Cancelled.");
  1013. return false;
  1014. }
  1015. _FRM.submit();
  1016. return true;
  1017. }
  1018. function ActNature(cc)
  1019. {
  1020. var _FRM = document._FRM;
  1021. doyou = confirm("Record Will Be Activated, Continue?");
  1022. if (doyou==true) {
  1023. _FRM.bcode.value = cc;
  1024. _FRM.donfx.value = 1;
  1025. } else {
  1026. _FRM.donfx.value=0;
  1027. alert("Transaction Cancelled.");
  1028. return false;
  1029. }
  1030. _FRM.submit();
  1031. return true;
  1032. }
  1033. </script>
  1034. <?php
  1035. require 'setup/setting.php';
  1036. if(!isset($_GET['page'])){
  1037. $page = 1;
  1038. } else {
  1039. $page = $_GET['page'];
  1040. }
  1041. // Define the number of results per page
  1042. $max_results = $thIntPageLimit;
  1043. // Figure out the limit for the query based
  1044. // on the current page number.
  1045. $from = abs((($page * $max_results) - $max_results));
  1046. if ($searcheenat<>"") {
  1047. $addends = "where naturedesc like '%$searcheenat%'";
  1048. } else {
  1049. $addends = "";
  1050. }
  1051. if ($valueofdesc=='desc') {
  1052. $searchsql = "SELECT * FROM $tbl_current $addends ORDER BY naturedesc $ascdesc limit $from, $max_results";
  1053. } else {
  1054. //if ($searchnat=='Search Nature') {
  1055. // $searchsql = "SELECT * FROM $tbl_current where naturestatus='A' and naturedesc like '$searcheenat%' ORDER BY naturedesc $ascdesc1 limit $from, $max_results";
  1056. //} else {
  1057. //$searchsql = "SELECT * FROM $tbl_current $addends ORDER BY naturedesc $ascdesc1 limit $from, $max_results";
  1058. $searchsql = "SELECT * FROM ebpls_buss_nature $addends ORDER BY naturedesc $ascdesc1 limit $from, $max_results";
  1059. //}
  1060. }
  1061. // echo $searcheenat . " ". $searchsql;
  1062. if ($searcheenat<>"") {
  1063. $addends = "where naturedesc like '%$searcheenat%'";
  1064. } else {
  1065. $addends = "";
  1066. }
  1067. $cntsql = "SELECT count(*) FROM $tbl_current $addends";
  1068. //$Dbresult=th_query($listmyid);
  1069. include'nextpage.php';
  1070. /*
  1071. $listmyid = "SELECT * FROM $tbl_current where naturestatus='A' ORDER BY naturedesc ";
  1072. $Dbresult=th_query($listmyid);
  1073. while($dtarow = @mysql_fetch_array($Dbresult)){
  1074. $myrow++;
  1075. include'tablecolor-inc.php';
  1076. echo "<tr bgcolor=$varcolor>";
  1077. echo "<td>$myrow</td>";
  1078. //echo "<td>$dtarow[natureid]</td>";
  1079. echo "<td>$dtarow[naturedesc]</td>";
  1080. if ($dtarow[natureoption]=='L'){
  1081. echo "<td align=center><img src=../images/pin.gif width=15 height=15/></td>";
  1082. }
  1083. elseif ($dtarow[natureoption]=='C'){
  1084. echo "<td align=center>-</td>";
  1085. }
  1086. else {
  1087. echo "<td align=center></td>";
  1088. }
  1089. echo "<td align=center> <a href=$PHP_SELF?natureid=$dtarow[natureid]&action_=1&actionID=1&part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&natureaction=Edit>Edit</a> | <a href=$PHP_SELF?natureid=$dtarow[natureid]&natureaction=Delete&part=$part&selMode=$selMode>DeActivate</a></td>";//$natureid
  1090. echo "</tr>";
  1091. }
  1092. */
  1093. ?>
  1094. </table>
  1095. <!--end here-->
  1096. </td>
  1097. </tr>
  1098. <?php
  1099. }
  1100. elseif ($action_==80){
  1101. ?>
  1102. <td colspan=2><b><i>Business Nature (Delete Mode)</i></b> &nbsp <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>><img src="/images/back1.gif" width=45 height=30/></a></td>
  1103. <?php
  1104. $dtaRec = mysql_query("SELECT * FROM $tbl_current WHERE natureid = '$natureid' and naturestatus='A' ",$link2db);
  1105. $numRec=mysql_num_rows($dtaRec);
  1106. if ($numRec==1) {
  1107. $nRec=mysql_fetch_array($dtaRec);
  1108. $nidescription=$nRec[naturedesc];
  1109. $niPsicCode=$nRec[psiccode];
  1110. }
  1111. else {
  1112. $validateID=1;
  1113. include'validate-inc.php';
  1114. }
  1115. ?>
  1116. <tr>
  1117. <td colspan=2><br></td>
  1118. </tr>
  1119. <tr>
  1120. <td width=15% valign=top>Description</td>
  1121. <td width=75%><textarea name=idescription rows=3 cols=60><?php echo $nidescription;?></textarea></td>
  1122. </tr>
  1123. <tr>
  1124. <td width=15% valign=top>PSIC Code</td>
  1125. <td width=75%><input type=text name=iPsicCode size=15 maxlength=15 value="<?php echo $niPsicCode;?>"></td>
  1126. </tr>
  1127. <tr>
  1128. <td colspan=2><br></td>
  1129. </tr>
  1130. <tr>
  1131. <td colspan=2 align=center><font color="#ff0033">Are you sure you want to DeActivate this record??? [ <a href=<?php echo $PHP_SELF;?>?natureid=<?php echo $natureid;?>&actionDeleteStatus=Ok&part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&reftype=bus&orderbyasdes=1>Yes</a> ] [ <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&reftype=bus&orderbyasdes=1>Cancel</a> ] </font></td>
  1132. </tr>
  1133. <tr>
  1134. <td colspan=2><br></td>
  1135. </tr>
  1136. <tr>
  1137. <td colspan=2><br></td>
  1138. </tr>
  1139. <?php
  1140. }
  1141. elseif ($action_==1){ // Business Nature Add Module start here...
  1142. ?>
  1143. <tr>
  1144. <?php
  1145. if ($natureaction=='Edit'){
  1146. ?>
  1147. <td colspan=2 class=header2 align=center width=100%>Business Nature (Edit Mode)</td>
  1148. <?php
  1149. }
  1150. else {
  1151. ?>
  1152. <td colspan=2 class=header2 align=center width=100%>Business Nature (Add Mode)</td>
  1153. <?php
  1154. }
  1155. ?>
  1156. </tr>
  1157. <?
  1158. if ($actionID=='' and $bussEvent == "") {
  1159. echo "<body onload=\"javascript: _FRM.idescription.focus();\"></body>";
  1160. } else {
  1161. echo "<body onload=\"javascript: _FRM.tfotype.focus();\"></body>";
  1162. }
  1163. ?>
  1164. <tr bgcolor="#EEEEEE">
  1165. <td colspan=2><br></td>
  1166. </tr>
  1167. <tr>
  1168. <td width=15% valign=top>Description</td>
  1169. <td width=75%><input type=text name=idescription maxlength=40 size=50 value="<?php echo $nidescription;?>"></td>
  1170. </tr>
  1171. <tr>
  1172. <td width=15% valign=top>PSIC Code</td>
  1173. <td width=75%><input type=text name=iPsicCode size=15 maxlength=15 value="<?php echo $niPsicCode;?>"></td>
  1174. </tr>
  1175. <tr>
  1176. <td colspan=2><br></td>
  1177. </tr>
  1178. <?php
  1179. if (empty($bussEvent)){
  1180. ?>
  1181. <tr>
  1182. <td><br></td>
  1183. <td><input type=submit name=ISubmitBussNature value="Save">
  1184. <input type=button name=iCancelNature value="Cancel" onClick=" alert('Transaction Cancelled!!'); parent.location='<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=0&orderbyasdes=1&reftype=<?php echo $reftype;?>';">
  1185. <input type=button name=iCancel1Nature value="View All" onClick="parent.location='index.php?part=4&class_type=Preference&pref_type=Business&selMode=ebpls_nbusiness&action_=0&orderbyasdes=1&reftype=bus&permit_type=Business';">
  1186. </td>
  1187. </tr>
  1188. <tr>
  1189. <td colspan=2><br></td>
  1190. </tr>
  1191. <?php
  1192. }
  1193. ?>
  1194. <!-- End here for Business Nature Information-->
  1195. <?php
  1196. if (!empty($actionID) and $actionID==1){
  1197. ?>
  1198. <!--Event for maintaining the taxes, fees and other charges -->
  1199. <?php
  1200. if ($bussEvent==1){
  1201. include'ebpls5503-1.php';
  1202. }
  1203. elseif ($bussEvent==2){
  1204. include'ebpls5503-2.php';
  1205. }
  1206. elseif ($bussEvent==3){
  1207. include'ebpls5503-3.php';
  1208. }
  1209. else {
  1210. include'ebpls5503-4.php';
  1211. }
  1212. ?>
  1213. <!--End here for taxes, fees and other charges maintenance-->
  1214. <?php
  1215. }
  1216. ?>
  1217. <?php
  1218. }
  1219. elseif ($action_==101){
  1220. ?>
  1221. <tr>
  1222. <td colspan=2><br></td>
  1223. </tr>
  1224. <tr>
  1225. <td colspan=2><b><i>Business Nature (<?php echo $eventApply;?>... Mode)</i></b> &nbsp <a href=<?php echo $PHP_SELF;?>?natureid=<?php echo $natureid;?>&action_=1&actionID=1&part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&natureaction=Edit&bussEvent=<?php echo $bussEvent;?>&aTFOID=<?php echo $aTFOID;?>&valueof_ResultId=1&aTAXFEEid=<?php echo $aTAXFEEid;?>&rangeid=<?php echo $rangeid;?>&rangeAction=>Back</a></td>
  1226. </tr>
  1227. <tr>
  1228. <td colspan=2 bgcolor="#EEEEEE"><br></td>
  1229. </tr>
  1230. <tr>
  1231. <td colspan=2><br></td>
  1232. </tr>
  1233. <tr>
  1234. <td colspan=2>Select Business Nature here:</td>
  1235. </tr>
  1236. <tr>
  1237. <td colspan=2><br></td>
  1238. </tr>
  1239. <tr>
  1240. <td colspan=2><select name=iCopytoNature>
  1241. <?php
  1242. $Xnatureid=$natureid;
  1243. $seleNature=mysql_query("Select * from ebpls_buss_nature where natureid!='$natureid' and naturestatus='A' ORDER BY naturedesc",$link2db); // L means with range link attached
  1244. //$seleNature=mysql_query("Select * from ebpls_buss_nature where natureid!='$natureid' and naturestatus='A' and natureoption is null ORDER BY naturedesc",$link2db); // L means with range link attached
  1245. $rowNature=mysql_num_rows($seleNature);
  1246. if ($rowNature>0){
  1247. $myrow=1;
  1248. $ctrrow=0;
  1249. while (list($natureid,$naturedesc) = mysql_fetch_row($seleNature)){
  1250. echo "<option value=$natureid>$naturedesc";
  1251. $myrow++;
  1252. }
  1253. }
  1254. ?>
  1255. </select>
  1256. </td>
  1257. </tr>
  1258. <tr>
  1259. <td colspan=2><br></td>
  1260. </tr>
  1261. <?php
  1262. //if ($eventApply=='Applyto'){
  1263. //?>
  1264. <!--<tr>
  1265. <td colspan=2><input type=submit name=iSubmitCopytoNature value="Apply Range To"></td>
  1266. </tr>-->
  1267. //<?php
  1268. //}
  1269. if ($eventApply=='Applyto') {
  1270. ?>
  1271. <tr>
  1272. <td colspan=2><input type=submit name=iSubmitApplytoNature value="Apply Range To"></td>
  1273. </tr>
  1274. <?php
  1275. }
  1276. ?>
  1277. <input type=hidden name=Xnatureid value="<?php echo $Xnatureid;?>">
  1278. <input type=hidden name=eventApply value="<?php echo $eventApply;?>">
  1279. <input type=hidden name=searcheenat value="<?php echo $searcheenat;?>">
  1280. <?php
  1281. //include'ebpls5503-4.php';
  1282. ?>
  1283. <?php
  1284. }
  1285. elseif ($action_==2){
  1286. ?>
  1287. <tr>
  1288. <td colspan=2><b><i>&nbsp;&nbsp;Master List of Requirements</i></b> <br> <br>&nbsp;<!--To add new record click here.-->&nbsp;<input type = submit name=reqbut value ='Add New Record'></td>
  1289. </tr>
  1290. <tr>
  1291. <td colspan=2 valign=top align=left><br>
  1292. <!--first table within a cell-->
  1293. <table width=100%>
  1294. <tr><td align=right colspan=5><!--<i>Legend Indicator: </i> <font color="#ff0033">0=Normal | 1=Default</font>--></td></tr>
  1295. <tr bgcolor="#EEEEEE">
  1296. <td width=5%>&nbsp;No.</td>
  1297. <td width=55%><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&valueofKey1=REQDescription&orderbyasdes=<?php echo $orderbyasdes;?>>Description</a></td>
  1298. <td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&valueofKey1=REQIndicator&orderbyasdes=<?php echo $orderbyasdes;?>>Indicator</a></td>
  1299. <!--<td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&valueofKey1=REQStatus&orderbyasdes=<?php echo $orderbyasdes;?>>Status</a></td>-->
  1300. <td width=20% align=center>Action</td>
  1301. </tr>
  1302. <?php
  1303. if (!empty($valueofKey1)){
  1304. if ($valueofKey1=='REQDescription'){
  1305. $listmyid = "SELECT * FROM $tbl_current where recstatus='A' ORDER BY reqdesc $ascdesc";
  1306. }
  1307. elseif ($valueofKey1=='REQIndicator'){
  1308. $listmyid = "SELECT * FROM $tbl_current where recstatus='A' ORDER BY reqindicator,reqdesc $ascdesc";
  1309. }
  1310. /*
  1311. elseif ($valueofKey1=='REQStatus'){
  1312. $listmyid = "SELECT * FROM $tbl_current where reqstatus='A' ORDER BY taxfeetype,tfodesc ";
  1313. }*/
  1314. /*else {
  1315. $listmyid = "SELECT * FROM $tbl_current where tfostatus='A' ORDER BY tfodesc ";
  1316. }*/
  1317. }
  1318. else {
  1319. $listmyid = "SELECT * FROM $tbl_current where recstatus='A' ORDER BY reqdesc $ascdesc";
  1320. }
  1321. $Dbresult=th_query($listmyid);
  1322. while($dtarow = @mysql_fetch_array($Dbresult)){
  1323. $myrow++;
  1324. include'tablecolor-inc.php';
  1325. echo "<tr bgcolor=$varcolor>";
  1326. echo "<td valign=top>&nbsp;$myrow</td>";
  1327. echo "<td valign=top>$dtarow[reqdesc]</td>";
  1328. if ($dtarow[reqindicator]==0) {
  1329. $rindicator='Normal';
  1330. } else {
  1331. $rindicator='Default';
  1332. }
  1333. echo "<td valign=top align=center>$rindicator</td>";
  1334. // echo "<td valign=top align=center>$dtarow[reqindicator]</td>";
  1335. echo "<td valign=top align=center> <a href=$PHP_SELF?reqid=$dtarow[reqid]&action_=21&actionID=1&part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&reqaction=Edit>Edit</a> | ";
  1336. ?>
  1337. <a href="#" onClick="javascript: confirm("Delete Record?"); DeleReq('<? echo $dtarow[reqid];?>');">DeActivate</a></td>
  1338. <?
  1339. echo "</tr>";
  1340. }
  1341. ?>
  1342. </table>
  1343. <!--end here-->
  1344. </td>
  1345. </tr>
  1346. <?php
  1347. }
  1348. elseif ($action_==21){
  1349. ?>
  1350. <tr>
  1351. <td colspan=2><b><i>Requirements (Add Module)</i></b></td><!--&nbsp <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>><img src="/images/back1.gif" width=35 height=35/></a>-->
  1352. </tr>
  1353. <tr bgcolor="#EEEEEE">
  1354. <td colspan=2><br></td>
  1355. </tr>
  1356. <tr>
  1357. <td width=15% valign=top>Description</td>
  1358. <td width=75%><input type=text name=ireqdescription size=50 maxlength=100 value="<?php echo$nireqdescription;?>"> &nbsp &nbsp &nbsp
  1359. <?php
  1360. if (!empty($nireqindicator) and $nireqindicator == 1){
  1361. ?>
  1362. <input type=checkbox name=ireqindicator value=1 CHECKED> Set as default
  1363. <?php
  1364. }
  1365. else {
  1366. ?>
  1367. <input type=checkbox name=ireqindicator value=1 CHECKED> Set as default
  1368. <?php
  1369. }
  1370. ?>
  1371. </td>
  1372. </tr>
  1373. <tr>
  1374. <td width=15% valign=top>Permit Type</td>
  1375. <td width=75%><select name=iPermitType >
  1376. <?php
  1377. if ($niPermitType=='') {
  1378. $niPermitType='Business';
  1379. }
  1380. ?>
  1381. <option value='<?php echo $niPermitType;?>'><?php echo $niPermitType;?></option>
  1382. <option value='Business'>Business</option>
  1383. <option value='Motorized'>Motorized</option>
  1384. <option value='Occupational'>Occupational</option>
  1385. <option value='Peddlers'>Peddlers</option>
  1386. <option value='Franchise'>Franchise</option>
  1387. <option value='Fishery'>Fishery</option>
  1388. </select>
  1389. </td>
  1390. </tr>
  1391. <tr>
  1392. <td colspan=2><hr size=2 width=100%></td>
  1393. </tr>
  1394. <tr>
  1395. <td colspan=2><br></td>
  1396. </tr>
  1397. <tr>
  1398. <td><br></td>
  1399. <script language="Javascript">
  1400. function CheckValues()
  1401. {
  1402. var _FRM = document._FRM;
  1403. var msgTitle = "Permit Requirements\n";
  1404. if(_FRM.ireqdescription.value == "")
  1405. {
  1406. alert( msgTitle + "Please input a valid description!");
  1407. return false;
  1408. }
  1409. if(_FRM.ireqdescription.value.length > 30)
  1410. {
  1411. alert("Description exceeds maximum length!");
  1412. return false;
  1413. }
  1414. _FRM.ISubmitREQ.value = "Submit";
  1415. _FRM.submit();
  1416. return true;
  1417. }
  1418. </script>
  1419. <input type="hidden" name="ISubmitREQ">
  1420. <input type="hidden" name="actionDeleteReq">
  1421. <input type="hidden" name="bbo">
  1422. <td><input type=Button name=ISubmitquiue value="Save" onClick="javascript: CheckValues();">
  1423. <input type=button name=iCancelREQ value="Cancel" onClick="parent.location=' <?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&orderbyasdes=1>';">
  1424. <input type=button name=iViewAll value="View All" onClick="parent.location=' <?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&orderbyasdes=1>';">
  1425. </td>
  1426. </tr>
  1427. <?php
  1428. }
  1429. elseif ($action_==82){
  1430. ?>
  1431. <tr>
  1432. <td colspan=2><b><i>Requirements (DeActivate Mode)</i></b></td><!--&nbsp <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&selMode=<?php echo $selMode;?>><img src="/images/back1.gif" width=35 height=35/></a>-->
  1433. </tr>
  1434. <tr bgcolor="#EEEEEE">
  1435. <td colspan=2><br></td>
  1436. </tr>
  1437. <tr>
  1438. <td width=15% valign=top>Description</td>
  1439. <td width=75%><input type=text name=ireqdescription size=50 maxlength=100 value="<?php echo$nireqdescription;?>"> &nbsp &nbsp &nbsp
  1440. <?php
  1441. if (!empty($nireqindicator) and $nireqindicator == 1){
  1442. ?>
  1443. <input type=checkbox name=ireqindicator value=1 CHECKED> Set as default
  1444. <?php
  1445. }
  1446. else {
  1447. ?>
  1448. <input type=checkbox name=ireqindicator value=1 CHECKED> Set as default
  1449. <?php
  1450. }
  1451. ?>
  1452. </td>
  1453. </tr>
  1454. <tr>
  1455. <td colspan=2><hr size=2 width=100%></td>
  1456. </tr>
  1457. <tr>
  1458. <td colspan=2><br></td>
  1459. </tr>
  1460. <tr>
  1461. <td colspan=2 align=center><font color="#ff0033">Are you sure you want to deactivate this record??? [ <a href=<?php echo $PHP_SELF;?>?reqid=<?php echo $reqid;?>&actionDeleteReq=Ok&part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&selMode=<?php echo $selMode;?>&action_=2&reftype=req&orderbyasdes=1>Yes</a> ] [ <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&selMode=<?php echo $selMode;?>&action_=2&reftype=req&orderbyasdes=1>Cancel</a> ] </font></td>
  1462. </tr>
  1463. <?php
  1464. }
  1465. elseif ($action_==9){
  1466. ?>
  1467. <tr>
  1468. <td colspan=2><b><i>&nbsp;&nbsp;Master List of PSIC</i></b> <br> <br>&nbsp;To add new record click here.
  1469. &nbsp;<input type = submit name=psicbut value = ADD></td>
  1470. </tr>
  1471. <tr>
  1472. <td colspan=2 valign=top align=left><br>
  1473. <!--first table within a cell-->
  1474. <table width=100%>
  1475. <tr bgcolor="#EEEEEE">
  1476. <td width=5%>&nbsp;No.</td>
  1477. <td width=55%><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=9&valueofKey2=PSICCode&orderbyasdes=<?php echo $orderbyasdes;?>>Description</a></td>
  1478. <td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=9&valueofKey2=PSICDescription&orderbyasdes=<?php echo $orderbyasdes;?>>Indicator</a></td>
  1479. <!--<td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&valueofKey1=REQStatus&orderbyasdes=<?php $orderbyasdes;?>>Status</a></td>-->
  1480. <td width=20% align=center>Action</td>
  1481. </tr>
  1482. <?php
  1483. if (!empty($valueofKey2)){
  1484. if ($valueofKey1=='PSICDescription'){
  1485. $listmyid = "SELECT * FROM $tbl_current where psicstatus='A' ORDER BY psicdesc $ascdesc";
  1486. }
  1487. elseif ($valueofKey2=='PSICCode'){
  1488. $listmyid = "SELECT * FROM $tbl_current where psicstatus='A' ORDER BY psiccode,psicdesc $ascdesc";
  1489. }
  1490. /*
  1491. elseif ($valueofKey1=='REQStatus'){
  1492. $listmyid = "SELECT * FROM $tbl_current where reqstatus='A' ORDER BY taxfeetype,tfodesc ";
  1493. }*/
  1494. /*else {
  1495. $listmyid = "SELECT * FROM $tbl_current where tfostatus='A' ORDER BY tfodesc ";
  1496. }*/
  1497. }
  1498. else {
  1499. $listmyid = "SELECT * FROM $tbl_current where psicstatus='A' ORDER BY psicdesc $ascdesc";
  1500. }
  1501. $Dbresult=th_query($listmyid);
  1502. while($dtarow = @mysql_fetch_array($Dbresult)){
  1503. $myrow++;
  1504. include'tablecolor-inc.php';
  1505. echo "<tr bgcolor=$varcolor>";
  1506. echo "<td valign=top>&nbsp;$myrow</td>";
  1507. echo "<td valign=top>$dtarow[psiccode]</td>";
  1508. echo "<td valign=top align=center>$dtarow[psicdesc]</td>";
  1509. echo "<td valign=top align=center><a href=$PHP_SELF?psicid=$dtarow[psicid]&action_=91&actionID=1&part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&psicaction=Edit>Edit</a> | <a href=$PHP_SELF?psicid=$dtarow[psicid]&psicaction=Delete&part=$part&class_type=$class_type&pref_type=Business&selMode=$selMode&action_=9>DeActivate</a></td>";
  1510. echo "</tr>";
  1511. }
  1512. ?>
  1513. </table>
  1514. <!--end here-->
  1515. </td>
  1516. </tr>
  1517. <?php
  1518. }
  1519. elseif ($action_==91){
  1520. ?>
  1521. <tr>
  1522. <td colspan=2><b><i>PSIC (Add Module)</i></b></td><!--&nbsp <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>><img src="/images/back1.gif" width=35 height=35/></a>-->
  1523. </tr>
  1524. <tr bgcolor="#EEEEEE">
  1525. <td colspan=2><br></td>
  1526. </tr>
  1527. <tr>
  1528. <td width=15% valign=top>PSIC Code</td>
  1529. <td width=75%><input type=text name=ipsiccode size=15 maxlength=20 value="<?php echo$nipsiccode;?>"></td>
  1530. </tr>
  1531. <tr>
  1532. <td width=15% valign=top>Description</td>
  1533. <td width=75%><input type=text name=ipsicdescription size=50 maxlength=255 value="<?php echo$nipsicdescription;?>"></td>
  1534. </tr>
  1535. <tr>
  1536. <td colspan=2><hr size=2 width=100%></td>
  1537. </tr>
  1538. <tr>
  1539. <td colspan=2><br></td>
  1540. </tr>
  1541. <tr>
  1542. <td><br></td>
  1543. <td><input type=submit name=ISubmitPSIC value="Submit">
  1544. <input type=button name=iCancelREQ value="Cancel" onClick="parent.location=' <?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&orderbyasdes=1>';">
  1545. <input type=button name=iViewAll value="View All" onClick="parent.location=' <?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=2&orderbyasdes=1>';">
  1546. </td>
  1547. </tr>
  1548. <?
  1549. }
  1550. elseif ($action_==3){
  1551. ?>
  1552. <tr>
  1553. <td colspan=2><b><i>Tax, Fee and Other Charges (Add Module)</i></b></td><!--&nbsp <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>><img src="/images/back1.gif" width=35 height=35/></a>-->
  1554. </tr>
  1555. <tr bgcolor="#EEEEEE">
  1556. <td colspan=2><br></td>
  1557. </tr>
  1558. <tr>
  1559. <td width=15% valign=top>DESCRIPTION</td>
  1560. <td width=75%><input type=text name=itfodescription size=50 maxlength=80 value="<?php echo $nitfodescription;?>"></td>
  1561. </tr>
  1562. <tr>
  1563. <td width=15% valign=top>TYPE</td>
  1564. <td width=75%><select name=itfotype>
  1565. <?php
  1566. $Dbtype_ = "SELECT * FROM ebpls_buss_taxfeetype ORDER BY taxfeetype ";
  1567. $Dbtyperesult=th_query($Dbtype_);
  1568. while($dtarow = @mysql_fetch_array($Dbtyperesult)){
  1569. if ($dtarow[typedesc]==$itfotype) {
  1570. $lec='selected';
  1571. } else {
  1572. $lec='';
  1573. }
  1574. echo "<option value=$dtarow[taxfeetype] $lec>$dtarow[typedesc]";
  1575. }
  1576. echo "<option value=$nitfotype SELECTED>$ntypedesc";
  1577. ?>
  1578. </select> &nbsp &nbsp &nbsp
  1579. <?php
  1580. if ($nitfoindicator == 1){ //!empty($nitfoindicator) and
  1581. ?>
  1582. <input type=checkbox name=itfoindicator value=1 CHECKED> SET AS DEFAULT
  1583. <?php
  1584. }
  1585. else {
  1586. ?>
  1587. <input type=checkbox name=itfoindicator value=1> SET AS DEFAULT
  1588. <?php
  1589. }
  1590. ?>
  1591. </td>
  1592. </tr>
  1593. <script language='Javascript' src='javascripts/default.js'></script>
  1594. <script language="Javascript">
  1595. function CheckIt(x)
  1596. {
  1597. var _FRM = document._FRM;
  1598. var msgTitle = "Tax, Fee and Other Charges\n";
  1599. if(isNaN(x.value))
  1600. {
  1601. alert( msgTitle + "Please input a valid amount!");
  1602. _FRM.pay.focus();
  1603. return false;
  1604. }
  1605. }
  1606. </script>
  1607. </td>
  1608. </tr>
  1609. <?php
  1610. if ($tfoaction=='Edit') {
  1611. $getde= mysql_query("select * from ebpls_buss_tfo where tfoid=$tfoid") or die ("-");
  1612. $defamt=mysql_fetch_row($getde);
  1613. $defamt=$defamt[6];
  1614. }
  1615. ?>
  1616. <tr>
  1617. <td width=15% valign=top>DEFAULT AMOUNT</td>
  1618. <td width=75%>
  1619. <input type=text size=15 name=defamt onBlur='javascript:CheckIt(defamt)' value=<?php if ($defamt=='') { $defamt=0; } echo $defamt; ?>>
  1620. <?php
  1621. $chkdb=mysql_query("select or_print from ebpls_buss_preference") or die(mysql_error);
  1622. $chkdb=mysql_fetch_row($chkdb);
  1623. if ($chkdb[0]==1) {
  1624. print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  1625. if ($niseparate_or == 1){
  1626. ?>
  1627. <input type=checkbox name=iseparate_or value=1 CHECKED> Separate O.R.
  1628. <?php
  1629. }
  1630. else {
  1631. ?>
  1632. <input type=checkbox name=iseparate_or value=1> Separate O.R.
  1633. <?php
  1634. }
  1635. }
  1636. if ($nubert==0) {
  1637. $ele = 'selected';
  1638. } else {
  1639. $elw = 'selected';
  1640. }
  1641. ?>
  1642. </td>
  1643. </tr>
  1644. <tr>
  1645. <td width=15% valign=top>NO. OF YEARS</td>
  1646. <td width=75%>
  1647. <select name=ubert class=select2000>
  1648. <option value=0 <?php echo $ele; ?>>EVERY</option>
  1649. <option value=1 <?php echo $elw; ?>>WITH IN</option>
  1650. </select>
  1651. <input type=text size=15 name=ilangtaon value=<?php echo $nilangtaon; ?>>
  1652. </td>
  1653. </tr>
  1654. <tr>
  1655. <td colspan=2><hr size=2 width=100%></td>
  1656. </tr>
  1657. <tr>
  1658. <td colspan=2><br></td>
  1659. </tr>
  1660. <tr>
  1661. <td><br></td>
  1662. <td><input type=submit name=ISubmitTFO value="Submit">
  1663. <input type=button name=iCancelTFO value="Cancel" onClick="parent.location=' <?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&valueofKey=TFODescription&orderbyasdes=1&reftype=<?php echo $reftype;?>';">
  1664. <input type=button name=iCancel1TFO value="View All" onClick="parent.location=' <?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&valueofKey=TFODescription&orderbyasdes=1&reftype=<?php echo $reftype;?>';">
  1665. </td>
  1666. </tr>
  1667. <?php
  1668. }
  1669. elseif ($action_==81){
  1670. ?>
  1671. <tr>
  1672. <td colspan=2><b><i>Tax, Fee and Other Charges (DeActivate Mode)</i></b></td><!--&nbsp <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>><img src="/images/back1.gif" width=35 height=35/></a>-->
  1673. </tr>
  1674. <tr bgcolor="#EEEEEE">
  1675. <td colspan=2><br></td>
  1676. </tr>
  1677. <?php
  1678. $DtaRec = mysql_query("SELECT * FROM $tbl_current WHERE tfoid = '$tfoid' ",$link2db);
  1679. $numDtaRec=mysql_num_rows($DtaRec);
  1680. if ($numDtaRec==1){
  1681. $nTfo=mysql_fetch_array($DtaRec);
  1682. $nitfodescription=$nTfo[tfodesc];
  1683. $nitfoindicator=$nTfo[tfoindicator];
  1684. $nitfotype=$nTfo[taxfeetype];
  1685. $nilangtaon=$nTfo[or_print];
  1686. $nubert=$nTFO[counter];
  1687. $DBtype1=mysql_query("SELECT * FROM ebpls_buss_taxfeetype WHERE taxfeetype = $nitfotype ",$link2db);
  1688. if (mysql_affected_rows($link2db)==1 ){
  1689. $nDb1=mysql_fetch_array($DBtype1);
  1690. $ntypedesc=$nDb1[typedesc];
  1691. }
  1692. }
  1693. ?>
  1694. <tr>
  1695. <td width=15% valign=top>Description</td>
  1696. <td width=75%><input type=text name=itfodescription size=50 maxlength=80 value="<?php echo$nitfodescription;?>"></td>
  1697. </tr>
  1698. <tr>
  1699. <td width=15% valign=top>Type</td>
  1700. <td width=75%><select name=itfotype>
  1701. <?php
  1702. echo "<option value=$nitfotype SELECTED>$ntypedesc";
  1703. ?>
  1704. </select> &nbsp &nbsp &nbsp
  1705. <?php
  1706. if ($nitfoindicator == 1){ //!empty($nitfoindicator) and
  1707. ?>
  1708. <input type=checkbox name=itfoindicator value=1 CHECKED> Set as default
  1709. <?php
  1710. }
  1711. elseif ($nitfoindicator == 0) {
  1712. ?>
  1713. <input type=checkbox name=itfoindicator value=1 > Set as default
  1714. <?php
  1715. }
  1716. ?>
  1717. </td>
  1718. </tr>
  1719. <tr>
  1720. <td colspan=2><br></td>
  1721. </tr>
  1722. <tr>
  1723. <td colspan=2><hr size=2 width=100%></td>
  1724. </tr>
  1725. <tr>
  1726. <td colspan=2><br></td>
  1727. </tr>
  1728. <tr>
  1729. <td colspan=2 align=center><font color="#ff0033">Are you sure you want to deactivate this record??? [ <a href=<?php echo $PHP_SELF;?>?tfoid=<?php echo $tfoid;?>&actionDeleteTfo=Ok&part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&reftype=tfo&orderbyasdes=1>Yes</a> ] [ <a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&reftype=tfo&orderbyasdes=1>Cancel</a> ] </font></td>
  1730. </tr>
  1731. <?php
  1732. }
  1733. elseif ($action_==5){
  1734. ?>
  1735. <tr>
  1736. <td colspan=2><b><i>&nbsp;&nbsp;Master List of Taxes, Fees and Other Charges</i></b> <br> <br>
  1737. &nbsp;<!--To add new record click here.-->&nbsp;<input type=submit name=tfobut value='Add New Record'></td>
  1738. </tr>
  1739. <tr>
  1740. <td colspan=2 valign=top align=left><br>
  1741. <!--first table within a cell-->
  1742. <table width=100%>
  1743. <tr><td align=right colspan=5><!--<i>Legend Indicator: </i> <font color="#ff0033">0=Normal | 1=Default</font>--></td></tr>
  1744. <tr bgcolor="#EEEEEE">
  1745. <td width=5%>&nbsp;No.</td>
  1746. <td width=35%><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&valueofKey=TFODescription&orderbyasdes=<?php echo $orderbyasdes;?>&reftype=<?php echo $reftype;?>>Description</a></td>
  1747. <td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&valueofKey=TFODefault&orderbyasdes=<?php echo $orderbyasdes;?>&reftype=<?php echo $reftype;?>>Default/Minimum Amount</a></td>
  1748. <td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&valueofKey=TFOIndicator&orderbyasdes=<?php echo $orderbyasdes;?>&reftype=<?php echo $reftype;?>>Indicator</a></td>
  1749. <td width=10% align=center><a href=<?php echo $PHP_SELF;?>?part=<?php echo $part;?>&class_type=<?php echo $class_type; ?>&pref_type=Business&selMode=<?php echo $selMode;?>&action_=5&valueofKey=TFOType&orderbyasdes=<?php echo $orderbyasdes;?>&reftype=<?php echo $reftype;?>>Type</a></td>
  1750. <td width=20% align=center>Action</td>
  1751. </tr>
  1752. <?php
  1753. require 'setup/setting.php';
  1754. if(!isset($_GET['page'])){
  1755. $page = 1;
  1756. } else {
  1757. $page = $_GET['page'];
  1758. }
  1759. // Define the number of results per page
  1760. $max_results = $thIntPageLimit;
  1761. // Figure out the limit for the query based
  1762. // on the current page number.
  1763. $from = abs((($page * $max_results) - $max_results));
  1764. /*if ($valueofdesc=='desc') {
  1765. $searchsql = "SELECT * FROM $tbl_current where tfostatus='A' and tfoindicator!=3 ORDER BY tfodesc $ascdesc";
  1766. $ascdesc1=$ascdesc;
  1767. } else {
  1768. $searchsql = "SELECT * FROM $tbl_current where tfostatus='A' ORDER BY naturedesc $ascdesc1 limit $from, $max_results";
  1769. }
  1770. */
  1771. //$Dbresult=th_query($listmyid);
  1772. if (!empty($valueofKey)){
  1773. if ($valueofKey=='TFODescription'){
  1774. $searchsql = "SELECT * FROM $tbl_current where tfoindicator!=3 ORDER BY tfodesc $ascdesc limit $from, $max_results";
  1775. }
  1776. elseif ($valueofKey=='TFOIndicator'){
  1777. $searchsql = "SELECT * FROM $tbl_current where tfoindicator!=3 ORDER BY tfoindicator $ascdesc,tfodesc limit $from, $max_results";
  1778. }
  1779. elseif ($valueofKey=='TFOType'){
  1780. $searchsql = "SELECT * FROM $tbl_current where tfoindicator!=3 ORDER BY taxfeetype,tfodesc $ascdesc limit $from, $max_results";
  1781. }
  1782. elseif ($valueofKey=='TFODefault'){
  1783. $searchsql = "SELECT * FROM $tbl_current where tfoindicator!=3 ORDER BY defamt $ascdesc limit $from, $max_results";
  1784. }
  1785. }
  1786. else {
  1787. $searchsql = "SELECT * FROM $tbl_current ORDER BY tfodesc $ascdesc limit $from, $max_results";
  1788. }
  1789. $cntsql = "SELECT count(*) FROM $tbl_current where tfoindicator!=3";
  1790. include'nextpage.php';
  1791. /*
  1792. }
  1793. else {
  1794. // if ($orderbyasdes==0) {
  1795. $listmyid = "SELECT * FROM $tbl_current where tfostatus='A' and tfoindicator!=3 ORDER BY tfodesc $ascdesc";
  1796. // } else {
  1797. // $listmyid = "SELECT * FROM $tbl_current where tfostatus='A' and tfoindicator!=3 ORDER BY tfodesc desc";
  1798. // }
  1799. }
  1800. }
  1801. $Dbresult=th_query($listmyid);
  1802. while($dtarow = @mysql_fetch_array($Dbresult)){
  1803. $myrow++;
  1804. include'tablecolor-inc.php';
  1805. $defFormat=number_format($dtarow[defamt],2);
  1806. echo "<tr bgcolor=$varcolor>";
  1807. echo "<td valign=top>&nbsp;$myrow</td>";
  1808. echo "<td valign=top>$dtarow[tfodesc]</td>";
  1809. echo "<td valign=top align=right>$defFormat</td>";
  1810. if ($dtarow[tfoindicator]==0) {
  1811. $rindicator='Normal';
  1812. } else {
  1813. $rindicator='Default';
  1814. }
  1815. echo "<td valign=top align=center>$rindicator</td>";
  1816. switch ($dtarow[taxfeetype]){
  1817. case 1:$itypedesc='TAX'; break;
  1818. case 2:$itypedesc='FEE'; break;
  1819. case 3:$itypedesc='OTHERS'; break;
  1820. }
  1821. echo "<td valign=top align=center>$itypedesc</td>";
  1822. echo "<td valign=top align=center> <a href=$PHP_SELF?tfoid=$dtarow[tfoid]&action_=3&class_type=$class_type&pref_type=Business&actionID=1&part=$part&class_type=$class_type&selMode=$selMode&tfoaction=Edit>Edit</a> | <a href=$PHP_SELF?tfoid=$dtarow[tfoid]&class_type=$class_type&pref_type=Business&tfoaction=Delete&part=$part&selMode=$selMode&action_=5>DeActivate</a></td>";
  1823. echo "</tr>";
  1824. }*/
  1825. ?>
  1826. </table>
  1827. <!--end here-->
  1828. </td>
  1829. </tr>
  1830. <?php
  1831. }
  1832. ?>
  1833. <tr>
  1834. <td colspan=2 align=center>
  1835. <?php
  1836. $data_item=1;
  1837. include'tablemenu-inc.php';
  1838. ?>
  1839. </td>
  1840. </tr>
  1841. </table>
  1842. <?php
  1843. //mysql_close($thDbLink);
  1844. ?>
  1845. </form>
  1846. </body>
  1847. </html>