コード例 #1
0
 function searchMachineriesDepreciation($searchKey, $page = 0)
 {
     if ($page > 0) {
         $page = ($page - 1) * PAGE_BY;
         $limit = "LIMIT {$page}," . PAGE_BY;
     }
     $fields = array("code", "description", "status", "value");
     $machineriesDepreciationRecords = new MachineriesDepreciationRecords();
     if ($machineriesDepreciationRecords->searchRecords($searchKey, $fields, $limit)) {
         if (!($domDoc = $machineriesDepreciationRecords->getDomDocument())) {
             return false;
         } else {
             $xmlStr = $domDoc->dump_mem(true);
             return $xmlStr;
         }
     } else {
         return false;
     }
 }
コード例 #2
0
 function codeAlreadyExists()
 {
     $MachineriesDepreciationList = new SoapObject(NCCBIZ . "MachineriesDepreciationList.php", "urn:Object");
     if (!($xmlStr = $MachineriesDepreciationList->getMachineriesDepreciationList())) {
         return false;
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return false;
         } else {
             $machineriesDepreciationRecords = new MachineriesDepreciationRecords();
             $machineriesDepreciationRecords->parseDomDocument($domDoc);
             $list = $machineriesDepreciationRecords->getArrayList();
             foreach ($list as $key => $machineriesDepreciation) {
                 if (strtoupper($this->formArray["code"]) == strtoupper($machineriesDepreciation->getCode())) {
                     if ($this->formArray["machineriesDepreciationID"] != $machineriesDepreciation->getMachineriesDepreciationID()) {
                         return true;
                     }
                 }
             }
         }
     }
 }
コード例 #3
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();
         }
     }
     $MachineriesDepreciationList = new SoapObject(NCCBIZ . "MachineriesDepreciationList.php", "urn:Object");
     $condition = " WHERE status='active' ";
     $condition .= $this->sortBlocks();
     $this->tpl->set_var("activeInactive", "(active ONLY)");
     if (!($xmlStr = $MachineriesDepreciationList->getMachineriesDepreciationList(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 {
             $machineriesDepreciationRecords = new MachineriesDepreciationRecords();
             $machineriesDepreciationRecords->parseDomDocument($domDoc);
             $list = $machineriesDepreciationRecords->getArrayList();
             $this->tpl->set_var("totalRecords", count($list));
             $this->tpl->set_block("rptsTemplate", "MachineriesDepreciationList", "MachineriesDepreciationListBlock");
             foreach ($list as $key => $listValue) {
                 $this->tpl->set_var("machineriesDepreciationID", $listValue->getMachineriesDepreciationID());
                 $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("MachineriesDepreciationListBlock", "MachineriesDepreciationList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #4
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["machineriesDepreciationID"]) > 0) {
                 $MachineriesDepreciationList = new SoapObject(NCCBIZ . "MachineriesDepreciationList.php", "urn:Object");
                 if (!($deletedRows = $MachineriesDepreciationList->deleteMachineriesDepreciation($this->formArray["machineriesDepreciationID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "activate":
             $MachineriesDepreciationList = new SoapObject(NCCBIZ . "MachineriesDepreciationList.php", "urn:Object");
             if (!($activeRows = $MachineriesDepreciationList->updateStatus($this->formArray["status"]))) {
                 $this->tpl->set_var("msg", "All records have status made <i>inactive</i>");
             } else {
                 $this->tpl->set_var("msg", $activeRows . " records have status made <i>active</i>");
             }
             break;
         case "cancel":
             header("location: MachineriesDepreciationList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $MachineriesDepreciationList = new SoapObject(NCCBIZ . "MachineriesDepreciationList.php", "urn:Object");
     $condition = $this->showHideInactive();
     $condition .= $this->sortBlocks();
     if (!($xmlStr = $MachineriesDepreciationList->getMachineriesDepreciationList(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 {
             $machineriesDepreciationRecords = new MachineriesDepreciationRecords();
             $machineriesDepreciationRecords->parseDomDocument($domDoc);
             $list = $machineriesDepreciationRecords->getArrayList();
             $this->tpl->set_block("rptsTemplate", "MachineriesDepreciationList", "MachineriesDepreciationListBlock");
             foreach ($list as $key => $listValue) {
                 $this->tpl->set_var("machineriesDepreciationID", $listValue->getMachineriesDepreciationID());
                 $this->tpl->set_var("code", $listValue->getCode());
                 $this->tpl->set_var("reportCode", $listValue->getReportCode());
                 $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("MachineriesDepreciationListBlock", "MachineriesDepreciationList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }