本文整理汇总了PHP中Province::setDomDocument方法的典型用法代码示例。如果您正苦于以下问题:PHP Province::setDomDocument方法的具体用法?PHP Province::setDomDocument怎么用?PHP Province::setDomDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Province
的用法示例。
在下文中一共展示了Province::setDomDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Main
function Main()
{
switch ($this->formArray["formAction"]) {
case "edit":
$this->tpl->set_var("MessageBlock", "");
$ProvinceDetails = new SoapObject(NCCBIZ . "ProvinceDetails.php", "urn:Object");
if (!($xmlStr = $ProvinceDetails->getProvinceDetails($this->formArray["provinceID"]))) {
$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 {
$province = new Province();
$province->parseDomDocument($domDoc);
$this->formArray["provinceID"] = $province->getProvinceID();
$this->formArray["code"] = $province->getCode();
$this->formArray["description"] = $province->getDescription();
$this->formArray["status"] = $province->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", "");
}
$ProvinceEncode = new SoapObject(NCCBIZ . "ProvinceEncode.php", "urn:Object");
if ($this->formArray["provinceID"] != "") {
$ProvinceDetails = new SoapObject(NCCBIZ . "ProvinceDetails.php", "urn:Object");
if (!($xmlStr = $ProvinceDetails->getProvinceDetails($this->formArray["provinceID"]))) {
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 {
$province = new Province();
$province->parseDomDocument($domDoc);
$province->setProvinceID($this->formArray["provinceID"]);
$province->setCode($this->formArray["code"]);
$province->setDescription($this->formArray["description"]);
$province->setStatus($this->formArray["status"]);
$province->setDomDocument();
$doc = $province->getDomDocument();
$xmlStr = $doc->dump_mem(true);
if (!($ret = $ProvinceEncode->updateProvince($xmlStr))) {
exit("error update");
}
}
}
} else {
$province = new Province();
$province->setProvinceID($this->formArray["provinceID"]);
$province->setCode($this->formArray["code"]);
$province->setDescription($this->formArray["description"]);
$province->setStatus($this->formArray["status"]);
$province->setDomDocument();
$doc = $province->getDomDocument();
$xmlStr = $doc->dump_mem(true);
if (!($ret = $ProvinceEncode->saveProvince($xmlStr))) {
exit("error save");
}
}
$this->formArray["provinceID"] = $ret;
header("location: ProvinceClose.php" . $this->sess->url("") . $this->sess->add_query(array("provinceID" => $ret)));
//header("location: ProvinceEncode.php");
exit;
break;
case "cancel":
header("location: ProvinceClose.php" . $this->sess->url("") . $this->sess->add_query(array("provinceID" => $ret)));
//header("location: ProvinceList.php");
exit;
break;
default:
$this->tpl->set_block("rptsTemplate", "ProvinceID", "ProvinceIDBlock");
$this->tpl->set_var("ProvinceIDBlock", "");
$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");
}