function getLand($propertyID) { $land = new Land(); $land->selectRecord($propertyID); if (!($domDoc = $land->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } }
function updateLandForBuildup($xmlStr) { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } $land = new Land(); $land->parseDomDocument($domDoc); //echo $xmlStr; $ret = $land->updateRecordForBuildup(); return $ret; }
function delete_by_parent($catalogue_id, $id) { $id = $this->uri->segment(5); $catalogue_id = $this->uri->segment(4); $lands = new Land($id); if (!$lands->exists()) { show_404(); } $lands->delete(); flash_message('success', 'Xóa thành công.'); redirect($this->admin . 'lands/list_by_parent/' . $catalogue_id); }
function save($object = '', $related_field = '') { if (!$this->exists()) { $o = new Land(); $o->select_max('position'); $o->get(); if (count($o->all) != 0) { $max = $o->position + 1; $this->position = $max; } else { $this->postion = 1; } } return parent::save($object, $related_field); }
function Main() { $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); $propertyType = $this->formArray["propertyType"]; $propertyID = $this->formArray["propertyID"]; switch ($propertyType) { case "Land": $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $land = new Land(); $land->parseDomDocument($domDoc); //$land->selectRecord($propertyID); $this->formArray["landTotalMarketValue"] += tofloat($land->getMarketValue()); $this->formArray["landTotalAssessedValue"] += tofloat($land->getAssessedValue()); $this->displayLand($land); //echo $this->formArray["landTotalAssessedValue"]; } } $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); break; case "PlantsTrees": $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object"); if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); //$plantsTrees->selectRecord($propertyID); $this->formArray["plantTotalMarketValue"] += tofloat($plantsTrees->getMarketValue()); $this->formArray["plantTotalAssessedValue"] += tofloat($plantsTrees->getAssessedValue()); $this->displayPlantsTrees($plantsTrees); } } $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); break; case "ImprovementsBuildings": $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object"); if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $improvementsBuildings = new ImprovementsBuildings(); $improvementsBuildings->parseDomDocument($domDoc); //$improvementsBuildings->selectRecord($propertyID); $this->formArray["bldgTotalMarketValue"] += tofloat($improvementsBuildings->getMarketValue()); $this->formArray["bldgTotalAssessedValue"] += tofloat($improvementsBuildings->getAssessedValue()); $this->displayImprovementsBuildings($improvementsBuildings); } } $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); break; case "Machineries": $MachineriesDetails = new SoapObject(NCCBIZ . "MachineriesDetails.php", "urn:Object"); if (!($xmlStr = $MachineriesDetails->getMachineries($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $machineries = new Machineries(); $machineries->parseDomDocument($domDoc); //$machineries->selectRecord($propertyID); $this->formArray["machTotalMarketValue"] += tofloat($machineries->getMarketValue()); $this->formArray["machTotalAssessedValue"] += tofloat($machineries->getAssessedValue()); $this->displayMachineries($machineries); } } $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); break; default: $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_var("LandBlock", ""); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); $this->tpl->set_var("MachineriesBlock", ""); $this->tpl->set_block("TDList", "TD", "TDBlock"); $this->tpl->set_var("TDBlock", ""); } $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object"); $this->formArray["afsID"] = $TDEncode->getAfsID($this->formArray["tdID"]); $afs = new AFS(); $this->formArray["odID"] = $afs->checkOdID($this->formArray["afsID"]); $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object"); $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]); $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) { //exit(print_r($OwnerList)); $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } $this->setForm(); $this->tpl->parse("TDListBlock", "TDList", true); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["rtdID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
<? $admin = "no"; include_once("../include/common.php"); $s->template_dir = $config["admin_template_dir"]; $s->compile_dir = $config["admin_compile_dir"]; if (isset($_POST["Enter"]) and ($_POST["Enter"] == "Enter")) { if ( ($_POST["Login"] == $config["admin_login"]) and ($_POST["Password"] == $config["admin_password"]) ){ $_SESSION['admin'] = 'a'; Flat::restoreLostObjects(REALTY_STATUS_NEW,REALTY_STATUS_APPLY); Flat::restoreLostObjects(REALTY_STATUS_RENT_NEW,REALTY_STATUS_RENT_APPLY); House::restoreLostObjects(REALTY_STATUS_NEW,REALTY_STATUS_APPLY); Land::restoreLostObjects(REALTY_STATUS_NEW,REALTY_STATUS_APPLY); header("Location: index.php"); } } $s->display('login.tpl'); ?>
} } $td1 = new TD(); $td1->selectRecord("601"); $td2 = new TD(); $td2->selectRecord("600"); echo "TD1 values<br>\n"; foreach ($td1 as $key => $value) { echo "{$key} = {$value}<br>\n"; } echo "TD2 values<br>\n"; foreach ($td2 as $key => $value) { echo "{$key} = {$value}<br>\n"; } $propertyType = $td1->propertyType; $property1 = new Land(); $property1->selectRecord($td1->propertyID); echo "property1 values<br>\n"; foreach ($property1 as $key => $value) { echo "{$key} = {$value}<br>\n"; } $afsID = $property1->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); echo "AFS values<br>\n"; foreach ($afs as $key => $value) { echo "{$key} = {$value}<br>\n"; } $tdNum = $td1->getTaxDeclarationNumber(); $taxDue = new Dues(); $taxDue->create($tdNum, "2002-01-01");
function parseDomDocument($domDoc) { $baseNode = $domDoc->document_element(); if ($baseNode->has_child_nodes()) { $child = $baseNode->first_child(); while ($child) { switch ($child->tagname) { case "landArray": $landNode = $child->first_child(); while ($landNode) { //if ($landNode->tagname=="Land") { if ($landNode->tagname) { $tempXmlStr = $domDoc->dump_node($landNode); $tempDomDoc = domxml_open_mem($tempXmlStr); $land = new Land(); $land->parseDomDocument($tempDomDoc); $this->landArray[] = $land; } $landNode = $landNode->next_sibling(); } break; case "plantsTreesArray": $plantsTreesNode = $child->first_child(); while ($plantsTreesNode) { //if ($plantsTreesNode->tagname=="PlantsTrees") { if ($plantsTreesNode->tagname) { $tempXmlStr = $domDoc->dump_node($plantsTreesNode); $tempDomDoc = domxml_open_mem($tempXmlStr); $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($tempDomDoc); $this->plantsTreesArray[] = $plantsTrees; } $plantsTreesNode = $plantsTreesNode->next_sibling(); } break; case "improvementsBuildingsArray": $improvementsBuildingsNode = $child->first_child(); while ($improvementsBuildingsNode) { //if ($improvementsBuildingsNode->tagname=="ImprovementsBuildings") { if ($improvementsBuildingsNode->tagname) { $tempXmlStr = $domDoc->dump_node($improvementsBuildingsNode); $tempDomDoc = domxml_open_mem($tempXmlStr); $improvementsBuildings = new ImprovementsBuildings(); $improvementsBuildings->parseDomDocument($tempDomDoc); $this->improvementsBuildingsArray[] = $improvementsBuildings; } $improvementsBuildingsNode = $improvementsBuildingsNode->next_sibling(); } break; case "machineriesArray": $machineriesNode = $child->first_child(); while ($machineriesNode) { //if ($machineriesNode->tagname=="Machineries") { if ($machineriesNode->tagname) { $tempXmlStr = $domDoc->dump_node($machineriesNode); $tempDomDoc = domxml_open_mem($tempXmlStr); $machineries = new Machineries(); $machineries->parseDomDocument($tempDomDoc); $this->machineriesArray[] = $machineries; } $machineriesNode = $machineriesNode->next_sibling(); } break; default: //eval("\$this->".$child->tagname."= \"".$child->get_content()."\";"); // test varvars $varvar = $child->tagname; $this->{$varvar} = html_entity_decode($child->get_content()); } $child = $child->next_sibling(); } } $this->setDomDocument(); }
public function clickTracker() { $json_request = array('status' => FALSE, 'responseText' => '', 'redirect' => FALSE); if (Request::ajax()) { $validator = Validator::make(Input::all(), array('land_id' => 'required')); if ($validator->passes()) { if ($land = Land::where('id', Input::get('land_id'))->first()) { $land->click = $land->click + 1; $land->save(); $json_request['status'] = TRUE; } } } else { return Redirect::back(); } return Response::json($json_request, 200); }
public function getCMSFields() { $fields = parent::getCMSFields(); if ($this->ID) { Session::set("FamilyID", $this->ID); } $nameField = TextField::create('Name', 'Family Name'); $fields->replaceField('Name', $nameField); $houseNoField = TextField::create('HouseNo', 'House No (govt)'); $fields->replaceField('HouseNo', $houseNoField); $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray(); $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes); $parishField->setEmptyString('select...'); $fields->replaceField('ParishID', $parishField); //remove FamilyMembers tab $fields->removeByName('FamilyMembers'); $memberGridFieldConfig = GridFieldConfig_RecordEditor::create(); $familyMemberList = FamilyMember::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); $familyMemberGridField = new GridField('Members', 'Family members', $familyMemberList, $memberGridFieldConfig); $fields->addFieldsToTab('Root.Members', array($familyMemberGridField)); //house gridfield $houseGridFeildConfig = GridFieldConfig_RecordEditor::create(); $houseList = House::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($houseList->count()) { $houseGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $houseGridField = new GridField('House', 'House', $houseList, $houseGridFeildConfig); $fields->addFieldsToTab('Root.Housing', array($houseGridField)); //land gridfield $landGridFeildConfig = GridFieldConfig_RecordEditor::create(); $landList = Land::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($landList->count()) { $landGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $landGridField = new GridField('Land', 'Land', $landList, $landGridFeildConfig); $fields->addFieldsToTab('Root.Housing', array($landGridField)); //ShiftedFrom gridfield $shiftedFromGridFeildConfig = GridFieldConfig_RecordEditor::create(); $shiftedFromList = ShiftedFrom::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($shiftedFromList->count()) { $shiftedFromGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $shiftedFromGridField = new GridField('Shifted', 'Shifted', $shiftedFromList, $shiftedFromGridFeildConfig); $fields->addFieldsToTab('Root.Housing', array($shiftedFromGridField)); //Agriculture gridfield $agricultureGridFeildConfig = GridFieldConfig_RecordEditor::create(); $agricultureList = Agriculture::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($agricultureList->count()) { $agricultureGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $agricultureGridField = new GridField('Agriculture', 'Agriculture', $agricultureList, $agricultureGridFeildConfig); $fields->addFieldsToTab('Root.Occupation', array($agricultureGridField)); //Business gridfield $businessGridFeildConfig = GridFieldConfig_RecordEditor::create(); $businessList = Business::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($businessList->count()) { $businessGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $businessGridField = new GridField('Business', 'Business', $businessList, $businessGridFeildConfig); $fields->addFieldsToTab('Root.Occupation', array($businessGridField)); //MonthlyIncome gridfield $monthlyIncomeGridFeildConfig = GridFieldConfig_RecordEditor::create(); $monthlyIncomeList = MonthlyIncome::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($monthlyIncomeList->count()) { $monthlyIncomeGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $monthlyIncomeGridField = new GridField('MonthlyIncome', 'MonthlyIncome', $monthlyIncomeList, $monthlyIncomeGridFeildConfig); $fields->addFieldsToTab('Root.Monthly', array($monthlyIncomeGridField)); //MonthlyExpense gridfield $monthlyExpenseGridFeildConfig = GridFieldConfig_RecordEditor::create(); $monthlyExpenseList = MonthlyExpense::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($monthlyExpenseList->count()) { $monthlyExpenseGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $monthlyExpenseGridField = new GridField('MonthlyExpense', 'MonthlyExpense', $monthlyExpenseList, $monthlyExpenseGridFeildConfig); $fields->addFieldsToTab('Root.Monthly', array($monthlyExpenseGridField)); //Vehicle gridfield $vehicleGridFeildConfig = GridFieldConfig_RecordEditor::create(); $vehicleList = Vehicle::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($vehicleList->count()) { $vehicleGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $vehicleGridField = new GridField('Vehicle', 'Vehicle', $vehicleList, $vehicleGridFeildConfig); $fields->addFieldsToTab('Root.OtherDetails', array($vehicleGridField)); //Appliance gridfield $applianceGridFeildConfig = GridFieldConfig_RecordEditor::create(); $applianceList = Appliance::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($applianceList->count()) { $applianceGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $applianceGridField = new GridField('Appliance', 'Appliance', $applianceList, $applianceGridFeildConfig); $fields->addFieldsToTab('Root.OtherDetails', array($applianceGridField)); //OtherFacility gridfield $otherFacilityGridFeildConfig = GridFieldConfig_RecordEditor::create(); $otherFacilityList = OtherFacility::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($otherFacilityList->count()) { $otherFacilityGridFeildConfig->removeComponentsByType('GridFieldAddNewButton'); } $otherFacilityGridField = new GridField('OtherFacility', 'Other Facility', $otherFacilityList, $otherFacilityGridFeildConfig); $fields->addFieldsToTab('Root.OtherDetails', array($otherFacilityGridField)); //Media gridfield $mediaGridFieldConfig = GridFieldConfig_RecordEditor::create(); $mediaList = Media::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($mediaList->count()) { $mediaGridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); } $mediaGridField = new GridField('Media', 'Media', $mediaList, $mediaGridFieldConfig); $fields->addFieldsToTab('Root.OtherDetails', array($mediaGridField)); //CatholicMagazine gridfield $catholicMagazineGridFieldConfig = GridFieldConfig_RecordEditor::create(); $catholicMagazineList = CatholicMagazine::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($catholicMagazineList->count()) { $catholicMagazineGridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); } $catholicMagazineGridField = new GridField('CatholicMagazine', 'Catholic Magazine', $catholicMagazineList, $catholicMagazineGridFieldConfig); $fields->addFieldsToTab('Root.OtherDetails', array($catholicMagazineGridField)); //Loan gridfield $loanGridFieldConfig = GridFieldConfig_RecordEditor::create(); $loanList = Loan::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($loanList->count()) { $loanGridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); } $loanGridField = new GridField('Loan', 'Loan', $loanList, $loanGridFieldConfig); $fields->addFieldsToTab('Root.Financial', array($loanGridField)); //Saving gridfield $savingGridFieldConfig = GridFieldConfig_RecordEditor::create(); $savingList = Saving::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($savingList->count()) { $savingGridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); } $savingGridField = new GridField('Saving', 'Saving', $savingList, $savingGridFieldConfig); $fields->addFieldsToTab('Root.Financial', array($savingGridField)); //Talent gridfield $talentGridFieldConfig = GridFieldConfig_RecordEditor::create(); $talentList = Talent::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($talentList->count()) { $talentGridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); } $talentGridField = new GridField('Talent', 'Talent', $talentList, $talentGridFieldConfig); $fields->addFieldsToTab('Root.Members', array($talentGridField)); //Contact gridfield $contactGridFieldConfig = GridFieldConfig_RecordEditor::create(); $contactList = Contact::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC'); // remove add button if record already exists if ($contactList->count()) { $contactGridFieldConfig->removeComponentsByType('GridFieldAddNewButton'); } $contactGridField = new GridField('Contact', 'Contact', $contactList, $contactGridFieldConfig); $fields->addFieldsToTab('Root.Contact', array($contactGridField)); return $fields; }
function removeRecords($propertyIDArray = "") { $land = new Land(); $rows = 0; foreach ($propertyIDArray as $key => $value) { if ($land->removeRecord($value)) { $rows++; } } return $rows; }
public function destroy($land_id) { $json_request = array('status' => FALSE, 'responseText' => '', 'redirect' => FALSE); if (Request::ajax()) { if ($gallery = Land::where('id', $land_id)->first()->gallery) { $photos = $gallery->photos; foreach ($gallery->photos as $photo) { if (!empty($photo->name) && File::exists(Config::get('site.galleries_photo_dir') . '/' . $photo->name)) { File::delete(Config::get('site.galleries_photo_dir') . '/' . $photo->name); } if (!empty($photo->name) && File::exists(Config::get('site.galleries_thumb_dir') . '/' . $photo->name)) { File::delete(Config::get('site.galleries_thumb_dir') . '/' . $photo->name); } $photo->delete(); } $gallery->delete(); } if ($photo = Land::where('id', $land_id)->first()->photo) { if (!empty($photo->name) && File::exists(Config::get('site.galleries_photo_dir') . '/' . $photo->name)) { File::delete(Config::get('site.galleries_photo_dir') . '/' . $photo->name); } if (!empty($photo->name) && File::exists(Config::get('site.galleries_thumb_dir') . '/' . $photo->name)) { File::delete(Config::get('site.galleries_thumb_dir') . '/' . $photo->name); } $photo->delete(); } Land::where('id', $land_id)->first()->recommended_lands()->detach(); Land::where('id', $land_id)->delete(); $json_request['responseText'] = "Участок удален."; $json_request['status'] = TRUE; } else { return Redirect::back(); } return Response::json($json_request, 200); }
function activateAll() { Land::setStatusMass("status=".REALTY_STATUS_APPLY,REALTY_STATUS_SALE); header("Location: ".$_SERVER['HTTP_REFERER']); exit(); }
<? /** * TITLE: Выбор участка * AVAILABLE_ONLY_IN_ADVANCED_MODE */ ?> <?php $lands = Land::orderByRaw('number + 0')->with('recommended.recommended_land')->get(); ?> @extends(Helper::layout()) @section('style') @stop @section('content') <div class="wrapper-choise js-choise-wrapper"> <div class="js-choise-map choise-map"> <div class="wrapper relative"> <div class="wrapper-photos js-map-title"> <h1 class="us-title title-choise page-full"><span>{{ $page->seo->h1 }}</span></h1> <div class="lines-choice"> <a href="#" data-number="1" class="choice__left js-choice-left"></a> <a data-number="2" class="choice__center js-choice-center"></a> <a href="#" data-number="3" class="choice__right js-choice-right"></a> </div> </div> <div class="wrapper-params"> <a href="#" class="us-btn btn-black-white js-show-filter" style="display: none;"> <span>Участки списком</span> </a> <a href="{{ URL::to('/buildings') }}" class="us-btn btn-black-white js-back-to-buildings" style="display: none;">
<p><?php echo $row->name; ?> </p> </a> </div> <?php } ?> </div> </div> <div class="sreenbox3and4" style="float:left; width:160px; margin-top:15px; margin-left:30px;"> <div class="box3"> <?php $landcategories = new Landcategory(4); $lands = new Land(); $lands->where('landcategory_id', $landcategories->id); $lands->order_by('position', 'asc'); $lands->get(5); ?> <p align="left" style="color:#0c7102; font-size:15px; margin-bottom: 1px; font-weight:bold;"> <a style="color:#0c7102;" href="<?php echo $landcategories->link; ?> "><?php echo $landcategories->name; ?> </a> </p> <?php foreach ($lands as $row) {
function Main() { $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_a($value, Assessor)) { $this->tpl->set_var("cityAssessorID", $value->getAssessorID()); $this->tpl->set_var("cityAssessorName", $value->getFullName()); $this->formArray["cityAssessorName"] = $value->getFullName(); } else { $this->tpl->set_var($key, ""); } break; case "cityTreasurer": if (is_a($value, Assessor)) { $this->tpl->set_var("cityTreasurerID", $value->getAssessorID()); $this->tpl->set_var("cityTreasurerName", $value->getFullName()); $this->formArray["cityTreasurerName"] = $value->getFullName(); } else { $this->tpl->set_var($key, ""); } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; $totalBalance = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); foreach ($value as $tkey => $tvalue) { $propertyType = $tvalue->getPropertyType(); $propertyID = $tvalue->getPropertyID(); switch ($propertyType) { case "Land": $land = new Land(); $land->selectRecord($propertyID); $assessedValue = $land->getAssessedValue(); $propertyIdentityNumber = $land->getPropertyIndexNumber(); break; case "PlantsTrees": $plantsTrees = new PlantsTrees(); $plantsTrees->selectRecord($propertyID); $assessedValue = $plantsTrees->getAssessedValue(); $PropertyIndexNumber = $plantsTrees->getPropertyIndexNumber(); break; case "ImprovementsBuildings": $improvementsBuildings = new ImprovementsBuildings(); $improvementsBuildings->selectRecord($propertyID); $assessedValue = $improvementsBuildings->getAssessedValue(); $PropertyIndexNumber = $improvementsBuildings->getPropertyIndexNumber(); break; case "Machineries": $machineries = new Machineries(); $machineries->selectRecord($propertyID); $assessedValue = $machineries->getAssessedValue(); $PropertyIndexNumber = $machineries->getPropertyIndexNumber(); break; default: break; } # set or get the due for this TD $taxDue = new Dues(); $taxDue->create($tvalue->getTaxDeclarationNumber(), "Jan 1, " . $rptop->getRptopdate()); $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->store(); $dueValues['basic'] = number_format($taxDue->getBasic(), 2); $dueValues['penalty'] = number_format($taxDue->getPenalty(), 2); $dueValues['sef'] = number_format($taxDue->getSEF(), 2); $dueValues['total'] = number_format($taxDue->getBasic() + $taxDue->getSEF() + $taxDue->getPenalty(), 2); $this->tpl->set_var($dueValues); $paidValues['paidBasic'] = number_format($taxDue->getPaidBasic(), 2); $paidValues['paidPenalty'] = number_format($taxDue->getPaidPenalty(), 2); $paidValues['paidSEF'] = number_format($taxDue->getPaidSEF(), 2); $paidValues['paidTotal'] = number_format($taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF(), 2); $this->tpl->set_var($paidValues); $balance = $taxDue->getBasic() + $taxDue->getSEF() + $taxDue->getPenalty() - ($taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF()); $totalBalance += $balance; $this->tpl->set_var(balance, number_format($balance, 2)); $totalValues['totAssessedValue'] += $assessedValue; $totalValues['totBasic'] += $taxDue->getBasic(); $totalValues['totPenalty'] += $taxDue->getPenalty(); $totalValues['totSEF'] += $taxDue->getSEF(); $totalValues['totTotal'] += $taxDue->getBasic() + $taxDue->getPenalty() + $taxDue->getSEF(); $totalValues['totPaidBasic'] += $taxDue->getPaidBasic(); $totalValues['totPaidPenalty'] += $taxDue->getPaidPenalty(); $totalValues['totPaidSEF'] += $taxDue->getPaidSEF(); $totalValues['totPaidTotal'] += $taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF(); $tdValues['assessedValue'] = number_format($assessedValue, 2); $tdValues['tdNumber'] = $tvalue->getTaxDeclarationNumber(); $tdValues['propertyIndexNumber'] = $PropertyIndexNumber; $this->tpl->set_var($tdValues); $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("TDListBlock", "TDList", true); $tdCtr++; } } else { $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; default: $this->formArray[$key] = $value; } } } } $this->setForm(); $this->tpl->set_var(totBalance, number_format($totalBalance, 2)); $this->tpl->set_var(amountDue, number_format($totalValues['totTotal'] - $totalValues['totPaidTotal'], 2)); $totalValues['totAssessedValue'] = number_format($totalValues['totAssessedValue'], 2); $totalValues['totBasic'] = number_format($totalValues['totBasic'], 2); $totalValues['totPenalty'] = number_format($totalValues['totPenalty'], 2); $totalValues['totSEF'] = number_format($totalValues['totSEF'], 2); $totalValues['totTotal'] = number_format($totalValues['totTotal'], 2); $totPaidalValues['totPaidBasic'] = number_format($totPaidalValues['totPaidBasic'], 2); $totPaidalValues['totPaidPenalty'] = number_format($totPaidalValues['totPaidPenalty'], 2); $totPaidalValues['totPaidSEF'] = number_format($totPaidalValues['totPaidSEF'], 2); $totPaidalValues['totPaidTotal'] = number_format($totPaidalValues['totPaidTotal'], 2); $this->tpl->set_var($totalValues); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
<? /** * TITLE: Готовые дома * AVAILABLE_ONLY_IN_ADVANCED_MODE */ ?> <?php $lands = Land::orderByRaw('number + 0')->get(); ?> @extends(Helper::layout()) @section('style') @stop @section('content') <div class="us-page"> <div class="wrapper"> <h1 class="us-title title-green"><span>{{ $page->seo->h1 }}</span></h1> <div class="us-desc"> Закажите постройку дома или заселяйтесь в готовый </div> <div class="us-desc"> Воспользуйтесь фильтрами для поиска подходящего варианта. На этой странице – готовые дома и некоторые типовые проекты наших партнеров. <span class="info-tooltip" data-tooltip="Типовые проекты — популярные варианты домов. Это не означает, что вы ими ограничены — вносите корректировки или закажите индивидуальный проект."></span> </div> <div class="build-filter"> @include(Helper::layout('forms.buildings-filter')) <div class="clearfix"></div> <div class="filter__update js-filter-loading"></div> </div> </div> <div class="done"> <div class="wrapper">
function Main() { switch ($this->formArray["formAction"]) { case "edit": $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($this->formArray["propertyID"]))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $land = new Land(); $land->parseDomDocument($domDoc); foreach ($land as $key => $value) { switch ($key) { case "propertyAdministrator": if (is_a($value, Person)) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday()); $this->formArray["personID"] = $value->getPersonID(); $this->formArray["lastName"] = $value->getLastName(); $this->formArray["firstName"] = $value->getFirstName(); $this->formArray["middleName"] = $value->getMiddleName(); $this->formArray["gender"] = $value->getGender(); $this->formArray["birth_year"] = removePreZero($dateArr["year"]); $this->formArray["birth_month"] = removePreZero($dateArr["month"]); $this->formArray["birth_day"] = removePreZero($dateArr["day"]); $this->formArray["maritalStatus"] = $value->getMaritalStatus(); $this->formArray["tin"] = $value->getTin(); if (is_array($value->addressArray)) { $this->formArray["addressID"] = $value->addressArray[0]->getAddressID(); $this->formArray["number"] = $value->addressArray[0]->getNumber(); $this->formArray["street"] = $value->addressArray[0]->getStreet(); $this->formArray["barangay"] = $value->addressArray[0]->getBarangay(); $this->formArray["district"] = $value->addressArray[0]->getDistrict(); $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity(); $this->formArray["province"] = $value->addressArray[0]->getProvince(); } $this->formArray["telephone"] = $value->getTelephone(); $this->formArray["mobileNumber"] = $value->getMobileNumber(); $this->formArray["email"] = $value->getEmail(); } else { $this->formArray[$key] = ""; } break; case "appraisedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["as_year"] = removePreZero($dateArr["year"]); $this->formArray["as_month"] = removePreZero($dateArr["month"]); $this->formArray["as_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "recommendingApprovalDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["re_year"] = removePreZero($dateArr["year"]); $this->formArray["re_month"] = removePreZero($dateArr["month"]); $this->formArray["re_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } case "approvedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["av_year"] = removePreZero($dateArr["year"]); $this->formArray["av_month"] = removePreZero($dateArr["month"]); $this->formArray["av_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; default: $this->formArray[$key] = $value; } } } } break; case "save": $LandEncode = new SoapObject(NCCBIZ . "LandEncode.php", "urn:Object"); if ($this->formArray["propertyID"] != "") { $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($this->formArray["propertyID"]))) { $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 { $address = new Address(); $address->setAddressID($this->formArray["addressID"]); $address->setNumber($this->formArray["number"]); $address->setStreet($this->formArray["street"]); $address->setBarangay($this->formArray["barangay"]); $address->setDistrict($this->formArray["district"]); $address->setMunicipalityCity($this->formArray["municipalityCity"]); $address->setProvince($this->formArray["province"]); $address->setDomDocument(); $propertyAdministrator = new Person(); $propertyAdministrator->setPersonID($this->formArray["personID"]); $propertyAdministrator->setLastName($this->formArray["lastName"]); $propertyAdministrator->setFirstName($this->formArray["firstName"]); $propertyAdministrator->setMiddleName($this->formArray["middleName"]); //$propertyAdministrator->setGender($this->formArray["gender"]); //$propertyAdministrator->setBirthday($this->birthdate); //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]); //$propertyAdministrator->setTin($this->formArray["tin"]); $propertyAdministrator->setAddressArray($address); $propertyAdministrator->setTelephone($this->formArray["telephone"]); //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]); $propertyAdministrator->setEmail($this->formArray["email"]); $propertyAdministrator->setDomDocument(); $land = new Land(); $land->parseDomDocument($domDoc); $land->setPropertyID($this->formArray["propertyID"]); $land->setAfsID($this->formArray["afsID"]); $land->setArpNumber($this->formArray["arpNumber"]); $land->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $land->setPropertyAdministrator($propertyAdministrator); $land->setVerifiedBy($this->formArray["verifiedByID"]); $land->setPlottingsBy($this->formArray["plottingsByID"]); $land->setNotedBy($this->formArray["notedByID"]); $land->setMarketValue($this->formArray["marketValue"]); $land->setKind($this->formArray["kind"]); $land->setActualUse($this->formArray["actualUse"]); $land->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]); $land->setAssessmentLevel($this->formArray["assessmentLevel"]); $land->setAssessedValue($this->formArray["assessedValue"]); $land->setPreviousOwner($this->formArray["previousOwner"]); $land->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $land->setTaxability($this->formArray["taxability"]); $land->setEffectivity($this->formArray["effectivity"]); $land->setAppraisedBy($this->formArray["appraisedByID"]); $land->setAppraisedByDate($this->formArray["appraisedByDate"]); $land->setRecommendingApproval($this->formArray["recommendingApprovalID"]); $land->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]); $land->setApprovedBy($this->formArray["approvedByID"]); $land->setApprovedByDate($this->formArray["approvedByDate"]); $land->setMemoranda($this->formArray["memoranda"]); $land->setPostingDate($this->formArray["postingDate"]); $land->setOctTctNumber($this->formArray["octTctNumber"]); $land->setSurveyNumber($this->formArray["surveyNumber"]); $land->setNorth($this->formArray["north"]); $land->setEast($this->formArray["east"]); $land->setSouth($this->formArray["south"]); $land->setWest($this->formArray["west"]); $land->setBoundaryDescription($this->formArray["boundaryDescription"]); $land->setClassification($this->formArray["classification"]); $land->setSubClass($this->formArray["subClass"]); $land->setArea($this->formArray["area"]); $land->setUnit($this->formArray["unit"]); $land->setPercentAdjustment($this->formArray["percentAdjustment"]); $land->setUnitValue($this->formArray["unitValue"]); $land->setAdjustmentFactor($this->formArray["adjustmentFactor"]); $land->setPercentAdjustment($this->formArray["percentAdjustment"]); $land->setValueAdjustment($this->formArray["valueAdjustment"]); $land->setIdle($this->formArray["idle"]); $land->setContested($this->formArray["contested"]); $land->setCreatedBy($this->userID); $land->setModifiedBy($this->userID); $land->setDomDocument(); $doc = $land->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $LandEncode->updateLand($xmlStr))) { exit("error update"); } } } } else { $address = new Address(); //$address->setAddressID($this->formArray["addressID"]); $address->setNumber($this->formArray["number"]); $address->setStreet($this->formArray["street"]); $address->setBarangay($this->formArray["barangay"]); $address->setDistrict($this->formArray["district"]); $address->setMunicipalityCity($this->formArray["municipalityCity"]); $address->setProvince($this->formArray["province"]); $address->setDomDocument(); $propertyAdministrator = new Person(); //$propertyAdministrator->setPersonID($this->formArray["personID"]); $propertyAdministrator->setLastName($this->formArray["lastName"]); $propertyAdministrator->setFirstName($this->formArray["firstName"]); $propertyAdministrator->setMiddleName($this->formArray["middleName"]); //$propertyAdministrator->setGender($this->formArray["gender"]); //$propertyAdministrator->setBirthday($this->birthdate); //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]); //$propertyAdministrator->setTin($this->formArray["tin"]); $propertyAdministrator->setAddressArray($address); $propertyAdministrator->setTelephone($this->formArray["telephone"]); //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]); $propertyAdministrator->setEmail($this->formArray["email"]); $propertyAdministrator->setDomDocument(); $land = new Land(); $land->parseDomDocument($domDoc); //$land->setPropertyID($this->formArray["propertyID"]); $land->setAfsID($this->formArray["afsID"]); $land->setArpNumber($this->formArray["arpNumber"]); $land->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]); $land->setPropertyAdministrator($propertyAdministrator); $land->setVerifiedBy($this->formArray["verifiedByID"]); $land->setPlottingsBy($this->formArray["plottingsByID"]); $land->setNotedBy($this->formArray["notedByID"]); $land->setMarketValue($this->formArray["marketValue"]); $land->setKind($this->formArray["kind"]); $land->setActualUse($this->formArray["actualUse"]); $land->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]); $land->setAssessmentLevel($this->formArray["assessmentLevel"]); $land->setAssessedValue($this->formArray["assessedValue"]); $land->setPreviousOwner($this->formArray["previousOwner"]); $land->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $land->setTaxability($this->formArray["taxability"]); $land->setEffectivity($this->formArray["effectivity"]); $land->setAppraisedBy($this->formArray["appraisedByID"]); $land->setAppraisedByDate($this->formArray["appraisedByDate"]); $land->setRecommendingApproval($this->formArray["recommendingApprovalID"]); $land->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]); $land->setApprovedBy($this->formArray["approvedByID"]); $land->setApprovedByDate($this->formArray["approvedByDate"]); $land->setMemoranda($this->formArray["memoranda"]); $land->setPostingDate($this->formArray["postingDate"]); $land->setOctTctNumber($this->formArray["octTctNumber"]); $land->setSurveyNumber($this->formArray["surveyNumber"]); $land->setNorth($this->formArray["north"]); $land->setEast($this->formArray["east"]); $land->setSouth($this->formArray["south"]); $land->setWest($this->formArray["west"]); $land->setBoundaryDescription($this->formArray["boundaryDescription"]); $land->setClassification($this->formArray["classification"]); $land->setSubClass($this->formArray["subClass"]); $land->setArea($this->formArray["area"]); $land->setUnit($this->formArray["unit"]); $land->setPercentAdjustment($this->formArray["percentAdjustment"]); $land->setUnitValue($this->formArray["unitValue"]); $land->setAdjustmentFactor($this->formArray["adjustmentFactor"]); $land->setPercentAdjustment($this->formArray["percentAdjustment"]); $land->setValueAdjustment($this->formArray["valueAdjustment"]); $land->setIdle($this->formArray["idle"]); $land->setContested($this->formArray["contested"]); $land->setCreatedBy($this->userID); $land->setModifiedBy($this->userID); $land->setDomDocument(); $doc = $land->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; $xmlStr = $doc->dump_mem(true); if (!($ret = $LandEncode->saveLand($xmlStr))) { echo "ret=" . $ret; } } $this->formArray["propertyID"] = $ret; header("location: LandClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit; break; case "cancel": header("location: LandList.php"); exit; break; default: if (!($firstPropertyID = $this->getFirstPropertyID())) { $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock"); $this->tpl->set_var("odIDBlock", ""); $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock"); $this->tpl->set_var("ACKBlock", ""); } else { $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($firstPropertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $land = new Land(); $land->parseDomDocument($domDoc); foreach ($land as $key => $value) { switch ($key) { case "propertyID": $this->formArray["propertyID"] = ""; break; case "propertyAdministrator": if (is_a($value, Person)) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday()); $this->formArray["personID"] = $value->getPersonID(); $this->formArray["lastName"] = $value->getLastName(); $this->formArray["firstName"] = $value->getFirstName(); $this->formArray["middleName"] = $value->getMiddleName(); $this->formArray["gender"] = $value->getGender(); $this->formArray["birth_year"] = removePreZero($dateArr["year"]); $this->formArray["birth_month"] = removePreZero($dateArr["month"]); $this->formArray["birth_day"] = removePreZero($dateArr["day"]); $this->formArray["maritalStatus"] = $value->getMaritalStatus(); $this->formArray["tin"] = $value->getTin(); if (is_array($value->addressArray)) { $this->formArray["addressID"] = $value->addressArray[0]->getAddressID(); $this->formArray["number"] = $value->addressArray[0]->getNumber(); $this->formArray["street"] = $value->addressArray[0]->getStreet(); $this->formArray["barangay"] = $value->addressArray[0]->getBarangay(); $this->formArray["district"] = $value->addressArray[0]->getDistrict(); $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity(); $this->formArray["province"] = $value->addressArray[0]->getProvince(); } $this->formArray["telephone"] = $value->getTelephone(); $this->formArray["mobileNumber"] = $value->getMobileNumber(); $this->formArray["email"] = $value->getEmail(); } else { $this->formArray[$key] = ""; } break; case "appraisedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["as_year"] = removePreZero($dateArr["year"]); $this->formArray["as_month"] = removePreZero($dateArr["month"]); $this->formArray["as_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "recommendingApprovalDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["re_year"] = removePreZero($dateArr["year"]); $this->formArray["re_month"] = removePreZero($dateArr["month"]); $this->formArray["re_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } case "approvedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["av_year"] = removePreZero($dateArr["year"]); $this->formArray["av_month"] = removePreZero($dateArr["month"]); $this->formArray["av_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "arpNumber": case "propertyIndexNumber": case "verifiedByID": case "verifiedBy": case "verifiedByName": case "plottingsByID": case "plottingsBy": case "plottingsByName": case "notedByID": case "notedBy": case "notedByName": case "marketValue": case "kind": case "actualUse": case "adjustedMarketValue": case "assessmentLevel": case "assessedValue": case "previousOwner": case "previousAssessedValue": case "taxability": case "effectivity": case "appraisedByID": case "appraisedBy": case "appraisedByName": case "appraisedByDate": case "recommendingApprovalID": case "recommendingApproval": case "recommendingApprovalName": case "recommendingApprovalDate": case "approvedByID": case "approvedBy": case "approvedByName": case "approvedByDate": case "memoranda": case "postingDate": case "octTctNumber": case "surveyNumber": case "north": case "east": case "south": case "west": case "boundaryDescription": case "classification": case "subClass": case "area": case "unit": case "unitValue": case "adjustmentFactor": case "percentAdjustment": case "valueAdjustment": case "as_month": case "as_day": case "as_year": case "re_month": case "re_day": case "re_year": case "av_month": case "av_day": case "av_year": case "idle": case "contested": $this->formArray[$key] = $value; break; } } } } } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function getLandListByCity($param) { global $config; $id = intval($param['id']); if (isset($_SESSION['user_id']) && in_array($_SESSION['user_id'], $config['user_workers'])) { $is_editor = true; $h = '<th></th>'; } else { $is_editor = false; $h = ''; } if (!$is_editor) { $limit = 3; } else { $limit = 30; } $html = ' История продаж в этом населенном пункте:<br><br> <table class="table table-striped table-bordered table-condensed"><thead> <tr> <th>Дата</th><th>Цена (руб.)</th></th><th>Площадь (соток)</th><th>Описание</th>' . $h . ' </tr></thead>'; $db_res = Land::getFullListLink("f.city_id={$id} AND f.status=" . REALTY_STATUS_SALE . " GROUP BY f.id ORDER BY updated_on DESC LIMIT {$limit}"); while ($row = $db_res->fetchRow()) { $html .= '<tr>'; $date = formatDate($row['updated_on']); $t = $is_editor ? '<td><a href="/land.html?action=updateDate&id=' . $row['id'] . '" title="Обновить дату"><img src="/images/icon_update.png"></a></td>' : ''; $price = number_format($row['price'], 0); $description = textReduce($row['description']); $html .= "<td><a href='/land.html?action=view&id={$row['id']}' title='смотреть'>{$date}</a></td><td>{$price}</td><td>{$row['area']}</td><td>{$description}</td>{$t}"; $html .= '</tr>'; } $html .= '</table>'; if (isset($date)) { echo $html; } else { echo ''; } }
public static function getAdminLandList($action, $per_page = 10, $current_page = 1) { if ($action == 'listActive') { $where = "f.status='" . REALTY_STATUS_ACTIVE . "' GROUP BY f.id"; } else { if ($action == 'listNew') { $where = "f.status='" . REALTY_STATUS_APPLY . "' GROUP BY f.id"; } } $start_pos = ($current_page - 1) * $per_page; $limit = " LIMIT {$start_pos},{$per_page}"; $amount = Land::getAmountInList($where); $order = " ORDER BY id DESC"; $db_res = Land::getFullListLink($where . $order . $limit); $paginator = self::paginator("land.php?action={$action}", $amount, $per_page, $current_page); $html = "\n\t\t<div><a href='land.html?action=activateAll'>Активировать все</a></div>\n\t\t<div>{$paginator}</div>\t\t\n\t\t<table class='base_text'>\n\t\t<thead>\n\t\t<tr>\n\t\t <th>Адрес</th>\n\t\t <th>Цена</th>\t\t \n\t\t <th>Описание</th>\n\t\t <th>Карта</th>\t\t \n\t\t <th></th>\n\t\t <th></th>\n\t\t <th></th>\n\t\t <th></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t"; while ($row = $db_res->fetchRow()) { $city = $row['city_id'] == 0 ? '' : $row['city']; $addr = $city; $price = number_format($row['price'], 0); $map = $row['lat'] && $row['lon'] ? 'Да' : '<b>Нет</b>'; $html .= "<tr>\n\t\t\t<td>{$addr}</td>\n\t\t\t<td>{$price}</td>\t\t\t\n\t\t\t<td>{$row['description']}</td>\n\t\t\t<td>{$map}</td>\n\t\t\t<td><a href='/land.html?action=edit&id={$row['id']}' target='_blank'>Редактировать</a></td>\t\t\t\n\t\t\t<td><a href='/land.html?action=view&id={$row['id']}' target='_blank'>Смотреть</a></td>\n\t\t\t<td><a href='javascript:delObject({$row['id']})'>Удалить</a></td>\n\t\t\t<td><a href='/land.html?action=approve&id={$row['id']}' target='_blank'>Активировать</a></td>\n\t\t\t</tr>"; } $html .= "</tbody></table>\n\t\t<script>\t\t\n\t\t\tdelObject = function(id) {\n\t\t\tif (confirm('Вы уверены удалить это объявление?')) {\n\t\t\t\tlocation.href = '/land.html?action=delete&id='+id;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\t\t\t\t\n\t\t</script>"; return $html; }
function Main() { $propertyType = $this->formArray["propertyType"]; $propertyID = $this->formArray["propertyID"]; switch ($propertyType) { case "Land": $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($propertyID))) { echo "xml failed"; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $land = new Land(); $land->parseDomDocument($domDoc); $this->formArray["landTotalMarketValue"] += tofloat($land->getMarketValue()); $this->formArray["landTotalAssessedValue"] += tofloat($land->getAssessedValue()); $this->displayLand($land); } } break; case "PlantsTrees": $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object"); if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($propertyID))) { echo "xml failed"; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); //$plantsTrees->selectRecord($propertyID); $this->formArray["plantTotalMarketValue"] += tofloat($plantsTrees->getMarketValue()); $this->formArray["plantTotalAssessedValue"] += tofloat($plantsTrees->getAssessedValue()); $this->displayPlantsTrees($plantsTrees); } } break; case "ImprovementsBuildings": $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object"); if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($propertyID))) { echo "xml failed"; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $improvementsBuildings = new ImprovementsBuildings(); $improvementsBuildings->parseDomDocument($domDoc); $this->formArray["bldgTotalMarketValue"] += tofloat($improvementsBuildings->getMarketValue()); $this->formArray["bldgTotalAssessedValue"] += tofloat($improvementsBuildings->getAssessedValue()); $this->displayImprovementsBuildings($improvementsBuildings); } } break; case "Machineries": $MachineriesDetails = new SoapObject(NCCBIZ . "MachineriesDetails.php", "urn:Object"); if (!($xmlStr = $MachineriesDetails->getMachineries($propertyID))) { echo "xml failed"; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error open xml"; } else { $machineries = new Machineries(); $machineries->parseDomDocument($domDoc); $this->formArray["machTotalMarketValue"] += tofloat($machineries->getMarketValue()); $this->formArray["machTotalAssessedValue"] += tofloat($machineries->getAssessedValue()); $this->displayMachineries($machineries); } } break; default: echo "wrong property type"; } //$this->setForm(); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $testpdf = new PDFWriter(); $testpdf->setOutputXML($this->tpl->get("templatePage"), "test"); if (isset($this->formArray["print"])) { $testpdf->writePDF($name); //,$this->formArray["print"]); } else { $testpdf->writePDF($name); } header("location: " . $testpdf->pdfPath); exit; }
function map($s) { $s->assign("lat",LAT_YOLA); $s->assign("lon",LON_YOLA); $s->assign("YANDEX_KEY",YANDEX_KEY); $ids = ''; $rooms = ''; $prices = ''; $prices_m = ''; $areas = ''; $addresses = ''; $storeys = ''; $dates = ''; $types = ''; $lons = ''; $lats = ''; $photos = ''; $icons = ''; if (!isset($_REQUEST['act']) || $_REQUEST['act']=='sales') { $status=REALTY_STATUS_SALE; } else { $status=REALTY_STATUS_RENT; } $res = _filter($status); $add_sql = "f.updated_on>'".getNextDate(date('Y-m-d'),-30)."' AND t.status=".REALTY_STATUS_ACTIVE.' AND '.$res['sql']; $db_res = Land::getFullListLink($add_sql); while ($row = $db_res->fetchRow()) { $ids .= $row['id'].','; $rooms .= $row['rooms'].','; $prices .= "'".number_format($row['price'],0)."',"; $prices_m .= "'".number_format($row['price_m'],0)."',"; $areas .= "'".$row['total_area']."',"; $addr = "{$row['street']}, {$row['tnum']}"; $addresses .= "'".$addr."',"; $date = explode(' ',$row['updated_on']); $ds = explode('-',$date[0]); $date = $ds[2].'.'.$ds[1].'.'.$ds[0]; $dates .= "'".$date."',"; $storeys .= "'".$row['storey']."/".$row['storeys']."',"; $types .= "'".Tenement::$TYPE[$row['ttype']]."',"; $lons .= "'".$row['lon']."',"; $lats .= "'".$row['lat']."',"; $photo = ($row['photo_tenement']!='') ? $row['tenement_id']."/".$row['photo_tenement']."_prev" : ''; $photos .= "'".$photo."',"; if ($row['price_m']<30000) { $color = 'a'; } else if ($row['price_m']<40000) { $color = 'b'; } else { $color = 'c'; } $ri = ($row['rooms']<4) ? $row['rooms'] : 3; $icons .= "'".$ri."k".$color."',"; } $s->assign("ids",$ids); $s->assign("rooms",$rooms); $s->assign("prices",$prices); $s->assign("prices_m",$prices_m); $s->assign("areas",$areas); $s->assign("addresses",$addresses); $s->assign("storeys",$storeys); $s->assign("dates",$dates); $s->assign("types",$types); $s->assign("lons",$lons); $s->assign("lats",$lats); $s->assign("photos",$photos); $s->assign("icons",$icons); $block_html = Html::getBlock('Квартиры на продажу на карте Йошкар-Олы',Html::pagelandMap()); $s->assign("block_html",$block_html); $s->display("land_map.tpl"); }
<label class="input"> {{ ExtForm::gallery('gallery') }} </label> </section> <section> <label class=""> {{ Form::checkbox('sold', 1) }} Участок продан </label> </section> <section> <label class="label">Товарные рекомендации</label> <div class="input select-multiple "> <?php $lands = array(); foreach (Land::where('sold', 0)->orderByRaw('number + 0')->lists('number', 'id') as $id => $number) { $lands[$id] = "Участок №{$number}"; } ?> {{ Form::select('recommended_lands[]', $lands, NULL, array('class'=>'select-multiple select2', 'multiple'=>'multiple')) }} </div> </section> </fieldset> <footer> <a class="btn btn-default no-margin regular-10 uppercase pull-left btn-spinner" href="{{URL::previous()}}"> <i class="fa fa-arrow-left hidden"></i> <span class="btn-response-text">Назад</span> </a> <button autocomplete="off" class="btn btn-success no-margin regular-10 uppercase btn-form-submit"> <i class="fa fa-spinner fa-spin hidden"></i> <span class="btn-response-text">Сохранить</span> </button>
function Main() { $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($this->formArray["propertyID"]))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $land = new Land(); $land->parseDomDocument($domDoc); foreach ($land as $key => $value) { switch ($key) { case "propertyAdministrator": if (is_a($value, Person)) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday()); $this->formArray["personID"] = $value->getPersonID(); $this->formArray["lastName"] = $value->getLastName(); $this->formArray["firstName"] = $value->getFirstName(); $this->formArray["middleName"] = $value->getMiddleName(); $this->formArray["gender"] = $value->getGender(); $this->formArray["birth_year"] = removePreZero($dateArr["year"]); $this->formArray["birth_month"] = removePreZero($dateArr["month"]); $this->formArray["birth_day"] = removePreZero($dateArr["day"]); $this->formArray["maritalStatus"] = $value->getMaritalStatus(); $this->formArray["tin"] = $value->getTin(); $this->formArray["addressID"] = $value->addressArray[0]->getAddressID(); $this->formArray["number"] = $value->addressArray[0]->getNumber(); $this->formArray["street"] = $value->addressArray[0]->getStreet(); $this->formArray["barangay"] = $value->addressArray[0]->getBarangay(); $this->formArray["district"] = $value->addressArray[0]->getDistrict(); $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity(); $this->formArray["province"] = $value->addressArray[0]->getProvince(); $this->formArray["telephone"] = $value->getTelephone(); $this->formArray["mobileNumber"] = $value->getMobileNumber(); $this->formArray["email"] = $value->getEmail(); } else { $this->formArray[$key] = ""; } break; case "verifiedBy": if (is_a($value, Assessor)) { $this->formArray["verifiedByID"] = $value->getAssessorID(); $this->formArray["verifiedByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "plottingsBy": if (is_a($value, Assessor)) { $this->formArray["plottingsByID"] = $value->getAssessorID(); $this->formArray["plottingsByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "notedBy": if (is_a($value, Assessor)) { $this->formArray["notedByID"] = $value->getAssessorID(); $this->formArray["notedByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "appraisedBy": if (is_a($value, Assessor)) { $this->formArray["appraisedByID"] = $value->getAssessorID(); $this->formArray["appraisedByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "appraisedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["as_year"] = removePreZero($dateArr["year"]); $this->formArray["as_month"] = removePreZero($dateArr["month"]); $this->formArray["as_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "recommendingApproval": if (is_a($value, Assessor)) { $this->formArray["recommendingApprovalID"] = $value->getAssessorID(); $this->formArray["recommendingApprovalName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "recommendingApprovalDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["re_year"] = removePreZero($dateArr["year"]); $this->formArray["re_month"] = removePreZero($dateArr["month"]); $this->formArray["re_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } case "approvedBy": if (is_a($value, Assessor)) { $this->formArray["approvedByID"] = $value->getAssessorID(); $this->formArray["approvedByName"] = $value->getFullName(); } else { $this->formArray[$key] = ""; } break; case "approvedByDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["av_year"] = removePreZero($dateArr["year"]); $this->formArray["av_month"] = removePreZero($dateArr["month"]); $this->formArray["av_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; default: $this->formArray[$key] = $value; } } } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { switch ($this->formArray["formAction"]) { case "remove": //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")"; $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object"); if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) { if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) { $this->tpl->set_var("msg", "SOAP failed"); //echo "SOAP failed"; } else { $this->tpl->set_var("msg", $deletedRows . " records deleted"); } } else { $this->tpl->set_var("msg", "0 records deleted"); } /* if (count($this->formArray["companyID"])) { //print_r($this->formArray["companyID"]); //exit; if (!$deletedRows = $OwnerList->removeOwnerCompanyRPTOP($this->formArray["rptopID"],$this->formArray["ownerID"],$this->formArray["companyID"])){ $this->tpl->set_var("msg", "SOAP failed"); echo "SOAP failed"; } else{ $this->tpl->set_var("msg", $deletedRows." records deleted"); } } else $this->tpl->set_var("msg", "0 records deleted");*/ header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit; break; default: $this->tpl->set_var("msg", ""); } //select $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); foreach ($rptop as $key => $value) { switch ($key) { case "owner": //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object"); if (is_a($value, "Owner")) { $this->formArray["ownerID"] = $rptop->owner->getOwnerID(); $xmlStr = $rptop->owner->domDocument->dump_mem(true); if (!$xmlStr) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", ""); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $this->displayOwnerList($domDoc); } } } else { $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock"); $this->tpl->set_var("PersonListBlock", ""); $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock"); $this->tpl->set_var("CompanyListBlock", ""); } break; case "cityAssessor": if (is_numeric($value)) { $cityAssessor = new Person(); $cityAssessor->selectRecord($value); $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID()); $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName()); $this->formArray["cityAssessorName"] = $cityAssessor->getFullName(); } else { $cityAssessor = $value; $this->tpl->set_var("cityAssessorID", $cityAssessor); $this->tpl->set_var("cityAssessorName", $cityAssessor); $this->formArray["cityAssessorName"] = $cityAssessor; } break; case "cityTreasurer": if (is_numeric($value)) { $cityTreasurer = new Person(); $cityTreasurer->selectRecord($value); $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID()); $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName()); $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName(); } else { $cityTreasurer = $value; $this->tpl->set_var("cityTreasurerID", $cityTreasurer); $this->tpl->set_var("cityTreasurerName", $cityTreasurer); $this->formArray["cityTreasurerName"] = $cityTreasurer; } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); foreach ($value as $tkey => $tvalue) { $propertyType = $tvalue->getPropertyType(); $propertyID = $tvalue->getPropertyID(); switch ($propertyType) { case "Land": $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object"); if (!($xmlStr = $LandDetails->getLand($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $land = new Land(); $land->parseDomDocument($domDoc); //$land->selectRecord($propertyID); $this->formArray["landTotalMarketValue"] += tofloat($land->getMarketValue()); $this->formArray["landTotalAssessedValue"] += tofloat($land->getAssessedValue()); $this->displayLand($land); //echo $this->formArray["landTotalAssessedValue"]; } } break; case "PlantsTrees": $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object"); if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $plantsTrees = new PlantsTrees(); $plantsTrees->parseDomDocument($domDoc); //$plantsTrees->selectRecord($propertyID); $this->formArray["plantTotalMarketValue"] += tofloat($plantsTrees->getMarketValue()); $this->formArray["plantTotalAssessedValue"] += tofloat($plantsTrees->getAssessedValue()); $this->displayPlantsTrees($plantsTrees); } } break; case "ImprovementsBuildings": $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object"); if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $improvementsBuildings = new ImprovementsBuildings(); $improvementsBuildings->parseDomDocument($domDoc); //$improvementsBuildings->selectRecord($propertyID); $this->formArray["bldgTotalMarketValue"] += tofloat($improvementsBuildings->getMarketValue()); $this->formArray["bldgTotalAssessedValue"] += tofloat($improvementsBuildings->getAssessedValue()); $this->displayImprovementsBuildings($improvementsBuildings); } } break; case "Machineries": $MachineriesDetails = new SoapObject(NCCBIZ . "MachineriesDetails.php", "urn:Object"); if (!($xmlStr = $MachineriesDetails->getMachineries($propertyID))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock"); $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc"); } else { $machineries = new Machineries(); $machineries->parseDomDocument($domDoc); //$machineries->selectRecord($propertyID); $this->formArray["machTotalMarketValue"] += tofloat($machineries->getMarketValue()); $this->formArray["machTotalAssessedValue"] += tofloat($machineries->getAssessedValue()); $this->displayMachineries($machineries); } } break; default: /* $this->tpl->set_block("TDList", "Land", "LandBlock"); $this->tpl->set_var("LandBlock", ""); $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock"); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock"); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock"); $this->tpl->set_var("MachineriesBlock", ""); $this->tpl->set_block("TDList", "TD", "TDBlock"); $this->tpl->set_var("TDBlock", ""); */ } $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("defaultTDListBlock", "defaultTDList", true); $this->tpl->parse("toggleTDListBlock", "toggleTDList", true); $this->tpl->parse("TDListBlock", "TDList", true); $this->tpl->set_var("LandBlock", ""); $this->tpl->set_var("PlantsTreesBlock", ""); $this->tpl->set_var("ImprovementsBuildingsBlock", ""); $this->tpl->set_var("MachineriesBlock", ""); $tdCtr++; //echo $this->formArray["landTotalAssessedValue"]."<br>"; } } else { $this->tpl->set_var("defaultTDListBlock", "//no default"); $this->tpl->set_var("toggleTDListBlock", "//no Toggle"); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; case "landTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "landTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "plantTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "bldgTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "machTotalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalMarketValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; case "totalAssessedValue": if (!$this->formArray[$key]) { $this->formArray[$key] = $value; } break; default: $this->formArray[$key] = $value; } } $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"]; $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"]; unset($rptop); $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $rptop = new RPTOP(); $rptop->setRptopID($this->formArray["rptopID"]); $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]); $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]); $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]); $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]); $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]); $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]); $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]); $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]); $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]); $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]); $rptop->setCreatedBy($this->userID); $rptop->setModifiedBy($this->userID); $rptop->setDomDocument(); $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object"); $rptop->setDomDocument(); $doc = $rptop->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) { echo "ret=" . $ret; } //echo $ret; } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"], "ownerID" => $this->formArray["ownerID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }