function getPropertyTypeFromOD($od) { $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if ($afsID = $AFSEncode->getAfsID($od->getOdID())) { if ($xmlStr = $TDDetails->getTDFromAfsID($afsID)) { $td = new TD(); if ($domDoc = domxml_open_mem($xmlStr)) { $td->parseDomDocument($domDoc); $propertyType = $td->getPropertyType(); } } } switch ($propertyType) { case "Land": $propertyType = "L/P"; break; case "ImprovementsBuildings": $propertyType = "I/B"; break; case "Machineries": $propertyType = "M"; break; default: $propertyType = "-"; break; } return $propertyType; }
function generateTDHistory($tdID) { $td = new TD(); $td->selectRecord($tdID); $afsID = $td->getAfsID(); // echo("afsID=$afsID<br>"); $afs = new AFS(); $afs->selectRecord($afsID); $odID = $afs->getOdID(); // echo("odID=$odID<br>"); $condition = sprintf(" WHERE presentODID='%s' ", fixQuotes($odID)); $odHistoryRecords = new ODHistoryRecords(); $odHistoryRecords->selectRecords($condition); if (count($odHistoryRecords->arrayList) > 0) { // echo("count>0<br>"); foreach ($odHistoryRecords->arrayList as $key => $odHistory) { $previousODID = $odHistory->getPreviousODID(); $presentODID = $odHistory->getPresentODID(); $previousAFS = new AFS(); $previousAFS->selectRecord($afsID = "", $limit = "", $previousODID); $previousAFSID = $previousAFS->getAfsID(); $previousTD = new TD(); $previousTD->selectRecord($tdID = "", $previousAFSID); $previousTDID = $previousTD->getTdID(); $this->tdHistory[] = $previousTD; $this->generateTDHistory($previousTDID); } } else { //echo("count==0<br>"); return false; } }
function Main() { $fp = fopen("batchCalculate.log", "w") or die("Couldn't create new file"); $rptopID = isset($_POST['rptopID']) ? $_POST['rptopID'] : $_GET['rptopID']; if (is_array($rptopID)) { foreach ($rptopID as $key => $id) { $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($id))) { exit("xml failed"); } else { fwrite($fp, "\r\nrptopid: " . $id . "\r\n"); if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error xmlDoc"; } else { $rptop = new RPTOP(); $td = new TD(); $rptop->parseDomDocument($domDoc); foreach ($rptop as $key => $rvalue) { if ($key == "tdArray") { $tdCtr = 0; if (count($rvalue)) { foreach ($rvalue as $tkey => $tvalue) { $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(), 2, ".", ""); $taxDue = new Dues($tvalue->getTdID(), $rptop->getTaxableYear()); $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setIdleStatus($idleStatus); if ($taxDue->getIdleStatus()) { $taxDue->setIdle($assessedValue); } else { $taxDue->setIdle(0); } $taxDue->store(); echo $id; echo "=>"; echo $tvalue->getTdID(); echo "<br>"; fwrite($fp, "TD: " . $tvalue->getTdID() . "...PROCESSED COMPLETE\r\n"); $tdCtr++; } } } } } } } header("Location: batchCalculateDone.php" . $this->sess->url("")); exit; } }
function getOdIDFromTdID($tdID) { $ret = false; $td = new TD(); if ($td->selectRecord($tdID)) { $afsID = $td->getAfsID(); if ($afs = new AFS()) { $afs->selectRecord($afsID); $odID = $afs->getOdID(); $ret = $odID; } } return $ret; }
function getTDNumber($tdID, $backtaxTDID) { if ($tdID != "") { $td = new TD(); $td->selectRecord($tdID); $tdNumber = $td->getTaxDeclarationNumber(); } else { if ($backtaxTDID != "") { $backtaxTD = new BacktaxTD(); $backtaxTD->selectRecord("", $backtaxTDID); $tdNumber = $backtaxTD->getTDNumber(); } } return $tdNumber; }
function getPropertyTypeFromOD($od) { $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if ($afsID = $AFSEncode->getAfsID($od->getOdID())) { if ($xmlStr = $TDDetails->getTDFromAfsID($afsID)) { $td = new TD(); if ($domDoc = domxml_open_mem($xmlStr)) { $td->parseDomDocument($domDoc); return $td->getPropertyType(); } } } return false; }
function email_fw_webmail_box($USER_ID) { $EMAIL_FW_WEBMAIL_BOX = ""; $FROM_MAIL_ID = ""; $FROM_WEBMAIL_BOX_DEFAULT = ""; $EMAIL_FW_WEBMAIL_BOX_ARRAY = array(); $query = "select * from webmail where USER_ID='" . $USER_ID . "' and EMAIL_PASS!='' order by IS_DEFAULT desc"; $cursor = exequery(TD::conn(), $query); while ($ROW = mysql_fetch_array($cursor)) { $MAIL_ID = $ROW['MAIL_ID']; $EMAIL = $ROW['EMAIL']; $IS_DEFAULT = $ROW['IS_DEFAULT']; $RECV_FW = $ROW['RECV_FW']; if ($FROM_WEBMAIL_BOX_DEFAULT == "") { $FROM_WEBMAIL_BOX_DEFAULT = $EMAIL; $FROM_MAIL_ID = $MAIL_ID; } if ($RECV_FW == 1) { $EMAIL_FW_WEBMAIL_BOX .= $EMAIL . ","; } } $EMAIL_FW_WEBMAIL_BOX_ARRAY[] = $FROM_WEBMAIL_BOX_DEFAULT; $EMAIL_FW_WEBMAIL_BOX_ARRAY[] = $EMAIL_FW_WEBMAIL_BOX; $EMAIL_FW_WEBMAIL_BOX_ARRAY[] = $FROM_MAIL_ID; return $EMAIL_FW_WEBMAIL_BOX_ARRAY; }
function displayTD($afsID) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTDFromAfsID($this->formArray["afsID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["previousOwner"] = $td->getPreviousOwner(); $this->formArray["previousAssessedValue"] = $td->getPreviousAssessedValue(); } } }
function add_task($file, $code) { $qry = "SELECT * FROM office_task WHERE TASK_CODE='{$code}'"; $csr = exequery(TD::conn(), $qry); if ($row = mysql_fetch_array($csr)) { } else { $qry = "INSERT INTO `office_task` (`TASK_TYPE`, `INTERVAL`, `EXEC_TIME`, `LAST_EXEC`,\n\t\t\t\t`EXEC_FLAG`, `EXEC_MSG`, `TASK_URL`, `TASK_NAME`, `TASK_DESC`, `TASK_CODE`, `USE_FLAG`,\n\t\t\t\t`SYS_TASK`, `EXT_DATA`) VALUES(\n\t\t\t\t'0',\n\t\t\t\t1,\n\t\t\t\t'00:00:00',\n\t\t\t\t'0000-00-00 00:00:00',\n\t\t\t\t1,\n\t\t\t\t'0000-00-00 00:00:00',\n\t\t\t\t'{$file}',\n\t\t\t\t'即时通讯离线消息推送',\n\t\t\t\t'定时将OA精灵离线消息推送到微信企业号',\n\t\t\t\t'{$code}',\n\t\t\t\t'1',\n\t\t\t\t'0',\n\t\t\t\t'')"; exequery(TD::conn(), $qry); //Add system parameter include_once "inc/utility_all.php"; add_sys_para(array("WEIXINQY_MSGCHECK_TIME" => "")); } }
function getAfsID($tdID) { $td = new TD(); $td->selectRecord($tdID); $propertyID = $td->propertyID; $propertyType = $td->propertyType; switch ($propertyType) { case "Land": $property = new Land(); break; case "PlantsTrees": $property = new PlantsTrees(); break; case "ImprovementsBuildings": $property = new ImprovementsBuildings(); break; case "Machineries": $property = new Machineries(); break; } $property->selectRecord($propertyID); $afsID = $property->afsID; return $afsID; }
public function createUser($user_id) { $user_ids = ""; $user_arr = explode(",", $user_id); foreach ($user_arr as $key => $value) { $user_ids .= "'" . $value . "',"; } $user_ids = rtrim($user_ids, ","); $sync = array(); $query = "SELECT USER_ID,USER_NAME,DEPT_ID,DEPT_ID_OTHER,USER_PRIV_NAME,USER_PRIV,MOBIL_NO,SEX,TEL_NO_DEPT,EMAIL FROM USER where USER_ID IN (" . $user_ids . ")"; $cursor = exequery(TD::conn(), $query); while ($ROW = mysql_fetch_array($cursor)) { $USER_ID = $ROW['USER_ID']; $USER_NAME = $ROW['USER_NAME']; $DEPT_ID = $ROW['DEPT_ID']; $DEPT_ID_OTHER = $ROW['DEPT_ID_OTHER']; $USER_PRIV_NAME = $ROW['USER_PRIV_NAME']; $USER_PRIV = $ROW['USER_PRIV']; $MOBIL_NO = $ROW['MOBIL_NO']; $SEX = $ROW['SEX']; $TEL_NO_DEPT = $ROW['TEL_NO_DEPT']; $EMAIL = $ROW['EMAIL']; if ($EMAIL == "" && !preg_match("/^([+-]?)\\d*\\.?\\d+\$/", $MOBIL_NO)) { $sync['failed'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']); } else { $_dept = array(); $_dept[] = $this->deptinfo[$DEPT_ID]['weixin_dept_id']; if ($DEPT_ID_OTHER != "") { $_dept_arr = array_filter(explode(",", $DEPT_ID_OTHER)); foreach ($_dept_arr as $key => $value) { $_dept[] = $this->deptinfo[$value]['weixin_dept_id']; } } $rs = $this->postData($this->url['create'], array("userid" => $USER_ID, "name" => $USER_NAME, "department" => $_dept, "position" => $USER_PRIV_NAME, "mobile" => preg_match("/^([+-]?)\\d*\\.?\\d+\$/", $MOBIL_NO) ? $MOBIL_NO : "", "gender" => $SEX, "tel" => $TEL_NO_DEPT, "email" => $EMAIL)); if ($rs['errcode'] == 0) { $sync['success'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']); } else { if ($rs['errcode'] == 60102) { $sync['exists'][] = sprintf("%s(%s)", $USER_NAME, $this->deptinfo[$DEPT_ID]['dept_name']); } } } } parent::logs("user_import", serialize($sync)); return array("success" => count($sync['success']), "failed" => count($sync['failed']), "exists" => count($sync['exists'])); }
function getTDArrayFromCompany($companyID) { $this->setDB(); $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerCompany " . " WHERE " . " Owner.ownerID = OwnerCompany.ownerID AND " . " OwnerCompany.companyID = '%s' ", $companyID); $this->db->query($sql); while ($this->db->next_record()) { $od = new OD(); if ($od->selectRecord($this->db->f("odID"))) { $this->ODArray[] = $od; $afs = new AFS(); if ($afs->selectRecord("", "", $od->getOdID(), "")) { $td = new TD(); if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) { $tdArray[] = $td; } } } } if (!is_array($tdArray)) { $tdArray = false; } return $tdArray; }
function displayTD($afsID) { $this->tpl->set_block("rptsTemplate", "TDTable", "TDTableBlock"); $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTDFromAfsID($this->formArray["afsID"]))) { $this->tpl->set_var("tdID", ""); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->parse("TDDBEmptyBlock", "TDDBEmpty", true); } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { $this->tpl->set_var("tdID", ""); $this->tpl->set_var("TDTableBlock", ""); $this->tpl->parse("TDDBEmptyBlock", "TDDBEmpty", true); } else { $td = new TD(); $td->parseDomDocument($domDoc); // update Cancels/CanceledBy TDNumber $td = $this->updateTDCancelsTDNumber($td); $td = $this->updateTDCanceledByTDNumber($td); $this->formArray["tdID"] = $td->tdID; $this->formArray["taxDeclarationNumber"] = $td->taxDeclarationNumber; //provincialAssessor if (is_numeric($td->provincialAssessor)) { $provincialAssessor = new Person(); $provincialAssessor->selectRecord($td->provincialAssessor); $this->formArray["provincialAssessor"] = $provincialAssessor->getFullName(); } else { $this->formArray["provincialAssessor"] = $td->provincialAssessor; } //provincialAssessorDate if ($td->provincialAssessorDate) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $td->provincialAssessorDate); $this->formArray["pa_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["pa_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["pa_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray["pa_yearValue"] = ""; $this->formArray["pa_month"] = ""; $this->formArray["pa_dayValue"] = ""; } //cityMunicipalAssessor if (is_numeric($td->cityMunicipalAssessor)) { $cityMunicipalAssessor = new Person(); $cityMunicipalAssessor->selectRecord($td->cityMunicipalAssessor); $this->formArray["cityMunicipalAssessor"] = $cityMunicipalAssessor->getFullName(); } else { $this->formArray["cityMunicipalAssessor"] = $td->cityMunicipalAssessor; } //cityMunicipalAssessorDate if ($td->cityMunicipalAssessorDate) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $td->cityMunicipalAssessorDate); $this->formArray["cm_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["cm_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["cm_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray["cm_yearValue"] = ""; $this->formArray["cm_month"] = ""; $this->formArray["cm_dayValue"] = ""; } $this->formArray["cancelsTDNumber"] = $td->cancelsTDNumber; $this->formArray["canceledByTDNumber"] = $td->canceledByTDNumber; $this->formArray["taxBeginsWithTheYear"] = $td->taxBeginsWithTheYear; $this->formArray["ceasesWithTheYear"] = $td->ceasesWithTheYear; //enteredInRPARForBy if (is_numeric($td->enteredInRPARForBy)) { $enteredInRPARForBy = new Person(); $enteredInRPARForBy->selectRecord($td->enteredInRPARForBy); $this->formArray["enteredInRPARForBy"] = $enteredInRPARForBy->getFullName(); } else { $this->formArray["enteredInRPARForBy"] = $td->enteredInRPARForBy; } $this->formArray["enteredInRPARForYear"] = $td->enteredInRPARForYear; $this->formArray["previousOwner"] = $td->previousOwner; $this->formArray["previousAssessedValue"] = $td->previousAssessedValue; $this->tpl->set_var("previousOwner", $td->previousOwner); if ($td->previousAssessedValue != "") { $this->tpl->set_var("previousAssessedValue", number_format(toFloat($td->previousAssessedValue), 2, ".", ",")); } $this->tpl->set_var("TDDBEmptyBlock", ""); $this->tpl->parse("TDTableBlock", "TDTable", true); } } }
function getTD($tdID) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($tdID))) { // error xmlStr } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $td = new TD(); $td->parseDomDocument($domDoc); return $td; } } }
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(); $td = new TD(); $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; //echo("count=".count($value)."<br>"); 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) { $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(), 2, ".", ""); $propertyType = $td->getPropertyType(); $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $PropertyIndexNumber = $afs->getPropertyIndexNumber(); $idleStatus = $td->getIdleStatus(); $formAssessedValue = number_format($td->getAssessedValue(), 2); if ($propertyType == "Land") { $formValues['assessedValueLand'] = $formAssessedValue; $formValues['assessedValueOthers'] = ""; } else { $formValues['assessedValueLand'] = ""; $formValues['assessedValueOthers'] = $formAssessedValue; } $formValues['assessedValue'] = $formAssessedValue; $formValues['propertyType'] = $propertyType; $taxDue = new Dues($tvalue->getTdID(), $this->formArray['taxableYear']); $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setIdleStatus($idleStatus); if ($taxDue->getIdleStatus()) { $taxDue->setIdle($assessedValue); } else { $taxDue->setIdle(0); } $taxDue->store(); $dueValues['basic'] = number_format($taxDue->getBasic(), 2); $dueValues['sef'] = number_format($taxDue->getSEF(), 2); $dueValues['total'] = number_format($taxDue->getBasic() + $taxDue->getSEF(), 2); $totalValues['totBasic'] += $taxDue->getBasic(); $totalValues['totSEF'] += $taxDue->getSEF(); $totalValues['totTotal'] += $taxDue->getBasic() + $taxDue->getSEF(); $totalValues['totAssessedValue'] += $assessedValue; $this->tpl->set_var($dueValues); $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("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->setPageDetailPerms(); $totalValues['totBasic'] = number_format($totalValues['totBasic'], 2); $totalValues['totSEF'] = number_format($totalValues['totSEF'], 2); $totalValues['totTotal'] = number_format($totalValues['totTotal'], 2); $totalValues['totAssessedValue'] = number_format($totalValues['totAssessedValue'], 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"); }
function displayTDDetails($propertyType) { $afsID = $this->formArray["afsID"]; $propertyID = $this->formArray["propertyID"]; $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $afsID, $propertyID, $propertyType))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["tdNumber"] = $td->getTaxDeclarationNumber(); foreach ($td as $tdkey => $tdvalue) { switch ($tdkey) { case "provincialAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["provincialAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["provincialAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["pa_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["pa_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["pa_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } break; case "cityMunicipalAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["cityMunicipalAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["cityMunicipalAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["cm_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["cm_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["cm_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } break; case "enteredInRPARForBy": if (is_a($tdvalue, Assessor)) { $this->formArray["enteredInRPARForByID"] = $tdvalue->getAssessorID(); $this->formArray["enteredInRPARForByName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; default: $this->formArray[$tdkey] = $tdvalue; } } } } }
$cursor = exequery(TD::conn(), $query); while ($ROW = mysql_fetch_array($cursor)) { if (!find_id($USER_ID_STR, $ROW['USER_ID'])) { $USER_ID_STR .= $ROW['USER_ID'] . ","; } } } $MY_ARRAY_DEPT = explode(",", $TO_ID); $ARRAY_COUNT_DEPT = sizeof($MY_ARRAY_DEPT); $I = 0; for (; $I < $ARRAY_COUNT_DEPT; ++$I) { if ($MY_ARRAY_DEPT[$I] == "") { continue; } $query_d = "select USER_ID from USER where (NOT_LOGIN = 0 or NOT_MOBILE_LOGIN = 0) and find_in_set('" . $MY_ARRAY_DEPT[$I] . "',DEPT_ID_OTHER)"; $cursor_d = exequery(TD::conn(), $query_d); while ($ROWD = mysql_fetch_array($cursor_d)) { if (!find_id($USER_ID_STR, $ROWD['USER_ID'])) { $USER_ID_STR .= $ROWD['USER_ID'] . ","; } } } $USER_ID_STR_ARRAY = explode(",", $USER_ID_STR); $USER_ID_STR_ARRAY_COUNT = sizeof($USER_ID_STR_ARRAY); $I = 0; for (; $I < $USER_ID_STR_ARRAY_COUNT; ++$I) { if (!($USER_ID_STR_ARRAY[$I] == "")) { $FUNC_ID_STR = getfunmenubyuserid($USER_ID_STR_ARRAY[$I]); if (!find_id($FUNC_ID_STR, 4)) { $USER_ID_STR = str_replace($USER_ID_STR_ARRAY[$I], "", $USER_ID_STR); }
function Main() { switch ($this->formArray["formAction"]) { case "save": $DueEncode = new SoapObject(NCCBIZ . "DueEncode.php", "urn:Object"); if ($this->formArray["dueID"] != "") { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDue($this->formArray["dueID"]))) { $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 { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->updateDue($xmlStr))) { exit("error update"); } unset($doc); unset($xmlStr); } } } } else { $dueArray = $this->setDues(); foreach ($dueArray as $due) { $doc = $due->getDomDocument(); $xmlStr = $doc->dump_mem(true); if (!($ret = $DueEncode->saveDue($xmlStr))) { exit("error saving"); } unset($doc); unset($xmlStr); } } $this->formArray["dueID"] = $ret; header("location: DueClose.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"]))); exit($ret); break; default: // grab current tax rates from TreasurySettings $treasurySettings = new TreasurySettings(); $treasurySettings->selectRecord(); $this->formArray["masterBasicTaxRate"] = $treasurySettings->getPctRPTax(); $this->formArray["masterSEFTaxRate"] = $treasurySettings->getPctSEF(); $this->formArray["masterIdleTaxRate"] = $treasurySettings->getPctIdle(); $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod(); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // domDoc empty } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["afsID"] = $td->getAfsID(); $this->formArray["taxDeclarationNumber"] = $td->getTaxDeclarationNumber(); $this->formArray["taxBeginsWithTheYear"] = $td->getTaxBeginsWithTheYear(); } } unset($xmlStr); unset($domDoc); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) { // xml failed } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // domDoc empty } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $this->formArray["assessedValue"] = $afs->getTotalAssessedValue(); $this->formArray["taxability"] = $afs->getTaxability(); $this->formArray["effectivity"] = $afs->getEffectivity(); $this->formArray["propertyType"] = $td->getPropertyType(); $this->formArray["idle"] = "No"; if ($td->getPropertyType() == "Land") { if (is_array($afs->landArray)) { // if land is stripped if (count($afs->landArray) > 1) { foreach ($afs->landArray as $land) { if ($land->getIdle() == "Yes") { $this->formArray["idle"] = "Yes"; break; } } } else { $this->formArray["idle"] = $afs->landArray[0]->getIdle(); } } } if ($this->formArray["idle"] == "") { $this->formArray["idle"] = "No"; } } } if ($this->formArray["dueID"] != "") { $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object"); if (!($xmlStr = $DueDetails->getDue($this->formArray["dueID"]))) { echo "xml failed"; } else { //echo $xmlStr; if (!($domDoc = domxml_open_mem($xmlStr))) { echo "error xmlDoc"; } else { $due = new Due(); $due->parseDomDocument($domDoc); foreach ($due as $key => $value) { switch ($key) { default: $this->formArray[$key] = $value; } } $this->formArray["dueDate_str"] = date("F d, Y", strtotime($this->formArray["dueDate"])); $this->formArray["taxDue"] = $due->getTaxDue(); } } } else { // select RPTOP taxable year from rptopID $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object"); if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) { exit("xml failed"); } else { if (!($domDoc = domxml_open_mem($xmlStr))) { exit("error domDoc"); } else { $rptop = new RPTOP(); $rptop->parseDomDocument($domDoc); $this->formArray["taxableYear"] = $rptop->getTaxableYear(); } } // display default Due details $this->formArray["dueDate"] = date("Y-n-d", strtotime($this->formArray["taxableYear"] . "-" . $treasurySettings->getAnnualDueDate())); $this->formArray["dueDate_str"] = date("F d, Y", strtotime($this->formArray["dueDate"])); $this->formArray["basicTaxRate"] = $this->formArray["masterBasicTaxRate"]; $this->formArray["sefTaxRate"] = $this->formArray["masterSEFTaxRate"]; $this->formArray["idleTaxRate"] = $this->formArray["masterIdleTaxRate"]; $this->formArray["basicTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["basicTaxRate"]; $this->formArray["sefTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["sefTaxRate"]; // if land->idle is "Yes", compute idleTax, otherwise set idleTax to zero if ($this->formArray["propertyType"] == "Land") { if ($this->formArray["idle"] == "Yes") { $this->formArray["idleTax"] = un_number_format($this->formArray["assessedValue"]) * $this->formArray["idleTaxRate"]; } else { $this->formArray["idleTax"] = "0.00"; } } // if afs->taxability is "Exempt", reset computations to zero. if ($this->formArray["taxability"] == "Exempt") { $this->formArray["basicTax"] = 0.0; $this->formArray["sefTax"] = 0.0; $this->formArray["idleTax"] = 0.0; } $this->formArray["taxDue"] = $this->formArray["basicTax"] + $this->formArray["sefTax"] + $this->formArray["idleTax"]; } } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("dueID" => $this->formArray["dueID"], "tdID" => $this->formArray["tdID"], "rptopID" => $this->formArray["rptopID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function getTDListOf($id, $type, $year) { $owner = new Owner(); //echo("\$ownerIDArray = \$owner->selectOwner".$type."(".$id.");"); eval("\$ownerIDArray = \$owner->selectOwner" . $type . "(" . $id . ");"); if ($ownerIDArray) { $odArray = ""; foreach ($ownerIDArray as $key => $value) { eval("\$odID = \$owner->selectOD" . $type . "({$value});"); if ($odID) { $odArray[] = $odID; } } unset($owner); if ($odArray) { $afsArray = ""; foreach ($odArray as $key => $value) { $afs = new AFS(); $afsIDArray[] = $afs->checkAfsID($value); } unset($afs); if ($afsIDArray) { $tdRecords = new TDRecords(); $tdIDArray = ""; foreach ($afsIDArray as $tkey => $tvalue) { $td = new TD(); if ($td->selectRecord("", $tvalue, "", "", $year)) { $tdIDArray[] = $td->getTdID(); } unset($td); /* $afs = new AFS; $afs->selectRecord($tvalue); //print_r($afs); //echo "<br>"; $landArray = $afs->getLandArray(); $plantsTreesArray = $afs->getPlantsTreesArray(); $improvementsBuildingsArray = $afs->getImprovementsBuildingsArray(); $machineriesArray = $afs->getMachineriesArray(); unset($afs); if ($landArray){ foreach($landArray as $lkey => $lvalue){ //echo($lvalue->getPropertyID()."<br>"); $td = new TD; if ($td->selectRecord("",$lvalue->getPropertyID(),"Land",$year)){ $tdRecords->setArrayList($td); $tdIDArray[] = $td->getTdID(); } unset($td); } } if ($plantsTreesArray){ foreach($plantsTreesArray as $lkey => $lvalue){ //echo($lvalue->getPropertyID()."<br>"); $td = new TD; if ($td->selectRecord("",$lvalue->getPropertyID(),"PlantsTrees",$year)){ $tdRecords->setArrayList($td); $tdIDArray[] = $td->getTdID(); } unset($td); } } if ($improvementsBuildingsArray){ foreach($improvementsBuildingsArray as $lkey => $lvalue){ //echo($lvalue->getPropertyID()."<br>"); $td = new TD; if ($td->selectRecord("",$lvalue->getPropertyID(),"ImprovementsBuildings",$year)){ $tdRecords->setArrayList($td); $tdIDArray[] = $td->getTdID(); } unset($td); } } if ($machineriesArray){ foreach($machineriesArray as $lkey => $lvalue){ //echo($lvalue->getPropertyID()."<br>"); $td = new TD; if ($td->selectRecord("",$lvalue->getPropertyID(),"Machineries",$year)){ $tdRecords->setArrayList($td); $tdIDArray[] = $td->getTdID(); } unset($td); } }*/ } $ret = $tdIDArray; //print_r($tdRecords->getArrayList()); /*if ($tdRecords->getArrayList()){ $tdRecords->setDomDocument(); if(!$domDoc = $tdRecords->getDomDocument()){ return $ret = false; } else { $xmlStr = $domDoc->dump_mem(true); return $ret = $xmlStr; } } else $ret = false;*/ } else { $ret = false; } } else { $ret = false; } } else { $ret = false; } return $ret; }
function getPrecedingTDArray($td) { $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object"); if ($this->formArray["odID"] = $ODDetails->getOdIDFromTdID($td->getTdID())) { $ODHistoryList = new SoapObject(NCCBIZ . "ODHistoryList.php", "urn:Object"); $ODHistoryRecords = new ODHistoryRecords(); if (!($xmlStr = $ODHistoryList->getPrecedingODList($this->formArray["odID"]))) { // do nothing. no preceding OD return false; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // no nothing. no preceding OD return false; } else { $ODHistoryRecords->parseDomDocument($domDoc); $precedingODList = $ODHistoryRecords->arrayList; $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object"); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); foreach ($precedingODList as $key => $odHistory) { $previousODID = $odHistory->getPreviousODID(); $previousAFSID = $AFSEncode->getAfsID($previousODID); $previousAFSxml = $AFSDetails->getAfs($previousAFSID); $previousAFSdomDoc = domxml_open_mem($previousAFSxml); $previousAFS = new AFS(); $previousAFS->parseDomDocument($previousAFSdomDoc); $precedingTDxml = $TDDetails->getTDFromAfsID($previousAFSID); $precedingTDdomDoc = domxml_open_mem($precedingTDxml); $precedingTD = new TD(); $precedingTD->parseDomDocument($precedingTDdomDoc); $this->precedingTDArray[] = $precedingTD; } } return $this->precedingTDArray; } } }
function displayTDDetails($propertyType) { $afsID = $this->formArray["afsID"]; $propertyID = $this->formArray["propertyID"]; $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $afsID, $propertyID, $propertyType))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { $this->formArray["tdNumber"] = ""; $this->formArray["tdID"] = ""; $this->formArray["propertyType"] = $propertyType; } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["tdNumber"] = $td->getTaxDeclarationNumber(); //$this->formArray["effectivity"] = $td->taxBeginsWithTheYear(); foreach ($td as $tdkey => $tdvalue) { switch ($tdkey) { case "provincialAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["provincialAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["provincialAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["pa_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["pa_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["pa_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } $this->formArray[$tdkey] = $tdvalue; //RC 20091007 break; case "cityMunicipalAssessor": if (is_a($tdvalue, Assessor)) { $this->formArray["cityMunicipalAssessorID"] = $tdvalue->getAssessorID(); $this->formArray["cityMunicipalAssessorName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $tdvalue); $this->formArray["cm_yearValue"] = removePreZero($dateArr["year"]); eval(MONTH_ARRAY); //$monthArray $this->formArray["cm_month"] = $monthArray[removePreZero($dateArr["month"])]; $this->formArray["cm_dayValue"] = removePreZero($dateArr["day"]); } else { $this->formArray[$tdkey] = ""; } $this->formArray[$tdkey] = $tdvalue; //RC 20091007 break; case "enteredInRPARForBy": if (is_a($tdvalue, Assessor)) { $this->formArray["enteredInRPARForByID"] = $tdvalue->getAssessorID(); $this->formArray["enteredInRPARForByName"] = $tdvalue->getFullName(); } else { $this->formArray[$tdkey] = ""; } break; case "previousOwner": // RC 20091006 This case allows for extra info $posSlash = strpos($tdvalue, "/"); if ($posSlash !== false) { $this->formArray[$tdkey] = substr($tdvalue, 0, $posSlash); $this->formArray["previousOwnerExtra"] = substr($tdvalue, $posSlash + 1); } else { $this->formArray[$tdkey] = $tdvalue; } break; case "cancelsTDNumber": // RC 20091006 allow for extra info $posSlash = strpos($tdvalue, "/"); if ($posSlash !== false) { $this->formArray[$tdkey] = substr($tdvalue, 0, $posSlash); $this->formArray["cancelsTDNumberExtra"] = substr($tdvalue, $posSlash + 1); } else { $this->formArray[$tdkey] = $tdvalue; } break; default: $this->formArray[$tdkey] = $tdvalue; } } } } }
function displayRecords() { $this->selectRecords(); $this->tpl->set_block("rptsTemplate", "OwnerPersonList", "OwnerPersonListBlock"); $this->tpl->set_block("OwnerPersonList", "ODList", "ODListBlock"); foreach ($this->arrayList as $person) { $this->tpl->set_var("personID", $person->getPersonID()); $this->tpl->set_var("lastName", $person->getLastName()); $this->tpl->set_var("firstName", $person->getFirstName()); $this->tpl->set_var("middleName", $person->getMiddleName()); $this->tpl->set_var("gender", $person->getGender()); $this->tpl->set_var("birthday", $person->getBirthday()); $this->tpl->set_var("maritalStatus", $person->getMaritalStatus()); $this->tpl->set_var("tin", $person->getTin()); $this->tpl->set_var("telephone", $person->getTelephone()); $this->tpl->set_var("mobileNumber", $person->getMobileNumber()); $this->tpl->set_var("email", $person->getEmail()); if (is_array($person->addressArray)) { $address = $person->addressArray[0]; $this->tpl->set_var("address", $address->getFullAddress()); } // capture OD, AFS, and TD info $this->setDB(); $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerPerson " . " WHERE " . " Owner.ownerID = OwnerPerson.ownerID AND " . " OwnerPerson.personID = '%s' ", $person->getPersonID()); $this->db->query($sql); while ($this->db->next_record()) { $od = new OD(); if ($od->selectRecord($this->db->f("odID"))) { $this->ODArray[] = $od; $this->tpl->set_var("odID", $od->getOdID()); if (is_object($od->locationAddress)) { $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress()); } else { $this->tpl->set_var("locationAddress", ""); } $afs = new AFS(); if ($afs->selectRecord("", "", $od->getOdID(), "")) { $this->tpl->set_var("afsID", $afs->getAfsID()); $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber()); $this->tpl->set_var("arpNumber", $afs->getArpNumber()); if (is_array($afs->landArray)) { $this->displayLandList($afs->landArray); } if (is_array($afs->plantsTreesArray)) { $this->displayPlantsTreesList($afs->plantsTreesArray); } if (is_array($afs->improvementsBuildingsArray)) { $this->displayImprovementsBuildingsList($afs->improvementsBuildingsArray); } if (is_array($afs->machineriesArray)) { $this->displayMachineriesList($afs->machineriesArray); } $td = new TD(); if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) { $this->tpl->set_var("tdID", $td->getTdID()); $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber()); $this->tpl->set_var("propertyType", $td->getPropertyType()); } } unset($td); unset($afs); unset($od); $this->tpl->parse("ODListBlock", "ODList", true); } } $this->tpl->parse("OwnerPersonListBlock", "OwnerPersonList", true); $this->tpl->set_var("ODListBlock", ""); $this->clearPropertyElements(); unset($this->ODArray); unset($this->AFSArray); unset($this->TDArray); unset($this->db); } }
function setDetails() { global $sess; # set the RPTOP to get the owner's object and information # get it from POST if possible, otherwise from GET $rptopID = isset($_POST['rptopID']) ? $_POST['rptopID'] : $_GET['rptopID']; //$rptopID = 14; $rptop = new RPTOP(); $rptop->selectRecord($rptopID); $amountPaid = str_replace(",", "", $_POST['amountPaid']); $dateDue = $rptop->getTaxableYear(); # must be a usable format $formValues['datePaid'] = date("F j, Y"); $pORDate = $_POST['prevORDate']; if ($pORDate) { list($pmonth, $pday, $pyear) = explode("-", $pORDate); $formValues['porMonth'] = date("F", mktime(0, 0, 0, $pmonth + 1, 0, 0)); $formValues['porYear'] = $pyear; $formValues['porDay'] = $pday; } else { $formValues['porMonth'] = ""; $formValues['porYear'] = ""; $formValues['porDay'] = ""; } $formValues['orYear'] = substr($rptop->getTaxableYear(), 2); $formValues['orMonth'] = date("F"); $formValues['orDay'] = date("j"); $formValues['taxableYear'] = $rptop->getTaxableYear(); $formValues['rptopNum'] = $rptop->getRptopNumber(); $formValues['prevORNum'] = $_POST['prevORNum']; $formValues['orNum'] = $_POST['receiptNo']; $formValues['kindOfPayment'] = $_POST['kindOfPayment']; $formValues['checkNumber'] = $_POST['checkNum']; $formValues['checkDate'] = $_POST['checkDate']; # set the specific TD (although this is in the RPTOP), hard to search for it. # get the tdID from POST or GET to initialize the TD $tdID = isset($_POST['tdID']) ? $_POST['tdID'] : $_GET['tdID']; //$tdID = array(2,1); //$ownerID=5; $td = new TD(); $ctr = 0; # $this->tpl->set_block('step3','PrintTDID','PrintTDIDs'); //$this->tpl->set_block('step3','TDID','TDIDs'); $this->tpl->set_block('receipt', 'Property', 'Properties'); $this->tpl->set_block('Property', 'Owner', 'Owners'); $n = 165; if (is_array($tdID)) { foreach ($tdID as $key => $id) { # set/pass tdIDs to form $this->tpl->set_var(tdID, $id); $this->tpl->parse('TDIDs', 'TDID', 'true'); $td->selectRecord($id); $tdNum = $td->getTaxDeclarationNumber(); $afs = new AFS(); $formValues['tdNum'] = $tdNum; $afs->selectRecord($td->getAfsID()); $od = new OD(); $od->selectRecord($afs->getOdID()); $addr = $od->getLocationAddress(); # get municipality/province and city(same for all tds) //$lotAddress = new LocationAddress; //$lotAddress->selectRecordFromTdID($id); //$formValues['province'] = $lotAddress->getProvince(); //$formValues['city'] = $lotAddress->getMunicipalityCity(); $formValues['city'] = $addr->getMunicipalityCity(); $formValues['province'] = $addr->getProvince(); $formValues['municipalityCityID'] = $addr->getMunicipalityCityID(); # get location/ block and lot number OR Barangay #$formValues['lotAddress'] = $lotAddress->getFullAddress(); $formValues['lotAddress'] = $addr->getNumber . " " . $addr->getStreet(); if ($formValues['lotAddress'] == "") { $formValues['lotAddress'] = $addr->getBarangay(); } $propertyType = $td->getPropertyType(); $propertyID = $td->getPropertyID(); $assessedValue = number_format($td->getAssessedValue(), 2, ".", ""); $formAssessedValue = number_format($td->getAssessedValue(), 2); # separate assessed value of land and others(plantsTrees, improvementsBuildings, machineries) if ($propertyType == "Land") { $formValues['assessedValueLand'] = $formAssessedValue; $formValues['assessedValueOthers'] = ""; } else { $formValues['assessedValueLand'] = ""; $formValues['assessedValueOthers'] = $formAssessedValue; } $formValues['assessedValue'] = $formAssessedValue; $formValues['propertyType'] = $propertyType; # set the owner's List # we define the owner from the RPTOP $ownerSwitch = true; if ($ctr > 0) { $ownerValues['ownerName'] = ""; $ownerValues['ownerAddress'] = ""; $this->tpl->set_var($ownerValues); $this->tpl->parse(Owners, Owner, false); } else { $owner = $rptop->getOwner(); $personArray = $owner->getPersonArray(); if (is_array($personArray)) { foreach ($personArray as $person) { $ownerValues['ownerKey'] = "personID"; $ownerValues['ownerScript'] = "PersonDetails.php"; $ownerValues['ownerID'] = $person->getPersonID(); $ownerValues['ownerName'] = $person->getLastName() . ", " . $person->getFirstName() . " " . $person->getMiddleName(); /*$addressArray = $person->getAddressArray(); $address = $addressArray[0]; $ownerValues['ownerAddress'] = $address->getNumber()." ". $address->getStreet()."<br>". $address->getBarangay().", ". $address->getMunicipalityCity()."<br>". $address->getProvince();*/ $this->tpl->set_var($ownerValues); $this->tpl->parse('Owners', 'Owner', 'true'); } } $companyArray = $owner->getCompanyArray(); if (is_array($companyArray)) { foreach ($companyArray as $company) { $ownerValues['cownerKey'] = "companyID"; $ownerValues['cownerScript'] = "CompanyDetails.php"; $ownerValues['cownerID'] = $company->getCompanyID(); $ownerValues['cownerName'] = $company->getCompanyName(); /*$addressArray = $company->getAddressArray(); $address = $addressArray[0]; $ownerValues['ownerAddress'] = $address->getNumber()." ". $address->getStreet()."<br>". $address->getBarangay().", ". $address->getMunicipalityCity()."<br> ". $address->getProvince(); */ $this->tpl->set_var($ownerValues); $this->tpl->parse('Owners', 'Owner', 'true'); } } if (is_array($personArray)) { if (count($personArray) > 1) { $receivedFrom = $personArray[0]->getFirstName() . " " . $personArray[0]->getMiddleName() . " " . $personArray[0]->getLastName() . " et al."; } else { $receivedFrom = $personArray[0]->getFirstName() . " " . $personArray[0]->getMiddleName() . " " . $personArray[0]->getLastName(); } } else { if (is_array($companyArray)) { if (count($companyArray) > 1) { $receivedFrom = $companyArray[0]->getCompanyName() . " et al."; } else { $receivedFrom = $companyArray[0]->getCompanyName(); } } } $formValues['receivedFrom'] = $receivedFrom; } //end if ($ctr > 0) # tax dues are defined from TDNumber and taxableYear # compute for taxes; to create dues obj pass tdID and due date (where due date is beginning of taxable year) -- 14 Aug 2003 // $taxDue = new Dues($id,$dateDue,$assessedValue); $taxDue = new Dues(); /* if(!$taxDue->create($id,$dateDue)){ $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); # check if land is idle, if yes, set assessed value if($taxDue->getIdleStatus() == 1){ $taxDue->setIdle($assessedValue); $idleStatus = 1; }else{ $taxDue->setIdle(0); $idleStatus = 0; } } */ $dateDue = $td->getTaxBeginsWithTheYear(); $taxDue = new Dues($id, $dateDue); if (!$taxDue->create($id, $dateDue)) { $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setIsDiscount(0); # check if land is idle, if yes, set assessed value # getIdleStatus -- temporary function if ($taxDue->getIdleStatus() == 1) { #echo("idle<br>"); $taxDue->setIdle($assessedValue); } } else { $taxDue->setIsDiscount($dateDue == date("Y") && date("n") <= $taxDue->discountPeriod && $taxDue->getPaymentMode() == "Annual"); } $paymentPeriod = $_POST['paymentPeriod']; # set amnesty to object //$amnesty = $_POST['amnesty']; //$taxDue->setAmnesty($amnesty=="Yes"); // $taxDue->store(); $totalTaxDue = $taxDue->getTotalDue($paymentPeriod); $totalAmount = $taxDue->getTotalDue($paymentPeriod); // $paymentPeriod= "Annual"; /* if(isset($_POST['paymentPeriod'])){ $paymentPeriod = $_POST['paymentPeriod']; }*/ $formValues['paymentPeriod'] = $paymentPeriod; $this->tpl->set_var($formValues); ## Compute taxes and set the page values //$totalTaxDue = $taxDue->getTotalDue($paymentPeriod); $interest = $taxDue->getPctPenalty(); if ($interest > 0 && $paymentPeriod != "Annual") { $paymentPeriod = "Annual"; } $basic = $taxDue->getBalanceBasic($paymentPeriod); $sef = $taxDue->getBalanceSEF($paymentPeriod); $idle = $taxDue->getBalanceIdle($paymentPeriod); $discount = $taxDue->getDiscount($basic + $sef); $penalty = $taxDue->getBalancePenalty($paymentPeriod); $taxValues['idleStatus'] = $idleStatus == 0 ? "" : "(I)"; $taxValues['basic'] = number_format($basic, 2); $taxValues['sef'] = number_format($sef, 2); $taxValues['pd1185'] = number_format(0.0, 2); $taxValues['subTotal'] = number_format($totalTaxDue, 2); $taxValues['periodTotal'] = number_format($basic + $sef + $idle, 2); $taxValues['interest'] = number_format($interest * 100.0, 1) . "%"; $taxValues['penalty'] = number_format($interest * 100, 0); $taxValues['discount'] = number_format($discount * 100.0, 1) . "%"; $taxValues['totBasic'] = number_format($basic * (1 + $interest), 2); $taxValues['totSEF'] = number_format($sef * (1 + $interest), 2); $taxValues['totPD1185'] = number_format(0, 2); $taxValues['totSubTotal'] = number_format(round($totalTaxDue, 2), 2); $taxValues['grandTotal'] = number_format($totalTaxDue, 2); # further breakdown of basic tax for RPT Receipt $taxValues['gf'] = number_format($basic * 0.7, 2); // 70% of basic $taxValues['ib'] = number_format($basic * 0.15, 2); // 15% of basic $taxValues['cb'] = number_format($basic * 0.15, 2); // 15% of basic for a total if 100% $taxValues['totGF'] = number_format($basic * 0.7 * (1 + $interest), 2); $taxValues['totIB'] = number_format($basic * 0.15 * (1 + $interest), 2); $taxValues['totCB'] = number_format($basic * 0.15 * (1 + $interest), 2); if ($paymentPeriod == "Annual") { $this->tpl->set_var("fullPmt", $taxValues['subTotal']); $this->tpl->set_var("partialPmt", ""); # get full payment total $fullPmtTotal += str_replace(",", "", $taxValues['subTotal']); $this->tpl->set_var("fullPmtTotal", number_format($fullPmtTotal, 2)); } else { $this->tpl->set_var("partialPmt", $taxValues['subTotal']); $this->tpl->set_var("num", ceil(date("n") / 3)); $this->tpl->set_var("fullPmt", ""); # get partial payment total $partialPmtTotal += str_replace(",", "", $taxValues['subTotal']); $this->tpl->set_var("partialPmtTotal", number_format($partialPmtTotal, 2)); } $this->tpl->set_var($taxValues); $this->tpl->parse('Properties', 'Property', 'true'); $ctr++; # get totals for penalty and grand total # $penaltyTotal += ($basic*$interest); -- removed bec penalty in percent $total += $totalTaxDue; # $this->tpl->set_var("penaltyTotal", number_format($penaltyTotal,2)); } } # end foreach if ($total > $totalTaxDue) { $totalTaxDue = $total; } // if backtaxTDCheckbox is checked if ($_POST['backtaxTDCheckbox'] && $_POST['backtaxTDCheckbox'] != "") { $totalTaxDue += $this->displayBacktaxTD($ownerSwitch); $fullPmtTotal = $totalTaxDue; $this->tpl->set_var("fullPmtTotal", number_format($fullPmtTotal, 2)); } # if amnesty checked/unchecked form will submit, set kind of payment and other details /*switch($formValues['kindOfPayment']){ case 'check': $this->tpl->set_var("selectedCheck","selected"); $this->tpl->set_var("disabledOn",""); $this->tpl->set_var("checkNum",$formValues['checkNum']); $this->tpl->set_var("checkDate",$formValues['checkDate']); break; case 'treasury note': $this->tpl->set_var("selectedTNote","selected"); $this->tpl->set_var("disabledOn","disabled"); $this->tpl->set_var("checkNum",""); $this->tpl->set_var("checkDate",""); break; case 'cash': default: $this->tpl->set_var("selectedCash","selected"); $this->tpl->set_var("disabledOn","disabled"); $this->tpl->set_var("checkNum",""); $this->tpl->set_var("checkDate",""); break; }*/ # get totals in words $amountPaid = $amountPaid ? number_format($amountPaid, 2) : number_format($total, 2); $this->tpl->set_var("total", number_format($total, 2)); $this->tpl->set_var("amountPaid", $amountPaid); $this->tpl->set_var("balance", $total - $amountPaid); $numToWords = new NumbersToWords(); $totalInWords = $numToWords->num_to_string(number_format(str_replace(",", "", $amountPaid), 2)); $this->tpl->set_var("totalInWords", $totalInWords); //$this->tpl->set_var("amnestyChecked", ($formValues['amnesty']=="Yes") ? " checked" : ""); //if(!isset($_POST['printReceipt_x'])) // $this->tpl->set_var("Session", $sess->url("")); }
function Main() { //echo $this->formArray["formAction"]; switch ($this->formArray["formAction"]) { case "save": $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object"); if ($this->formArray["tdID"] != "") { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { $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 { $td = new TD(); $td->parseDomDocument($domDoc); $td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //exit($xmlStr); if (!($ret = $TDEncode->updateTD($xmlStr))) { exit("error update"); } } } } else { $td = new TD(); $td->parseDomDocument($domDoc); //$td->setTdID($this->formArray["tdID"]); $td->setAfsID($this->formArray["afsID"]); $td->setPropertyID($this->formArray["propertyID"]); $td->setPropertyType($this->formArray["propertyType"]); $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]); $td->setProvincialAssessor($this->formArray["provincialAssessorID"]); $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]); $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]); $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]); $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]); $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]); $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]); $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]); $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]); $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]); $td->setPreviousOwner($this->formArray["previousOwner"]); $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]); $td->setCreatedBy($this->userID); $td->setModifiedBy($this->userID); $td->setDomDocument(); $doc = $td->getDomDocument(); $xmlStr = $doc->dump_mem(true); //echo $xmlStr; if (!($ret = $TDEncode->saveTD($xmlStr))) { echo "Error saving"; } } $this->formArray["propertyID"] = $ret; header("location: TDClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"]))); exit($ret); break; case "cancel": header("location: TDList.php"); exit; break; default: if ($this->formArray["tdID"]) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) { 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 { $td = new TD(); $td->parseDomDocument($domDoc); foreach ($td as $key => $value) { switch ($key) { case "provincialAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["pa_year"] = removePreZero($dateArr["year"]); $this->formArray["pa_month"] = removePreZero($dateArr["month"]); $this->formArray["pa_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; case "cityMunicipalAssessorDate": if (true) { list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value); $this->formArray["cm_year"] = removePreZero($dateArr["year"]); $this->formArray["cm_month"] = removePreZero($dateArr["month"]); $this->formArray["cm_day"] = removePreZero($dateArr["day"]); } else { $this->formArray[$key] = ""; } break; default: //echo $key."=>".$value."<br>"; $this->formArray[$key] = $value; } } } } } $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock"); $this->tpl->set_var("odIDBlock", ""); $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock"); $this->tpl->set_var("ACKBlock", ""); } $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["tdID"], "propertyType" => $this->formArray["propertyType"], "propertyID" => $this->formArray["propertyID"], "afsID" => $this->formArray["afsID"]))); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function getPropertyClassificationFromTD($tdID) { $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD($tdID))) { return false; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } else { $td = new TD(); $td->parseDomDocument($domDoc); $afsID = $td->getAfsID(); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFS($afsID))) { return false; } else { if (!($domDoc = domxml_open_mem($xmlStr))) { return false; } else { $afs = new AFS(); $afs->parseDomDocument($domDoc); $LandActualUsesDetails = new SoapObject(NCCBIZ . "LandActualUsesDetails.php", "urn:Object"); $PlantsTreesActualUsesDetails = new SoapObject(NCCBIZ . "PlantsTreesActualUsesDetails.php", "urn:Object"); $ImprovementsBuildingsActualUsesDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsActualUsesDetails.php", "urn:Object"); $MachineriesActualUsesDetails = new SoapObject(NCCBIZ . "MachineriesActualUsesDetails.php", "urn:Object"); if (is_array($afs->landArray)) { foreach ($afs->landArray as $land) { $landActualUsesID = $land->getActualUse(); if ($xmlStr = $LandActualUsesDetails->getLandActualUsesDetails($landActualUsesID)) { if ($domDoc = domxml_open_mem($xmlStr)) { $landActualUses = new LandActualUses(); $landActualUses->parseDomDocument($domDoc); return $landActualUses->getReportCode(); } } } } else { if (is_array($afs->plantsTreesArray)) { foreach ($afs->plantsTreesArray as $plantsTrees) { $plantsTreesActualUsesID = $plantsTrees->getActualUse(); if ($xmlStr = $PlantsTreesActualUsesDetails->getPlantsTreesActualUsesDetails($plantsTreesActualUsesID)) { if ($domDoc = domxml_open_mem($xmlStr)) { $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->parseDomDocument($domDoc); return $plantsTreesActualUses->getReportCode(); } } } } else { if (is_array($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $improvementsBuildings) { $improvementsBuildingsActualUsesID = $improvementsBuildings->getActualUse(); if ($xmlStr = $ImprovementsBuildingsActualUsesDetails->getImprovementsBuildingsActualUsesDetails($improvementsBuildingsActualUsesID)) { if ($domDoc = domxml_open_mem($xmlStr)) { $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->parseDomDocument($domDoc); return $improvementsBuildingsActualUses->getReportCode(); } } } } else { if (is_array($afs->machineriesArray)) { foreach ($afs->machineriesArray as $machineries) { $machineriesActualUsesID = $machineries->getActualUse(); if ($xmlStr = $MachineriesActualUsesDetails->getMachineriesActualUsesDetails($machineriesActualUsesID)) { if ($domDoc = domxml_open_mem($xmlStr)) { $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->parseDomDocument($domDoc); return $machineriesActualUses->getReportCode(); } } } } } } } return true; } } } } }
function CreateNewRPU_AFS_TDGenRevBrgy($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = true) { $link = mysql_connect(MYSQLDBHOST, MYSQLDBUSER, MYSQLDBPWD); mysql_select_db(MYSQLDBNAME, $link); $sql = "select Person.firstName, Person.lastName from Person, Owner, OwnerPerson " . "where Person.personID = OwnerPerson.personID and OwnerPerson.ownerID = Owner.ownerID and Owner.odID = " . $odID; $rs = mysql_query($sql, $link); $prevowners = ''; while ($row = mysql_fetch_assoc($rs)) { $prevowners .= $row['firstName'] . ' ' . $row['lastName'] . ', '; } $prevowners = substr($prevowners, 0, strlen($prevowners) - 2); $sql = "select AFS.totalAssessedValue from AFS where AFS.odID = " . $odID; $rs = mysql_query($sql, $link); $prevassdval = 0; if ($row = mysql_fetch_assoc($rs)) { $prevassdval = $row['totalAssessedValue']; } $od = new OD(); $od->selectRecord($odID); unset($od->oldODArray); $od->setTransactionCode($transactionCode); $od->setOldODArray($odID); // create new OD $ownerID = $od->owner->getOwnerID(); $newOdID = $od->insertRecord(); $newOwnerID = $od->newOwnerID; $od->setDomDocument(); // associate existing Owner to new OD $owner = new Owner(); $owner->selectRecord($ownerID); if (count($owner->personArray)) { foreach ($owner->personArray as $personKey => $personValue) { if ($copyOwner) { $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID()); } } } if (count($owner->companyArray)) { foreach ($owner->companyArray as $companyKey => $companyValue) { if ($copyOwner) { $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID()); } } } // create new AFS and associate existing properties to new AFS $afs = new AFS(); $afsID = $afs->checkAfsID($odID); $afs->selectRecord($afsID); $afs->setOdID($newOdID); $afs->effectivity = date("Y") + 1; // new arpNumber is blank //$afs->arpNumber = ""; // retain PIN except for Consolidation and Subdivision //if($transactionCode=="SD" || $transactionCode=="CS"){ $afs->propertyIndexNumber = ""; //} $afs->setDomDocument(); $newAFSID = $afs->insertRecord(); $afs->arpNumber = '(' . $newAFSID . ')'; $afs->updateRecord(); if ($copyAFS) { if ($copyTD) { $td = new TD(); $td->taxDeclarationNumber = $afs->arpNumber; $td->afsID = $newAFSID; $td->previousOwner = $prevowners; $td->previousAssessedValue = $prevassdval; $td->setDomDocument(); $newTDID = $td->insertRecord(); } if (count($afs->landArray)) { foreach ($afs->landArray as $landKey => $landValue) { $landValue->setPropertyID(""); $landValue->setAfsID($newAFSID); $landValue->propertyAdministrator->setPersonID(""); // set unitValue from SubClass $landSubclasses = new LandSubclasses(); $landSubclasses->selectRecord(intVal($landValue->subClass)); $landValue->setUnitValue($landSubclasses->getValue()); // set assessmentLevel from ActualUse $landActualUses = new LandActualUses(); $landActualUses->selectRecord(intVal($landValue->actualUse)); $landValue->setAssessmentLevel($landActualUses->getValue()); $landValue->calculateMarketValue(); $landValue->calculateValueAdjustment(); $landValue->calculateAdjustedMarketValue(); $landValue->calculateAssessedValue(); $landValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $landValue->appraisedByDate = ""; $landValue->recommendingApprovalDate = ""; $landValue->approvedByDate = ""; $newP = $landValue->insertRecord(); } } if (count($afs->plantsTreesArray)) { foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) { $plantsTreesValue->setPropertyID(""); $plantsTreesValue->setAfsID($newAFSID); $plantsTreesValue->propertyAdministrator->setPersonID(""); // set unitPrice from ProductClass $plantsTreesClasses = new PlantsTreesClasses(); $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass)); $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue()); // set assessmentLevel from ActualUse $plantsTreesActualUses = new PlantsTreesActualUses(); $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse)); $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue()); $plantsTreesValue->calculateMarketValue(); $plantsTreesValue->calculateValueAdjustment(); $plantsTreesValue->calculateAdjustedMarketValue(); $plantsTreesValue->calculateAssessedValue(); $plantsTreesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $plantsTreesValue->appraisedByDate = ""; $plantsTreesValue->recommendingApprovalDate = ""; $plantsTreesValue->approvedByDate = ""; $newP = $plantsTreesValue->insertRecord(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) { $improvementsBuildingsValue->setPropertyID(""); $improvementsBuildingsValue->setAfsID($newAFSID); $improvementsBuildingsValue->propertyAdministrator->setPersonID(""); // set unitValue from BuildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification)); $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue()); // set assessmentLevel from ActualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse)); $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue()); $improvementsBuildingsValue->calculateMarketValue(); $improvementsBuildingsValue->calculateAccumulatedDepreciation(); $improvementsBuildingsValue->calculatedDepreciatedMarketValue(); $improvementsBuildingsValue->calculateAdjustedMarketValue(); $improvementsBuildingsValue->calculateAssessedValue(); $improvementsBuildingsValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $improvementsBuildingsValue->appraisedByDate = ""; $improvementsBuildingsValue->recommendingApprovalDate = ""; $improvementsBuildingsValue->approvedByDate = ""; $newP = $improvementsBuildingsValue->insertRecord(); } } if (count($afs->machineriesArray)) { foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) { $machineriesValue->setPropertyID(""); $machineriesValue->setAfsID($newAFSID); $machineriesValue->propertyAdministrator->setPersonID(""); // set assessmentLevel from ActualUse $machineriesActualUses = new MachineriesActualUses(); $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse)); $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue()); $machineriesValue->calculateMarketValue(); $machineriesValue->calculateDepreciatedMarketValue(); $machineriesValue->calculateAdjustedMarketValue(); $machineriesValue->calculateAssessedValue(); $machineriesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA; $machineriesValue->appraisedByDate = ""; $machineriesValue->recommendingApprovalDate = ""; $machineriesValue->approvedByDate = ""; $newP = $machineriesValue->insertRecord(); } } } $sql = "update AFS set archive = 'true' where AFS.odID = " . $odID; mysql_query($sql, $link); $sql = "update OD set archive = 'true' where OD.odID = " . $odID; mysql_query($sql, $link); $sql = "update TD set archive = 'true' where TD.afsID = " . $afsID; mysql_query($sql, $link); mysql_close($link); return $newOdID; echo "OD - " . $odID . "->" . $newOdID . "<br>"; echo "Owner - " . $ownerID . "->" . $newOwnerID . "<br>"; echo "AFS - " . $afsID . "->" . $newAFSID . "<br>" . $newP; }
function selectRecord($rptopID) { if ($rptopID == "") { return; } $this->setDB(); $sql = sprintf("SELECT * FROM %s WHERE rptopID=%s;", RPTOP_TABLE, $rptopID); $this->db->query($sql); //echo $sql; $rptop = new RPTOP(); if ($this->db->next_record()) { foreach ($this->db->Record as $key => $value) { switch ($key) { default: $this->{$key} = $value; } } ///* $sql = sprintf("SELECT ownerID FROM %s WHERE rptopID = %s;", OWNER_TABLE, $rptopID); $this->db->query($sql); //echo $sql; while ($this->db->next_record()) { $owner = new Owner(); //echo test; $owner->selectRecord($this->db->f("ownerID")); $this->owner = $owner; } $sql = sprintf("SELECT * FROM %s WHERE rptopID=%s;", RPTOPTD_TABLE, $rptopID); $this->setDB(); //echo $sql; //* $this->db->query($sql); while ($this->db->next_record()) { $td = new TD(); $td->selectRecord($this->db->f("tdID")); $this->tdArray[] = $td; } $this->setDomDocument(); //*/ /* $tdRecords = new TDRecords; $tdRecords->selectRecords($this->rptopID); $this->tdArray = $tdRecords->getArrayList(); //*/ $this->setDomDocument(); $ret = true; } else { $ret = false; } return $ret; }
<?php include_once "inc/conn.php"; include_once "inc/utility_all.php"; define("MSGCHECKTIME", "WEIXINQY_MSGCHECK_TIME"); $CUR_TIME = time(); $PARA_ARRAY = get_sys_para(MSGCHECKTIME, FALSE); $MSG_CHK_TIME = intval(trim($PARA_ARRAY[MSGCHECKTIME])); $BEGIN_TIME = $MSG_CHK_TIME <= 0 ? $CUR_TIME : $MSG_CHK_TIME; $query = "SELECT FROM_UID,TO_UID,CONTENT,SEND_TIME FROM MESSAGE where REMIND_FLAG='1' and MSG_TYPE='1' and\n\t\t\t FROM_UID!=0 and TO_UID!=0 and SEND_TIME>'{$BEGIN_TIME}' and SEND_TIME<='{$CUR_TIME}' order by TO_UID,FROM_UID,SEND_TIME asc"; $cursor = exequery(TD::conn(), $query); if (!$cursor) { echo "-ERR "; exit; } while ($ROW = mysql_fetch_array($cursor)) { $FROM_UID = $ROW['FROM_UID']; include_once "inc/utility_cache.php"; $FROM_USER_NAME = getuserinfobyuid($FROM_UID, "USER_NAME"); $TO_UID = $ROW['TO_UID']; $CONTENT = $ROW['CONTENT']; include_once "inc/itask/itask.php"; mobile_push_notification($TO_UID, $FROM_USER_NAME . _(":") . $CONTENT . _("【即时通讯离线消息】"), "msg"); } set_sys_para(array(MSGCHECKTIME => $CUR_TIME)); $CUR_TIME_FORMAT = date("Y-m-d H:i:s", $CUR_TIME); $qry = "UPDATE OFFICE_TASK SET LAST_EXEC='{$CUR_TIME_FORMAT}',EXEC_FLAG='1',EXEC_MSG='{$CUR_TIME_FORMAT}' WHERE TASK_CODE='inst_msg_offl_push'"; exequery(TD::conn(), $qry); echo "+OK";
function setDetails() { global $sess; $this->tpl->set_var($_GET); $this->tpl->set_var($_POST); # set the RPTOP to get the owner's object and information # get it from POST if possible, otherwise from GET $rptopID = isset($_POST['rptopID']) ? $_POST['rptopID'] : $_GET['rptopID']; $rptop = new RPTOP(); $rptop->selectRecord($rptopID); $dateDue = $rptop->getTaxableYear() . "-01-01"; # must be a usable format $formValues['taxableYear'] = $rptop->getTaxableYear(); $formValues['rptopNum'] = $rptop->getRptopNumber(); # set the specific TD (although this is in the RPTOP), hard to search for it. # get the tdID from POST or GET to initialize the TD $tdID = isset($_POST['tdID']) ? $_POST['tdID'] : $_GET['tdID']; $td = new TD(); $td->selectRecord($tdID); $tdNum = $td->getTaxDeclarationNumber(); $formValues['tdNum'] = $tdNum; # we define the property from the TD $propertyType = $td->getPropertyType(); $propertyID = $td->getPropertyID(); switch ($propertyType) { case "Land": $property = new Land(); break; case "PlantsTrees": $property = new PlantsTrees(); break; case "ImprovementsBuildings": $property = new ImprovementsBuildings(); break; case "Machineries": $property = new Machineries(); break; default: echo "cannot be! {$propertyType}"; break; } if (is_object($property)) { $property->selectRecord($propertyID); $assessedValue = number_format($property->getAssessedValue(), 2, ".", ""); $formValues['assessedValue'] = number_format($property->getAssessedValue(), 2); } $formValues['propertyType'] = $propertyType; # set the owner's List # we define the owner from the RPTOP $this->tpl->set_block('step3', 'Owner', 'Owners'); $owner = $rptop->getOwner(); $personArray = $owner->getPersonArray(); if (is_array($personArray)) { foreach ($personArray as $person) { $ownerValues['ownerName'] = $person->getLastName() . ", " . $person->getFirstName() . " " . $person->getMiddleName(); $addressArray = $person->getAddressArray(); $address = $addressArray[0]; $ownerValues['ownerAddress'] = $address->getNumber() . " " . $address->getStreet() . "<br>" . $address->getBarangay() . ", " . $address->getMunicipalityCity() . "<br>" . $address->getProvince(); $this->tpl->set_var($ownerValues); $this->tpl->parse('Owners', 'Owner', 'true'); } } $companyArray = $owner->getCompanyArray(); if (is_array($companyArray)) { foreach ($companyArray as $company) { $ownerValues['ownerName'] = $company->getCompanyName(); $addressArray = $company->getAddressArray(); $address = $addressArray[0]; $ownerValues['ownerAddress'] = $address->getNumber() . " " . $address->getStreet() . "<br>" . $address->getBarangay() . ", " . $address->getMunicipalityCity() . "<br> " . $address->getProvince(); $this->tpl->set_var($ownerValues); $this->tpl->parse('Owners', 'Owner', 'true'); } } # tax dues are defined from TDNumber and taxableYear # compute for taxes $taxDue = new Dues(); if ($taxDue->create($tdNum, $dateDue) == false) { $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setDueDate($dateDue); $taxDue->setUpdateDate(); } $paymentPeriod = "Annual"; if (isset($_POST['paymentPeriod'])) { $paymentPeriod = $_POST['paymentPeriod']; } switch ($paymentPeriod) { case 'Annual': $this->tpl->set_var("checkedAnnual", "checked"); break; case 'Q1': $this->tpl->set_var("checkedQ1", "checked"); break; case 'Q2': $this->tpl->set_var("checkedQ2", "checked"); break; case 'Q3': $this->tpl->set_var("checkedQ3", "checked"); break; case 'Q4': $this->tpl->set_var("checkedQ4", "checked"); break; default: break; } $this->tpl->set_var($formValues); ## Compute taxes and set the page values $basic = $taxDue->getBalanceBasic($paymentPeriod); $sef = $taxDue->getBalanceSEF($paymentPeriod); $interest = $taxDue->computePenalty($paymentPeriod); $taxValues['basic'] = number_format($basic, 2); $taxValues['sef'] = number_format($sef, 2); $taxValues['pd1185'] = number_format(0.0, 2); $taxValues['subTotal'] = number_format($basic + $sef, 2); $taxValues['periodTotal'] = number_format($basic + $sef, 2); $taxValues['discount'] = "0.0%"; $taxValues['interest'] = number_format($interest * 100.0, 1) . "%"; $taxValues['totBasic'] = number_format($basic * (1 + $interest), 2); $taxValues['totSEF'] = number_format($sef * (1 + $interest), 2); $taxValues['totPD1185'] = number_format(0, 2); $taxValues['totSubTotal'] = number_format(($basic + $sef) * (1 + $interest), 2); $taxValues['grandTotal'] = number_format(($basic + $sef) * (1 + $interest), 2); # further breakdown of basic tax for RPT Receipt $taxValues['gf'] = number_format($basic * 0.7, 2); // 70% of basic $taxValues['ib'] = number_format($basic * 0.15, 2); // 15% of basic $taxValues['cb'] = number_format($basic * 0.15, 2); // 15% of basic for a total if 100% $taxValues['totGF'] = number_format($basic * 0.7 * (1 + $interest), 2); $taxValues['totIB'] = number_format($basic * 0.15 * (1 + $interest), 2); $taxValues['totCB'] = number_format($basic * 0.15 * (1 + $interest), 2); $this->tpl->set_var($taxValues); if (!isset($_POST['printReceipt_x'])) { $this->tpl->set_var("Session", $sess->url("")); } }
function displayTDDetails() { $afsID = $this->formArray["afsID"]; $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object"); if (!($xmlStr = $TDDetails->getTD("", $afsID, "", ""))) { // error xml } else { if (!($domDoc = domxml_open_mem($xmlStr))) { // error domDoc } else { $td = new TD(); $td->parseDomDocument($domDoc); $this->formArray["taxDeclarationNumber"] = $td->getTaxDeclarationNumber(); $this->formArray["memoranda"] = $td->getMemoranda(); $this->formArray["cancelsTDNumber"] = $td->getCancelsTDNumber(); //cityMunicipalAssessor if (is_numeric($td->getCityMunicipalAssessor())) { $cityMunicipalAssessor = new Person(); $cityMunicipalAssessor->selectRecord($td->cityMunicipalAssessor); $this->formArray["cityAssessor"] = $cityMunicipalAssessor->getFullName(); } else { $this->formArray["cityAssessor"] = $td->getCityMunicipalAssessor; } $this->formArray["propertyType"] = $td->getPropertyType(); } } }