function displayOwnerList($domDoc) { $ownerRecords = new OwnerRecords(); $ownerRecords->parseDomDocument($domDoc); $list = $ownerRecords->getArrayList(); foreach ($list as $key => $value) { if (count($value->personArray)) { $this->tpl->set_block("rptsTemplate", "OwnerDBEmpty", "OwnerDBEmptyBlock"); $this->tpl->set_var("OwnerDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); foreach ($value->personArray as $personKey => $personValue) { $this->tpl->set_var("personID", $personValue->getPersonID()); if (!($pname = $personValue->getFullName())) { $pname = "none"; } $this->tpl->set_var("fullName", $pname); $pAddress = $personValue->addressArray ? $personValue->addressArray[0]->getFullAddress() : ""; $this->tpl->set_var("address", $pAddress); $this->tpl->set_var("telephone", $personValue->getTelephone()); $this->tpl->parse("PersonListBlock", "PersonList", true); } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); } if (count($value->companyArray)) { $this->tpl->set_block("rptsTemplate", "OwnerDBEmpty", "OwnerDBEmptyBlock"); $this->tpl->set_var("OwnerDBEmptyBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); foreach ($value->companyArray as $companyKey => $companyValue) { $this->tpl->set_var("companyID", $companyValue->getCompanyID()); if (!($cname = $companyValue->getCompanyName())) { $cname = "none"; } $this->tpl->set_var("companyName", $cname); $cAddress = $companyValue->addressArray ? $companyValue->addressArray[0]->getFullAddress() : ""; $this->tpl->set_var("address", $cAddress); $this->tpl->set_var("telephone", $companyValue->getTelephone()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } } else { $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } //if (!count($value->companyArray)&&count($value->personArray)){ // $this->tpl->set_block("rptsTemplate", "OwnerDBEmpty", "OwnerDBEmptyBlock"); // $this->tpl->set_var("OwnerDBEmptyBlock", ""); //} } }
function displayOwnerList($domDoc) { $ownerRecords = new OwnerRecords(); $ownerRecords->parseDomDocument($domDoc); $list = $ownerRecords->getArrayList(); foreach ($list as $key => $value) { if (count($value->personArray)) { $p = 0; foreach ($value->personArray as $pKey => $pValue) { $p++; if ($p == 1) { $this->tpl->set_var("PersonListBlock", ""); } $this->tpl->set_var("personID", $pValue->getPersonID()); $this->tpl->set_var("OwnerPerson", $pValue->getFullName()); $this->tpl->parse("PersonListBlock", "PersonList", true); } $this->tpl->set_var("none", ""); } else { if (!count($value->companyArray)) { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("PersonListBlock", ""); } if (count($value->companyArray)) { $c = 0; foreach ($value->companyArray as $cKey => $cValue) { $c++; if ($c == 1) { $this->tpl->set_var("CompanyListBlock", ""); } $this->tpl->set_var("companyID", $cValue->getCompanyID()); $this->tpl->set_var("OwnerCompany", $cValue->getCompanyName()); $this->tpl->parse("CompanyListBlock", "CompanyList", true); } $this->tpl->set_var("none", ""); } else { if (!count($value->personArray)) { $this->tpl->set_var("none", "none"); } $this->tpl->set_var("CompanyListBlock", ""); } } }
function getOwnerNames($ownerID) { $ownerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($xmlStr = $ownerList->getOwnerList($ownerID))) { return ""; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { return ""; } else { $ownerRecords = new OwnerRecords(); $ownerRecords->parseDomDocument($domDoc); $list = $ownerRecords->getArrayList(); $ownerNames = ""; foreach ($list as $owner) { if (is_array($owner->getPersonArray())) { $personArray = $owner->getPersonArray(); foreach ($personArray as $person) { if ($ownerNames != "") { $ownerNames .= ", "; } $ownerNames .= $person->getFullName(); } } if (is_array($owner->getCompanyArray())) { $companyArray = $owner->getCompanyArray(); foreach ($companyArray as $company) { if ($ownerNames != "") { $ownerNames .= ", "; } $ownerNames .= $company->getCompanyName(); } } } return $ownerNames; } } }
function getReceivedFromName($ownerID) { $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($xmlStr = $OwnerList->getOwnerList($ownerID))) { // error xmlStr } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $ownerRecords = new OwnerRecords(); $ownerRecords->parseDomDocument($domDoc); $receivedFromName = ""; $ownerArrayList = $ownerRecords->getArrayList(); foreach ($ownerArrayList as $owner) { $companyArray = $owner->getCompanyArray(); $personArray = $owner->getPersonArray(); if (is_array($personArray)) { foreach ($personArray as $person) { if ($receivedFromName != "") { $receivedFromName .= ", "; } $receivedFromName .= $person->getFirstName(); if ($person->getMiddleName() != "") { $receivedFromName .= " " . substr($person->getMiddleName(), 0, 1) . "."; } $receivedFromName .= " " . $person->getLastName(); } } if (is_array($companyArray)) { foreach ($companyArray as $company) { if ($receivedFromName != "") { $receivedFromName .= ", "; } $receivedFromName .= $company->getCompanyName(); } } } return $receivedFromName; } } }