function updatePropAssessUses($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $propAssessUses = new PropAssessUses(); $propAssessUses->parseDomDocument($domDoc); $ret = $propAssessUses->updateRecord(); return $ret; }
function parseDomDocument($domDoc) { $baseNode = $domDoc->document_element(); if ($baseNode->has_child_nodes()) { $child = $baseNode->first_child(); while ($child) { //if ($child->tagname=="PropAssessUses") { if ($child->tagname) { $tempXmlStr = $domDoc->dump_node($child); $tempDomDoc = domxml_open_mem($tempXmlStr); $propAssessUses = new PropAssessUses(); $propAssessUses->parseDomDocument($tempDomDoc); $this->arrayList[] = $propAssessUses; } $child = $child->next_sibling(); } } else { return false; } return $this->setDomDocument(); }
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"); }