コード例 #1
0
ファイル: ODDetails.php プロジェクト: armic/erpts
 function Main()
 {
     //echo $this->formArray["formAction"];
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["personID"]) > 0) {
                 $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object");
                 if (!($deletedRows = $PersonList->deleteRecord($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) {
                 $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object");
                 if (!($deletedRows = $CompanyList->deleteRecord($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: ODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"])));
             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: ODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
     if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) {
         exit("xml failed");
     } else {
         //exit($xmlStr);
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $od = new OD();
             $od->parseDomDocument($domDoc);
             foreach ($od as $key => $value) {
                 if ($key == "locationAddress" && is_object($value)) {
                     foreach ($value as $lkey => $lvalue) {
                         $this->formArray[$lkey] = $lvalue;
                     }
                 } else {
                     $this->formArray[$key] = $value;
                 }
             }
             $this->formArray["landArea"] = number_format($od->getLandArea(), 4, '.', ',');
             // confirmation for double transaction
             $this->formArray["TRANSACTION_MAX_DAYDIFFERENCE"] = TRANSACTION_MAX_DAYDIFFERENCE;
             $this->formArray["dayDifference"] = getDateDifference($od->getDateCreated(), strtotime("now"), "d");
             $this->formArray["dayDifferenceText"] = getOnlyDays($this->formArray["dayDifference"]);
             $this->formArray["transactionCode"] = $od->getTransactionCode();
             $this->formArray["blockDoubleTransaction"] = $od->getArchive();
             $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
             $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
             //$OwnerList = new SoapObject(NCCBIZ."OwnerList.php", "urn:Object");
             $xmlStr = $od->owner->domDocument->dump_mem(true);
             if (!$xmlStr) {
                 //exit(print_r($OwnerList));
                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                 $this->tpl->set_var("OwnerListTableBlock", "");
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $this->displayOwnerList($domDoc);
                 }
             }
         }
     }
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     if (!($afsID = $AFSEncode->getAfsID($this->formArray["odID"]))) {
         //$this->tpl->set_block("rptsTemplate", "AFSDetails", "AFSDetailsBlock");
         //$this->tpl->set_var("AFSDetailsBlock", "");
         //echo "1afsID=".$afsID."=>".$this->formArray["odID"];
         $afs = new AFS();
         $afs->setOdID($this->formArray["odID"]);
         $afs->setDomDocument();
         $doc = $afs->getDomDocument();
         $xmlStr = $doc->dump_mem(true);
         //echo $xmlStr;
         if (!($afsID = $AFSEncode->saveAFS($xmlStr))) {
             echo "ret=" . $afsID;
         }
         //echo "<br>afsID=".$afsID;
     } else {
         //echo "2afsID=".$afsID."=>".$this->formArray["odID"];
         //$this->tpl->set_block("rptsTemplate", "AFSEncode", "AFSEncodeBlock");
         //$this->tpl->set_var("AFSEncodeBlock", "");
     }
     $this->displayODHistory();
     $this->formArray["afsID"] = $afsID;
     $this->setForm();
     $this->setPageDetailPerms();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #2
0
 function Main()
 {
     //echo $this->formArray["formAction"];
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["personID"]) > 0) {
                 $PersonList = new SoapObject(NCCBIZ . "PersonList.php", "urn:Object");
                 if (!($deletedRows = $PersonList->deleteRecord($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) {
                 $CompanyList = new SoapObject(NCCBIZ . "CompanyList.php", "urn:Object");
                 if (!($deletedRows = $CompanyList->deleteRecord($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: ChangeOfOwnershipODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"])));
             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: ChangeOfOwnershipODDetails.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
     if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) {
         exit("xml failed");
     } else {
         //exit($xmlStr);
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
         } else {
             $od = new OD();
             $od->parseDomDocument($domDoc);
             foreach ($od as $key => $value) {
                 if ($key == "locationAddress" && is_object($value)) {
                     foreach ($value as $lkey => $lvalue) {
                         $this->formArray[$lkey] = $lvalue;
                     }
                 } else {
                     $this->formArray[$key] = $value;
                 }
             }
             $this->formArray["landArea"] = number_format($od->getLandArea(), 4, '.', ',');
             $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
             $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
             //$OwnerList = new SoapObject(NCCBIZ."OwnerList.php", "urn:Object");
             $xmlStr = $od->owner->domDocument->dump_mem(true);
             if (!$xmlStr) {
                 //exit(print_r($OwnerList));
                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                 $this->tpl->set_var("OwnerListTableBlock", "");
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $this->displayOwnerList($domDoc);
                 }
             }
         }
     }
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     if (!($afsID = $AFSEncode->getAfsID($this->formArray["odID"]))) {
         //$this->tpl->set_block("rptsTemplate", "AFSDetails", "AFSDetailsBlock");
         //$this->tpl->set_var("AFSDetailsBlock", "");
         //echo "1afsID=".$afsID."=>".$this->formArray["odID"];
         $afs = new AFS();
         $afs->setOdID($this->formArray["odID"]);
         $afs->setDomDocument();
         $doc = $afs->getDomDocument();
         $xmlStr = $doc->dump_mem(true);
         //echo $xmlStr;
         if (!($afsID = $AFSEncode->saveAFS($xmlStr))) {
             echo "ret=" . $afsID;
         }
         //echo "<br>afsID=".$afsID;
     } else {
         //echo "2afsID=".$afsID."=>".$this->formArray["odID"];
         //$this->tpl->set_block("rptsTemplate", "AFSEncode", "AFSEncodeBlock");
         //$this->tpl->set_var("AFSEncodeBlock", "");
     }
     $this->formArray["afsID"] = $afsID;
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #3
0
ファイル: OwnerList.php プロジェクト: armic/erpts
 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");
 }