Exemplo n.º 1
0
 function getOwnerNames()
 {
     $ownerRecords = new OwnerRecords();
     if ($ownerNames = $ownerRecords->getOwnerNames()) {
         return $ownerNames;
     } else {
         return false;
     }
 }
Exemplo n.º 2
0
 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", "");
         //}
     }
 }
Exemplo n.º 3
0
 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", "");
         }
     }
 }
Exemplo n.º 4
0
 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;
         }
     }
 }
Exemplo n.º 5
0
 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;
         }
     }
 }
Exemplo n.º 6
0
 function removeOwnerCompany($ownerID, $personIDArray)
 {
     $ownerRecords = new OwnerRecords();
     $rows = $ownerRecords->removeOwnerCompanyRecords($ownerID, $personIDArray);
     return $rows;
 }
Exemplo n.º 7
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             //print_r($this->formArray);
             if (count($this->formArray["personID"]) > 0) {
                 $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object");
                 if (!($deletedRows = $PersonList->deletePerson($this->formArray["personID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             //print_r($this->formArray);
             if (count($this->formArray["companyID"]) > 0) {
                 $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object");
                 if (!($deletedRows = $CompanyList->deleteCompany($this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: OwnerList.php" . $this->sess->url("") . $this->sess->add_query(array("ownerID" => $this->formArray["ownerID"])));
             exit;
             break;
         case "remove":
             //*
             if (count($this->formArray["personID"])) {
                 $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                 if (!($deletedRows = $OwnerList->removeOwnerPerson($this->formArray["ownerID"], $this->formArray["personID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["companyID"]) > 0) {
                 $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                 if (!($deletedRows = $OwnerList->removeOwnerCompany($this->formArray["ownerID"], $this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: OwnerList.php" . $this->sess->url("") . $this->sess->add_query(array("ownerID" => $this->formArray["ownerID"])));
             exit;
             break;
         case "cancel":
             header("location: OwnerList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $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", "invalid ownerID");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $ownerRecords = new OwnerRecords();
             $ownerRecords->parseDomOwnerRecords($domDoc);
             $list = $ownerRecords->getOwnerList();
             foreach ($list as $key => $value) {
                 if (count($value->personArray)) {
                     $this->tpl->set_block("rptsTemplate", "PersonDBEmpty", "PersonDBEmptyBlock");
                     $this->tpl->set_var("PersonDBEmptyBlock", "");
                     $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);
                         $this->tpl->set_var("tin", $personValue->getTin());
                         $this->tpl->set_var("telephone", $personValue->getTelephone());
                         $this->tpl->set_var("mobileNumber", $personValue->getMobileNumber());
                         $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", "CompanyDBEmpty", "CompanyDBEmptyBlock");
                     $this->tpl->set_var("CompanyDBEmptyBlock", "");
                     $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                     //print_r($value->companyArray);
                     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);
                         $this->tpl->set_var("tin", $companyValue->getTin());
                         $this->tpl->set_var("telephone", $companyValue->getTelephone());
                         $this->tpl->set_var("fax", $companyValue->getFax());
                         $this->tpl->parse("CompanyListBlock", "CompanyList", true);
                     }
                 } else {
                     $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                     $this->tpl->set_var("CompanyListBlock", "");
                 }
             }
         }
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemplo n.º 8
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "deletePerson":
             //print_r($this->formArray);
             if (count($this->formArray["personID"]) > 0) {
                 $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object");
                 if (!($deletedRows = $PersonList->deleteOwner($this->formArray["personID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "deleteCompany":
             //print_r($this->formArray);
             if (count($this->formArray["companyID"]) > 0) {
                 $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object");
                 if (!($deletedRows = $CompanyList->deleteCompany($this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "cancel":
             header("location: OwnerList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
     if (!($xmlStr = $OwnerList->getOwnerList())) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $personRecords = new OwnerRecords();
             $personRecords->parseDomOwnerRecords($domDoc);
             $list = $personRecords->getOwnerList();
             $this->tpl->set_block("rptsTemplate", "OwnerList", "OwnerListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("personID", $value->getOwnerID());
                 if (!($pname = $value->getFullName())) {
                     $pname = "none";
                 }
                 $this->tpl->set_var("fullName", $pname);
                 $this->tpl->set_var("tin", $value->getTin());
                 $this->tpl->set_var("telephone", $value->getTelephone());
                 $this->tpl->set_var("mobileNumber", $value->getMobileNumber());
                 $this->tpl->parse("OwnerListBlock", "OwnerList", true);
             }
         }
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }