コード例 #1
0
 function getLGUName()
 {
     $eRPTSSettings = new eRPTSSettings();
     $eRPTSSettings->selectRecord(1);
     $this->formArray["lguType"] = strtoupper($eRPTSSettings->getLguType());
     $this->formArray["lguName"] = strtoupper($eRPTSSettings->getLguName());
 }
コード例 #2
0
 function displayPageHeading()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $this->tpl->set_var("monthYearString", date("F - Y", strtotime($this->formArray["year"] . "-" . $this->formArray["month"] . "-01")));
 }
コード例 #3
0
ファイル: eRPTSSettingsEncode.php プロジェクト: armic/erpts
 function updateERPTSSettings($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $erptsSettings = new eRPTSSettings();
     $erptsSettings->parseDomDocument($domDoc);
     $ret = $erptsSettings->updateRecord();
     return $ret;
 }
コード例 #4
0
ファイル: eRPTSSettingsDetails.php プロジェクト: armic/erpts
 function getERPTSSettingsDetails($eRPTSSettingsID)
 {
     $erptsSettings = new eRPTSSettings();
     $erptsSettings->selectRecord($eRPTSSettingsID);
     if (!($domDoc = $erptsSettings->getDomDocument())) {
         return false;
     } else {
         $xmlStr = $domDoc->dump_mem(true);
         return $xmlStr;
     }
 }
コード例 #5
0
 function setLguDetails()
 {
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         $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 {
             $erptsSettings = new eRPTSSettings();
             $erptsSettings->parseDomDocument($domDoc);
             $this->formArray["lguName"] = strtoupper($erptsSettings->getLguName());
             $this->formArray["lguType"] = strtoupper($erptsSettings->getLguType());
         }
     }
 }
コード例 #6
0
ファイル: PrintTDsumm.php プロジェクト: armic/erpts
 function displayLGUInfo()
 {
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         // error xml
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $eRPTSSettings = new eRPTSSettings();
             $eRPTSSettings->parseDomDocument($domDoc);
             //RC 20091006 Add logic so if City, TD Assessor is City Assessor, else Provincial Assessor
             if ($eRPTSSettings->getLguType() == "City") {
                 if ($eRPTSSettings->getAssessorLastName() != "") {
                     $this->formArray["TDAssessorName"] = $eRPTSSettings->getAssessorFullName();
                     $this->formArray["TDApprovedDate"] = $this->formArray["cityMunicipalAssessorDate"];
                     $ordinanceCouncil = "Panglungsod";
                 } else {
                     $this->formArray["TDAssessorName"] = "";
                 }
             } else {
                 // provincialAssessor
                 if ($eRPTSSettings->getProvincialAssessorLastName() != "") {
                     $this->formArray["TDAssessorName"] = $eRPTSSettings->getProvincialAssessorFullName();
                     $this->formArray["TDApprovedDate"] = $this->formArray["provincialAssessorDate"];
                     $ordinanceCouncil = "Panlalawigan";
                 } else {
                     $this->formArray["TDAssessorName"] = "";
                 }
             }
             $this->formArray["TDAssessorName"] = strtoupper($this->formArray["TDAssessorName"]);
             $this->formArray["notesLine3"] = $ordinanceCouncil . " under Ordinance No. " . $eRPTSSettings->getOrdinanceNo() . " dated " . $eRPTSSettings->getOrdinanceDate() . ". It does not and cannot by itself alone";
         }
     }
 }
コード例 #7
0
 function getERPTSSettingsDetails()
 {
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         // error xmlStr
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $eRPTSSettings = new eRPTSSettings();
             $eRPTSSettings->parseDomDocument($domDoc);
             return $eRPTSSettings;
         }
     }
 }
コード例 #8
0
ファイル: PrintTDsumm.php プロジェクト: armic/erpts
 function displayAssessor()
 {
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         // error xml
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $eRPTSSettings = new eRPTSSettings();
             $eRPTSSettings->parseDomDocument($domDoc);
             // provincialAssessor
             if ($eRPTSSettings->getProvincialAssessorLastName() != "") {
                 $this->formArray["provincialAssessorName"] = $eRPTSSettings->getProvincialAssessorFullName();
             } else {
                 $this->formArray["provincialAssessorName"] = "";
             }
             if ($eRPTSSettings->getAssessorLastName() != "") {
                 $this->formArray["cityMunicipalAssessorName"] = $eRPTSSettings->getAssessorFullName();
             } else {
                 $this->formArray["cityMunicipalAssessorName"] = "";
             }
         }
     }
 }
コード例 #9
0
ファイル: collectionReport7.php プロジェクト: armic/erpts
 function Main()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $dbPayment = new DB_RPTS();
     $dbTD = new DB_RPTS();
     $dbBacktaxTD = new DB_RPTS();
     $dbDue = new DB_RPTS();
     $dbPaymentTD = new DB_RPTS();
     $dbPaymentBacktaxTD = new DB_RPTS();
     $dbCollection = new DB_RPTS();
     // gather unique TD's and BacktaxTD's from Payments for year
     $sqlPayment = "SELECT paymentID, " . "tdID, " . "backtaxTDID " . "FROM Payment " . "WHERE status!='cancelled' " . "AND YEAR(paymentDate) LIKE '" . $this->formArray["year"] . "' " . "GROUP BY tdID, backtaxTDID " . "ORDER BY paymentID DESC ";
     $dbPayment->query($sqlPayment);
     if ($dbPayment->nf() > 0) {
         while ($dbPayment->next_record()) {
             $year = "";
             $pageRecord = array("propertyIndexNumber" => "", "tdNumber" => "", "paidBasic" => 0, "paidSef" => 0, "discount" => 0, "basicSef" => 0, "yearDel" => "", "basicDel" => 0, "sefDel" => 0, "penalty" => 0, "totalDel" => 0, "totalAmount" => 0);
             if ($dbPayment->f("backtaxTDID") != 0) {
                 // ------- start of BacktaxTD condition ------------------------- //
                 // gather BacktaxTD details
                 $sqlBacktaxTD = "SELECT tdNumber as tdNumber, " . "startYear as year " . "FROM BacktaxTD " . "WHERE " . "backtaxTDID = '" . $dbPayment->f("backtaxTDID") . "' ";
                 $dbBacktaxTD->query($sqlBacktaxTD);
                 if ($dbBacktaxTD->next_record()) {
                     $pageRecord["tdNumber"] = $dbBacktaxTD->f("tdNumber");
                     $year = $dbBacktaxTD->f("year");
                 }
                 // gather Payments for BacktaxTD for this year
                 $sqlPaymentBacktaxTD = "SELECT * " . "FROM Payment WHERE " . "backtaxTDID='" . $dbPayment->f("backtaxTDID") . "' " . "AND YEAR(paymentDate) LIKE '" . $this->formArray["year"] . "' " . "AND status!='cancelled' " . "ORDER BY paymentID DESC ";
                 $dbPaymentBacktaxTD->query($sqlPaymentBacktaxTD);
                 if ($dbPaymentBacktaxTD->nf() > 0) {
                     while ($dbPaymentBacktaxTD->next_record()) {
                         // gather Collections for Payment
                         $sqlCollection = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentBacktaxTD->f("paymentID") . "' " . "AND Collection.status!='cancelled' " . "ORDER BY collectionID DESC ";
                         $dbCollection->query($sqlCollection);
                         if ($dbCollection->nf() > 0) {
                             while ($dbCollection->next_record()) {
                                 switch ($dbCollection->f("taxType")) {
                                     case "basic":
                                         // paidBasic
                                         $paidBasic = 0;
                                         if ($dbCollection->f("amnesty") != "true") {
                                             $paidBasic = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                             // penalty, basicDel and totalDel
                                             if ($dbCollection->f("penalty") > 0) {
                                                 $pageRecord["yearDel"] = $year;
                                                 // basicDel
                                                 $basicDel = 0;
                                                 $basicDel = $dbCollection->f("taxDue");
                                                 // penalty
                                                 $penalty = 0;
                                                 $penalty = $dbCollection->f("penalty");
                                                 // totalDel
                                                 $totalDel = $basicDel + $penalty;
                                                 $pageRecord["basicDel"] += $basicDel;
                                                 $pageRecord["penalty"] += $penalty;
                                                 $pageRecord["totalDel"] += $totalDel;
                                                 // totalAmount
                                                 $pageRecord["totalAmount"] += $penalty;
                                             }
                                         }
                                         $paidBasic = $paidBasic + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                         // discount
                                         $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                         // basicSef
                                         $basicSef = $paidBasic - $discount;
                                         $pageRecord["paidBasic"] += $paidBasic;
                                         $pageRecord["discount"] += $discount;
                                         $pageRecord["basicSef"] += $basicSef;
                                         // totalAmount
                                         $pageRecord["totalAmount"] += $basicSef;
                                         break;
                                     case "sef":
                                         // paidSef
                                         $paidSef = 0;
                                         if ($dbCollection->f("amnesty") != "true") {
                                             $paidSef = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                             // penalty, sefDel and totalDel
                                             if ($dbCollection->f("penalty") > 0) {
                                                 $pageRecord["yearDel"] = $year;
                                                 // sefDel
                                                 $sefDel = 0;
                                                 $sefDel = $dbCollection->f("taxDue");
                                                 // penalty
                                                 $penalty = 0;
                                                 $penalty = $dbCollection->f("penalty");
                                                 // totalDel
                                                 $totalDel = $sefDel + $penalty;
                                                 $pageRecord["sefDel"] += $sefDel;
                                                 $pageRecord["penalty"] += $penalty;
                                                 $pageRecord["totalDel"] += $totalDel;
                                                 // totalAmount
                                                 $pageRecord["totalAmount"] += $penalty;
                                             }
                                         }
                                         $paidSef = $paidSef + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                         // discount
                                         $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                         // basicSef
                                         $basicSef = $paidSef - $discount;
                                         $pageRecord["paidSef"] += $paidSef;
                                         $pageRecord["discount"] += $discount;
                                         $pageRecord["basicSef"] += $basicSef;
                                         // totalAmount
                                         $pageRecord["totalAmount"] += $basicSef;
                                         break;
                                 }
                             }
                         }
                     }
                 }
                 // ------- start of BacktaxTD condition ------------------------- //
             } else {
                 if ($dbPayment->f("tdID") != 0) {
                     // ------- start of TD condition ------------------------- //
                     // gather TD details
                     $sqlTD = "SELECT AFS.propertyIndexNumber as propertyIndexNumber, " . "TD.taxDeclarationNumber as taxDeclarationNumber " . "FROM TD, AFS " . "WHERE " . "TD.afsID = AFS.afsID " . "AND TD.tdID='" . $dbPayment->f("tdID") . "' " . "AND TD.archive!='true' " . "AND AFS.archive!='true' ";
                     $dbTD->query($sqlTD);
                     if ($dbTD->next_record()) {
                         $pageRecord["propertyIndexNumber"] = $dbTD->f("propertyIndexNumber");
                         $pageRecord["tdNumber"] = $dbTD->f("taxDeclarationNumber");
                     }
                     // gather dueDate Year from Due
                     $sqlDue = "SELECT YEAR(dueDate) as year " . "FROM Due " . "WHERE tdID='" . $dbPayment->f("tdID") . "' " . "AND dueType='Annual' ";
                     $dbDue->query($sqlDue);
                     if ($dbDue->next_record()) {
                         $year = $dbDue->f("year");
                     }
                     // gather Payments for TD for this year
                     $sqlPaymentTD = "SELECT * " . "FROM Payment WHERE " . "tdID='" . $dbPayment->f("tdID") . "' " . "AND YEAR(paymentDate) LIKE '" . $this->formArray["year"] . "' " . "AND status!='cancelled' " . "ORDER BY paymentID DESC ";
                     $dbPaymentTD->query($sqlPaymentTD);
                     if ($dbPaymentTD->nf() > 0) {
                         while ($dbPaymentTD->next_record()) {
                             // gather Collections for Payment
                             $sqlCollection = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentTD->f("paymentID") . "' " . "AND Collection.status!='cancelled' " . "ORDER BY collectionID DESC ";
                             $dbCollection->query($sqlCollection);
                             if ($dbCollection->nf() > 0) {
                                 while ($dbCollection->next_record()) {
                                     switch ($dbCollection->f("taxType")) {
                                         case "basic":
                                             // paidBasic
                                             $paidBasic = 0;
                                             if ($dbCollection->f("amnesty") != "true") {
                                                 $paidBasic = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                                 // penalty, basicDel and totalDel
                                                 if ($dbCollection->f("penalty") > 0) {
                                                     $pageRecord["yearDel"] = $year;
                                                     // basicDel
                                                     $basicDel = 0;
                                                     $basicDel = $dbCollection->f("taxDue");
                                                     // penalty
                                                     $penalty = 0;
                                                     $penalty = $dbCollection->f("penalty");
                                                     // totalDel
                                                     $totalDel = $basicDel + $penalty;
                                                     $pageRecord["basicDel"] += $basicDel;
                                                     $pageRecord["penalty"] += $penalty;
                                                     $pageRecord["totalDel"] += $totalDel;
                                                     // totalAmount
                                                     $pageRecord["totalAmount"] += $penalty;
                                                 }
                                             }
                                             $paidBasic = $paidBasic + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                             // discount
                                             $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                             // basicSef
                                             $basicSef = $paidBasic - $discount;
                                             $pageRecord["paidBasic"] += $paidBasic;
                                             $pageRecord["discount"] += $discount;
                                             $pageRecord["basicSef"] += $basicSef;
                                             // totalAmount
                                             $pageRecord["totalAmount"] += $basicSef;
                                             break;
                                         case "sef":
                                             // paidSef
                                             $paidSef = 0;
                                             if ($dbCollection->f("amnesty") != "true") {
                                                 $paidSef = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                                 // penalty, sefDel and totalDel
                                                 if ($dbCollection->f("penalty") > 0) {
                                                     $pageRecord["yearDel"] = $year;
                                                     // sefDel
                                                     $sefDel = 0;
                                                     $sefDel = $dbCollection->f("taxDue");
                                                     // penalty
                                                     $penalty = 0;
                                                     $penalty = $dbCollection->f("penalty");
                                                     // totalDel
                                                     $totalDel = $sefDel + $penalty;
                                                     $pageRecord["sefDel"] += $sefDel;
                                                     $pageRecord["penalty"] += $penalty;
                                                     $pageRecord["totalDel"] += $totalDel;
                                                     // totalAmount
                                                     $pageRecord["totalAmount"] += $penalty;
                                                 }
                                             }
                                             $paidSef = $paidSef + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                             // discount
                                             $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                             // basicSef
                                             $basicSef = $paidSef - $discount;
                                             $pageRecord["paidSef"] += $paidSef;
                                             $pageRecord["discount"] += $discount;
                                             $pageRecord["basicSef"] += $basicSef;
                                             // totalAmount
                                             $pageRecord["totalAmount"] += $basicSef;
                                             break;
                                     }
                                 }
                             }
                         }
                     }
                     // ------- end of TD condition ------------------------- //
                 }
             }
             $pageRecordArrayList[] = $pageRecord;
             unset($pageRecord);
         }
         if (is_array($pageRecordArrayList)) {
             $ypos = 426;
             $decrementYposBy = 12;
             $linesPerPage = 24;
             $count = count($pageRecordArrayList);
             $numOfPages = ceil($count / $linesPerPage);
             $pageCtr = 1;
             $lineCtr = 1;
             $recordCtr = 1;
             $this->tpl->set_var("year", $this->formArray["year"]);
             $this->tpl->set_var("numOfPages", $numOfPages);
             $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
             $this->tpl->set_block("Page", "Row", "RowBlock");
             $this->tpl->set_block("Page", "Totals", "TotalsBlock");
             $totalsArray = array("totalPaidBasic" => 0, "totalPaidSef" => 0, "totalDiscount" => 0, "totalBasicSef" => 0, "totalBasicDel" => 0, "totalSefDel" => 0, "totalPenalty" => 0, "totalTotalDel" => 0, "totalTotalAmount" => 0);
             foreach ($pageRecordArrayList as $recordArray) {
                 $this->tpl->set_var("ypos", $ypos);
                 $this->tpl->set_var("recordCtr", $recordCtr);
                 // write values
                 $totalsArray["totalPaidBasic"] += un_number_format($recordArray["paidBasic"]);
                 $totalsArray["totalPaidSef"] += un_number_format($recordArray["paidSef"]);
                 $totalsArray["totalDiscount"] += un_number_format($recordArray["discount"]);
                 $totalsArray["totalBasicSef"] += un_number_format($recordArray["basicSef"]);
                 $totalsArray["totalBasicDel"] += un_number_format($recordArray["basicDel"]);
                 $totalsArray["totalSefDel"] += un_number_format($recordArray["sefDel"]);
                 $totalsArray["totalPenalty"] += un_number_format($recordArray["penalty"]);
                 $totalsArray["totalTotalDel"] += un_number_format($recordArray["totalDel"]);
                 $totalsArray["totalTotalAmount"] += un_number_format($recordArray["totalAmount"]);
                 foreach ($recordArray as $key => $value) {
                     switch ($key) {
                         case "paidBasic":
                         case "paidSef":
                         case "discount":
                         case "basicSef":
                         case "basicDel":
                         case "sefDel":
                         case "penalty":
                         case "totalDel":
                         case "totalAmount":
                             $value = formatCurrency($value);
                             break;
                     }
                     $this->tpl->set_var($key, $value);
                 }
                 $this->tpl->parse("RowBlock", "Row", true);
                 if ($recordCtr == count($pageRecordArrayList) || $lineCtr == $linesPerPage) {
                     if ($pageCtr == $numOfPages) {
                         foreach ($totalsArray as $key => $value) {
                             $value = formatCurrency($value);
                             $this->tpl->set_var($key, $value);
                         }
                         $this->tpl->parse("TotalsBlock", "Totals", true);
                     } else {
                         $this->tpl->set_var("TotalsBlock", "");
                     }
                     $this->tpl->set_var("page", $pageCtr);
                     $this->tpl->parse("PageBlock", "Page", true);
                     $this->tpl->set_var("RowBlock", "");
                     $this->tpl->set_var("TotalsBlock", "");
                     $ypos = 426;
                     $lineCtr = 0;
                     $pageCtr++;
                 }
                 $lineCtr++;
                 $recordCtr++;
                 $ypos = $ypos - $decrementYposBy;
             }
             $this->tpl->parse("templatePage", "rptsTemplate");
             $this->tpl->finish("templatePage");
         } else {
             exit("no collections to list for " . $this->formArray["year"]);
         }
     } else {
         exit("no collections to list for " . $this->formArray["year"]);
     }
     $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);
     }
 }
コード例 #10
0
ファイル: collectionReport5.php プロジェクト: armic/erpts
 function Main()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $dbTD = new DB_RPTS();
     $dbBacktaxTD = new DB_RPTS();
     $dbPaymentBacktaxTD = new DB_RPTS();
     $dbPaymentTD = new DB_RPTS();
     $dbDues = new DB_RPTS();
     // gather TD's
     $sql = "SELECT Due.dueID as dueID, " . "Due.tdID as tdID, " . "Due.dueType as dueType, " . "Due.dueDate as dueDate, " . "Due.basicTax as basicTax, " . "Due.basicTaxRate as basicTaxRate, " . "Due.sefTax as sefTax, " . "Due.sefTaxRate as sefTaxRate, " . "Due.idleTax as idleTax, " . "Due.idleTaxRate as idleTaxRate, " . "TD.afsID as afsID, " . "TD.propertyType as propertyType, " . "TD.taxDeclarationNumber as taxDeclarationNumber, " . "AFS.odID as odID, " . "AFS.arpNumber as arpNumber, " . "AFS.propertyIndexNumber as propertyIndexNumber, " . "AFS.taxability as taxability, " . "AFS.effectivity as effectivity, " . "AFS.totalMarketValue as totalMarketValue, " . "AFS.totalAssessedValue as totalAssessedValue " . "FROM Due, TD, AFS " . "WHERE Due.tdID = TD.tdID " . "AND TD.afsID = AFS.afsID " . "AND AFS.archive != 'true' " . "AND TD.archive != 'true' " . "AND Due.dueType = 'Annual' " . "AND YEAR(Due.dueDate)  <= YEAR(NOW()) " . "AND TD.propertyType LIKE '" . $this->formArray["classification"] . "' " . "GROUP BY Due.tdID, YEAR(Due.dueDate) " . "ORDER BY Due.dueDate DESC";
     $dbTD->query($sql);
     if ($dbTD->nf() > 0) {
         // gather BacktaxTD's
         while ($dbTD->next_record()) {
             $sqlBacktaxTD = "SELECT backtaxTDID, " . "tdID, " . "tdNumber, " . "startYear, " . "endYear, " . "startQuarter, " . "assessedValue, " . "basicRate, " . "sefRate, " . "basicTax, " . "sefTax, " . "idleTax, " . "penalties, " . "paid, " . "balance, " . "total " . "FROM BacktaxTD " . "WHERE tdID='" . $dbTD->f("tdID") . "' " . "ORDER BY startYear ASC ";
             $dbBacktaxTD->query($sqlBacktaxTD);
             if ($dbBacktaxTD->nf() > 0) {
                 while ($dbBacktaxTD->next_record()) {
                     $backtaxTDRecordArray[] = $dbBacktaxTD->Record;
                 }
             }
             $tdRecordArray[] = array("td" => $dbTD->Record, "backtaxTD" => $backtaxTDRecordArray);
             unset($backtaxTDRecordArray);
         }
     }
     if (is_array($tdRecordArray)) {
         // verify whether each TD Record or BacktaxTD Record is delinquent by comparing it to Payment
         // if it is not in Payment it is considered delinquent
         // if amountPaid is insufficient to amountDue, it is considered delinquent
         foreach ($tdRecordArray as $recordArray) {
             $basicAmountDelinquent = 0;
             $sefAmountDelinquent = 0;
             $penalty = 0;
             $totalDelinquent = 0;
             // find delinquent backtaxTD's
             if (is_array($recordArray["backtaxTD"])) {
                 foreach ($recordArray["backtaxTD"] as $backtaxTDRecord) {
                     $basicAmountDelinquent = 0;
                     $sefAmountDelinquent = 0;
                     $penalty = 0;
                     $totalDelinquent = 0;
                     $sqlPaymentBacktaxTD = "SELECT paymentID, " . "dueType, " . "backtaxTDID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE backtaxTDID='" . $backtaxTDRecord["backtaxTDID"] . "' " . "AND status!='cancelled'";
                     $dbPaymentBacktaxTD->query($sqlPaymentBacktaxTD);
                     if ($dbPaymentBacktaxTD->nf() > 0) {
                         if ($dbPaymentBacktaxTD->next_record()) {
                             // if amountPaid is less than balanceDue, it is delinquent
                             if ($dbPaymentBacktaxTD->f("amountPaid") < $dbPaymentBacktaxTD->f("balanceDue")) {
                                 $paidBasic = $backtaxTDRecord["basicRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $dbPaymentBacktaxTD->f("amountPaid");
                                 $paidSef = $backtaxTDRecord["sefRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $dbPaymentBacktaxTD->f("amountPaid");
                                 $basicAmountDelinquent = $backtaxTDRecord["basicTax"] - $paidBasic;
                                 $sefAmountDelinquent = $backtaxTDRecord["sefTax"] - $paidSef;
                                 $backtaxTD = new BacktaxTD();
                                 $backtaxTD->selectRecord("", $backtaxTDRecord["backtaxTDID"], "");
                                 $backtaxTD->calculatePenalty(date("Y-m-d"));
                                 $penalty = $backtaxTD->getPenalties();
                                 $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                                 $delinquentRecordArray[] = array("propertyIndexNumber" => "", "taxDeclarationNumber" => $backtaxTDRecord["tdNumber"], "yearDelinquent" => $backtaxTDRecord["startYear"], "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                             }
                         }
                     } else {
                         $paidBasic = $backtaxTDRecord["basicRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $backtaxTDRecord["paid"];
                         $paidSef = $backtaxTDRecord["sefRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $backtaxTDRecord["paid"];
                         $basicAmountDelinquent = $backtaxTDRecord["basicTax"] - $paidBasic;
                         $sefAmountDelinquent = $backtaxTDRecord["sefTax"] - $paidSef;
                         $backtaxTD = new BacktaxTD();
                         $backtaxTD->selectRecord("", $backtaxTDRecord["backtaxTDID"], "");
                         $backtaxTD->calculatePenalty(date("Y-m-d"));
                         $penalty = $backtaxTD->getPenalties();
                         $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                         $delinquentRecordArray[] = array("propertyIndexNumber" => "", "taxDeclarationNumber" => $backtaxTDRecord["tdNumber"], "yearDelinquent" => $backtaxTDRecord["startYear"], "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                     }
                 }
             }
             // find delinquent TD's
             if (is_array($recordArray["td"])) {
                 $tdRecord = $recordArray["td"];
                 $basicAmountDelinquent = 0;
                 $sefAmountDelinquent = 0;
                 $penalty = 0;
                 $totalDelinquent = 0;
                 $sqlPaymentTD = "SELECT paymentID, " . "dueID, " . "dueType, " . "tdID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE tdID='" . $tdRecord["tdID"] . "' " . "AND status!='cancelled'";
                 $dbPaymentTD->query($sqlPaymentTD);
                 if ($dbPaymentTD->nf() > 0) {
                     while ($dbPaymentTD->next_record()) {
                         if ($dbPaymentTD->f("dueType") == "Annual") {
                             if ($dbPaymentTD->f("amountPaid") < $dbPaymentTD->f("balanceDue")) {
                                 $paidBasic = $tdRecord["basicRate"] / ($tdRecord["basicRate"] + $tdRecord["sefRate"]) * $dbPaymentTD->f("amountPaid");
                                 $paidSef = $tdRecord["sefRate"] / ($tdRecord["basicRate"] + $tdRecord["sefRate"]) * $dbPaymentTD->f("amountPaid");
                                 $basicAmountDelinquent = $tdRecord["basicTax"] - $paidBasic;
                                 $sefAmountDelinquent = $tdRecord["sefTax"] - $paidSef;
                                 $due = new Due();
                                 $due->selectRecord($tdRecord["dueID"]);
                                 $due = $this->computePenalty(date("Y-m-d"), $due);
                                 $penalty = $due->getPenalty();
                                 $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                                 $delinquentRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "taxDeclarationNumber" => $tdRecord["taxDeclarationNumber"], "yearDelinquent" => date("Y", strtotime($tdRecord["dueDate"])), "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                             }
                             break;
                         } else {
                             $tmpPaidQuarterDues[] = $dbPaymentTD->f("dueID");
                         }
                     }
                     if (is_array($tmpPaidQuarterDues)) {
                         // not all quarters have been paid if less than four
                         if (count($tmpPaidQuarterDues) < 4) {
                             foreach ($tmpPaidQuarterDues as $dueID) {
                                 $sqlDueCondition .= " AND Due.dueID!='" . $dueID . "' ";
                             }
                             // grab unpaid quarterly dues that have not been paid before quarterly dueDate
                             $sqlDues = "SELECT Due.dueID as dueID, " . "Due.dueType as dueType, " . "Due.tdID as tdID " . "FROM Due, TD, AFS " . "WHERE TD.afsID = AFS.afsID " . "AND AFS.archive != 'true' " . "AND TD.archive != 'true' " . "AND Due.dueType != 'Annual' " . "AND Due.tdID = '" . $tdRecord["tdID"] . "'" . "AND TD.propertyType LIKE '" . $this->formArray["classification"] . "' " . "AND YEAR(Due.dueDate)  <= " . date("Y", strtotime($tdRecord["dueDate"])) . " " . "AND Due.dueDate <= '" . date("Y-m-d") . "' " . $sqlDueCondition . " " . "GROUP BY Due.tdID, Due.dueDate " . "ORDER BY Due.dueDate DESC";
                             $dbDues->query($sqlDues);
                             while ($dbDues->next_record()) {
                                 $due = new Due();
                                 $due->selectRecord($dbDues->f("dueID"));
                                 $basicAmountDelinquent += $due->getBasicTax();
                                 $sefAmountDelinquent += $due->getSefTax();
                                 $due = $this->computePenalty(date("Y-m-d"), $due);
                                 $penalty += $due->getPenalty();
                             }
                             $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                             $delinquentRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "taxDeclarationNumber" => $tdRecord["taxDeclarationNumber"], "yearDelinquent" => date("Y", strtotime($tdRecord["dueDate"])), "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                         }
                         unset($sqlDueCondition);
                         unset($tmpPaidQuarterDues);
                     }
                 } else {
                     $basicAmountDelinquent = $tdRecord["basicTax"];
                     $sefAmountDelinquent = $tdRecord["sefTax"];
                     $due = new Due();
                     $due->selectRecord($tdRecord["dueID"]);
                     $due = $this->computePenalty(date("Y-m-d"), $due);
                     $penalty = $due->getPenalty();
                     $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                     $delinquentRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "taxDeclarationNumber" => $tdRecord["taxDeclarationNumber"], "yearDelinquent" => date("Y", strtotime($tdRecord["dueDate"])), "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                 }
             }
         }
     }
     // print page
     if (is_array($delinquentRecordArray)) {
         $ypos = 615;
         $decrementYposBy = 12;
         $linesPerPage = 42;
         $count = count($delinquentRecordArray);
         $numOfPages = ceil($count / $linesPerPage);
         $pageCtr = 1;
         $lineCtr = 1;
         $recordCtr = 1;
         $this->tpl->set_var("classification", $this->formArray["classification"]);
         $this->tpl->set_var("numOfPages", $numOfPages);
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         $this->tpl->set_block("Page", "Row", "RowBlock");
         $this->tpl->set_block("Page", "Totals", "TotalsBlock");
         $totalsArray = array("totalBasicAmountDelinquent" => 0, "totalSefAmountDelinquent" => 0, "totalPenalty" => 0, "totalTotalDelinquent" => 0);
         foreach ($delinquentRecordArray as $recordArray) {
             $this->tpl->set_var("ypos", $ypos);
             $this->tpl->set_var("recordCtr", $recordCtr);
             // write values
             $totalsArray["totalBasicAmountDelinquent"] += un_number_format($recordArray["basicAmountDelinquent"]);
             $totalsArray["totalSefAmountDelinquent"] += un_number_format($recordArray["sefAmountDelinquent"]);
             $totalsArray["totalPenalty"] += un_number_format($recordArray["penalty"]);
             $totalsArray["totalTotalDelinquent"] += un_number_format($recordArray["totalDelinquent"]);
             foreach ($recordArray as $key => $value) {
                 switch ($key) {
                     case "basicAmountDelinquent":
                     case "sefAmountDelinquent":
                     case "penalty":
                     case "totalDelinquent":
                         $value = formatCurrency($value);
                         break;
                 }
                 $this->tpl->set_var($key, $value);
             }
             $this->tpl->parse("RowBlock", "Row", true);
             if ($recordCtr == count($delinquentRecordArray) || $lineCtr == $linesPerPage) {
                 if ($pageCtr == $numOfPages) {
                     foreach ($totalsArray as $key => $value) {
                         $value = formatCurrency($value);
                         $this->tpl->set_var($key, $value);
                     }
                     $this->tpl->parse("TotalsBlock", "Totals", true);
                 } else {
                     $this->tpl->set_var("TotalsBlock", "");
                 }
                 $this->tpl->set_var("page", $pageCtr);
                 $this->tpl->parse("PageBlock", "Page", true);
                 $this->tpl->set_var("RowBlock", "");
                 $this->tpl->set_var("TotalsBlock", "");
                 $ypos = 615;
                 $lineCtr = 0;
                 $pageCtr++;
             }
             $lineCtr++;
             $recordCtr++;
             $ypos = $ypos - $decrementYposBy;
         }
         $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);
         }
     } else {
         exit("no delinquent collectible records to display");
     }
 }
コード例 #11
0
ファイル: UserListPrint.php プロジェクト: armic/erpts
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         default:
             $this->tpl->set_var("msg", "");
     }
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         $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 {
             $erptsSettings = new eRPTSSettings();
             $erptsSettings->parseDomDocument($domDoc);
             $this->formArray["eRPTSSettingsID"] = $erptsSettings->getERPTSSettingsID();
             $this->formArray["lguName"] = $erptsSettings->getLguName();
             $this->formArray["lguType"] = $erptsSettings->getLguType();
             $this->formArray["chiefExecutiveDesignation"] = $erptsSettings->getChiefExecutiveDesignation();
             $this->formArray["chiefExecutiveFirstName"] = $erptsSettings->getChiefExecutiveFirstName();
             $this->formArray["chiefExecutiveMiddleName"] = $erptsSettings->getChiefExecutiveMiddleName();
             $this->formArray["chiefExecutiveLastName"] = $erptsSettings->getChiefExecutiveLastName();
             $this->formArray["assessorDesignation"] = $erptsSettings->getAssessorDesignation();
             $this->formArray["assessorFirstName"] = $erptsSettings->getAssessorFirstName();
             $this->formArray["assessorMiddleName"] = $erptsSettings->getAssessorMiddleName();
             $this->formArray["assessorLastName"] = $erptsSettings->getAssessorLastName();
             $this->formArray["treasurerDesignation"] = $erptsSettings->getTreasurerDesignation();
             $this->formArray["treasurerFirstName"] = $erptsSettings->getTreasurerFirstName();
             $this->formArray["treasurerMiddleName"] = $erptsSettings->getTreasurerMiddleName();
             $this->formArray["treasurerLastName"] = $erptsSettings->getTreasurerLastName();
         }
     }
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     $condition = " WHERE status='enabled' ";
     $this->tpl->set_var("activeInactive", "(enabled ONLY)");
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $UserList->getUserList(0, $condition))) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database is empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $userRecords = new UserRecords();
             $userRecords->parseDomDocument($domDoc);
             $list = $userRecords->getArrayList();
             $this->tpl->set_var("totalRecords", count($list));
             $this->tpl->set_block("rptsTemplate", "UserList", "UserListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("userID", $value->getUserID());
                 $this->tpl->set_var("userType", $value->getUserType());
                 $userTypeListArray = $value->getUserTypeListArray();
                 $userTypeBitArray = $value->getUserTypeBitArray($value->getUserType());
                 $userTypeDescriptions = $value->getUserTypeDescriptions($userTypeListArray, $userTypeBitArray);
                 $userTypeDescriptions = str_replace(",", ",<br>", $userTypeDescriptions);
                 $this->tpl->set_var("userTypeDescriptions", $userTypeDescriptions);
                 $this->tpl->set_var("username", $value->getUsername());
                 $this->tpl->set_var("fullName", $value->getFullName());
                 $this->tpl->set_var("personID", $value->getPersonID());
                 $this->tpl->set_var("dateCreated", date("m-d-Y", $value->getDateCreated()));
                 $this->tpl->set_var("dateModified", date("m-d-Y", $value->getDateModified()));
                 $this->tpl->set_var("status", $value->getStatus());
                 $this->tpl->set_var("statusCheck", $this->getStatusCheck($value->getStatus()));
                 $this->tpl->parse("UserListBlock", "UserList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #12
0
ファイル: collectionReport9.php プロジェクト: armic/erpts
 function Main()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $dbTD = new DB_RPTS();
     $dbBacktaxTD = new DB_RPTS();
     $dbPaymentBacktaxTD = new DB_RPTS();
     $dbPaymentTD = new DB_RPTS();
     $dbCollectionBacktaxTD = new DB_RPTS();
     $dbCollectionTD = new DB_RPTS();
     $dbDue = new DB_RPTS();
     // gather TD's
     $sql = "SELECT Due.dueID as dueID, " . "Due.tdID as tdID, " . "Due.dueType as dueType, " . "Due.dueDate as dueDate, " . "Due.basicTax as basicTax, " . "Due.basicTaxRate as basicTaxRate, " . "Due.sefTax as sefTax, " . "Due.sefTaxRate as sefTaxRate, " . "Due.idleTax as idleTax, " . "Due.idleTaxRate as idleTaxRate, " . "TD.afsID as afsID, " . "TD.propertyType as propertyType, " . "TD.taxDeclarationNumber as taxDeclarationNumber, " . "AFS.odID as odID, " . "AFS.arpNumber as arpNumber, " . "AFS.propertyIndexNumber as propertyIndexNumber, " . "AFS.taxability as taxability, " . "AFS.effectivity as effectivity, " . "AFS.totalMarketValue as totalMarketValue, " . "AFS.totalAssessedValue as totalAssessedValue " . "FROM Due, TD, AFS " . "WHERE Due.tdID = TD.tdID " . "AND TD.afsID = AFS.afsID " . "AND AFS.archive != 'true' " . "AND TD.archive != 'true' " . "AND Due.dueType = 'Annual' " . "AND TD.propertyType LIKE '" . $this->formArray["classification"] . "' " . "GROUP BY Due.tdID, YEAR(Due.dueDate) " . "ORDER BY Due.dueDate DESC";
     $dbTD->query($sql);
     if ($dbTD->nf() > 0) {
         // gather BacktaxTD's
         while ($dbTD->next_record()) {
             $sqlBacktaxTD = "SELECT backtaxTDID, " . "tdID, " . "tdNumber, " . "startYear, " . "endYear, " . "startQuarter, " . "assessedValue, " . "basicRate, " . "sefRate, " . "basicTax, " . "sefTax, " . "idleTax, " . "penalties, " . "paid, " . "balance, " . "total " . "FROM BacktaxTD " . "WHERE tdID='" . $dbTD->f("tdID") . "' " . "ORDER BY startYear ASC ";
             $dbBacktaxTD->query($sqlBacktaxTD);
             if ($dbBacktaxTD->nf() > 0) {
                 while ($dbBacktaxTD->next_record()) {
                     $backtaxTDRecordArray[] = $dbBacktaxTD->Record;
                 }
             }
             $tdRecordArray[] = array("td" => $dbTD->Record, "backtaxTD" => $backtaxTDRecordArray);
             unset($backtaxTDRecordArray);
         }
     }
     if (is_array($tdRecordArray)) {
         foreach ($tdRecordArray as $recordArray) {
             // gather backtaxTD details
             if (is_array($recordArray["backtaxTD"])) {
                 foreach ($recordArray["backtaxTD"] as $backtaxTDRecord) {
                     $paidBasic = 0;
                     $paidSEF = 0;
                     $paidPenalty = 0;
                     $totalTaxCollected = 0;
                     $basic = 0;
                     $sef = 0;
                     $penalty = 0;
                     $totalCollectible = 0;
                     // get totalTaxCollected
                     $sqlPaymentBacktaxTD = "SELECT paymentID, " . "dueType, " . "backtaxTDID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE backtaxTDID='" . $backtaxTDRecord["backtaxTDID"] . "' " . "AND status!='cancelled'";
                     $dbPaymentBacktaxTD->query($sqlPaymentBacktaxTD);
                     if ($dbPaymentBacktaxTD->nf() > 0) {
                         while ($dbPaymentBacktaxTD->next_record()) {
                             $sqlCollectionBacktaxTD = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentBacktaxTD->f("paymentID") . "' " . "AND status!='cancelled' ";
                             $dbCollectionBacktaxTD->query($sqlCollectionBacktaxTD);
                             if ($dbCollectionBacktaxTD->nf() > 0) {
                                 while ($dbCollectionBacktaxTD->next_record()) {
                                     switch ($dbCollectionBacktaxTD->f("taxType")) {
                                         case "basic":
                                             if ($dbCollectionBacktaxTD->f("amnesty") != "true") {
                                                 $paidBasic += $dbCollectionBacktaxTD->f("amountPaid") - $dbCollectionBacktaxTD->f("penalty");
                                                 $paidPenalty += $dbCollectionBacktaxTD->f("penalty");
                                                 $totalTaxCollected += $dbCollectionBacktaxTD->f("amountPaid");
                                             } else {
                                                 $paidBasic += $dbCollectionBacktaxTD->f("amountPaid");
                                                 $totalTaxCollected += $paidBasic;
                                             }
                                             break;
                                         case "sef":
                                             if ($dbCollectionBacktaxTD->f("amnesty") != "true") {
                                                 $paidSEF += $dbCollectionBacktaxTD->f("amountPaid") - $dbCollectionBacktaxTD->f("penalty");
                                                 $paidPenalty += $dbCollectionBacktaxTD->f("penalty");
                                                 $totalTaxCollected += $dbCollectionBacktaxTD->f("amountPaid");
                                             } else {
                                                 $paidSEF += $dbCollectionBacktaxTD->f("amountPaid");
                                                 $totalTaxCollected += $paidSEF;
                                             }
                                             break;
                                     }
                                 }
                             }
                         }
                     }
                     // get totalCollectible
                     $basic = $backtaxTDRecord["basicTax"];
                     $sef = $backtaxTDRecord["sefTax"];
                     $backtaxTD = new BacktaxTD();
                     $backtaxTD->selectRecord("", $backtaxTDRecord["backtaxTDID"], "");
                     $backtaxTD->calculatePenalty(date("Y-m-d"));
                     $penalty = $backtaxTD->getPenalties();
                     $totalCollectible = $basic + $sef + $penalty;
                     $lineRecordArray[] = array("propertyIndexNumber" => "TD#:" . $backtaxTDRecord["tdNumber"] . " (" . $backtaxTDRecord["startYear"] . ")", "tdNumber" => $backtaxTDRecord["tdNumber"], "paidBasic" => $paidBasic, "paidSEF" => $paidSEF, "paidPenalty" => $paidPenalty, "totalTaxCollected" => $totalTaxCollected, "basic" => $basic, "sef" => $sef, "penalty" => $penalty, "totalCollectible" => $totalCollectible);
                 }
             }
             $paidBasic = 0;
             $paidSEF = 0;
             $paidPenalty = 0;
             $totalTaxCollected = 0;
             $basic = 0;
             $sef = 0;
             $penalty = 0;
             $totalCollectible = 0;
             // gather TD details
             if (is_array($recordArray["td"])) {
                 $tdRecord = $recordArray["td"];
                 // get totalTaxCollected
                 $sqlPaymentTD = "SELECT paymentID, " . "dueType, " . "backtaxTDID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE tdID='" . $tdRecord["tdID"] . "' " . "AND status!='cancelled'";
                 $dbPaymentTD->query($sqlPaymentTD);
                 if ($dbPaymentTD->nf() > 0) {
                     while ($dbPaymentTD->next_record()) {
                         $sqlCollectionTD = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentTD->f("paymentID") . "' " . "AND status!='cancelled' ";
                         $dbCollectionTD->query($sqlCollectionTD);
                         if ($dbCollectionTD->nf() > 0) {
                             while ($dbCollectionTD->next_record()) {
                                 switch ($dbCollectionTD->f("taxType")) {
                                     case "basic":
                                         if ($dbCollectionTD->f("amnesty") != "true") {
                                             $paidBasic += $dbCollectionTD->f("amountPaid") - $dbCollectionTD->f("penalty");
                                             $paidPenalty += $dbCollectionTD->f("penalty");
                                             $totalTaxCollected += $dbCollectionTD->f("amountPaid");
                                         } else {
                                             $paidBasic += $dbCollectionTD->f("amountPaid");
                                             $totalTaxCollected += $paidBasic;
                                         }
                                         break;
                                     case "sef":
                                         if ($dbCollectionTD->f("amnesty") != "true") {
                                             $paidSEF += $dbCollectionTD->f("amountPaid") - $dbCollectionTD->f("penalty");
                                             $paidPenalty += $dbCollectionTD->f("penalty");
                                             $totalTaxCollected += $dbCollectionTD->f("amountPaid");
                                         } else {
                                             $paidSEF += $dbCollectionTD->f("amountPaid");
                                             $totalTaxCollected += $paidSEF;
                                         }
                                         break;
                                 }
                             }
                         }
                     }
                 }
                 // get totalCollectible
                 $due = new Due();
                 if ($due->selectRecord($tdRecord["dueID"])) {
                     $basic = $due->getBasicTax();
                     $sef = $due->getSefTax();
                     $due = $this->computePenalty(date("Y-m-d"), $due);
                     $penalty = $due->getPenalty();
                     $totalCollectible = $basic + $sef + $penalty;
                 }
                 $lineRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "tdNumber" => $tdRecord["taxDeclarationNumber"], "paidBasic" => $paidBasic, "paidSEF" => $paidSEF, "paidPenalty" => $paidPenalty, "totalTaxCollected" => $totalTaxCollected, "basic" => $basic, "sef" => $sef, "penalty" => $penalty, "totalCollectible" => $totalCollectible);
             }
         }
     }
     // print page
     if (is_array($lineRecordArray)) {
         $ypos = 400;
         $decrementYposBy = 12;
         $linesPerPage = 20;
         $count = count($lineRecordArray);
         $numOfPages = ceil($count / $linesPerPage);
         $pageCtr = 1;
         $lineCtr = 1;
         $recordCtr = 1;
         $this->tpl->set_var("classification", $this->formArray["classification"]);
         $this->tpl->set_var("numOfPages", $numOfPages);
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         $this->tpl->set_block("Page", "Row", "RowBlock");
         $this->tpl->set_block("Page", "Totals", "TotalsBlock");
         $totalsArray = array("totalPaidBasic" => 0, "totalPaidSEF" => 0, "totalPaidPenalty" => 0, "totalTotalTaxCollected" => 0, "totalBasic" => 0, "totalSef" => 0, "totalPenalty" => 0, "totalTotalCollectible" => 0);
         foreach ($lineRecordArray as $recordArray) {
             $this->tpl->set_var("ypos", $ypos);
             $this->tpl->set_var("recordCtr", $recordCtr);
             // tally totals
             $totalsArray["totalPaidBasic"] += un_number_format($recordArray["paidBasic"]);
             $totalsArray["totalPaidSEF"] += un_number_format($recordArray["paidSEF"]);
             $totalsArray["totalPaidPenalty"] += un_number_format($recordArray["paidPenalty"]);
             $totalsArray["totalTotalTaxCollected"] += un_number_format($recordArray["totalTaxCollected"]);
             $totalsArray["totalBasic"] += un_number_format($recordArray["basic"]);
             $totalsArray["totalSef"] += un_number_format($recordArray["sef"]);
             $totalsArray["totalPenalty"] += un_number_format($recordArray["penalty"]);
             $totalsArray["totalTotalCollectible"] += un_number_format($recordArray["totalCollectible"]);
             // write values
             foreach ($recordArray as $key => $value) {
                 switch ($key) {
                     case "paidBasic":
                     case "paidSEF":
                     case "paidPenalty":
                     case "totalTaxCollected":
                     case "basic":
                     case "sef":
                     case "penalty":
                     case "totalCollectible":
                         $value = formatCurrency($value);
                         break;
                 }
                 $this->tpl->set_var($key, $value);
             }
             $this->tpl->parse("RowBlock", "Row", true);
             if ($recordCtr == count($lineRecordArray) || $lineCtr == $linesPerPage) {
                 if ($pageCtr == $numOfPages) {
                     foreach ($totalsArray as $key => $value) {
                         $value = formatCurrency($value);
                         $this->tpl->set_var($key, $value);
                     }
                     $this->tpl->parse("TotalsBlock", "Totals", true);
                 } else {
                     $this->tpl->set_var("TotalsBlock", "");
                 }
                 $this->tpl->set_var("page", $pageCtr);
                 $this->tpl->parse("PageBlock", "Page", true);
                 $this->tpl->set_var("RowBlock", "");
                 $this->tpl->set_var("TotalsBlock", "");
                 $ypos = 400;
                 $lineCtr = 0;
                 $pageCtr++;
             }
             $lineCtr++;
             $recordCtr++;
             $ypos = $ypos - $decrementYposBy;
         }
         $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);
         }
     } else {
         exit("no records to display");
     }
 }
コード例 #13
0
ファイル: RPTOPEncode.php プロジェクト: armic/erpts
 function initMasterTreasurerList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         // error xml
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $eRPTSSettings = new eRPTSSettings();
             $eRPTSSettings->parseDomDocument($domDoc);
             switch ($tempVar) {
                 case "cityTreasurer":
                     $this->tpl->set_var("id", $eRPTSSettings->getTreasurerFullName());
                     $this->tpl->set_var("name", $eRPTSSettings->getTreasurerFullName());
                     $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                     $this->initSelected($tempVar . "ID", $eRPTSSettings->getTreasurerFullName());
                     $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
                     break;
             }
         }
     }
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE userType='Treasury' AND status='enabled'"))) {
         // error xmlStr
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $UserRecords = new UserRecords();
             $UserRecords->parseDomDocument($domDoc);
             $list = $UserRecords->getArrayList();
             foreach ($list as $key => $user) {
                 $person = new Person();
                 $person->selectRecord($user->personID);
                 $this->tpl->set_var("id", $user->personID);
                 $this->tpl->set_var("name", $person->getFullName());
                 $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                 $this->initSelected($tempVar . "ID", $user->personID);
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }
コード例 #14
0
ファイル: eRPTSSettingsEncode.php プロジェクト: armic/erpts
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "save":
             $eRPTSSettingsEncode = new SoapObject(NCCBIZ . "eRPTSSettingsEncode.php", "urn:Object");
             if ($this->formArray["eRPTSSettingsID"] != "") {
                 $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
                 if (!($xmlStr = $eRPTSSettingsDetails->geteRPTSSettingsDetails($this->formArray["eRPTSSettingsID"]))) {
                     exit("record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $erptsSettings = new eRPTSSettings();
                         $erptsSettings->parseDomDocument($domDoc);
                         $erptsSettings->setERPTSSettingsID($this->formArray["eRPTSSettingsID"]);
                         $erptsSettings->setLguName($this->formArray["lguName"]);
                         $erptsSettings->setLguType($this->formArray["lguType"]);
                         $erptsSettings->setChiefExecutiveDesignation($this->formArray["chiefExecutiveDesignation"]);
                         $erptsSettings->setChiefExecutiveFirstName($this->formArray["chiefExecutiveFirstName"]);
                         $erptsSettings->setChiefExecutiveMiddleName($this->formArray["chiefExecutiveMiddleName"]);
                         $erptsSettings->setChiefExecutiveLastName($this->formArray["chiefExecutiveLastName"]);
                         $erptsSettings->setAssessorDesignation($this->formArray["assessorDesignation"]);
                         $erptsSettings->setAssessorFirstName($this->formArray["assessorFirstName"]);
                         $erptsSettings->setAssessorMiddleName($this->formArray["assessorMiddleName"]);
                         $erptsSettings->setAssessorLastName($this->formArray["assessorLastName"]);
                         $erptsSettings->setTreasurerDesignation($this->formArray["treasurerDesignation"]);
                         $erptsSettings->setTreasurerFirstName($this->formArray["treasurerFirstName"]);
                         $erptsSettings->setTreasurerMiddleName($this->formArray["treasurerMiddleName"]);
                         $erptsSettings->setTreasurerLastName($this->formArray["treasurerLastName"]);
                         $erptsSettings->setProvincialAssessorDesignation($this->formArray["provincialAssessorDesignation"]);
                         $erptsSettings->setProvincialAssessorFirstName($this->formArray["provincialAssessorFirstName"]);
                         $erptsSettings->setProvincialAssessorMiddleName($this->formArray["provincialAssessorMiddleName"]);
                         $erptsSettings->setProvincialAssessorLastName($this->formArray["provincialAssessorLastName"]);
                         $erptsSettings->setProvincialTreasurerDesignation($this->formArray["provincialTreasurerDesignation"]);
                         $erptsSettings->setProvincialTreasurerFirstName($this->formArray["provincialTreasurerFirstName"]);
                         $erptsSettings->setProvincialTreasurerMiddleName($this->formArray["provincialTreasurerMiddleName"]);
                         $erptsSettings->setProvincialTreasurerLastName($this->formArray["provincialTreasurerLastName"]);
                         $erptsSettings->setOrdinanceNo($this->formArray["ordinanceNo"]);
                         $erptsSettings->setOrdinanceDate($this->formArray["ordinanceDate"]);
                         $erptsSettings->setDomDocument();
                         $doc = $erptsSettings->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $eRPTSSettingsEncode->updateERPTSSettings($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $erptsSettings = new eRPTSSettings();
                 $erptsSettings->setLguName($this->formArray["lguName"]);
                 $erptsSettings->setLguType($this->formArray["lguType"]);
                 $erptsSettings->setChiefExecutiveDesignation($this->formArray["chiefExecutiveDesignation"]);
                 $erptsSettings->setChiefExecutiveFirstName($this->formArray["chiefExecutiveFirstName"]);
                 $erptsSettings->setChiefExecutiveMiddleName($this->formArray["chiefExecutiveMiddleName"]);
                 $erptsSettings->setChiefExecutiveLastName($this->formArray["chiefExecutiveLastName"]);
                 $erptsSettings->setAssessorDesignation($this->formArray["assessorDesignation"]);
                 $erptsSettings->setAssessorFirstName($this->formArray["assessorFirstName"]);
                 $erptsSettings->setAssessorMiddleName($this->formArray["assessorMiddleName"]);
                 $erptsSettings->setAssessorLastName($this->formArray["assessorLastName"]);
                 $erptsSettings->setTreasurerDesignation($this->formArray["treasurerDesignation"]);
                 $erptsSettings->setTreasurerFirstName($this->formArray["treasurerFirstName"]);
                 $erptsSettings->setTreasurerMiddleName($this->formArray["treasurerMiddleName"]);
                 $erptsSettings->setTreasurerLastName($this->formArray["treasurerLastName"]);
                 $erptsSettings->setProvincialAssessorDesignation($this->formArray["provincialAssessorDesignation"]);
                 $erptsSettings->setProvincialAssessorFirstName($this->formArray["provincialAssessorFirstName"]);
                 $erptsSettings->setProvincialAssessorMiddleName($this->formArray["provincialAssessorMiddleName"]);
                 $erptsSettings->setProvincialAssessorLastName($this->formArray["provincialAssessorLastName"]);
                 $erptsSettings->setProvincialTreasurerDesignation($this->formArray["provincialTreasurerDesignation"]);
                 $erptsSettings->setProvincialTreasurerFirstName($this->formArray["provincialTreasurerFirstName"]);
                 $erptsSettings->setProvincialTreasurerMiddleName($this->formArray["provincialTreasurerMiddleName"]);
                 $erptsSettings->setProvincialTreasurerLastName($this->formArray["provincialTreasurerLastName"]);
                 $erptsSettings->setOrdinanceNo($this->formArray["ordinanceNo"]);
                 $erptsSettings->setOrdinanceDate($this->formArray["ordinanceDate"]);
                 $erptsSettings->setDomDocument();
                 $doc = $erptsSettings->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $eRPTSSettingsEncode->saveERPTSSettings($xmlStr))) {
                     exit("error save");
                 }
             }
             $this->formArray["eRPTSSettingsID"] = $ret;
             break;
         default:
             $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
             if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
                 $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 {
                     $erptsSettings = new eRPTSSettings();
                     $erptsSettings->parseDomDocument($domDoc);
                     $this->formArray["eRPTSSettingsID"] = $erptsSettings->getERPTSSettingsID();
                     $this->formArray["lguName"] = $erptsSettings->getLguName();
                     $this->formArray["lguType"] = $erptsSettings->getLguType();
                     $this->formArray["chiefExecutiveDesignation"] = $erptsSettings->getChiefExecutiveDesignation();
                     $this->formArray["chiefExecutiveFirstName"] = $erptsSettings->getChiefExecutiveFirstName();
                     $this->formArray["chiefExecutiveMiddleName"] = $erptsSettings->getChiefExecutiveMiddleName();
                     $this->formArray["chiefExecutiveLastName"] = $erptsSettings->getChiefExecutiveLastName();
                     $this->formArray["assessorDesignation"] = $erptsSettings->getAssessorDesignation();
                     $this->formArray["assessorFirstName"] = $erptsSettings->getAssessorFirstName();
                     $this->formArray["assessorMiddleName"] = $erptsSettings->getAssessorMiddleName();
                     $this->formArray["assessorLastName"] = $erptsSettings->getAssessorLastName();
                     $this->formArray["treasurerDesignation"] = $erptsSettings->getTreasurerDesignation();
                     $this->formArray["treasurerFirstName"] = $erptsSettings->getTreasurerFirstName();
                     $this->formArray["treasurerMiddleName"] = $erptsSettings->getTreasurerMiddleName();
                     $this->formArray["treasurerLastName"] = $erptsSettings->getTreasurerLastName();
                     $this->formArray["provincialAssessorDesignation"] = $erptsSettings->getProvincialAssessorDesignation();
                     $this->formArray["provincialAssessorFirstName"] = $erptsSettings->getProvincialAssessorFirstName();
                     $this->formArray["provincialAssessorMiddleName"] = $erptsSettings->getProvincialAssessorMiddleName();
                     $this->formArray["provincialAssessorLastName"] = $erptsSettings->getProvincialAssessorLastName();
                     $this->formArray["provincialTreasurerDesignation"] = $erptsSettings->getProvincialTreasurerDesignation();
                     $this->formArray["provincialTreasurerFirstName"] = $erptsSettings->getProvincialTreasurerFirstName();
                     $this->formArray["provincialTreasurerMiddleName"] = $erptsSettings->getProvincialTreasurerMiddleName();
                     $this->formArray["provincialTreasurerLastName"] = $erptsSettings->getProvincialTreasurerLastName();
                     $this->formArray["ordinanceNo"] = $erptsSettings->getOrdinanceNo();
                     $this->formArray["ordinanceDate"] = $erptsSettings->getOrdinanceDate();
                 }
             }
     }
     $this->setForm();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #15
0
 function setLguDetails()
 {
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         $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 {
             $erptsSettings = new eRPTSSettings();
             $erptsSettings->parseDomDocument($domDoc);
             $this->formArray["lguName"] = strtoupper($erptsSettings->getLguName());
             $this->formArray["lguType"] = strtoupper($erptsSettings->getLguType());
             $this->tpl->set_var("lguName", $this->formArray["lguName"]);
             $this->tpl->set_var("lguType", $this->formArray["lguType"]);
             if (strtolower($this->formArray["lguType"]) == "municipality") {
                 $provinceRecords = new ProvinceRecords();
                 $condition = "WHERE status='active' ORDER BY provinceID ASC LIMIT 1";
                 if ($provinceRecords->selectRecords($condition)) {
                     if (is_array($provinceRecords->arrayList)) {
                         $province = $provinceRecords->arrayList[0];
                         $this->formArray["provinceName"] = strtoupper($province->getDescription());
                         $this->tpl->set_var("provinceName", strtoupper($this->formArray["provinceName"]));
                     }
                 }
             }
         }
     }
 }
コード例 #16
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         default:
             $this->tpl->set_var("msg", "");
     }
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         $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 {
             $erptsSettings = new eRPTSSettings();
             $erptsSettings->parseDomDocument($domDoc);
             $this->formArray["eRPTSSettingsID"] = $erptsSettings->getERPTSSettingsID();
             $this->formArray["lguName"] = $erptsSettings->getLguName();
             $this->formArray["lguType"] = $erptsSettings->getLguType();
             $this->formArray["chiefExecutiveDesignation"] = $erptsSettings->getChiefExecutiveDesignation();
             $this->formArray["chiefExecutiveFirstName"] = $erptsSettings->getChiefExecutiveFirstName();
             $this->formArray["chiefExecutiveMiddleName"] = $erptsSettings->getChiefExecutiveMiddleName();
             $this->formArray["chiefExecutiveLastName"] = $erptsSettings->getChiefExecutiveLastName();
             $this->formArray["assessorDesignation"] = $erptsSettings->getAssessorDesignation();
             $this->formArray["assessorFirstName"] = $erptsSettings->getAssessorFirstName();
             $this->formArray["assessorMiddleName"] = $erptsSettings->getAssessorMiddleName();
             $this->formArray["assessorLastName"] = $erptsSettings->getAssessorLastName();
             $this->formArray["treasurerDesignation"] = $erptsSettings->getTreasurerDesignation();
             $this->formArray["treasurerFirstName"] = $erptsSettings->getTreasurerFirstName();
             $this->formArray["treasurerMiddleName"] = $erptsSettings->getTreasurerMiddleName();
             $this->formArray["treasurerLastName"] = $erptsSettings->getTreasurerLastName();
         }
     }
     $LandSubclassesList = new SoapObject(NCCBIZ . "LandSubclassesList.php", "urn:Object");
     $condition = " WHERE status='active' ";
     $condition .= $this->sortBlocks();
     $this->tpl->set_var("activeInactive", "(active ONLY)");
     if (!($xmlStr = $LandSubclassesList->getLandSubclassesList(0, $condition))) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database is empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $landSubclassesRecords = new LandSubclassesRecords();
             $landSubclassesRecords->parseDomDocument($domDoc);
             $list = $landSubclassesRecords->getArrayList();
             $this->tpl->set_var("totalRecords", count($list));
             $this->tpl->set_block("rptsTemplate", "LandSubclassesList", "LandSubclassesListBlock");
             foreach ($list as $key => $listValue) {
                 $this->tpl->set_var("landSubclassesID", $listValue->getLandSubclassesID());
                 $this->tpl->set_var("code", $listValue->getCode());
                 $this->tpl->set_var("description", $listValue->getDescription());
                 $this->tpl->set_var("value", $listValue->getValue());
                 $this->tpl->set_var("status", $listValue->getStatus());
                 $this->tpl->set_var("statusCheck", $this->getStatusCheck($listValue->getStatus()));
                 $this->tpl->parse("LandSubclassesListBlock", "LandSubclassesList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #17
0
ファイル: LandEncode.php プロジェクト: armic/erpts
 function initMasterSignatoryList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $eRPTSSettingsDetails = new SoapObject(NCCBIZ . "eRPTSSettingsDetails.php", "urn:Object");
     if (!($xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1))) {
         // error xml
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             // error domDoc
         } else {
             $eRPTSSettings = new eRPTSSettings();
             $eRPTSSettings->parseDomDocument($domDoc);
             switch ($tempVar) {
                 case "recommendingApproval":
                 case "approvedBy":
                     $this->formArray["recommendingApprovalID"] = $this->formArray["recommendingApproval"];
                     $this->formArray["approvedByID"] = $this->formArray["approvedBy"];
                     $this->tpl->set_var("id", $eRPTSSettings->getAssessorFullName());
                     $this->tpl->set_var("name", $eRPTSSettings->getAssessorFullName());
                     $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                     $this->initSelected($tempVar . "ID", $eRPTSSettings->getAssessorFullName());
                     $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
                     // provincialAssessor
                     if ($eRPTSSettings->getProvincialAssessorLastName() != "") {
                         $this->formArray["recommendingApprovalID"] = $this->formArray["recommendingApproval"];
                         $this->formArray["approvedByID"] = $this->formArray["approvedBy"];
                         $this->tpl->set_var("id", $eRPTSSettings->getProvincialAssessorFullName());
                         $this->tpl->set_var("name", $eRPTSSettings->getProvincialAssessorFullName());
                         $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                         $this->initSelected($tempVar . "ID", $eRPTSSettings->getProvincialAssessorFullName());
                         $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
                     }
                     break;
             }
         }
     }
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE (userType='Signatory' OR userType='Assessor') AND status='enabled'"))) {
         //$this->tpl->set_var("id", "");
         //$this->tpl->set_var("name", "empty list");
         //$this->tpl->parse($TempVar."ListBlock", $TempVar."List", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             //$this->tpl->set_var("", "");
             //$this->tpl->set_var("name", "empty list");
             //$this->tpl->parse($TempVar."ListBlock", $TempVar."List", true);
         } else {
             $UserRecords = new UserRecords();
             $UserRecords->parseDomDocument($domDoc);
             $list = $UserRecords->getArrayList();
             foreach ($list as $key => $user) {
                 $person = new Person();
                 $person->selectRecord($user->personID);
                 $this->tpl->set_var("id", $user->personID);
                 $this->tpl->set_var("name", $person->getFullName());
                 $this->formArray[$tempVar . "ID"] = $this->formArray[$tempVar];
                 $this->initSelected($tempVar . "ID", $user->personID);
                 $this->tpl->parse($TempVar . "ListBlock", $TempVar . "List", true);
             }
         }
     }
 }