コード例 #1
0
ファイル: RPTOPBatchEncode.php プロジェクト: armic/erpts
 function initMasterTreasurerList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE " . AUTH_USER_MD5_TABLE . ".userType REGEXP '1\$' AND " . AUTH_USER_MD5_TABLE . ".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);
             }
         }
     }
 }
コード例 #2
0
ファイル: UserList.php プロジェクト: armic/erpts
 function searchUser($searchKey, $page = 0)
 {
     if ($page > 0) {
         $page = ($page - 1) * PAGE_BY;
         $limit = "LIMIT {$page}," . PAGE_BY;
     }
     $fields = array("code", "description", "status");
     $userRecords = new UserRecords();
     if ($userRecords->searchRecords($searchKey, $fields, $limit)) {
         if (!($domDoc = $userRecords->getDomDocument())) {
             return false;
         } else {
             $xmlStr = $domDoc->dump_mem(true);
             return $xmlStr;
         }
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: PlantsTreesEncode.php プロジェクト: armic/erpts
 function initMasterSignatoryList($TempVar, $tempVar)
 {
     $this->tpl->set_block("rptsTemplate", $TempVar . "List", $TempVar . "ListBlock");
     // commented out: March 16, 2004:
     // recommended that approval lists come ONLY out of the Users table and not out of eRPTSSettings
     /* Begin of Comment out
     
     		$eRPTSSettingsDetails = new SoapObject(NCCBIZ."eRPTSSettingsDetails.php", "urn:Object");
     		if(!$xmlStr = $eRPTSSettingsDetails->getERPTSSettingsDetails(1)){
     			// xml failed
     		}
     		else{
     			if(!$domDoc = domxml_open_mem($xmlStr)){
     				// error domDoc
     			}
     			else{
     				$eRPTSSettings = new eRPTSSettings;
     				$eRPTSSettings->parseDomDocument($domDoc);
     				switch($tempVar){
     					case "recommendingApproval":
     					case "approvedBy":
     
     						// provincialAssessor
     						
     						if($eRPTSSettings->getProvincialAssessorLastName()!=""){
     
     							$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->initSelected($tempVar."ID",$eRPTSSettings->getAssessorFullName());
     							$this->tpl->parse($TempVar."ListBlock",$TempVar."List",true);
     						
     							$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;
     				}
     			}
     		}
     
     		*/
     // End of Comment out : March 16, 2004
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList(0, " WHERE " . AUTH_USER_MD5_TABLE . ".userType REGEXP '1\$' AND " . AUTH_USER_MD5_TABLE . ".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);
             }
         }
     }
 }
コード例 #4
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);
             }
         }
     }
 }
コード例 #5
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");
 }
コード例 #6
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);
             }
         }
     }
 }
コード例 #7
0
ファイル: UserList.php プロジェクト: armic/erpts
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["userID"]) > 0) {
                 $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
                 if (!($deletedRows = $UserList->deleteUser($this->formArray["userID"]))) {
                     $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 "enable":
             $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
             if (!($enabledRows = $UserList->updateStatus($this->formArray["status"]))) {
                 $this->tpl->set_var("msg", "All records have status <i>disabled</i>");
             } else {
                 $this->tpl->set_var("msg", $enabledRows . " records have status <i>enabled</i>");
             }
             break;
         case "cancel":
             header("location: UserList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     $condition = $this->showHideDisabled();
     $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_block("rptsTemplate", "UserList", "UserListBlock");
             foreach ($list as $key => $value) {
                 $this->tpl->set_var("userID", $value->getUserID());
                 $this->tpl->set_var("userType", $value->getUserType());
                 $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", $value->getDateModified());
                 $this->tpl->set_var("status", $value->getStatus());
                 $this->tpl->set_var("statusCheck", $this->getStatusCheck($value->getStatus()));
                 $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->parse("UserListBlock", "UserList", 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");
 }
コード例 #8
0
ファイル: UserEncode.php プロジェクト: armic/erpts
 function usernameAlreadyExists()
 {
     $UserList = new SoapObject(NCCBIZ . "UserList.php", "urn:Object");
     if (!($xmlStr = $UserList->getUserList())) {
         return false;
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             return false;
         } else {
             $userRecords = new UserRecords();
             $userRecords->parseDomDocument($domDoc);
             $list = $userRecords->getArrayList();
             foreach ($list as $key => $user) {
                 if (strtoupper($this->formArray["username"]) == strtoupper($user->getUsername())) {
                     if ($this->formArray["userID"] != $user->getUserID()) {
                         return true;
                     }
                 }
             }
         }
     }
 }
コード例 #9
0
ファイル: testUser.php プロジェクト: armic/erpts
include("assessor/UserRecords.php");


$userRecords = new UserRecords;
if ($userRecords->selectRecords()){
	if(!$domDoc = $userRecords->getDomDocument()){
		echo "blah";
	}
	else {
		$xmlStr = $domDoc->dump_mem(true);
	}
}

$domDoc = domxml_open_mem($xmlStr);

$userRecords = new UserRecords;
$userRecords->parseDomDocument($domDoc);
$list = $userRecords->getArrayList();
foreach ($list as $key => $value){
    echo $value->getUserID();
	echo $value->getUserType();
	echo $value->getUsername();
	echo $value->getFullName();
	echo $value->getPersonID();
	echo $value->getDateCreated();
	echo $value->getDateModified();
	echo $value->getStatus();
	echo $value->getStatus();
}