USING ( afsID ) INNER JOIN ".ucwords($classification)."ActualUses ON ".ucwords($classification).".actualUse = ".ucwords($classification)."ActualUses.".$classification."ActualUsesID GROUP BY ( ".$classification."ActualUsesID )"; else $sql ="SELECT ".ucwords($classification)."ActualUses.code as description, sum( ".ucwords($classification).".marketValue ) as total FROM AFS INNER JOIN ".ucwords($classification)." USING ( afsID ) INNER JOIN ".ucwords($classification)."ActualUses ON ".ucwords($classification).".actualUse = ".ucwords($classification)."ActualUses.".$classification."ActualUsesID LEFT JOIN Location ON AFS.odID = Location.odID LEFT JOIN LocationAddress ON Location.locationAddressID = LocationAddress.locationAddressID LEFT JOIN Barangay ON LocationAddress.barangayID = Barangay.barangayID WHERE AFS.archive != 'true' AND Barangay.barangayID = $brgyID GROUP BY ( ".$classification."ActualUsesID )"; $db->query($sql); if($db->num_rows() >0){ for($i=0;$db->next_record();$i++){ $total += $db->f("total"); $t[$i] = $db->f("total"); $barangay[$i] = $db->f("description"); } } /*for($i=0;$i<count($t);$i++){ $percentage[$i] = ($t[$i]/$total) * 100; }*/ //$vCht4 = array(1,20,20,34,5,52,41,20,34,43,64,40); // $vCht5 = array(12,21,36,27,14,23,3,5,29,23,12,5);
function computeProperty($column, $sql) { $db = new DB_SelectLGU($this->dbName); $db->query($sql); while ($db->next_record()) { $code = $db->f("reportCode"); switch ($code) { case "RE": $this->totalRETaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subRETaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalRETaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subRETaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "AG": $this->totalAGTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subAGTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalAGTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subAGTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "CO": $this->totalCOTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subCOTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalCOTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subCOTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "IN": $this->totalINTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subINTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalINTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subINTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "MI": $this->totalMITaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subMITaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalMITaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subMITaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "TI": $this->totalTITaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subTITaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalTITaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subTITaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "SP": $this->totalSPTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subSPTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalSPTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subSPTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "HO": $this->totalHOTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subHOTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalHOTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subHOTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "SC": $this->totalSCTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subSCTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalSCTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subSCTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "CU": $this->totalCUTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subCUTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalCUTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subCUTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "OTX": $this->totalOTTaxableMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subOTTaxable' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalOTTaxableAssessedValue += $db->f("assessedValue"); eval('$this->totalTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subOTTaxable' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalTaxableMarketValue += $db->f("adjustedMarketValue"); $this->totalTaxableAssessedValue += $db->f("assessedValue"); break; case "GO": $this->totalGOExemptMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subGOExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalGOExemptAssessedValue += $db->f("assessedValue"); eval('$this->totalExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subGOExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalExemptMarketValue += $db->f("adjustedMarketValue"); $this->totalExemptAssessedValue += $db->f("assessedValue"); break; case "RL": $this->totalRLExemptMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subRLExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalRLExemptAssessedValue += $db->f("assessedValue"); eval('$this->totalExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subRLExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalExemptMarketValue += $db->f("adjustedMarketValue"); $this->totalExemptAssessedValue += $db->f("assessedValue"); break; case "CH": $this->totalCHExemptMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subCHExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalCHExemptAssessedValue += $db->f("assessedValue"); eval('$this->totalExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subCHExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalExemptMarketValue += $db->f("adjustedMarketValue"); $this->totalExemptAssessedValue += $db->f("assessedValue"); break; case "ED": $this->totalEDExemptMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subEDExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalEDExemptAssessedValue += $db->f("assessedValue"); eval('$this->totalExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subEDExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalExemptMarketValue += $db->f("adjustedMarketValue"); $this->totalExemptAssessedValue += $db->f("assessedValue"); break; case "OTE": $this->totalOTExemptMarketValue += $db->f("adjustedMarketValue"); eval('$this->totalExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->subOTExempt' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); $this->totalOTExemptAssessedValue += $db->f("assessedValue"); eval('$this->totalExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); eval('$this->subOTExempt' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalExemptMarketValue += $db->f("adjustedMarketValue"); $this->totalExemptAssessedValue += $db->f("assessedValue"); break; } if ($column == "Land") { $areaInSquareMeters = $this->getLandAreaInSquareMeters($code); $this->totalLandArea += $areaInSquareMeters; switch ($code) { case "RE": case "AG": case "CO": case "IN": case "MI": case "TI": case "SP": case "HO": case "SC": case "CU": case "OTX": if ($code == "OTX") { $code = "OT"; } $this->totalTaxableLandArea += $areaInSquareMeters; eval('$this->sub' . $code . 'TaxableLandArea += $areaInSquareMeters;'); break; case "GO": case "RL": case "CH": case "ED": case "OTE": if ($code == "OTE") { $code = "OT"; } $this->totalExemptLandArea += $areaInSquareMeters; eval('$this->sub' . $code . 'ExemptLandArea += $areaInSquareMeters;'); break; } } eval('$this->total' . $column . 'MarketValue += $db->f("adjustedMarketValue");'); eval('$this->total' . $column . 'AssessedValue += $db->f("assessedValue");'); $this->totalMarketValue += $db->f("adjustedMarketValue"); $this->totalAssessedValue += $db->f("assessedValue"); } }