$db = new DB_SelectLGU("erpts-test");
$db->query("SELECT * FROM Barangay ORDER BY description");
$tpl->set_block(report,BRGY,bBlk);
if($db->num_rows()>0){
	for($r=0;$db->next_record();$r++){
		$tpl->set_var(barangayID,$db->f("barangayID"));
		$tpl->set_var(barangayName,$db->f("description"));
		$tpl->parse(bBlk,BRGY,true);
	}
}
$tpl->set_var(fileName,$PHP_SELF);

if($isSubmit){

  
 $db = new DB_SelectLGU("erpts-test");

if($brgyID==0)
 $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
		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
예제 #2
0
 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");
     }
 }