コード例 #1
0
 function updateImprovementsBuildingsDepreciation($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $improvementsBuildingsDepreciation = new ImprovementsBuildingsDepreciation();
     $improvementsBuildingsDepreciation->parseDomDocument($domDoc);
     $ret = $improvementsBuildingsDepreciation->updateRecord();
     return $ret;
 }
コード例 #2
0
 function getImprovementsBuildingsDepreciationDetails($improvementsBuildingsDepreciationID)
 {
     $improvementsBuildingsDepreciation = new ImprovementsBuildingsDepreciation();
     $improvementsBuildingsDepreciation->selectRecord($improvementsBuildingsDepreciationID);
     if (!($domDoc = $improvementsBuildingsDepreciation->getDomDocument())) {
         return false;
     } else {
         $xmlStr = $domDoc->dump_mem(true);
         return $xmlStr;
     }
 }
コード例 #3
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $this->tpl->set_var("MessageBlock", "");
             $ImprovementsBuildingsDepreciationDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDepreciationDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDepreciationDetails->getImprovementsBuildingsDepreciationDetails($this->formArray["improvementsBuildingsDepreciationID"]))) {
                 $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                 $this->tpl->set_var("TableBlock", "record not found");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "error xmlDoc");
                 } else {
                     $improvementsBuildingsDepreciation = new ImprovementsBuildingsDepreciation();
                     $improvementsBuildingsDepreciation->parseDomDocument($domDoc);
                     $this->formArray["improvementsBuildingsDepreciationID"] = $improvementsBuildingsDepreciation->getImprovementsBuildingsDepreciationID();
                     $this->formArray["code"] = $improvementsBuildingsDepreciation->getCode();
                     $this->formArray["reportCode"] = $improvementsBuildingsDepreciation->getReportCode();
                     $this->formArray["description"] = $improvementsBuildingsDepreciation->getDescription();
                     $this->formArray["rangeLowerBound"] = $improvementsBuildingsDepreciation->getRangeLowerBound();
                     $this->formArray["rangeUpperBound"] = $improvementsBuildingsDepreciation->getRangeUpperBound();
                     $this->formArray["value"] = $improvementsBuildingsDepreciation->getValue();
                     $this->formArray["status"] = $improvementsBuildingsDepreciation->getStatus();
                 }
             }
             break;
         case "save":
             if ($this->codeAlreadyExists() == true) {
                 $this->message = "Error. Cannot Save. Code already exists.";
                 $this->tpl->set_var("message", $this->message);
                 $this->tpl->parse("MessageBlock", "Message", true);
                 break;
             } else {
                 $this->tpl->set_var("MessageBlock", "");
             }
             $ImprovementsBuildingsDepreciationEncode = new SoapObject(NCCBIZ . "ImprovementsBuildingsDepreciationEncode.php", "urn:Object");
             if ($this->formArray["improvementsBuildingsDepreciationID"] != "") {
                 $ImprovementsBuildingsDepreciationDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDepreciationDetails.php", "urn:Object");
                 if (!($xmlStr = $ImprovementsBuildingsDepreciationDetails->getImprovementsBuildingsDepreciationDetails($this->formArray["improvementsBuildingsDepreciationID"]))) {
                     exit("record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $improvementsBuildingsDepreciation = new ImprovementsBuildingsDepreciation();
                         $improvementsBuildingsDepreciation->parseDomDocument($domDoc);
                         $improvementsBuildingsDepreciation->setImprovementsBuildingsDepreciationID($this->formArray["improvementsBuildingsDepreciationID"]);
                         $improvementsBuildingsDepreciation->setCode($this->formArray["code"]);
                         $improvementsBuildingsDepreciation->setReportCode($this->formArray["reportCode"]);
                         $improvementsBuildingsDepreciation->setDescription($this->formArray["description"]);
                         $improvementsBuildingsDepreciation->setRangeLowerBound($this->formArray["rangeLowerBound"]);
                         $improvementsBuildingsDepreciation->setRangeUpperBound($this->formArray["rangeUpperBound"]);
                         $improvementsBuildingsDepreciation->setValue($this->formArray["value"]);
                         $improvementsBuildingsDepreciation->setStatus($this->formArray["status"]);
                         $improvementsBuildingsDepreciation->setDomDocument();
                         $doc = $improvementsBuildingsDepreciation->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $ImprovementsBuildingsDepreciationEncode->updateImprovementsBuildingsDepreciation($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $improvementsBuildingsDepreciation = new ImprovementsBuildingsDepreciation();
                 $improvementsBuildingsDepreciation->setImprovementsBuildingsDepreciationID($this->formArray["improvementsBuildingsDepreciationID"]);
                 $improvementsBuildingsDepreciation->setCode($this->formArray["code"]);
                 $improvementsBuildingsDepreciation->setReportCode($this->formArray["reportCode"]);
                 $improvementsBuildingsDepreciation->setDescription($this->formArray["description"]);
                 $improvementsBuildingsDepreciation->setRangeLowerBound($this->formArray["rangeLowerBound"]);
                 $improvementsBuildingsDepreciation->setRangeUpperBound($this->formArray["rangeUpperBound"]);
                 $improvementsBuildingsDepreciation->setValue($this->formArray["value"]);
                 $improvementsBuildingsDepreciation->setStatus($this->formArray["status"]);
                 $improvementsBuildingsDepreciation->setDomDocument();
                 $doc = $improvementsBuildingsDepreciation->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $ImprovementsBuildingsDepreciationEncode->saveImprovementsBuildingsDepreciation($xmlStr))) {
                     exit("error save");
                 }
             }
             $this->formArray["improvementsBuildingsDepreciationID"] = $ret;
             header("location: ImprovementsBuildingsDepreciationClose.php" . $this->sess->url("") . $this->sess->add_query(array("improvementsBuildingsDepreciationID" => $ret)));
             //header("location: ImprovementsBuildingsDepreciationEncode.php");
             exit;
             break;
         case "cancel":
             header("location: ImprovementsBuildingsDepreciationClose.php" . $this->sess->url("") . $this->sess->add_query(array("improvementsBuildingsDepreciationID" => $ret)));
             //header("location: ImprovementsBuildingsDepreciationList.php");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "ImprovementsBuildingsDepreciationID", "ImprovementsBuildingsDepreciationIDBlock");
             $this->tpl->set_var("ImprovementsBuildingsDepreciationIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
             $this->tpl->set_var("MessageBlock", "");
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #4
0
 function updateStatus($statusIDArray = "")
 {
     $rows = 0;
     $this->selectRecords();
     foreach ($this->arrayList as $key => $value) {
         $value->status = "inactive";
         $value->updateRecord();
     }
     foreach ($statusIDArray as $key => $value) {
         $improvementsBuildingsDepreciation = new ImprovementsBuildingsDepreciation();
         $improvementsBuildingsDepreciation->selectRecord($value);
         $improvementsBuildingsDepreciation->status = "active";
         $improvementsBuildingsDepreciation->updateRecord();
         $rows++;
     }
     return $rows;
 }