function getPropAssessUsesDetails($propAssessUsesID) { $propAssessUses = new PropAssessUses(); $propAssessUses->selectRecord($propAssessUsesID); if (!($domDoc = $propAssessUses->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } }
function Main() { switch ($this->formArray["formAction"]) { case "edit": $PropAssessUsesDetails = new SoapObject(NCCBIZ . "PropAssessUsesDetails.php", "urn:Object"); if (!($xmlStr = $PropAssessUsesDetails->getPropAssessUsesDetails($this->formArray["propAssessUsesID"]))) { $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 { $propAssessUses = new PropAssessUses(); $propAssessUses->parseDomDocument($domDoc); $this->formArray["propAssessUsesID"] = $propAssessUses->getPropAssessUsesID(); $this->formArray["code"] = $propAssessUses->getCode(); $this->formArray["description"] = $propAssessUses->getDescription(); $this->formArray["value"] = $propAssessUses->getValue(); $this->formArray["status"] = $propAssessUses->getStatus(); } } break; case "save": $PropAssessUsesEncode = new SoapObject(NCCBIZ . "PropAssessUsesEncode.php", "urn:Object"); if ($this->formArray["propAssessUsesID"] != "") { $PropAssessUsesDetails = new SoapObject(NCCBIZ . "PropAssessUsesDetails.php", "urn:Object"); if (!($xmlStr = $PropAssessUsesDetails->getPropAssessUsesDetails($this->formArray["propAssessUsesID"]))) { 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 { $propAssessUses = new PropAssessUses(); $propAssessUses->parseDomDocument($domDoc); $propAssessUses->setPropAssessUsesID($this->formArray["propAssessUsesID"]); $propAssessUses->setCode($this->formArray["code"]); $propAssessUses->setDescription($this->formArray["description"]); $propAssessUses->setValue($this->formArray["value"]); $propAssessUses->setStatus($this->formArray["status"]); $propAssessUses->setDomDocument(); $doc = $propAssessUses->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $PropAssessUsesEncode->updatePropAssessUses($xmlStr))) { exit("error update"); } } } } else { $propAssessUses = new PropAssessUses(); $propAssessUses->setPropAssessUsesID($this->formArray["propAssessUsesID"]); $propAssessUses->setCode($this->formArray["code"]); $propAssessUses->setDescription($this->formArray["description"]); $propAssessUses->setValue($this->formArray["value"]); $propAssessUses->setStatus($this->formArray["status"]); $propAssessUses->setDomDocument(); $doc = $propAssessUses->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $PropAssessUsesEncode->savePropAssessUses($xmlStr))) { exit("error save"); } } $this->formArray["propAssessUsesID"] = $ret; header("location: PropAssessUsesEncode.php"); exit; break; case "cancel": header("location: PropAssessUsesList.php"); exit; break; default: $this->tpl->set_block("rptsTemplate", "PropAssessUsesID", "PropAssessUsesIDBlock"); $this->tpl->set_var("PropAssessUsesIDBlock", ""); $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock"); $this->tpl->set_var("ACKBlock", ""); } $this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }