本文整理汇总了PHP中District::getDistrictID方法的典型用法代码示例。如果您正苦于以下问题:PHP District::getDistrictID方法的具体用法?PHP District::getDistrictID怎么用?PHP District::getDistrictID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类District
的用法示例。
在下文中一共展示了District::getDistrictID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}