$exemptedfee = 0; } //end wopi } // end cango //sakit na ulo ko $gtp = mysql_query("update ebpls_business_enterprise_permit set active = 0 where\n\t\t\t\t\t\towner_id ='{$owner_id}' and business_id ='{$business_id}'"); // $gtp = mysql_query("update ebpls_business_enterprise_permit set active = 1 where // owner_id ='$owner_id' and business_id ='$business_id' order by for_year desc limit 1"); $yeary = $yearnow - 1; $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "owner_id ='{$owner_id}' and business_id ='{$business_id}'"); $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=1", "owner_id ='{$owner_id}' and business_id ='{$business_id}' and date_create like '{$yeary}%'"); $wil = UpdateQuery($dbtype, $dbLink, "tempassess", "active=0", "owner_id ='{$owner_id}' and business_id ='{$business_id}'"); $wil = UpdateQuery($dbtype, $dbLink, "tempassess", "active=1", "owner_id ='{$owner_id}' and business_id ='{$business_id}' and date_create like '{$yeary}%'"); //will create permit record $res = InsertQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "\n\t\t\t\t(business_id, owner_id, for_year,\n\t\t\t\tapplication_date,input_by, transaction, \n\t\t\t\tpaid, steps, pin, active)", "{$business_id}, {$owner_id},'{$yearnow}', \n\t\t\t\tnow(), '{$usern}', '{$stat}', \n\t\t\t\t0,'For Assessment', '{$pin}', 1"); ?> <body onload="alert('Assessment Process Completed'); parent.location='index.php?part=4&class_type=Permits&itemID_=1221&owner_id=<?php echo $owner_id; ?> &com=<?php echo $stat; ?> &permit_type=Business&stat=<?php echo $stat; ?> &business_id=<?php echo $business_id; ?> &busItem=Business';"></body>
} else { if ($getd[amtformula] != 'complex formula') { if ($chk1[0] != 1) { //use min if (!is_numeric($getd[amtformula])) { $formula_rep = str_replace("X0", $basis, strtoupper($getd[amtformula])); @eval("\$compval={$is_dec}{$formula_rep};"); } } else { $compval = $getd[amtformula]; } } else { //complex code //eval ("\$compval=$fr$ff$outamt$addcp;"); } $result = InsertQuery($dbtype, $dbLink, "tempassess", "(assid, owner_id, business_id, natureid, taxfeeid, \n\t\t\tmulti, amt, formula, compval, tfoid,active, transaction,date_create)", "{$varx},{$owner_id}, {$business_id},{$getn['0']},\n\t {$getd['taxfeeid']},{$basis},0,'{$getd['amtformula']}',{$compval},\n\t\t {$getd['tfoid']},1, '{$stat}',now()"); } } $gtotind = $gtotind + $totind; } if ($gettag[sassess] == '1') { $feecompute = 0; } $rt = $rt + $totind - $feecompute; $df = $df += 1; $varx++; $add2fee = $feecompute + $add2fee; $feecompute = ''; } //if ($PROCESS=='COMPUTE') { if ($tftnum == 4) {
<?php namespace Framework\Utilities; error_reporting(E_ALL); ini_set("display_errors", 1); include '../DatabaseFunctions.php'; echo "<h2>Testing DatabaseFunctions class</h2>"; /* Enter your database connection information. You should first import the sql file given in data folder */ $connection_information = array("host" => "localhost", "user" => "nadir", "password" => "kcbW5eFSCbPXbJGLHvUGG8T8", "database" => "dev_pakphp", "debug" => "2", "charset" => "utf8"); SelectQuery($connection_information); UpdateQuery($connection_information); InsertQuery($connection_information); //DeleteQuery($connection_information); /** * Used to select data from database * * @since 1.2.2 * @param array $connection_information an array with following keys: * host => the database host name * user => the database user * password => the database password * database => the database name * debug => the debug level it can be 0,1 or 2 * charset => utf8 */ function SelectQuery($connection_information) { /** The database connection details */ $parameters = $connection_information; /** The DatabaseFunctions object is created */
if ($stat == 'New') { if ($business_capital_investment != 0) { $oki = 1; } else { $oki = 0; } } else { if ($gross_sale != 0 || $business_capital_investment != 0) { $oki = 1; } else { $oki = 0; } } if ($oki == 12) { $getnat = addslashes($getnat); $saveit = InsertQuery($dbtype, $dbLink, $tempbiz, "(bus_code, bus_nature, cap_inv,\n last_yr, owner_id, business_id,\n active, transaction, recpaid, date_create)", "'{$_idx}', '{$getnat}', {$_cap},\n {$lastyr}, {$owner_id}, {$business_id},\n 1,'New','0',now()"); } } else { if ($PROCESS != 'SAVE') { ?> <!--<body onload='javascript:alert("Line Already Added");'></body>--><?php } } } } //editline } if ($business_id == '') { $business_id = 0; } //get bus nature
if ($haveaddpay == $watqtr) { $haveaddpay = ''; } //check if will bill @($howmanydec = $havemat / $getyr[counter]); $isdeci = strpos($howmanydec, "."); if ($isdeci > 0 and $haveaddpay == $watqtr) { // will not bill $getf[6] = 0; } if ($PROCESS != 'COMPUTE' and $haveaddpay != $watqtr) { $result = InsertQuery($dbtype, $dbLink, "tempassess", "(assid, owner_id, business_id, natureid, \n\t\t\t\t\t\t taxfeeid, multi, amt, formula, compval,\n\t\t\t\t tfoid,active, transaction,date_create)", "{$varx},{$owner_id}, {$business_id},'',\n\t\t\t\t\t '',1,{$getf['6']},'{$getf['6']}',{$getf['6']}, {$getf['0']},1,\n\t\t\t\t\t '{$stat}',now()"); $varx++; } if ($PROCESS == 'COMPUTE' and $haveaddpay == '' and $watqtr == '') { $result = InsertQuery($dbtype, $dbLink, "tempassess", "(assid, owner_id, business_id, natureid,\n taxfeeid, multi, amt, formula, compval,\n tfoid,active, transaction,date_create)", "{$varx},{$owner_id}, {$business_id},'',\n '',1,{$getf['6']},'{$getf['6']}',{$getf['6']}, {$getf['0']},1,\n '{$stat}',now()"); $varx++; } else { $geth = mysql_query("select * from tempassess where owner_id='{$owner_id}' and business_id='{$business_id}'\n\t\t\t\t\t\t\t\t\t\tand active=1 and tfoid='{$getf['0']}' order by date_create desc"); $getputa = mysql_fetch_assoc($geth); $getf[6] = $getputa[compval]; } } if ($itemID_ != 4212 and $usemin == '') { $geth = mysql_query("select * from tempassess where owner_id='{$owner_id}' and business_id='{$business_id}'\n\t\t\t\t\t\t\t\t\t\tand active=1 and tfoid='{$getf['0']}' order by date_create desc"); $getputa = mysql_fetch_assoc($geth); $getf[6] = $getputa[compval]; } ?> <tr><td width=50%><?php
$interestrate = $getpended[rateofinterest] * $d; } elseif ($getpended['inttype'] == '2') { while ($x <= $d) { $counter = $counter * $intrate; $x++; } $interestrate = $counter - 1; } if ($getpended['feeonly'] == '1') { $busint = $interestrate * $nTotalTax; } elseif ($getpended['feeonly'] == '2') { $busint = $interestrate * ($nTotalTax + $nTotalFee); } elseif ($getpended['feeonly'] == '3') { $busint = $interestrate * ($nTotalTax + $nTotalFee + $buspen); } $updatebus = UpdateQuery($dbtype, $dbLink, "bus_grandamt", "active = 0", "owner_id = '{$owner_id}' and business_id='{$business_id}' and ts != '{$yearnow1}'"); $ramt2 = round($ramt2, 2); $nTaxnFee = round($nTotalTax + $nTotalFee, 2); $nTotalTax = round($nTotalTax, 2); $buspen = round($buspen, 2); $busint = round($busint, 2); $nbacktax = round($nbacktax, 2); $divtax = round($divtax, 2); $totalexptax = round($totalexptax, 2); $totexemption = $grandamt * $getbusexempt1[tax_exemption] / 100; $totexemption = round($totexemption, 2); $busvalues = "'', '{$owner_id}', '{$business_id}', '{$nTaxnFee}', '{$buspen}', '{$busint}', '0', '{$nTotalTax}', '', '1', '{$stat}', '{$totexemption}', '{$yearnow1}', '{$pmode}', '{$robert}'"; $insertbus = InsertQuery($dbtype, $dbLink, "bus_grandamt", "", $busvalues); } } //}
if (strtolower($getit[0]) == 'quarterly') { $sendthis = "Due date for 1st Q is {$getnow['qtrdue1']},2nd Q is {$getnow['qtrdue2']}, 3rd Q is {$getnow['qtrdue3']},4th Q is {$getnow['qtrdue4']}"; } elseif (strtolower($getit[0]) == 'semi-annual') { $sendthis = "Due date for 1st sem is {$getnow['semdue1']},2nd sem is {$getnow['semdue2']}"; } elseif (strtolower($getit[0]) == 'annual') { $getdue1 = SelectDataWhere($dbtype, $dbLink, 'ebpls_buss_penalty', ""); $getnow = FetchRow($dbtype, $getdue); $sendthis = "Due date for this year is {$getnow['renewaldate']}"; } } elseif ($keyword == 'req') { } } } //send it $res = InsertQuery($dbtype, $dbLink, "sms_send", "", "'','{$cellnum}','{$sendthis}',1,now()"); $res = InsertQuery($dbtype, $dbLink, "sms_archive", "", "'','{$cellnum}','{$sendthis}',1,now()"); //flush $delsms = DeleteQuery($dbtype, $dbLink, "sms", "smsid<>0 order by smsid asc limit 1"); } if ($sendthis != '') { echo "Message:" . $sendthis . " has been sent to " . $celnum; } else { echo "No New Messages Found. Will Search Again"; } sleep(2); setUrlRedirect('sms_server.php'); ?>
&busItem=Occupational";'></body> <?php } } } } //end if occupational /* if ($owner_id=='') { $owner_id=$id; } */ if ($permit_type == 'Occupational' || $permit_type == 'Peddlers') { $totalvec = 1; } //need to add drop command $getcnt = SelectDataWhere($dbtype, $dbLink, $temptbl, "where owner_id={$owner_id}"); $cnts = NumRows($dbtype, $getcnt); // $lop=1; for ($lop = 1; $lop <= $cnts; $lop++) { $gettemp = SelectDataWhere($dbtype, $dbLink, $temptbl, "where owner_id={$owner_id} limit 1"); $getfee = FetchArray($dbtype, $gettemp); $slash = 'add'; require_once "includes/stripslash.php"; //insert fees to main table $fee_desc = addslashes($getfee[fee_desc]); $insertit = InsertQuery($dbtype, $dbLink, "ebpls_fees_paid", "(owner_id, fee_desc, fee_amount, \n\t\t\t\tmulti_by, permit_type, permit_status,\n\t\t\t\tinput_by, input_date)", "{$owner_id}, '{$fee_desc}', {$getfee['fee_amount']}, \n\t\t\t\t{$totalvec}, '{$permit_type}', '{$status}', \n\t\t\t\t'{$usern}', '{$tdate}'"); $deltemp = DeleteQuery($dbtype, $dbLink, $temptbl, "owner_id ={$owner_id} and \n\t\t\t\t\tpermit_type='{$permit_type}' limit 1"); } }
} $result = InsertQuery($dbtype, $dbLink, "tempassess", "(assid, owner_id, business_id, natureid, \r\n\t\t\t taxfeeid, multi, amt, formula, \r\n\t\t\t compval, tfoid, active, transaction)", "{$varx},{$owner_id}, {$business_id},{$getn['0']},\r\n\t\t {$getd['2']},{$xv},'{$getd['1']}','{$getd['1']}',{$compval}, {$getd['8']},\r\n\t\t\t 1, '{$stat}'"); } else { if ($getd[1] != 'complex formula') { if ($chk1[0] != 1) { //use min if (!is_numeric($getd[1])) { eval("\$compval={$d}({$xv}{$getd['1']};"); } } else { $compval = $getd[1]; } } else { eval("\$compval={$fr}{$ff}{$outamt}{$addcp};"); } $result = InsertQuery($dbtype, $dbLink, "tempassess", "(assid, owner_id, business_id, natureid, taxfeeid, \r\n\t\t\tmulti, amt, formula, compval, tfoid,active, transaction)", "{$varx},{$owner_id}, {$business_id},{$getn['0']},\r\n\t {$getd['2']},{$xv},0,'{$getd['1']}',{$compval}, {$getd['8']},1, '{$stat}'"); } } if ($gettag[sassess] == '1') { $feecompute = 0; } $rt = $rt + $totind - $feecompute; $df = $df += 1; $varx++; $add2fee = $feecompute + $add2fee; $feecompute = ''; } /* if ($gettag[sassess]=='') { $tftnum=4; }
$cango = 1; } $wopi++; } if ($cango == '1') { $wopi = 0; $ui = UpdateQuery($dbtype, $dbLink, "tempassess", "active = 0", "owner_id='{$owner_id}' and\n business_id='{$business_id}'"); while ($wopi < $gr) { $tempid = $tempbus[$wopi]; $lastyr = $gross[$wopi]; $getbus = SelectDataWhere($dbtype, $dbLink, "tempbusnature", "where tempid={$tempid}"); $getbu = FetchRow($dbtype, $getbus); $bus_code = $getbu[1]; $bus_nature = $getbu[2]; $oldlay = $getbu[4]; $result = InsertQuery($dbtype, $dbLink, "tempbusnature", "", "'', '{$bus_code}', '{$bus_nature}',{$lastyr},\n \t \t{$lastyr},{$owner_id},{$business_id}, now(),\n\t \t0, 1,'','{$stat}','0'"); $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "tempid='{$tempid}'"); $wopi++; } // end wopi } ?> <body onload="alert('Assessment Process Completed'); parent.location='index.php?part=4&newpred=1&noregfee=1&class_type=Permits&itemID_=4212&owner_id=<?php echo $owner_id; ?> &com=assess&permit_type=Business&stat=<?php echo $stat; ?> &business_id=<?php echo $business_id;
<?php if ($fishactive == 'Add') { /* if ($actcom<>'Delete') { $my = SelectDataWhere($dbtype,$dbLink,"fish_activity", "where owner_id=$owner_id and transaction = '$stat' and active = 1"); $my = NumRows($dbtype,$my); if ($my==0) { */ echo "'',{$fish_act},{$owner_id},{$qty}, '{$stat}',1"; $inact = InsertQuery($dbtype, $dbLink, "fish_assess", "", "'',{$fish_act},{$owner_id},{$qty}, '{$stat}',1"); // } // } } ?> <tr> <td align="center" valign="top" class='normal' colspan=4> <table cellspacing=0 cellpadding=0 border=1 width=60%><br> <tr> <td align="center" valign="top" class='header2' colspan=2> List of Fishery Activities </td> </tr> </table> <br> </tr> <table cellspacing=0 cellpadding=0 border=0 width=60%><br> <tr> <td width=150 align=right>Activity </td>
?> <title>SMS Sender </title> <div align = center> <table border=0> <td> </td> </table> </div> <?php $getsend = SelectDataWhere($dbtype, $dbLink, "sms_send", "where new_sms=1 limit 1"); $getcnt = NumRows($dbtype, $getsend); $smsid = $getit[0]; while ($getit = FetchRow($dbtype, $getsend)) { $smsid = $getit[0]; $tym = date('H:m:s'); $x = 1; echo "Sending Message: {$getit['2']} to {$getit['1']}<BR>"; $tym = date('H:m:s'); $mnum = $getit[1]; $mmsg = $getit[2]; $fileopened = fopen("textfile", "wb"); fwrite($fileopened, "To: {$mnum}\r\n\r\n"); fwrite($fileopened, "{$mmsg}"); fclose($fileopened); $nRand = rand(00, 99999); $copfile = shell_exec("cp textfile /home/site/gsm/outgoing/textfile{$nRand}"); sleep(2); $updateit = DeleteQuery($dbtype, $dbLink, "sms_send", "smsid={$smsid}"); $archiveit = InsertQuery($dbtype, $dbLink, "sms_archive", "", "'','{$mnum}','{$mmsg}',now()"); } setUrlRedirect("sms_sender.php");
<?php if ($reg_but == 'Save') { $chkboat = SelectDataWhere($dbtype, $dbLink, "fish_boat", " where boat_name='{$boat_name}'"); $chkboat = NumRows($dbtype, $chkboat); if ($chkboat == 1 and $editit != 1) { ?> <body onload='javascript:alert("Duplicate Boat Name Found");'></body> <?php } else { if ($editit != 1) { $insboat = InsertQuery($dbtype, $dbLink, "fish_boat", "", "'',{$owner_id},'{$boat_name}',\n\t\t\t\t\t\t'{$crew_num}','{$eng_type}',{$eng_cap},\n\t\t\t\t\t\t'{$reg_num}',now(),'{$usern}','',''"); } else { $upboat = UpdateQuery($dbtype, $dbLink, "fish_boat", "boat_name='{$boat_name}', crew='{$crew_num}',\n\t\t\t\t\t\tengine_type='{$eng_type}', engine_cap={$eng_cap},\n\t\t\t\t\t\treg_no='{$reg_num}', up_date=now(), \n\t\t\t\t\t\tup_by='{$usern}'", "boat_id={$boatid}"); } } } else { if ($fishcom == 'Edit') { $getr = SelectDataWhere($dbtype, $dbLink, "fish_boat", "where boat_id = {$boatid}"); $getb = FetchRow($dbtype, $getr); $editit = 1; } elseif ($fishcom == 'Delete') { $getd = DeleteQuery($dbtype, $dbLink, "fish_boat", "boat_id = {$boatid}"); $editit = ''; } } ?> <table cellspacing=0 cellpadding=0 border=1 width=60%> <tr>
<?php } else { //occu depolt $cntfee = SelectDataWhere($dbtype, $dbLink, "ebpls_fees_paid", "where permit_type='{$permit_type}' and \n\t\t\towner_id={$owner_id} and permit_status='{$stat}'"); $cntit = NumRows($dbtype, $cntfee); //load all defaults if ($cntit == 0) { $cntfee = SelectDataWhere($dbtype, $dbLink, $temptbl, "where owner_id={$owner_id}"); $cntit = NumRows($dbtype, $cntfee); if ($cntit == 0) { //get depolt $getdepolt = SelectMultiTable($dbtype, $dbLink, $fee, "fee_id, fee_desc, fee_amount", "where permit_type='{$stat}' and active=1"); while ($getfee = FetchRow($dbtype, $getdepolt)) { //foreach ($getfee as $field ) $getfee[1] = addslashes($getfee[1]); $insertfee = InsertQuery($dbtype, $dbLink, $temptbl, "(fee_id, fee_desc, fee_amount, \n\t\t\t permit_type, owner_id)", "{$getfee['0']}, '{$getfee['1']}',\n\t\t {$getfee['2']},'{$permit_type}', {$owner_id}"); } //while } //2nd cnt } $mfee = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "fee_paid_id, fee_desc, fee_amount", "where permit_type='{$permit_type}' and owner_id={$owner_id} \n\t\t\tand permit_status='{$stat}'"); while ($getfee = FetchRow($dbtype, $mfee)) { print "<tr>\n"; foreach ($getfee as $field) { print "<td> {$field} </td>\n"; } print "</tr>\n"; } $mfee = SelectMultiTable($dbtype, $dbLink, $temptbl, "fee_id, fee_desc, fee_amount", "where permit_type='{$permit_type}'\n\t\t and owner_id={$owner_id}"); while ($getfee = FetchRow($dbtype, $mfee)) {
Modication History: 2008.05.06 RJC Define undefined to clean up phperror.log */ require_once "includes/variables.php"; $PROCESS = isset($PROCESS) ? $PROCESS : ''; //2008.05.06 define undefined $com = isset($com) ? $com : ''; if ($com != 'approve') { // process successful if ($PROCESS == 'SAVE' || $PROCESS == 'PAYMENT') { $dec_comment = addslashes($dec_comment); $getapp = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_approve", "where owner_id = {$owner_id} and \n\t\t\t\t business_id={$business_id}"); $getnum = NumRows($dbtype, $getapp); if ($getnum == 0) { $savedata = InsertQuery($dbtype, $dbLink, "ebpls_buss_approve", "", "'',{$owner_id}, {$business_id}, {$decide}, \n\t\t\t\t '{$dec_comment}', '{$stat}'"); } else { $updata = UpdateQuery($dbtype, $dbLink, "ebpls_buss_approve", "decision={$decide},dec_comment='{$dec_comment}', \n\t\t\t\t transaction='{$stat}'", "owner_id = {$owner_id} and business_id={$business_id}"); } if ($decide == 1) { $updateit = UpdateQuery($dbtype, $dbLink, $permittable, "steps='For Payment'", "owner_id={$owner_id} and business_id={$business_id}"); } if ($PROCESS == 'PAYMENT' and $decide == 1) { ?> <body onload="parent.location='index.php?part=4&newpred=<?php echo $newpred; ?> &noregfee=<?php echo $noregfee; ?> &class_type=Permits&itemID_=2212&owner_id=<?php
$luk = SelectDataWhere($dbtype, $dbLink, $permittable, " \n\t\t\t\towner_id={$owner_id} and \n\t\t\t\tbusiness_id={$business_id} \n\t\t\t\tand active=1 and transaction='ReNew'"); $luk = NumRows($luk); if ($luk == 0) { $res = InsertQuery($dbtype, $dbLink, $permittable, "\n\t\t\t\t(business_id, owner_id, for_year,\n\t\t\t\tapplication_date,input_by, transaction, \n\t\t\t\tpaid, steps, pin, active)", "{$business_id}, {$owner_id},'{$currdate['year']}', \n\t\t\t\tnow(), '{$usern}', '{$stat}', \n\t\t\t\t0,'For Assessment', '{$pin}', 1"); } $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "tempid=" . $tempid); $bp = UpdateQuery($dbtype, $dbLink, $permittable, "active=0", "owner_id={$owner_id} and business_id={$business_id}\n\t\t\tand active=1"); $clr = 1; } elseif ($stat == 'Retire') { $wil = InsertQuery($dbtype, $dbLink, "tempbusnature", "", "'', '{$bus_code}', '{$bus_nature}',{$oldlay},\n {$lay},{$owner_id}, {$business_id}, now(),\n 0, 1,2,'Retire'"); $updatepermit = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "pmode='{$pmode}'", "owner_id={$owner_id} and \n\t\t\tbusiness_id={$business_id} order by \n\t\t\tbusiness_permit_id desc limit 1"); $wil3 = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise", "business_payment_mode='Annual'", "owner_id={$owner_id} and business_id={$business_id}"); $luk = SelectDataWhere($dbtype, $dbLink, $permittable, " where \n\t\t\towner_id={$owner_id} and business_id={$business_id}\n and active=1 and transaction='Retire'"); $luk = NumRows($luk); if ($luk == 0) { $res = InsertQuery($dbtype, $dbLink, $permittable, "(business_id, owner_id, for_year,\n\t\t\tapplication_date,input_by, transaction, \n\t\t\tpaid, steps, pin, active)", "{$business_id},{$owner_id},'{$currdate['year']}', \n\t\t\tnow(), '{$usern}', '{$stat}', \n\t\t\t0,'For Assessment', '{$pin}', 1"); } $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "tempid=" . $tempid); $bp = UpdateQuery($dbtype, $dbLink, $permittable, "active=0", "owner_id={$owner_id} and business_id={$business_id}\n and active=1"); $clr = 1; } if ($clr == 1) { $dt = DeleteQuery($dbtype, $dbLink, "tempassess", "owner_id={$owner_id} and business_id={$business_id}\n\t\t\tand active=1 and transaction='{$stat}'"); ?> <body onLoad='javascript: opener.location.reload(true); window.close()'></body> <?php } } ?>
$owner_id = $ownerID; require_once "includes/form_add_mtoppermit.html"; require_once "includes/form_add_midoccu.php"; } else { $owner_id = $ownerID; require_once "includes/form_add_mtoppermit.html"; require_once "includes/form_add_middlepermit.php"; } if ($permit_type != 'Business') { require_once "includes/mtop.php"; } } } elseif ($com == 'RenewVeh') { $nmkyear = date('Y'); $deleteexist = @mysql_query("delete from renew_vehicle where owner_id='{$owner_id}' and motorized_motor_id = '{$mid}' and date_updated like '{$nmkyear}%'"); $insrenewveh = InsertQuery($dbtype, $dbLink, "renew_vehicle", "", "'','{$owner_id}', '{$mid}','0', '{$usern}',now()"); $updaterenewveh = UpdateQuery($dbtype, $dbLink, $vehicle, "retire=4, transaction='ReNew'", "motorized_motor_id={$mid}"); require_once "includes/form_add_mtoppermit.html"; require_once "includes/form_add_middlepermit.php"; require_once "includes/mtop.php"; } elseif ($com == 'Edit') { $getown = SelectMultiTable($dbtype, $dbLink, $owner, "owner_first_name, owner_middle_name,\n\t\t\t owner_last_name, owner_gender", "where owner_id={$owner_id}"); $res = FetchRow($dbtype, $getown); $owner_first_name = $res[0]; $owner_middle_name = $res[1]; $owner_last_name = $res[2]; $owner_gender = $res[3]; $buttag = 'Save'; $buttag1 = 'Cancel'; $slash = 'update'; require_once "includes/stripslash.php";
$ort = FetchArray($dbtype, $ort); $totpaid = $amtchange[0]; $amtchange = $totpay - $amtchange[0]; $orno = $ort[or_no]; //please populate ACCOUNT CODES $getmax = SelectDataWhere($dbtype, $dbLink, "ebpls_transaction_payment_or", ""); $or = NumRows($dbtype, $getmax); $or = $or + 1; $trans_id = $owner_id; $payment_code = $orno; $payment_id = 0; $tax_fee_code = 'taxcode'; $account_code = 'acntcode'; $account_desc = 'acnt desc'; $insertor = InsertQuery($dbtype, $dbLink, "ebpls_transaction_payment_or", "\n (or_no, payment_code, trans_id,or_date,total_amount_due,\n total_amount_less,total_amount_paid,ts_create,payment_officer)", "'{$or}','{$payment_code}', {$trans_id}, now(), {$totpaid},\n {$amtchange}, {$totpaid}, now(),'{$usern}'"); $insertdetails = InsertQuery($dbtype, $dbLink, "ebpls_transaction_payment_or_details", "(or_no,trans_id, payment_id, tax_fee_code,\n account_code, account_nature, account_desc, \n\t\t\t\tamount_due, ts, permit_type)", "'{$or}',{$trans_id}, {$payment_id}, '{$tax_fee_code}',\n '{$account_code}','CREDIT', '{$account_desc}', {$totpaid},\n\t\t\t\tnow(), '{$permit_type}'"); $updatepaid = UpdateQuery($dbtype, $dbLink, "temppayment", "status = 0", "owner_id = {$owner_id} and \n\t\t\t\tpermit_type='{$permit_type}'"); $addpay = ''; } } } $addpay = isset($addpay) ? $addpay : ''; //2008.05.06 $cmd = isset($cmd) ? $cmd : ''; if ($com != 'cash' and $com != 'check' and $com != 'reassess' and $com != 'Select' and $com != 'Edit' and $com != 'Delete' and $com != 'ReNew' and $addpay != 'Compute' and $cmd != 'delete') { // process successful $PROCESS = isset($PROCESS) ? $PROCESS : ''; //2008.05.06 if ($PROCESS == 'SAVE') { if ($permit_type == 'Business') { $ext = ' and business_id=' . $business_id;
if ($owner_id == '') { $checksame = SelectDataWhere($dbtype, $dbLink, $dtable, "where fee_desc='{$feedesc}' and\n\t\t\t\tpermit_type='{$ptype}'"); $chks = NumRows($dbtype, $checksame); if ($chks > 0) { ?> <body onLoad='javascript:alert ("Duplicate Entry. Cannot Save");'></body> <?php // print "<td align=right><font color=red>Duplicat</font></td>"; // print "<td align=left><font color=red>e Entry. Cannot Save</font></td>"; } else { $feedesc = addslashes($feedesc); if ($feet == "Motorized") { $result = InsertQuery($dbtype, $dbLink, $dtable, "(fee_desc, fee_amount, lastupdatedby, \n\t\t\t\t\t\tlastupdated, permit_type, nyears)", "'{$feedesc}', {$feeamount},'{$usern}', now(), '{$ptype}', '{$MFees}'"); $MFees = ""; } else { $result = InsertQuery($dbtype, $dbLink, $dtable, "(fee_desc, fee_amount, lastupdatedby, \n\t\t\t\t\t\tlastupdated, permit_type)", "'{$feedesc}', {$feeamount},'{$usern}', now(), '{$ptype}'"); } $feet = ""; $owner_id = ""; $feedesc = ""; $feeamount = ""; $ptype = ""; $com = ""; ?> <body onLoad='javascript:AddRec();'></body> <?php } } else { if ($feet == "Motorized") { $result = UpdateQuery($dbtype, $dbLink, $dtable, "fee_desc='{$feedesc}', fee_amount = {$feeamount}, lastupdatedby='{$usern}',\n\t\t\t lastupdated=now(), permit_type='{$ptype}', nyears = '{$MFees}'", "fee_id = '{$owner_id}'"); $MFees = "";
$insnew = InsertQuery($dbtype, $dbLink, "culture_fee", "", "'','{$culture_type}', {$fee_type}, '{$formamt}',\n\t \t {$constamt},now(),'{$uom}','ReNew',1"); $culture_renew = mysql_insert_id(); } else { $insnew = InsertQuery($dbtype, $dbLink, "culture_fee", "", "'','{$culture_type}', {$fee_type}, '{$formamt}',\n\t \t {$constamt},now(),'{$uom}','{$ptype}',1"); $culture_new = mysql_insert_id(); } } while ($i < $no_range) { if ($fishadd == 'Update') { $insnew = UpdateQuery($dbtype, $dbLink, "culture_range", "range_lower={$rangelow[$i]},\n range_higher={$rangehigh[$i]},\n amt={$amt[$i]}", "fee_id={$feeid[$i]}"); } else { if ($userenew == true) { $insnew = InsertQuery($dbtype, $dbLink, "culture_range", "", "'',{$culture_new},{$rangelow[$i]},\n\t\t\t\t\t\t{$rangehigh[$i]},{$amt[$i]}"); $insrenew = InsertQuery($dbtype, $dbLink, "culture_range", "", "'',{$culture_renew},{$rangelow[$i]},\n \t{$rangehigh[$i]},{$amt[$i]}"); } else { $insnew = InsertQuery($dbtype, $dbLink, "culture_range", "", "'',{$culture_new},{$rangelow[$i]},\n \t {$rangehigh[$i]},{$amt[$i]}"); } } $i = $i += 1; } } //woki=1 } //woki=2 } if ($notwoki != 1) { $updateit = ''; $ftag = 'Save'; $chkread = 'checkbox'; } } elseif ($searchfee == 'Search') {
//if ($owner_id<>'' and $business_id<>'') { $ic = 0; $col1 = 0; $getreq = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_requirements", "where recstatus='A' and reqindicator='1' and permit_type='Business'"); $gt = NumRows($dbtype, $getreq); while ($ic < $gt) { while ($getr = FetchRow($dbtype, $getreq)) { $ic++; if ($col1 == 0) { include 'tablecolor-inc.php'; print "<tr bgcolor='{$varcolor}'>\n"; } $check1 = SelectDataWhere($dbtype, $dbLink, "havereq", " where owner_id={$owner_id}\n \tand business_id={$business_id} \n\t\t\t\t\tand reqid={$getr['0']}"); $hreq = NumRows($dbtype, $check1); if ($hreq == 0) { $insertreq = InsertQuery($dbtype, $dbLink, "havereq", "", "'', {$getr['0']}, {$owner_id}, {$business_id},0"); $ch = 'UNCHECKED'; $gethr[4] = 0; } else { $gethr = FetchRow($dbtype, $check1); if ($gethr[4] == 1) { $ch = 'CHECKED'; } else { $ch = 'UNCHECKED'; } } $getr[1] = stripslashes($getr[1]); print "\t\n\t\t\t\t<td align=right width=5%><input type=hidden name=colre[{$ic}] \n\t\t\t\tvalue={$getr['0']}>  \n\t\t\t\t<input type=checkbox name=x[{$ic}] {$ch}></td><td align=left width=23%>{$getr['1']}\n\t\t\t\t</td>"; $col1 = $col1 + 1; $arr_id[$i++] = $ic; if ($col1 > 1) {
//$dbLink = get_db_connection(); global $ThUserData; require_once "includes/variables.php"; include "lib/multidbconnection.php"; $dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname); if ($msgid == '') { $msgid = 0; } if ($savebt == 'SAVE') { if ($keyword != null and $message != null) { $keyword = strtolower(addslashes($keyword)); $message = trim(addslashes($message)); if ($com == 'editsms') { $result = UpdateQuery($dbtype, $dbLink, "sms_message", "keyword='{$keyword}', full_message='{$message}',\r\n\t\t\t\t\tdateupdated=now(),updateby='{$usern}'", "msgid={$msgid}"); } else { $result = InsertQuery($dbtype, $dbLink, "sms_message", "", "'','{$keyword}','{$message}',now(),'{$usern}'"); } $msgid = 0; $keyword = ''; $message = ''; } } if ($com == 'deletesms') { $result = DeleteQuery($dbtype, $dbLink, "sms_message", "msgid={$msgid}"); $msgid = 0; } elseif ($com == 'editsms') { $getmsg = SelectDataWhere($dbtype, $dbLink, "sms_message", "where msgid={$msgid}"); $getmsg = mysql_fetch_row($getmsg); } ?> <script language='Javascript' src='javascripts/default.js'></script>
$ftag = 'Update'; } else { $ftag = 'Save'; } } $i = 0; if ($woki == 1) { while ($i < $no_range) { if ($updateit == '1') { $insnew = UpdateQuery($dbtype, $dbLink, "boat_fee", "boat_type='{$boat_type}',\n range_lower={$rangelow[$i]},\n range_higher={$rangehigh[$i]},\n unit_measure='{$uom}',\n amt={$amt[$i]}, transaction = '{$ptype}'", "fee_id={$feeid[$i]}"); } else { if ($userenew == true) { $insnew = InsertQuery($dbtype, $dbLink, "boat_fee", "", "'','{$boat_type}',{$rangelow[$i]},\n\t\t\t\t\t\t\t{$rangehigh[$i]},'{$uom}',{$amt[$i]},'New',1,3"); $insrenew = InsertQuery($dbtype, $dbLink, "boat_fee", "", "'','{$boat_type}',{$rangelow[$i]},\n\t {$rangehigh[$i]},'{$uom}',{$amt[$i]},'ReNew',1,3"); } else { $insnew = InsertQuery($dbtype, $dbLink, "boat_fee", "", "'','{$boat_type}',{$rangelow[$i]},\n\t \t {$rangehigh[$i]},'{$uom}',{$amt[$i]},'{$ptype}',1,3"); } } $i++; } if ($updateit == '1') { ?> <body onload='UpRec();parent.location="index.php?part=4&class_type=Preference&selMode=ebpls_nboatfees&permit=others&action_=8&itemEvent=1&data_item=0&orderbyasdes=1"';></body> <?php } else { ?> <body onload='AddRec();parent.location="index.php?part=4&class_type=Preference&selMode=ebpls_nboatfees&permit=others&action_=8&itemEvent=1&data_item=0&orderbyasdes=1";'></body> <?php } $boat_type = ''; $uom = '';
} } $updatebiz = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "paid=1", "owner_id={$owner_id} \n\t\t\t\tand business_id={$business_id}"); $insertdetails = InsertQuery($dbtype, $dbLink, "ebpls_transaction_payment_or_details", "(\n or_no,trans_id , payment_id, tax_fee_code,\n\t account_code, account_nature, account_desc, \n\t\t\t\tamount_due, ts,payment_part, or_entry_type, \n\t\t\t\tlinepaid, nat_id, transaction,permit_type)", "'{$ctl_no}',{$trans_id}, {$payment_id}, '{$tax_fee_code}',\n\t '{$account_code}', 'CREDIT', '{$account_desc}' , {$amtpay}, \n\t\t\t\tnow(),'{$pay_mode}','{$cmd}','{$linepaid}', \n\t\t\t\t{$nat_id}, '{$istat}', 'Business'"); $updateit = UpdateQuery($dbtype, $dbLink, $permittable, "steps='For Releasing'", "owner_id={$owner_id} and business_id={$business_id}"); // save fees paid $gettag = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", ""); $gettag = FetchArray($dbtype, $gettag); if ($gettag[sassess] == '') { //check if have rec $chkit = SelectDataWhere($dbtype, $dbLink, "bus_fees_paid", "where owner_id={$owner_id} and \n\t\t\t\t\t\tbusiness_id={$business_id}"); $chkit = NumRows($dbtype, $chkit); if ($chkit == 0) { $getfee = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_tfo", "where\ttfoindicator=1 and \n\t\t\t\t\t\ttaxfeetype!=1 and tfostatus='A'"); while ($getf = FetchRow($dbtype, $getfee)) { $insit = InsertQuery($dbtype, $dbLink, "bus_fees_paid", "''", "'',{$owner_id}, {$business_id},\n\t\t\t\t\t\t{$getf['0']}, {$getf['6']},now())"); } } } $updatebusnature = UpdateQuery($dbtype, $dbLink, "tempbusnature", "linepaid=5,recpaid=1", "owner_id={$owner_id} and business_id={$business_id} and active='1'"); ?> <body onunload='opener.location.reload(true); ' onLoad='window.open("ebplsreceipt.php?owner_id=<?php echo $owner_id; ?> &business_id=<?php echo $business_id; ?> &or_no=<?php echo $or_no; ?> &cn=<?php