예제 #1
0
파일: AFSEncode.php 프로젝트: armic/erpts
 function getOdID($afsID)
 {
     $afs = new AFS();
     if (!($odID = $afs->checkOdID($afsID))) {
         return false;
     } else {
         return $odID;
     }
 }
예제 #2
0
파일: TDDetails.php 프로젝트: armic/erpts
 function Main()
 {
     $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
     $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
     $this->tpl->set_var("TDDBEmptyBlock", "");
     $this->tpl->set_block("TDList", "Land", "LandBlock");
     $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock");
     $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock");
     $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock");
     $propertyType = $this->formArray["propertyType"];
     $propertyID = $this->formArray["propertyID"];
     switch ($propertyType) {
         case "Land":
             $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object");
             if (!($xmlStr = $LandDetails->getLand($propertyID))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $land = new Land();
                     $land->parseDomDocument($domDoc);
                     //$land->selectRecord($propertyID);
                     $this->formArray["landTotalMarketValue"] += tofloat($land->getMarketValue());
                     $this->formArray["landTotalAssessedValue"] += tofloat($land->getAssessedValue());
                     $this->displayLand($land);
                     //echo $this->formArray["landTotalAssessedValue"];
                 }
             }
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             $this->tpl->set_var("MachineriesBlock", "");
             break;
         case "PlantsTrees":
             $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
             if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($propertyID))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $plantsTrees = new PlantsTrees();
                     $plantsTrees->parseDomDocument($domDoc);
                     //$plantsTrees->selectRecord($propertyID);
                     $this->formArray["plantTotalMarketValue"] += tofloat($plantsTrees->getMarketValue());
                     $this->formArray["plantTotalAssessedValue"] += tofloat($plantsTrees->getAssessedValue());
                     $this->displayPlantsTrees($plantsTrees);
                 }
             }
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             $this->tpl->set_var("MachineriesBlock", "");
             break;
         case "ImprovementsBuildings":
             $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($propertyID))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $improvementsBuildings = new ImprovementsBuildings();
                     $improvementsBuildings->parseDomDocument($domDoc);
                     //$improvementsBuildings->selectRecord($propertyID);
                     $this->formArray["bldgTotalMarketValue"] += tofloat($improvementsBuildings->getMarketValue());
                     $this->formArray["bldgTotalAssessedValue"] += tofloat($improvementsBuildings->getAssessedValue());
                     $this->displayImprovementsBuildings($improvementsBuildings);
                 }
             }
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_var("MachineriesBlock", "");
             break;
         case "Machineries":
             $MachineriesDetails = new SoapObject(NCCBIZ . "MachineriesDetails.php", "urn:Object");
             if (!($xmlStr = $MachineriesDetails->getMachineries($propertyID))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $machineries = new Machineries();
                     $machineries->parseDomDocument($domDoc);
                     //$machineries->selectRecord($propertyID);
                     $this->formArray["machTotalMarketValue"] += tofloat($machineries->getMarketValue());
                     $this->formArray["machTotalAssessedValue"] += tofloat($machineries->getAssessedValue());
                     $this->displayMachineries($machineries);
                 }
             }
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             break;
         default:
             $this->tpl->set_block("TDList", "Land", "LandBlock");
             $this->tpl->set_var("LandBlock", "");
             $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock");
             $this->tpl->set_var("PlantsTreesBlock", "");
             $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock");
             $this->tpl->set_var("ImprovementsBuildingsBlock", "");
             $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock");
             $this->tpl->set_var("MachineriesBlock", "");
             $this->tpl->set_block("TDList", "TD", "TDBlock");
             $this->tpl->set_var("TDBlock", "");
     }
     $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object");
     $this->formArray["afsID"] = $TDEncode->getAfsID($this->formArray["tdID"]);
     $afs = new AFS();
     $this->formArray["odID"] = $afs->checkOdID($this->formArray["afsID"]);
     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
         //exit(print_r($OwnerList));
         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
         $this->tpl->set_var("OwnerListTableBlock", "");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $this->displayOwnerList($domDoc);
         }
     }
     $this->setForm();
     $this->tpl->parse("TDListBlock", "TDList", true);
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["rtdID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }