예제 #1
0
파일: tdHistory.php 프로젝트: armic/erpts
 function generateTDHistory($tdID)
 {
     $td = new TD();
     $td->selectRecord($tdID);
     $afsID = $td->getAfsID();
     //		echo("afsID=$afsID<br>");
     $afs = new AFS();
     $afs->selectRecord($afsID);
     $odID = $afs->getOdID();
     //	echo("odID=$odID<br>");
     $condition = sprintf(" WHERE presentODID='%s' ", fixQuotes($odID));
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectRecords($condition);
     if (count($odHistoryRecords->arrayList) > 0) {
         //	echo("count>0<br>");
         foreach ($odHistoryRecords->arrayList as $key => $odHistory) {
             $previousODID = $odHistory->getPreviousODID();
             $presentODID = $odHistory->getPresentODID();
             $previousAFS = new AFS();
             $previousAFS->selectRecord($afsID = "", $limit = "", $previousODID);
             $previousAFSID = $previousAFS->getAfsID();
             $previousTD = new TD();
             $previousTD->selectRecord($tdID = "", $previousAFSID);
             $previousTDID = $previousTD->getTdID();
             $this->tdHistory[] = $previousTD;
             $this->generateTDHistory($previousTDID);
         }
     } else {
         //echo("count==0<br>");
         return false;
     }
 }
예제 #2
0
 function displayRecords()
 {
     $this->selectRecords();
     $this->tpl->set_block("rptsTemplate", "OwnerPersonList", "OwnerPersonListBlock");
     $this->tpl->set_block("OwnerPersonList", "ODList", "ODListBlock");
     foreach ($this->arrayList as $person) {
         $this->tpl->set_var("personID", $person->getPersonID());
         $this->tpl->set_var("lastName", $person->getLastName());
         $this->tpl->set_var("firstName", $person->getFirstName());
         $this->tpl->set_var("middleName", $person->getMiddleName());
         $this->tpl->set_var("gender", $person->getGender());
         $this->tpl->set_var("birthday", $person->getBirthday());
         $this->tpl->set_var("maritalStatus", $person->getMaritalStatus());
         $this->tpl->set_var("tin", $person->getTin());
         $this->tpl->set_var("telephone", $person->getTelephone());
         $this->tpl->set_var("mobileNumber", $person->getMobileNumber());
         $this->tpl->set_var("email", $person->getEmail());
         if (is_array($person->addressArray)) {
             $address = $person->addressArray[0];
             $this->tpl->set_var("address", $address->getFullAddress());
         }
         // capture OD, AFS, and TD info
         $this->setDB();
         $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerPerson " . " WHERE " . " Owner.ownerID = OwnerPerson.ownerID AND " . " OwnerPerson.personID = '%s' ", $person->getPersonID());
         $this->db->query($sql);
         while ($this->db->next_record()) {
             $od = new OD();
             if ($od->selectRecord($this->db->f("odID"))) {
                 $this->ODArray[] = $od;
                 $this->tpl->set_var("odID", $od->getOdID());
                 if (is_object($od->locationAddress)) {
                     $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress());
                 } else {
                     $this->tpl->set_var("locationAddress", "");
                 }
                 $afs = new AFS();
                 if ($afs->selectRecord("", "", $od->getOdID(), "")) {
                     $this->tpl->set_var("afsID", $afs->getAfsID());
                     $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber());
                     $this->tpl->set_var("arpNumber", $afs->getArpNumber());
                     if (is_array($afs->landArray)) {
                         $this->displayLandList($afs->landArray);
                     }
                     if (is_array($afs->plantsTreesArray)) {
                         $this->displayPlantsTreesList($afs->plantsTreesArray);
                     }
                     if (is_array($afs->improvementsBuildingsArray)) {
                         $this->displayImprovementsBuildingsList($afs->improvementsBuildingsArray);
                     }
                     if (is_array($afs->machineriesArray)) {
                         $this->displayMachineriesList($afs->machineriesArray);
                     }
                     $td = new TD();
                     if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) {
                         $this->tpl->set_var("tdID", $td->getTdID());
                         $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber());
                         $this->tpl->set_var("propertyType", $td->getPropertyType());
                     }
                 }
                 unset($td);
                 unset($afs);
                 unset($od);
                 $this->tpl->parse("ODListBlock", "ODList", true);
             }
         }
         $this->tpl->parse("OwnerPersonListBlock", "OwnerPersonList", true);
         $this->tpl->set_var("ODListBlock", "");
         $this->clearPropertyElements();
         unset($this->ODArray);
         unset($this->AFSArray);
         unset($this->TDArray);
         unset($this->db);
     }
 }
예제 #3
0
 function getTDArrayFromCompany($companyID)
 {
     $this->setDB();
     $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerCompany " . " WHERE " . " Owner.ownerID = OwnerCompany.ownerID AND " . " OwnerCompany.companyID = '%s' ", $companyID);
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $od = new OD();
         if ($od->selectRecord($this->db->f("odID"))) {
             $this->ODArray[] = $od;
             $afs = new AFS();
             if ($afs->selectRecord("", "", $od->getOdID(), "")) {
                 $td = new TD();
                 if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) {
                     $tdArray[] = $td;
                 }
             }
         }
     }
     if (!is_array($tdArray)) {
         $tdArray = false;
     }
     return $tdArray;
 }
예제 #4
0
파일: DueDetails.php 프로젝트: armic/erpts
 function getTDIDArrayFromParentTDID($presentTDID)
 {
     $presentTD = new TD();
     $presentTD->selectRecord($presentTDID);
     $presentAfsID = $presentTD->getAfsID();
     $presentAFS = new AFS();
     $presentAFS->selectRecord($presentAFSID);
     $presentODID = $presentAFS->getOdID();
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectPrecOD($presentODID);
     if (is_array($odHistoryRecords->arrayList)) {
         foreach ($odHistoryRecords as $odID) {
             $afs = new AFS();
             $afs->selectRecord("", "", $odID);
             $afsID = $afs->getAfsID();
             $td = new TD();
             $td->selectRecord("", $afsID);
             $tdID = $td->getTdID();
             $tdIDArray[] = $tdID;
         }
         if (is_array($tdIDArray)) {
             return $tdIDArray;
         }
     }
     return false;
 }
예제 #5
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "save":
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 exit("error xml");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     exit("error domDoc");
                 } else {
                     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $afs->setArpNumber($this->formArray["arpNumber"]);
                     $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                     $afs->setTaxability($this->formArray["taxability"]);
                     $afs->setEffectivity($this->formArray["effectivity"]);
                     $afs->setDomDocument();
                     $doc = $afs->getDomDocument();
                     $xmlStr = $doc->dump_mem(true);
                     if (!($ret = $AFSEncode->updateAFS($xmlStr))) {
                         exit("error update");
                     }
                 }
             }
             header("location: RPUIdentificationClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         default:
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 exit("error xml");
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     exit("error domDoc");
                 } else {
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $this->formArray["afsID"] = $afs->getAfsID();
                     $this->formArray["arpNumber"] = $afs->getArpNumber();
                     $this->formArray["taxability"] = $afs->getTaxability();
                     $this->formArray["effectivity"] = $afs->getEffectivity();
                     $this->formArray["propertyIndexNumber"] = $afs->getPropertyIndexNumber();
                 }
             }
             break;
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
예제 #6
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "save":
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 exit("error xml");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     exit("error domDoc");
                 } else {
                     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $afs->setArpNumber($this->formArray["arpNumber"]);
                     $afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]);
                     // convert $pointsArray to $gisTechnicalDescription string
                     // separate each point with "-" and each pointRecord with ","
                     $pointsArray = $this->formArray["pointsArray"];
                     $pointID = 1;
                     if (is_array($pointsArray)) {
                         for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) {
                             $pointArray = array($pointID, $pointsArray[$pointID]["pointType"], $pointsArray[$pointID]["quadrant"], $pointsArray[$pointID]["bearingDeg"], $pointsArray[$pointID]["bearingMin"], $pointsArray[$pointID]["distance"]);
                             $pointString = implode("-", $pointArray);
                             $gisTechDescArray[$pointID] = $pointString;
                         }
                         $gisTechnicalDescription = implode(",", $gisTechDescArray);
                         $this->formArray["gisTechnicalDescription"] = $gisTechnicalDescription;
                     }
                     $afs->setGISTechnicalDescription($this->formArray["gisTechnicalDescription"]);
                     $afs->setDomDocument();
                     $doc = $afs->getDomDocument();
                     $xmlStr = $doc->dump_mem(true);
                     if (!($ret = $AFSEncode->updateAFS($xmlStr))) {
                         exit("error update");
                     }
                 }
             }
             header("location: GISTechnicalDescriptionClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         case "del":
             // temporarily del points
             $delPointsArray = $this->formArray["pointsArray"];
             $pointID = 1;
             if (is_array($delPointsArray)) {
                 for ($delPointID = 1; $delPointID <= count($delPointsArray); $delPointID++) {
                     if ($delPointID != $this->formArray["delPointID"]) {
                         $pointsArray[$pointID]["pointType"] = $delPointsArray[$delPointID]["pointType"];
                         $pointsArray[$pointID]["quadrant"] = $delPointsArray[$delPointID]["quadrant"];
                         $pointsArray[$pointID]["bearingDeg"] = $delPointsArray[$delPointID]["bearingDeg"];
                         $pointsArray[$pointID]["bearingMin"] = $delPointsArray[$delPointID]["bearingMin"];
                         $pointsArray[$pointID]["distance"] = $delPointsArray[$delPointID]["distance"];
                         $pointID++;
                     }
                 }
                 if (is_array($pointsArray)) {
                     $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock");
                     for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) {
                         $this->tpl->set_var("pointID", $pointID);
                         $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]);
                         $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]);
                         $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]);
                         $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]);
                         $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]);
                         $this->tpl->parse("PointsListBlock", "PointsList", true);
                     }
                     $this->formArray["pointsExist"] = "true";
                 } else {
                     $this->formArray["pointsExist"] = "false";
                     $this->hideBlock("PointsList");
                 }
             }
             break;
         case "add":
             // temporarily add points
             $pointsArray = $this->formArray["pointsArray"];
             $pointID = 1;
             if (is_array($pointsArray)) {
                 $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock");
                 for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) {
                     $this->tpl->set_var("pointID", $pointID);
                     $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]);
                     $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]);
                     $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]);
                     $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]);
                     $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]);
                     $this->tpl->parse("PointsListBlock", "PointsList", true);
                 }
                 $pointsArray[$pointID]["pointType"] = $this->formArray["pointType"];
                 $pointsArray[$pointID]["quadrant"] = $this->formArray["quadrant"];
                 $pointsArray[$pointID]["bearingDeg"] = $this->formArray["bearingDeg"];
                 $pointsArray[$pointID]["bearingMin"] = $this->formArray["bearingMin"];
                 $pointsArray[$pointID]["distance"] = $this->formArray["distance"];
                 $this->tpl->set_var("pointID", $pointID);
                 $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]);
                 $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]);
                 $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]);
                 $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]);
                 $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]);
                 $this->tpl->parse("PointsListBlock", "PointsList", true);
             } else {
                 $pointsArray[$pointID]["pointType"] = $this->formArray["pointType"];
                 $pointsArray[$pointID]["quadrant"] = $this->formArray["quadrant"];
                 $pointsArray[$pointID]["bearingDeg"] = $this->formArray["bearingDeg"];
                 $pointsArray[$pointID]["bearingMin"] = $this->formArray["bearingMin"];
                 $pointsArray[$pointID]["distance"] = $this->formArray["distance"];
                 $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock");
                 $this->tpl->set_var("pointID", $pointID);
                 $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]);
                 $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]);
                 $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]);
                 $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]);
                 $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]);
                 $this->tpl->parse("PointsListBlock", "PointsList", true);
             }
             $this->formArray["pointsExist"] = "true";
             break;
         default:
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 exit("error xml");
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     exit("error domDoc");
                 } else {
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $this->formArray["afsID"] = $afs->getAfsID();
                     $this->formArray["cadastralLotNumber"] = $afs->getCadastralLotNumber();
                     $this->formArray["gisTechnicalDescription"] = $afs->getGISTechnicalDescription();
                     if ($this->formArray["gisTechnicalDescription"] == "") {
                         $this->formArray["pointsExist"] = "false";
                         $this->hideBlock("PointsList");
                     } else {
                         $this->formArray["pointsExist"] = "true";
                         // parse gisTechnicalDescription into $pointsArray
                         // separate each pointRecord at "," and each point at "-"
                         $gisTechDescArray = explode(",", $this->formArray["gisTechnicalDescription"]);
                         foreach ($gisTechDescArray as $pointString) {
                             $pointArray = explode("-", $pointString);
                             $pointID = $pointArray[0];
                             $pointsArray[$pointID]["pointType"] = $pointArray[1];
                             $pointsArray[$pointID]["quadrant"] = $pointArray[2];
                             $pointsArray[$pointID]["bearingDeg"] = $pointArray[3];
                             $pointsArray[$pointID]["bearingMin"] = $pointArray[4];
                             $pointsArray[$pointID]["distance"] = $pointArray[5];
                         }
                         if (is_array($pointsArray)) {
                             $this->tpl->set_block("rptsTemplate", "PointsList", "PointsListBlock");
                             for ($pointID = 1; $pointID <= count($pointsArray); $pointID++) {
                                 $this->tpl->set_var("pointID", $pointID);
                                 $this->tpl->set_var("pointType", $pointsArray[$pointID]["pointType"]);
                                 $this->tpl->set_var("quadrant", $pointsArray[$pointID]["quadrant"]);
                                 $this->tpl->set_var("bearingDeg", $pointsArray[$pointID]["bearingDeg"]);
                                 $this->tpl->set_var("bearingMin", $pointsArray[$pointID]["bearingMin"]);
                                 $this->tpl->set_var("distance", $pointsArray[$pointID]["distance"]);
                                 $this->tpl->parse("PointsListBlock", "PointsList", true);
                             }
                         }
                     }
                 }
             }
             break;
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }