当前位置: 首页>>代码示例>>PHP>>正文


PHP Province::setDomDocument方法代码示例

本文整理汇总了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");
 }
开发者ID:armic,项目名称:erpts,代码行数:91,代码来源:ProvinceEncode.php


注:本文中的Province::setDomDocument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。