<?php require_once "lib/ebpls.lib.php"; require_once "lib/ebpls.utils.php"; require_once "ebpls-php-lib/utils/ebpls.search.funcs.php"; //--- get connection from DB global $ThUserData; //$permit_type = 'Business'; require_once "includes/variables.php"; include_once "lib/multidbconnection.php"; $dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname); $result = SelectMultiTable($dbtype, $dbLink, "{$owner}, ebpls_business_enterprise", " concat({$owner}.owner_first_name,' ', {$owner}.owner_middle_name, \r\n\t\t\t' ', {$owner}.owner_last_name) as full,\r\n ebpls_business_enterprise.business_name, \r\n\t\t\tebpls_business_enterprise.business_payment_mode", "where {$owner}.owner_id={$owner_id} and \r\n\t\t\tebpls_business_enterprise.owner_id={$owner_id} and\r\n ebpls_business_enterprise.business_id={$business_id}"); $list = FetchRow($dbtype, $result); ?> <link rel="stylesheet" href="stylesheets/default.css" type="text/css"/> <script language='Javascript' src='javascripts/default.js'></script> <div align="CENTER"> <!---// start of the table //--> <br> <table border=0 cellspacing=0 cellpadding=0 width='90%'> <tr><td align="center" valign="center" class='titleblue' width='90%'> Assessment for <?php echo ucfirst($permit_type); ?> Permit</td></tr> <tr><td align="center" valign="center" class='normal' height=10> </td></tr> <tr> <td align="center" valign="center" class='normal'> <form name="_FRM" method="POST" action='index.php?part=4&class_type=Permits&itemID_=4212&owner_id=<?php echo $owner_id; ?>
$pdf->Cell(80, 5, $resulta[busadd], 1, 0, 'L'); $getline = mysql_query("select * from tempbusnature a\n\t\t\t\t\t\t\t\t where a.owner_id='{$resulta['owner_id']}' and\n\t\t\t\t\t\t\t\t a.business_id='{$resulta['business_id']}' and a.active=1\n\t\t\t\t\t\t\t\t "); /*-------------------------------------------------------------------------------- frederick >>> found out that this script is located below/after the $getcap query This is the reason why the array $getl[bus_code] resulted empty and the capital investment did not appear in the report, therefore, this has been moved here: */ $getl = mysql_fetch_assoc($getline); //---------------------------------------------------------------------------------- $getcap = mysql_query("select * from tempbusnature a\n\t\t\t\t\t\t\t\t where a.owner_id='{$resulta['owner_id']}' and\n\t\t\t\t\t\t\t\t a.business_id='{$resulta['business_id']}' and a.bus_code='{$getl['bus_code']}'\n\t\t\t\t\t\t\t\t order by tempid"); $getcap = mysql_fetch_assoc($getcap); $totcap = $totcap + $getcap[cap_inv]; $totgross = $totgross + $getl[last_yr]; $pdf->Cell(30, 5, number_format($getcap[cap_inv], 2), 1, 0, 'R'); $pdf->Cell(30, 5, number_format($getl[last_yr], 2), 1, 0, 'R'); $getcas = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_or a,\n ebpls_transaction_payment_or_details b", "a.payment_code, a.or_date", "where a.or_no=b.or_no and b.trans_id={$resulta['owner_id']} and\n b.or_entry_type='CASH' and\n b.payment_id={$resulta['business_id']} and b.transaction='{$resulta['transaction']}' order by a.or_no desc"); $getcash = FetchArray($dbtype, $getcas); $pdf->Cell(40, 5, $getcash[payment_code] . "/" . substr($getcash[or_date], 0, 11), 1, 0, 'C'); $pdf->Cell(25, 5, substr($resulta[application_date], 0, 11), 1, 0, 'C'); $pdf->Cell(10, 5, $resulta[transaction], 1, 1, 'C'); $i++; } /* $i = 1; $pdf->SetY($Y_Table_Position); while ($i < $number_of_rows) { $pdf->SetX(1); $pdf->MultiCell(349,5,$i,1); $i = $i +1; } */
//2008.05.06 if ($mtopsearch == 'SEARCH') { //search existing require_once "includes/release_search.php"; } elseif ($com == 'PrintReport') { //verify if already have a permit code if ($permit_type != 'Business') { $vericode = SelectMultiTable($dbtype, $dbLink, $permittable, "released,{$incode}", "where owner_id = {$owner_id} and active=1 limit 1"); } else { $vericode = SelectMultiTable($dbtype, $dbLink, $permittable, "released,{$incode}", "where owner_id = {$owner_id} and \n\t\t\t business_id={$business_id} and active = 1 limit 1"); } $veri = FetchRow($dbtype, $vericode); if ($veri[0] == '0' || $veri[0] == '') { //assign new code //get format of permit $getcod = SelectMultiTable($dbtype, $dbLink, "permit_templates", "permit_header, permit_date, permit_sequence", "where permit_type='{$permit_type}'"); $getcode = FetchRow($dbtype, $getcod); //check if have other permit last year //get setting $rr = mysql_query("select * from ebpls_buss_preference"); $rt = mysql_fetch_assoc($rr); $ry = $rt["iReset"]; if ($ry == '1') { $getpyr = mysql_query("select * from {$permittable} order by {$incode} desc"); $gt = mysql_fetch_assoc($getpyr); $anoba = $gt["for_year"]; if ($anoba == date('Y')) { //get total number of permit released $curyr = date('Y'); $gettotal = SelectDataWhere($dbtype, $dbLink, $permittable, "where released = 1 and for_year = '{$curyr}'"); $gettot = NumRows($dbtype, $gettotal);
"> <input type=hidden name=noregfee value="<?php echo $noregfee; ?> "> <th>Trans Type</th> <th>Payment Mode</th> <th>Payment Status</th> </tr> <?php /* if ($owner_id=='') { $owner_id=$own_id; } */ $getdata = SelectMultiTable($dbtype, $dbLink, "ebpls_business_enterprise a, \n\t\t\t\tebpls_business_enterprise_permit b, {$owner} c", "a.business_payment_mode, b.paid, \n\t\t\tconcat(c.owner_last_name,',',c.owner_first_name,' ',c.owner_middle_name)\n\t\t\tas fullname, concat(c.owner_house_no,\n\t\t\tc.owner_street,c.owner_barangay_code,\n\t\t\tc.owner_zone_code,c.owner_district_code,\n\t\t\tc.owner_city_code,c.owner_province_code,\n\t\t\tc.owner_zip_code) as address, c.owner_gender,\n\t\t\tc.owner_phone_no, a.business_name, \n\t\t\tconcat(a.business_lot_no,' ', a.business_street,' ', \n\t\t\ta.business_barangay_code,' ', a.business_zone_code,' ', \n\t\t\ta.business_barangay_name,' ', a.business_district_code,' ', \n\t\t\ta.business_city_code,' ', a.business_province_code,' ', \n\t\t\ta.business_zip_code) as bizadd,b.transaction", "where a.owner_id = b.owner_id and a.business_id = b.business_id and \n\t\t\tc.owner_id={$owner_id} and\n\t\t\ta.owner_id = {$owner_id} and a.business_id = {$business_id} and \n\t\t\tb.transaction='{$stat}' and b.active=1"); $getid = FetchRow($dbtype, $getdata); $pmode = $getid[0]; $getdata = mysql_query("select * from ebpls_owner a, ebpls_barangay b, ebpls_zone c,\n\t\t\t\t\t\tebpls_district d, ebpls_city_municipality e, ebpls_province f,\n\t\t\t\t\t\tebpls_zip g where owner_id = {$owner_id} and a.owner_barangay_code=b.barangay_code and\n\t\t\ta.owner_zone_code=c.zone_code and a.owner_district_code=d.district_code and\n\t\t\ta.owner_city_code=e.city_municipality_code and a.owner_province_code=f.province_code and\n\t\t\ta.owner_city_code=g.upper"); $getda = FetchArray($dbtype, $getdata); if ($getda[zone_desc] == '') { $getdata = mysql_query("select * from ebpls_owner a, ebpls_barangay b, \n\t\t\t\t\t\tebpls_district d, ebpls_city_municipality e, ebpls_province f,\n\t\t\t\t\t\tebpls_zip g where owner_id = {$owner_id} and a.owner_barangay_code=b.barangay_code and\n\t\t\t a.owner_district_code=d.district_code and\n\t\t\ta.owner_city_code=e.city_municipality_code and a.owner_province_code=f.province_code and\n\t\t\ta.owner_city_code=g.upper"); $getda = FetchArray($dbtype, $getdata); } $add = "{$getda['owner_street']} {$getda['barangay_desc']} {$getda['zone_desc']}, {$getda['district_desc']} \n\t\t{$getda['city_municipality_desc']}, {$getda['province_desc']}, {$getda['zip_code']}"; $getdata = mysql_query("select * from ebpls_business_enterprise a, ebpls_barangay b, ebpls_zone c,\n\t\t\t\t\t\tebpls_district d, ebpls_city_municipality e, ebpls_province f,\n\t\t\t\t\t\tebpls_zip g where owner_id = {$owner_id} and a.business_id='{$business_id}'\n\t\t\t\t\t\tand a.business_barangay_code=b.barangay_code and\n\t\t\ta.business_zone_code=c.zone_code and a.business_district_code=d.district_code and\n\t\t\ta.business_city_code=e.city_municipality_code and a.business_province_code=f.province_code and\n\t\t\ta.business_city_code=g.upper"); $getda = FetchArray($dbtype, $getdata); if ($getda[zone_desc] == '') { $getdata = mysql_query("select * from ebpls_business_enterprise a, ebpls_barangay b, \n\t\t\t\t\t\tebpls_district d, ebpls_city_municipality e, ebpls_province f,\n\t\t\t\t\t\tebpls_zip g where owner_id = {$owner_id} and a.business_id='{$business_id}'\n\t\t\t\t\t\tand a.business_barangay_code=b.barangay_code and\n\t\t\t a.business_district_code=d.district_code and\n\t\t\ta.business_city_code=e.city_municipality_code and a.business_province_code=f.province_code and\n\t\t\ta.business_city_code=g.upper"); $getda = FetchArray($dbtype, $getdata); }
<!-- <html> <head> <link rel="stylesheet" href="stylesheets/default.css" type="text/css"/> </head> <body> <br> <div align='center'> <?php if ($owner_id == '') { $owner_id = 0; } $getemp = SelectMultiTable($dbtype, $dbLink, $permittable, "occ_permit_code, occ_permit_application_date,\r\n occ_position_applied, occ_employer,occ_employer_trade_name,\r\n occ_employer_lot_no, occ_employer_street, business_id", "where owner_id={$owner_id} and active=1"); $getit = FetchRow($dbtype, $getemp); $permit_code = $getit[0]; $pos_app = $getit[2]; $permit_date = $getit[1]; $employer_name = $getit[3]; $trade_name = $getit[4]; $street = $getit[6]; $lot_no = $getit[5]; ?> <form name="_FRM" method="POST" action="index.php?part=1221&owner_id=<?php echo $owner_id; ?> &permit_type=Occupational&stat=<?php echo $status; ?> &create=No&addfee=Add">--> <form method=post action ='index.php?part=4&class_type=Permits&itemID_=1221&addfee=Add&owner_id=<?php
?> ,0,0,'<?php echo $getcheck[13]; ?> ')"><font color=blue>View Payment Details</font></a> <?php } ?> </td> <tr> <?php $totscheck = $totscheck + $getcheck[3]; $s++; } } $getclear = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_check a, \n\t\t\tebpls_transaction_payment_or b,\n ebpls_transaction_payment_or_details c", "sum(a.check_amount)", "where a.or_no=b.or_no and a.or_no=c.or_no and b.or_no=c.or_no and\n c.or_entry_type='CHECK' and a.check_status='CLEARED' and\n\t\t\tc.transaction='{$istat}' and\n c.trans_id={$owner_id} and c.payment_id={$business_id}"); $totcheck = FetchRow($dbtype, $getclear); print "<tr><br></tr>"; $totchecknf = number_format($totscheck, 2); print "<tr><td></td><td></td><td align=right>Total Check Payment:</td><td align=right>{$totchecknf}</td></tr>"; $totpay = $totcash + $totscheck; ?> </table> <table border =0 align=left class=sub> <tr><td></td><td>Total Payments Made:</td><td><font color=red><b>Php <?php echo number_format($totpay, 2); ?> <b></font></td><td></td> </table> <?php
$nConstant->InsertNewTaxFee($sValues); } elseif ($Indicator == 2) { //formula $nFormula = new TaxFee(); if ($Fmode == 1) { //Normal formula $sValues = "'',{$natureid}, {$tfotype}, {$Basis},\n {$Indicator},{$Fmode},'{$AmountFormula}',now(),\n {$TaxType},'{$uom}',{$MinAmount}"; $nFormula->InsertNewTaxFee($sValues); } elseif ($Fmode == 2) { $sValues = "'',{$natureid}, {$tfotype}, {$Basis},\n {$Indicator},{$Fmode},'{$orig_complex}',now(),\n {$TaxType},'{$uom}',{$MinAmount}"; $nFormula->InsertNewTaxFee($sValues); $added = 1; $tax_fee_id = $nFormula->outid; //save to complex $loop = 0; $staxfee = SelectMultiTable($dbtype, $dbLink, "ebpls_buss_preference", "sassess", ""); $prefset = FetchArray($dbtype, $staxfee); $sassesscomplex = $prefset['sassess']; // per estab $rrc = mysql_query("select * from ebpls_buss_complex where\n \t\t\t\tcomplex_taxfeeid='{$aTAXFEEid}' order by var_complex"); $howmanycomplex = mysql_num_rows($rrc); if ($sassess == '1') { while ($rrp = mysql_fetch_assoc($rrc)) { $loop++; $nip = mysql_query("select * from ebpls_buss_taxfeeother where taxfeeid='{$rrp['complex_tfoid']}'"); $rip = mysql_fetch_assoc($nip); $rip = $rip[tfo_id]; $nip = mysql_query("select * from ebpls_buss_taxfeeother where natureid='{$natureid}' and\n \t\t\ttfo_id='{$rip}' and taxtype='{$TaxType}'"); $rip = mysql_fetch_assoc($nip); $rip = $rip[taxfeeid]; $sValues = "'',{$tax_fee_id},'{$rip}',\n 'X{$loop}',now()";
<tr> <td>Access Pin</td><td><?php echo $pin; ?> </td> </tr> <tr> <td>Website Username/Password</td><td><?php echo $getus . "/" . $passwd; ?> </td> </tr> <tr><td></td></tr> <tr><td>Line of Business</td><td>Capital Investment</td><td>Gross Sales</td><tr> <?php $getnat = SelectMultiTable($dbtype, $dbLink, "tempbusnature", "bus_nature, cap_inv, last_yr", "where owner_id={$owner_id} and business_id={$business_id}\n \t\t\tand active = 1"); while ($getit = FetchRow($dbtype, $getnat)) { ?> <tr> <td><?php echo $getit[0]; ?> </td> <td><?php echo $getit[1]; ?> </td> <td><?php echo $getit[2]; ?> </td>
<?php //matinding nakakahilong sql $ff = "("; $outamt = ''; $compsql = SelectMultiTable($dbtype, $dbLink, "tempassess a, ebpls_buss_taxfeeother b,\r\n ebpls_buss_complex c", "a.multi, a.amt, a.formula, c.coptr, c.addons,a.compval", "where a.natureid = b.natureid and \r\n\t\t\ta.taxfeeid = b.taxfeeid and a.taxfeeid = c.taxfeeid1 and \r\n\t\t\tb.taxfeeid = c.taxfeeid1 and a.tfoid = b.tfoid and \r\n\t\t\ta.tfoid = c.tfoid and b.tfoid = c.tfoid and \r\n\t\t\ta.natureid = b.natureid and b.natureid = c.natureid \r\n\t\t\tand a.natureid = c.natureid and\r\n\t\t\tc.taxfeeid={$taxfeeid} and a.active=1\r\n and a.transaction='{$stat}' and owner_id = {$owner_id} \r\n\t\t\tand business_id = {$business_id}\r\n\t\t\torder by compid asc"); while ($comp = FetchRow($dbtype, $compsql)) { if (is_numeric($comp[2])) { $formula = "((" . $comp[0] . "*" . $comp[2] . "))" . $comp[3] . $comp[4]; } else { $formula = "((" . $comp[0] . $comp[2] . $comp[3] . $comp[4]; } $outamt = $outamt . $formula; } $cfr = $fr . $ff . $outamt; //."))"; // eval ("\$totind=$fr$ff$outamt));"); // echo $cfr; //count "(" ")" $sop = substr_count($cfr, '('); $scp = substr_count($cfr, ')'); if ($sop > $scp) { $looper = $scp; $addcp = ''; while ($looper < $sop) { $addcp = $addcp . ')'; $looper++; } } eval("\$totind={$cfr}{$addcp};"); // echo $totind;
$nfgetd = $getd[1]; } $ttnf = $totind; $ttn = number_format($ttnf, 2); if ($getd[6] == 2) { $nfgetd = 'complex formula'; } if ($rtag == 'range') { $nfgetd = ''; $getd[1] = $range[0]; $ttn = number_format($compvalrange, 2); $totind = $compvalrange; } //check for exempted fees //$getd[7] tfoid $getex = SelectMultiTable($dbtype, $dbLink, "ebpls_business_enterprise a, fee_exempt b,\r\n ebpls_buss_tfo c", "a.*", "where a.business_id={$business_id} and\r\n\t\t\ta.business_category_code=b.business_category_code and\r\n\t\t\tc.tfoid={$getd['8']} and b.tfoid={$getd['8']} and\r\n\t\t\tb.active=1"); $getfeex = NumRows($dbtype, $getex); if ($getfeex > 0) { $exemptedfee = $exemptedfee + $getd[1]; $usemin = 'Fee Exempted'; $nfgetd = '0.00'; $rtag = ''; $ttn = '0.00'; $getd[1] = 0; $ttnf = 0; $totind = 0; $chngcompval = 1; } //$totind = round($ttn,2); //dating ganito $totind = round($totind, 2); $grandamt = $grandamt + $totind;
?> '"> <?php } else { ?> <body onload='javascript: alert("Cannot Process. No Payment Is Made");'></body> <?php $nopayment = '1'; require_once "includes/payform.php"; } } else { $tfee = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "sum(fee_amount)* multi_by", "where owner_id = {$owner_id} and\n permit_type='{$permit_type}'"); $totalfee = FetchRow($dbtype, $tfee); $totpay = $totalfee[0]; $totchnge = SelectMultiTable($dbtype, $dbLink, "temppayment", "sum(payamt)", "where owner_id = {$owner_id} \n\t\t\t\t and permit_type='{$permit_type}' and status=1\n and permit_status='{$stat}'"); $amtchange = FetchRow($dbtype, $totchnge); $ort = SelectDataWhere($dbtype, $dbLink, "temppayment", "where owner_id = {$owner_id} and permit_type='{$permit_type}' \n\t\t\t\t and status=1 and permit_status='{$stat}'"); $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';
$pdf->SetY($Y_Table_Position); while ($resulta = mysql_fetch_array($result)) { $pdf->SetX(1); //$pdf->MultiCell(349,5,$i,1); $pdf->SetX(5); $pdf->Cell(10, 5, $i, 1, 0, 'L'); $pdf->Cell(50, 5, $resulta[fulln], 1, 0, 'L'); $pdf->Cell(40, 5, $resulta[business_name], 1, 0, 'L'); $pdf->Cell(90, 5, $resulta[bus_add], 1, 0, 'L'); $getlineb = mysql_query("select a.cap_inv as invest from tempbusnature a,\n ebpls_buss_nature b where a.owner_id={$resulta['owner_id']} and\n a.business_id={$resulta['business_id']} and\n a.bus_code=b.natureid \n order by tempid"); $resultb = mysql_fetch_array($getlineb); $pdf->Cell(25, 5, $resultb[invest], 1, 0, 'R'); $getlineb = mysql_query("select a.last_yr as invest from tempbusnature a,\n ebpls_buss_nature b where a.owner_id={$resulta['owner_id']} and\n a.business_id={$resulta['business_id']} and\n a.bus_code=b.natureid and a.active=1 \n order by tempid desc"); $resultb = mysql_fetch_array($getlineb); $pdf->Cell(25, 5, $resultb[invest], 1, 0, 'R'); $getcas = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_or a,\n ebpls_transaction_payment_or_details b, \n\t\t\tebpls_business_enterprise_permit c", "a.ts_create as pay_date, concat(a.payment_code,'/',a.or_no),\n a.total_amount_paid, a.payment_officer, a.or_no, a.total_amount_due,\n a.payment_code as or_num", "where a.or_no=b.or_no and b.trans_id={$resulta['owner_id']} and\n b.or_entry_type='CASH' and\n b.payment_id={$resulta['business_id']} and\n\t\t\tb.payment_id=c.business_id and\n\t\t\tb.trans_id=c.owner_id and c.active=1 and\t \n\t\t\tb.transaction='{$resulta['transaction']}'"); $geta = FetchArray($dbtype, $getcas); $getapp = mysql_query("select * from ebpls_business_enterprise_permit\n\t\t\twhere owner_id = {$resulta['owner_id']} and \n\t\t\tbusiness_id ={$resulta['business_id']} and\n\t\t\tactive=1"); $getapp = mysql_fetch_array($getapp); $pdf->Cell(25, 5, $geta[or_num], 1, 0, 'L'); $pdf->Cell(25, 5, $geta[pay_date], 1, 0, 'L'); $pdf->Cell(25, 5, $getapp[application_date], 1, 0, 'L'); $pdf->Cell(20, 5, $resulta[transaction], 1, 0, 'L'); $i++; $pdf->SetY($pdf->GetY() + 5); } /* $i = 1; $pdf->SetY($Y_Table_Position); while ($i < $number_of_rows) {
/* if ($id<>'') { $owner_id = $id; } */ $getown = SelectMultiTable($dbtype, $dbLink, $owner, "owner_first_name, owner_middle_name, owner_last_name, owner_gender", "where owner_id={$owner_id}"); $res = FetchRow($dbtype, $getown); //$owner_id=$owner_id; $owner_first_name = $res[0]; $owner_middle_name = $res[1]; $owner_last_name = $res[2]; if ($tag == 'Occupational' and $permit_type == 'Occupational') { //$owner_id = $idcnt; require_once "includes/form_add_mtoppermit.html"; //require_once "includes/form_pay_occu.html"; $getemp = SelectMultiTable($dbtype, $dbLink, "{$permittable} a, ebpls_business_enterprise b", "a.occ_permit_code,a.occ_permit_application_date, \r\n\t\t\t a.occ_position_applied , b.business_name", "where a.owner_id={$owner_id} and a.business_id=b.business_id"); $getit = FetchRow($dbtype, $getemp); $permit_code = $getit[0]; $pos_app = $getit[2]; $permit_date = $getit[1]; $employer_name = $getit[3]; require_once "includes/form_pay_midoccu.php"; require_once "includes/paymtop.php"; } elseif ($permit_type == 'Peddlers') { require_once "includes/form_add_mtoppermit.html"; $getemp = SelectDataWhere($dbtype, $dbLink, $permittable, "where owner_id={$owner_id}"); $getit = FetchArray($dbtype, $getemp); $merchandise = stripslashes($getit[merchandise_sold]); $peddler_bus = stripslashes($getit[peddlers_business_name]); $apply = $getit[application_date]; $permid = $getit[peddlers_permit_id];
$getch = $getche[0] + $getch; // } } $totbak = $totbak + $getch; ?> <!--<table> <tr> <td> <?php echo $backpays1[0]; ?> </td> </tr>--> <?php if ($istat == 'Retire') { $backtaks = SelectMultiTable($dbtype, $dbLink, "bus_grandamt", "grandamt, totpenamt, si, waive", "where owner_id={$owner_id} and business_id={$business_id} \r\n\t\t\t and active = 0 order by gid desc limit 1"); } else { $backtaks = SelectMultiTable($dbtype, $dbLink, "bus_grandamt", "sum(grandamt), sum(totpenamt), sum(si), sum(waive)", "where owner_id={$owner_id} and business_id={$business_id} and active = 0\r\n\t order by gid desc limit 1"); } $backtaks1 = mysql_fetch_row($backtaks); if ($backtaks1[0] == '') { $notpaid = 0; } else { $baktax1 = $backtaks1[0]; $baktax2 = $backtaks1[1]; $baktax3 = $backtaks1[2]; $totbaktax = $baktax1 + $baktax2 + $baktax3; $totbaktax = $totbaktax - $backtaks1[3]; $notpaid = abs($totbaktax - $totbak); }
$owner_last_name = $res[2]; $owner_gender = $res[3]; $buttag = 'Add'; $buttag1 = 'Clear'; $verdel = SelectDataWhere($dbtype, $dbLink, $vehicle, "where motorized_motor_id={$mid}"); $getver = FetchArray($dbtype, $verdel); $stat1 = $getver[status]; $owner_id = $ownerID; require_once "includes/form_add_mtoppermit.html"; require_once "includes/form_add_middlepermit.php"; if ($com == 'Delete') { //search history $getown = SelectMultiTable($dbtype, $dbLink, "ebpls_motorized_vehicles a, vehicle_transfer b", "motorized_motor_id", " where a.motorized_motor_id ='{$mid}' and a.motorized_motor_id=b.motor_id "); $gg = NumRows($dbtype, $getown); if ($gg > 0) { $getown = SelectMultiTable($dbtype, $dbLink, "ebpls_motorized_vehicles a, vehicle_transfer b", "*", " where a.motorized_motor_id ='{$mid}' and a.motorized_motor_id=b.motor_id and\n b.new_owner='{$owner_id}'"); $ff = NumRows($dbtype, $getown); $ft = FetchArray($dbtype, $getown); if ($ff > 0) { //update vehicle $updateit = UpdateQuery($dbtype, $dbLink, $vehicle, "motorized_operator_id = {$ft['old_owner']},permit_type='{$permit_type}',retire=2,transaction='Drop'", " motorized_motor_id='{$mid}'"); $D = DeleteQuery($dbtype, $dbLink, "vehicle_transfer", "motor_id='{$mid}' and\n\t\t\t\t\t\tnew_owner='{$owner_id}'"); ?> <body onload='javascript:("Vehicle Transferred Cancelled");'</body> <?php } else { ?> <body onload='javascript:ExistOther();'></body> <?php } } else {
if ($getyr[counter] == 1) { $cnt = 0; $fg = date('Y', strtotime($getyr[date_create])); while ($cnt < $getyr[or_print]) { $cnt++; $getyears = SelectMultiTable($dbtype, $dbLink, "tempassess a, ebpls_buss_tfo c", "c.or_print,a.date_create,c.tfodesc, c.counter", "where a.tfoid=c.tfoid and a.tfoid = {$getd['tfoid']} \n and a.date_create like '{$fg}%'"); $geyr = NumRows($dbtype, $getyears); if ($geyr == 0) { $cnt = $getyr[or_print] + 1; $bill_date = $bill_date + 1; } $fg = $fg - 1; } } //gety tempassess $temp = SelectMultiTable($dbtype, $dbLink, "tempassess a, ebpls_buss_taxfeeother b, ebpls_buss_tfo c", "a.natureid, a.taxfeeid, a.multi,\n c.tfodesc, b.amtformula,b.indicator, \n \t\t\t\t b.mode, b.uom, c.tfoid,a.date_create, a.compval", "where b.taxtype='{$tftype}'\n and a.owner_id={$owner_id} and a.business_id={$business_id} and\n\t\t\t\ta.taxfeeid = '{$getd['taxfeeid']}' and a.natureid = '{$getn['0']}' and \n\t\t\t\t a.active = 1 and a.natureid=b.natureid and a.taxfeeid=b.taxfeeid \n\t\t\t\t and b.tfo_id=c.tfoid {$tft}"); //$temp = SelectMultiTable($dbtype,$dbLink, //"tempassess a, ebpls_buss_taxfeeother b, ebpls_buss_tfo c", //"a.natureid, a.taxfeeid, a.multi, // c.tfodesc, b.amtformula,b.indicator, //b.mode, b.uom, c.tfoid,a.date_create, a.compval", /// "where a.assid='$varx' and b.taxtype='$tftype' // and a.owner_id=$owner_id and a.business_id=$business_id and //a.active = 1 and a.natureid=b.natureid and a.taxfeeid=b.taxfeeid //and b.tfo_id=c.tfoid $tft"); $gethuh = FetchArray($dbtype, $temp); $pdf->Cell(25, 5, $gethuh['compval'], 1, 1, 'C'); //simulan dito //end dito $gethuh[multi] = round($gethuh[multi], 2); //$tempamount = $totind;
include "lib/multidbconnection.php"; $dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname); //get lgu name $getlgu = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", ""); $getlgu = FetchRow($dbtype, $getlgu); $getchek = SelectMultiTable($dbtype, $dbLink, "temppayment a, {$owner} d", "a.*, concat(d.owner_last_name,', ', d.owner_first_name,\r\n ' ', d.owner_middle_name)", "where a.owner_id={$owner_id} and\r\n\t\t\ta.permit_type='{$permit_type}' and permit_status='{$stat}' \r\n\t\t\tand a.owner_id=d.owner_id and a.or_no='{$or_no}'"); $getit = FetchRow($dbtype, $getchek); $amt2words = makewords($getit[1]); $pos1 = strpos($amt2words, " And "); $slen = strlen($amt2words); // - $pos1; $amt2words1 = substr($amt2words, 0, $pos1); $amt2words2 = substr($amt2words, $pos1); //get bus nature $datengay = date('Y'); $getbus = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "fee_desc, fee_amount, multi_by", "where owner_id={$owner_id} and\r\n permit_type='{$permit_type}' and permit_status='{$stat}' and input_date like '{$datengay}%' and active='1'"); define('FPDF_FONTPATH', 'font/'); require 'ebpls-php-lib/html2pdf_lib/fpdf.php'; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 10); $pdf->Cell(50, 48, 'Control #' . $getit[8], '0', '2', 'R'); $pdf->Cell(50, 7, $tdate, '0', '2', 'R'); //current date $pdf->Cell(35, 7, $getlgu[4], '0', '2'); //municipality $pdf->Cell(35, 7, $getit[9], '0', '2'); //payor $pdf->Cell(50, 10, 'Payment For ' . $permit_type . ' Permit', '0', '2'); //space $nc = 0;
$backtaxcompute = 0; $xloop++; //echo $xloop."VooDoo<br>"; //Boat Fees $getboat = SelectDataWhere($dbtype, $dbLink, "fish_boat", "where owner_id={$owner_id}"); while ($getb = FetchRow($dbtype, $getboat)) { $getfee = SelectDataWhere($dbtype, $dbLink, "boat_fee", "where boat_type='{$getb['4']}' and\n\t\t\t\t\t\trange_lower<={$getb['5']} and range_higher>={$getb['5']} and\n\t\t\t\t\t\ttransaction='Renew' and active = 1"); $getnum = NumRows($dbtype, $getfee); if ($getnum == 0) { $getfee = SelectDataWhere($dbtype, $dbLink, "boat_fee", "where boat_type='{$getb['4']}' and\n\t\t\t\t\t\t\trange_lower<={$getb['5']} and range_higher=0 and\n\t\t\t\t\t\t\ttransaction='Renew' and active = 1"); } $getfee1 = FetchArray($dbtype, $getfee); $backtaxcompute = $backtaxcompute + $getfee1[amt]; } //Fish Activity Fees $rt = SelectMultiTable($dbtype, $dbLink, "culture_fee a, fish_assess b", "a.culture_type, b.amt, b.ass_id, b.culture_id", "where a.culture_id = b.culture_id and b.owner_id = '{$owner_id}'"); $tfee1 = 0; while ($ft = FetchRow($dbtype, $rt)) { $getfee = SelectDataWhere($dbtype, $dbLink, "culture_fee", "where culture_id='{$ft['3']}'"); $gf = FetchRow($dbtype, $getfee); if ($gf[2] == '1') { //constant $tfee = $gf[4]; } elseif ($gf[2] == '2') { //formula eval("\$tfee={$ft['1']}{$gf['3']};"); } elseif ($gf[2] == '3') { //range $getr = SelectDataWhere($dbtype, $dbLink, "culture_range", "where\n\t\t\t\t\t\t\tculture_id={$ft['3']} and range_lower<={$ft['1']} and\n\t\t\t\t\t\t\trange_higher >= {$ft['1']}"); $numr = NumRows($dbtype, $getr); if ($numr == 0) {
$getpay = SelectMultiTable($dbtype, $dbLink, "temppayment", "payid, payamt, pay_date, pay_type, \n\t\t\tor_no,status", "where owner_id = {$owner_id} and permit_type='{$permit_type}' \n\t\t\tand permit_status='{$stat}' and pay_date like '{$getyearnow}%' and status ='1'"); $payedamount = 0; while ($getpayed = mysql_fetch_assoc($getpay)) { $payedamount = $payedamount + $getpayed['payamt']; } $payedass = 0; $gettopay = SelectMultiTable($dbtype, $dbLink, "ebpls_other_penalty_amount", "amount, bt", "where owner_id = '{$owner_id}' and permit_type='{$permit_type}'\n and year = '{$getyearnow}'"); while ($gettopayed = mysql_fetch_assoc($gettopay)) { $payedass = $payedass + $gettopayed['amount']; $payedass = $payedass + $gettopayed['bt']; } $gettopay1 = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "fee_amount, multi_by", "where owner_id = '{$owner_id}' and permit_type='{$permit_type}'\n and input_date like '{$getyearnow}%' and active = '0' and permit_status != '{$stat}'"); while ($gettopayed1 = mysql_fetch_assoc($gettopay1)) { $payedass = $payedass + $gettopayed1['fee_amount'] * $gettopayed1['multi_by']; } $gettopay2 = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "fee_amount, multi_by", "where owner_id = '{$owner_id}' and permit_type='{$permit_type}'\n and input_date like '{$getyearnow}%' and active = '0' and permit_status = 'Transfer/Dropping'"); while ($gettopayed2 = mysql_fetch_assoc($gettopay2)) { $payedass = $payedass + $gettopayed2['fee_amount'] * $gettopayed2['multi_by']; } if ($checkrentype1['renewaltype'] == '2' and $stat == "ReNew") { $getfees908 = @mysql_query("select * from temppayment where permit_type= '{$permit_type}' and permit_status = '{$stat}' and owner_id = '{$owner_id}' and pay_date like '{$getyearnow}%' and status = '0'"); $addamty = 0; while ($addamty34 = mysql_fetch_assoc($getfees908)) { $addamty = $addamty + $addamty34['payamt']; } } $balancefornow = $origtotal - $payedamount; //echo $addamty."VooDoo"; if ($balancefornow > 0) { ?> <script language='Javascript' src='javascripts/default.js'></script>
<?php $stsearch = SelectMultiTable($dbtype, $dbLink, "ebpls_business_enterprise", "business_category_code", "where owner_id={$owner_id} and \n\t\t business_id={$business_id}"); $stsearch = FetchRow($dbtype, $stsearch); $ndsearch = SelectMultiTable($dbtype, $dbLink, "ebpls_business_category", "tax_exemption", "where business_category_code='{$stsearch['0']}'"); $ndsearch = FetchRow($dbtype, $ndsearch); //echo $totexempt; //$totexempt=$grandamt-$notexempt; $Exemption = 0; $Exemption = $tottax * ($ndsearch[0] / 100); if ($Exemption > 0) { if ($itemID_ == 4212) { ?> <tr><td width=100></td> <td></td><td align=right>Tax :</td><td align=right> <?php $taxamt = number_format($grandamt - $nyotfee, 2); print "{$taxamt} </td></tr>"; $alignment = 'right'; $Pesosign = 'Php '; } else { $alignment = 'right'; } print "<tr><td width=100></td>"; if ($itemID_ != 2212) { print " <td></td>"; // } // if ($itemID_<>2212) { $alignment = 'right'; $Pesosign = ''; } if ($itemID_ == 2212) {
&or_no=<?php echo $get_info[4]; ?> &permit_type=<?php echo $permit_type; ?> &stat=<?php echo $stat; ?> ");'>Re-Print OR</a></div></td> <?php } print "</tr>\n"; } //end while $getpay = SelectMultiTable($dbtype, $dbLink, "temppayment", "sum(payamt)", "where owner_id = {$owner_id} and permit_type='{$permit_type}' \n\t\t\t and permit_status='{$stat}' and pay_date like '{$getyearnow}%'"); $totalpaid = FetchRow($dbtype, $getpay); $totalpaidnf = number_format($totalpaid[0], 2); ?> <tr><td> </td><td> </td><td> </td><td> </td></tr> <tr><td>Total : </td> <td align=right> <?php echo $totalpaidnf; ?> </td> <?php $hj = $totalpaid[0]; $amtchange = $hj - $totalpay; if ($amtchange < 0) { print "<td></td>\n"; } else {
?> ,<?php echo $ppart; ?> ,<?php echo $getn[0]; ?> ,'','',<?php echo $feecomputeline; ?> )"> Check</a> </td> </tr> <?php } else { $getorn = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_or a,\n ebpls_transaction_payment_or_details b", "a.or_no, b.or_entry_type", "where b.trans_id={$owner_id} and b.payment_id={$business_id} and\n\t\t\tb.nat_id={$getn['0']} and b.linepaid=1 and a.or_no=b.or_no \n\t\t\tand a.trans_id=b.trans_id"); $getorn = FetchRow($dbtype, $getorn); ?> <td></td><td align=right></td> <td align=right> <a class=subnavwhite href="ebplsreceipt.php?owner_id=<?php echo $owner_id; ?> &business_id=<?php echo $business_id; ?> &or_no=<?php echo $getorn[0]; ?> &cmd=<?php echo $getorn[1];
Retire</a> </td> </tr> --> <?php } ?> <tr> <td> </td><td>Total Amount Due</td><td align=right><?php echo number_format($totalpaymentsked, 2); ?> </td><td> </td></tr> <?php //echo $totalpaymentsked."=="; $chkinmayor = SelectMultiTable($dbtype, $dbLink, "ebpls_buss_tfo", "tfodesc", "where tfodesc like '%mayor%'"); $chkinmayor = FetchRow($dbtype, $chkinmayor); ?> </table> <script language='Javascript' src='javascripts/default.js'></script> <script language="Javascript"> function PaymentCommand(cmd,amt,paymde,paypart,or,natid,pens,recno,feeline) { var trans_id var x,y,w,h trans_id = document._FRM.trans_id.value; // center on screen if ( cmd == 'CASH' ) { w = 400 h = screen.height - 100
//echo "thth".$qtrcnt."VooDoo"; if ($monthcounter <= $scounter) { $getsurchargepaid = @mysql_query("select sum(penalty), sum(surcharge), sum(backtax), sum(taxes) from comparative_statement where owner_id = '{$owner_id}' and business_id = '{$business_id}' and for_year = '{$taonnatinngayon}' and month >= {$a1} and month <= {$a2}"); //echo "select sum(penalty), sum(surcharge), sum(backtax), sum(taxes) from comparative_statement where owner_id = '$owner_id' and business_id = '$business_id' and for_year = '$taonnatinngayon' and month >= $a1 and month <= $a2"; $getsumnun = @mysql_fetch_row($getsurchargepaid); $getsumnun1 = $getsumnun[0] + $getsumnun[1] + $getsumnun[2]; $paidtaxes = $getsumnun[3]; } else { $getsumnun1 = 0; } $totalcash = $getcash[0]; $totalcheck = $totcheck[0]; $totalpayment = $totalcash + $totalcheck; $staxfee = SelectMultiTable($dbtype, $dbLink, "ebpls_buss_preference", "staxesfees,swaivetax, predcomp", ""); $prefset = FetchArray($dbtype, $staxfee); $startd = SelectMultiTable($dbtype, $dbLink, "ebpls_business_enterprise", " business_start_date", "where business_id='{$business_id}' and owner_id='{$owner_id}'"); $startdate = FetchArray($dbtype, $startd); $startdate = strtotime($startdate['business_start_date']); $predcomp = $prefset['predcomp']; if ($predcomp == 1 and $stat == 'New') { $exemptedfee = 0; } $totaltaxfee = $grandamt; $totalfee = $totfee - $exemptedfee; $totalexptax = $exemptot; $totaltax = $totaltaxfee - $totalfee; $totalexemptedfee = $exemptedfee; $totalremain = $totaltaxfee - $totalpayment; /* echo "<br>Total Tax/Fee = $totaltaxfee <br> Total Tax = $totaltax <br>
require "ebpls4222.php"; if ($grandamt == '') { $sendthis = "Cannot Assess Your Business"; } $sendthis = "Your Business Assessed Value Is {$grandamt}"; } else { $stat = $getstat[2]; $getfee = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "sum(fee_amount)", "where owner_id = '{$owner_id}' and\n\t\t\t\tpermit_type='{$permit_type}' and\n\t\t\t\tpermit_status='{$stat}'"); $getfee = FetchRow($dbtype, $getfee); $sendthis = $getfee[0]; $sendthis = "Your Tax Due Is " . $sendthis; } } elseif ($keyword == 'duedate') { $business_id = $getstat[2]; $owner_id = $getstat[1]; $getdue = SelectMultiTable($dbtype, $dbLink, 'ebpls_business_enterprise', "business_payment_mode", "where owner_id='{$owner_id}' and business_id='{$business_id}'"); $getit = FetchRow($dbtype, $getdue); $getdue1 = SelectDataWhere($dbtype, $dbLink, 'ebpls_buss_penalty1', ""); $getnow = Fetcharray($dbtype, $getdue1); echo $getit[0]; 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') { }
} $varx++; // end assessment sana ok } } } } $gettag = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", ""); $gettag = FetchArray($dbtype, $gettag); if ($gettag[sassess] == '' and $yearnow1 != $currentyearna) { $currentyearna = $yearnow1; $resultf = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_tfo", "where tfoindicator='1' and tfostatus='A' and taxfeetype<>'1' "); $cntfee = NumRows($dbtype, $resultf); $feetype = 1; while ($getf = FetchRow($dbtype, $resultf)) { $getex = SelectMultiTable($dbtype, $dbLink, "ebpls_business_enterprise a, \n\t\t\tfee_exempt b, ebpls_buss_tfo c", "a.*", "where a.business_id={$business_id} and\n a.business_category_code=b.business_category_code and\n c.tfoid={$getf['0']} and b.tfoid={$getf['0']} and\n b.active=1"); $getfeex = NumRows($dbtype, $getex); if ($getfeex > 0) { $exemptedfee = $exemptedfee + $getf[6]; $usemin = 'Fee Exempted '; $getf[6] = 0; } $havegar = strpos(strtolower($getf[1]), 'garbage'); if ($g_zone == 0) { if ($havegar > -1) { $exemptedfee = $exemptedfee + $getd[amtformula]; $usemin = 'Not in Garbage Zone '; $rtag = ''; $getf[6] = 0; $totind = 0; }
<?php /*Modification History: 2008.05.08 RJC Define undefined variables and set undefined constants to text to reduce phperror.log */ require_once "includes/variables.php"; include_once "class/BusinessPermitClass.php"; include_once "class/BusinessEstablishmentClass.php"; $staxfee = SelectMultiTable($dbtype, $dbLink, "ebpls_buss_preference", "staxesfees,swaivetax, predcomp", ""); $prefset = FetchArray($dbtype, $staxfee); $predcomp = $prefset['predcomp']; $owner_id = isset($owner_id) ? $owner_id : ''; //2008.05.08 if ($owner_id == '') { $owner_id = 0; } $strValues = "edit_by='',edit_locked=0"; $strWhere = "owner_id='{$owner_id}'"; $qu = mysql_query("update ebpls_owner set {$strValues} where {$strWhere}"); $business_id = isset($business_id) ? $business_id : ''; //2008.05.08 if ($business_id != '') { $ifpaid = SelectDataWhere($dbtype, $dbLink, $permittable, "where owner_id = {$owner_id}\n and business_id = {$business_id} and active = 1"); $strValues = "edit_by='',edit_locked=0"; $strWhere = "business_id='{$business_id}'"; $qu = mysql_query("update ebpls_business_enterprise set {$strValues} where {$strWhere}"); //$ifpaid = mysql_query("select paid from $permittable where owner_id = $owner_id // and business_id = $business_id and active = 1"); $ifpaid = FetchRow($dbtype, $ifpaid); $ifpaid = $ifpaid[0]; if ($ifpaid > 0) {
if ($permit_type == "Peddlers") { $getbus = SelectMultiTable($dbtype, $dbLink, "ebpls_peddlers_fees", "fee_desc, fee_amount", "where permit_type='{$stat}' and active='1'"); while ($nc < 8) { while ($getb = FetchRow($dbtype, $getbus)) { $pdf->Cell(75, 5, $getb[0], '0', '0'); //desc $Tot = $getb[1]; $pdf->Cell(75, 5, '', '0', '1'); //amount //$pdf->Cell(75,5,number_format($Tot,2),'0','1');//amount } $nc++; } } if ($permit_type == "Fishery") { $getbus = SelectMultiTable($dbtype, $dbLink, "ebpls_fishery_fees", "fee_desc, fee_amount", "where permit_type='{$stat}' and active='1'"); $pdf->Cell(75, 5, 'Boat Registration', '0', '1'); //desc $pdf->Cell(75, 5, 'Fish Activity', '0', '1'); //desc while ($nc < 6) { while ($getb = FetchRow($dbtype, $getbus)) { $pdf->Cell(75, 5, $getb[0], '0', '0'); //desc $Tot = $getb[1]; $pdf->Cell(75, 5, '', '0', '1'); //amount //$pdf->Cell(75,5,number_format($Tot,2),'0','1');//amount } $nc++; }
$backtaks = SelectMultiTable($dbtype, $dbLink, "bus_grandamt", "sum(grandamt), sum(totpenamt), sum(si), sum(penamt)", "where owner_id={$owner_id} and business_id='{$business_id}' and ts = '{$lastpaydatey}' and active = 0\r\n\torder by gid desc"); $bt = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_or_details a,\r\n\tebpls_transaction_payment_or b", "b.total_amount_paid,a.ts", "where a.trans_id={$owner_id} and a.payment_id={$business_id} \r\n\tand a.trans_id = b.trans_id and a.or_no=b.or_no\r\n\tand a.or_entry_type<>'CHECK' and ts like '{$lastpaydatey}%'"); while ($getche = FetchRow($dbtype, $bt)) { $getch = $getche[0] + $getch; } $totbak = $getch; $getch = 0; $bt = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_or_details a, \r\n\tebpls_transaction_payment_check b", "b.check_amount,a.ts", "where a.trans_id={$owner_id} and a.payment_id={$business_id} \r\n\tand a.or_entry_type='CHECK' and b.check_status='CLEARED'\r\n\tand a.or_no=b.or_no and ts like '{$lastpaydatey}%'"); while ($getche = FetchRow($dbtype, $bt)) { $getch = $getche[0] + $getch; } $totbak = $totbak + $getch; if ($istat == 'Retire') { $backtaks = SelectMultiTable($dbtype, $dbLink, "bus_grandamt", "sum(grandamt), sum(totpenamt), sum(si), sum(penamt)", "where owner_id={$owner_id} and business_id='{$business_id}' and ts = '{$lastpaydatey}' \r\n\t\tand active = 0 order by gid desc"); } else { $backtaks = SelectMultiTable($dbtype, $dbLink, "bus_grandamt", "sum(grandamt), sum(totpenamt), sum(si), sum(penamt)", "where owner_id={$owner_id} and business_id='{$business_id}' and ts = '{$lastpaydatey}' and active = 0\r\n\t\torder by gid desc"); } $backtaks1 = mysql_fetch_row($backtaks); if ($backtaks1[0] == '') { $notpaid = 0; } else { $baktax1 = $backtaks1[0]; $baktax2 = $backtaks1[1]; $baktax3 = $backtaks1[2]; $baktax4 = $backtaks1[3]; $totbaktax = $baktax1 + $baktax2 + $baktax3 + $baktax4; $notpaid = $totbaktax - $totbak; if ($notpaid < 0) { $notpaid = 0; } }
<td align="left" valign="top" class='normal'> <input type='text' tabindex=3 name='owner_last_name' maxlength=60 class='text180' value="<?php echo $owner[3]; ?> " onchange='javascript:flagchange(changeondin);'> </td> <td align="right" valign="top" class='normal'> <font color="#FF0000">* </font>Citizenship : </td> <td align="left" valign="top" class='normal'> <!-- <input type='text' name='owner_citizenship' maxlength=255 class='text180' value=""> --> <select name='owner_citizenship' tabindex=6 class='select100' onchange='javascript:flagchange(changeondin);'> <?php if ($owner_id == '0') { $defcit = 'Filipino'; } else { $defcit = $owner[12]; } $cit = SelectMultiTable($dbtype, $dbLink, "ebpls_citizenship", "cit_desc", ""); while ($getcit = FetchRow($dbtype, $cit)) { if ($getcit[0] == $defcit) { $selec = 'selected'; } else { $selec = ''; } print "<option value={$getcit['0']} {$selec}> {$getcit['0']} </option>"; } ?> </select> </td> </tr> <tr>