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


PHP District::getCode方法代码示例

本文整理汇总了PHP中District::getCode方法的典型用法代码示例。如果您正苦于以下问题:PHP District::getCode方法的具体用法?PHP District::getCode怎么用?PHP District::getCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在District的用法示例。


在下文中一共展示了District::getCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Main

 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $this->tpl->set_var("MessageBlock", "");
             $DistrictDetails = new SoapObject(NCCBIZ . "DistrictDetails.php", "urn:Object");
             if (!($xmlStr = $DistrictDetails->getDistrictDetails($this->formArray["districtID"]))) {
                 $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 {
                     $district = new District();
                     $district->parseDomDocument($domDoc);
                     $this->formArray["districtID"] = $district->getDistrictID();
                     $this->formArray["code"] = $district->getCode();
                     $this->formArray["municipalityCityID"] = $district->getMunicipalityCityID();
                     $this->formArray["description"] = $district->getDescription();
                     $this->formArray["status"] = $district->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", "");
             }
             $DistrictEncode = new SoapObject(NCCBIZ . "DistrictEncode.php", "urn:Object");
             if ($this->formArray["districtID"] != "") {
                 $DistrictDetails = new SoapObject(NCCBIZ . "DistrictDetails.php", "urn:Object");
                 if (!($xmlStr = $DistrictDetails->getDistrictDetails($this->formArray["districtID"]))) {
                     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 {
                         $district = new District();
                         $district->parseDomDocument($domDoc);
                         $district->setDistrictID($this->formArray["districtID"]);
                         $district->setCode($this->formArray["code"]);
                         $district->setMunicipalityCityID($this->formArray["municipalityCityID"]);
                         $district->setDescription($this->formArray["description"]);
                         $district->setStatus($this->formArray["status"]);
                         $district->setDomDocument();
                         $doc = $district->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $DistrictEncode->updateDistrict($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $district = new District();
                 $district->setDistrictID($this->formArray["districtID"]);
                 $district->setCode($this->formArray["code"]);
                 $district->setMunicipalityCityID($this->formArray["municipalityCityID"]);
                 $district->setDescription($this->formArray["description"]);
                 $district->setStatus($this->formArray["status"]);
                 $district->setDomDocument();
                 $doc = $district->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $DistrictEncode->saveDistrict($xmlStr))) {
                     exit("error save");
                 }
             }
             $this->formArray["districtID"] = $ret;
             header("location: DistrictClose.php" . $this->sess->url("") . $this->sess->add_query(array("districtID" => $ret)));
             //header("location: DistrictEncode.php?".$this->sess->name."=".$this->sess->id."&districtID=".$ret.".&formAction=edit");
             exit;
             break;
         case "cancel":
             header("location: DistrictClose.php" . $this->sess->url("") . $this->sess->add_query(array("districtID" => $ret)));
             //header("location: DistrictList.php?".$this->sess->name."=".$this->sess->id."&districtID=".$ret.".&formAction=edit");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "DistrictID", "DistrictIDBlock");
             $this->tpl->set_var("DistrictIDBlock", "");
             $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,代码行数:94,代码来源:DistrictEncode.php

示例2: getDistrict

 function getDistrict($districtID)
 {
     $DistrictDetails = new SoapObject(NCCBIZ . "DistrictDetails.php", "urn:Object");
     if (!($xmlStr = $DistrictDetails->getDistrictDetails($districtID))) {
         $ret = "District DB empty";
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $ret = "error districtXmlDoc";
         } else {
             $district = new District();
             $district->parseDomDocument($domDoc);
             if ($district->getCode() == "0") {
                 $ret = "no district";
             } else {
                 $ret = $district->getDescription();
             }
         }
     }
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:20,代码来源:BarangayList.php


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