<?php

	// Perform Login
    $SHORTCODE_STATUS = PHPCUS_SHORTCODE::CUS_QUICK_LOGIN();
	
	// Check Array Input
	PHPCUS_PARAM::CUS_DOES_NOT_SUPPORT_ARRAY();
	
	// Check already authenticated
	PHPCUS_PARAM::CUS_REQUIRES_AUTHENTICATION();
	// Check access rights
	PHPCUS_PARAM::CUS_HAS_PERMISSION(PHPCUS_SYSTEM::AUTHORITY_VIEW_ONLY, 'record_child_collection');
	
	if
	(
		PHPRC_HTTP_PARAM::REF_ISSET_IN_ARRAY
		(
			[
					'PARAM_REC_CHLDCOLLECT_ID',
					'PARAM_REC_CHLDCOLLECT_ACC_GROUP_ID',
					'PARAM_REC_CHLDCOLLECT_REC_POSDEVICE_ID',
					'PARAM_REC_CHLDCOLLECT_ACC_LINKSVR_ID',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_TO',
					'PARAM_REC_CHLDCOLLECT_DESCRIPTION',
					'PARAM_REC_CHLDCOLLECT_AMOUNT_FROM',
					'PARAM_REC_CHLDCOLLECT_AMOUNT_TO',
					'PARAM_REC_CHLDCOLLECT_REMARKS',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_TO',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_FROM',
					'PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_TO',
					'PARAM_REC_CHLDCOLLECT_ACC_ACCOUNT_ID',
					'PARAM_REC_CHLDCOLLECT_DATE_FROM',
					'PARAM_REC_CHLDCOLLECT_DATE_TO',
					'PARAM_REC_CHLDCOLLECT_STATUS',
					
					'PARAM_ACC_GROUP_ID',	
					'PARAM_ACC_GROUP_DESCRIPTION',	
					'PARAM_ACC_GROUP_STATUS',	
					'PARAM_ACC_GROUP_SYSTEM_GENERATED',	
					'PARAM_REC_POSDEVICE_ID',	
					'PARAM_REC_POSDEVICE_ACC_GROUP_ID',	
					'PARAM_REC_POSDEVICE_DESCRIPTION',	
					'PARAM_REC_POSDEVICE_MODEL',	
					'PARAM_REC_POSDEVICE_CODE',	
					'PARAM_REC_POSDEVICE_OS',	
					'PARAM_REC_POSDEVICE_MACHINE_ID',	
					'PARAM_REC_POSDEVICE_PERMIT_NUMBER',	
					'PARAM_REC_POSDEVICE_DATE_ACCREDITED_FROM',
					'PARAM_REC_POSDEVICE_DATE_ACCREDITED_TO',
					'PARAM_REC_POSDEVICE_ADDRESS',	
					'PARAM_REC_POSDEVICE_CONTACT',	
					'PARAM_REC_POSDEVICE_TIN',	
					'PARAM_REC_POSDEVICE_RESET_COUNT_FROM',
					'PARAM_REC_POSDEVICE_RESET_COUNT_TO',
					'PARAM_REC_POSDEVICE_REGISTRATION_ACC_ACCOUNT_ID',	
					'PARAM_REC_POSDEVICE_DATE_REGISTERED_FROM',
					'PARAM_REC_POSDEVICE_DATE_REGISTERED_TO',
					'PARAM_REC_POSDEVICE_PROCESSED_ACC_ACCOUNT_ID',	
					'PARAM_REC_POSDEVICE_DATE_PROCESSED_FROM',
					'PARAM_REC_POSDEVICE_DATE_PROCESSED_TO',
					'PARAM_REC_POSDEVICE_STATUS',	
					'PARAM_ACC_LINKSVR_ID',	
					'PARAM_ACC_LINKSVR_ACC_GROUP_ID',	
					'PARAM_ACC_LINKSVR_BRANCH_ID',	
					'PARAM_ACC_LINKSVR_DESCRIPTION',	
					'PARAM_ACC_LINKSVR_USERNAME',	
					'PARAM_ACC_LINKSVR_PASSWORD',	
					'PARAM_ACC_LINKSVR_HASH_KEY',	
					'PARAM_ACC_LINKSVR_PUBLIC_KEY',	
					'PARAM_ACC_LINKSVR_URL',	
					'PARAM_ACC_LINKSVR_AUTH_LEVEL',	
					'PARAM_ACC_LINKSVR_IS_SELF',	
					'PARAM_ACC_LINKSVR_STATUS',	
					'PARAM_ACC_ACCOUNT_ID',	
					'PARAM_ACC_ACCOUNT_SERVER_ID',	
					'PARAM_ACC_ACCOUNT_ACC_LEVEL_ID',	
					'PARAM_ACC_ACCOUNT_ACC_GROUP_ID',	
					'PARAM_ACC_ACCOUNT_ADD_RESOURCE_ID',	
					'PARAM_ACC_ACCOUNT_USERNAME',	
					'PARAM_ACC_ACCOUNT_PASSWORD',	
					'PARAM_ACC_ACCOUNT_AUTH_CODE',	
					'PARAM_ACC_ACCOUNT_FIRST_NAME',	
					'PARAM_ACC_ACCOUNT_MIDDLE_NAME',	
					'PARAM_ACC_ACCOUNT_LAST_NAME',	
					'PARAM_ACC_ACCOUNT_POSITION',	
					'PARAM_ACC_ACCOUNT_SYS_GENDER_ID',	
					'PARAM_ACC_ACCOUNT_STATUS',	
					'PARAM_ACC_ACCOUNT_SYSTEM_GENERATED',	
		
					'PARAM_ORDER_FIELD',
					'PARAM_ORDER_TYPE',
					'PARAM_SKIP',
					'PARAM_LIMIT'
			], True
		)
	)
	{
		Try
		{
			// Read params
			// ------------------------------------------------------------------	
			$PARAM_REC_CHLDCOLLECT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_ID');
			$PARAM_REC_CHLDCOLLECT_ACC_GROUP_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_ACC_GROUP_ID');
			$PARAM_REC_CHLDCOLLECT_REC_POSDEVICE_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_REC_POSDEVICE_ID');
			$PARAM_REC_CHLDCOLLECT_ACC_LINKSVR_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_ACC_LINKSVR_ID');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_TO');
			$PARAM_REC_CHLDCOLLECT_DESCRIPTION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_CHLDCOLLECT_DESCRIPTION');
			$PARAM_REC_CHLDCOLLECT_AMOUNT_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_AMOUNT_FROM');
			$PARAM_REC_CHLDCOLLECT_AMOUNT_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_AMOUNT_TO');
			$PARAM_REC_CHLDCOLLECT_REMARKS = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_CHLDCOLLECT_REMARKS');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_TO');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_FROM');
			$PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_TO');
			$PARAM_REC_CHLDCOLLECT_ACC_ACCOUNT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_CHLDCOLLECT_ACC_ACCOUNT_ID');
			$PARAM_REC_CHLDCOLLECT_DATE_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_CHLDCOLLECT_DATE_FROM');
			$PARAM_REC_CHLDCOLLECT_DATE_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_CHLDCOLLECT_DATE_TO');
			$PARAM_REC_CHLDCOLLECT_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_REC_CHLDCOLLECT_STATUS');
			
			$PARAM_ACC_GROUP_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_GROUP_ID');	
			$PARAM_ACC_GROUP_DESCRIPTION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_GROUP_DESCRIPTION');	
			$PARAM_ACC_GROUP_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_GROUP_STATUS');	
			$PARAM_ACC_GROUP_SYSTEM_GENERATED = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_GROUP_SYSTEM_GENERATED');	
			$PARAM_REC_POSDEVICE_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_POSDEVICE_ID');	
			$PARAM_REC_POSDEVICE_ACC_GROUP_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_POSDEVICE_ACC_GROUP_ID');	
			$PARAM_REC_POSDEVICE_DESCRIPTION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_DESCRIPTION');	
			$PARAM_REC_POSDEVICE_MODEL = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_MODEL');	
			$PARAM_REC_POSDEVICE_CODE = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_CODE');	
			$PARAM_REC_POSDEVICE_OS = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_OS');	
			$PARAM_REC_POSDEVICE_MACHINE_ID = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_MACHINE_ID');	
			$PARAM_REC_POSDEVICE_PERMIT_NUMBER = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_PERMIT_NUMBER');	
			$PARAM_REC_POSDEVICE_DATE_ACCREDITED_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_POSDEVICE_DATE_ACCREDITED_FROM');
			$PARAM_REC_POSDEVICE_DATE_ACCREDITED_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_POSDEVICE_DATE_ACCREDITED_TO');
			$PARAM_REC_POSDEVICE_ADDRESS = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_ADDRESS');	
			$PARAM_REC_POSDEVICE_CONTACT = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_CONTACT');	
			$PARAM_REC_POSDEVICE_TIN = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_POSDEVICE_TIN');	
			$PARAM_REC_POSDEVICE_RESET_COUNT_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_POSDEVICE_RESET_COUNT_FROM');
			$PARAM_REC_POSDEVICE_RESET_COUNT_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_POSDEVICE_RESET_COUNT_TO');
			$PARAM_REC_POSDEVICE_REGISTRATION_ACC_ACCOUNT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_POSDEVICE_REGISTRATION_ACC_ACCOUNT_ID');	
			$PARAM_REC_POSDEVICE_DATE_REGISTERED_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_POSDEVICE_DATE_REGISTERED_FROM');
			$PARAM_REC_POSDEVICE_DATE_REGISTERED_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_POSDEVICE_DATE_REGISTERED_TO');
			$PARAM_REC_POSDEVICE_PROCESSED_ACC_ACCOUNT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_POSDEVICE_PROCESSED_ACC_ACCOUNT_ID');	
			$PARAM_REC_POSDEVICE_DATE_PROCESSED_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_POSDEVICE_DATE_PROCESSED_FROM');
			$PARAM_REC_POSDEVICE_DATE_PROCESSED_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_POSDEVICE_DATE_PROCESSED_TO');
			$PARAM_REC_POSDEVICE_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_REC_POSDEVICE_STATUS');	
			$PARAM_ACC_LINKSVR_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_LINKSVR_ID');	
			$PARAM_ACC_LINKSVR_ACC_GROUP_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_LINKSVR_ACC_GROUP_ID');	
			$PARAM_ACC_LINKSVR_BRANCH_ID = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_BRANCH_ID');	
			$PARAM_ACC_LINKSVR_DESCRIPTION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_DESCRIPTION');	
			$PARAM_ACC_LINKSVR_USERNAME = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_USERNAME');	
			$PARAM_ACC_LINKSVR_PASSWORD = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_PASSWORD');	
			$PARAM_ACC_LINKSVR_HASH_KEY = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_HASH_KEY');	
			$PARAM_ACC_LINKSVR_PUBLIC_KEY = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_PUBLIC_KEY');	
			$PARAM_ACC_LINKSVR_URL = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_LINKSVR_URL');	
			$PARAM_ACC_LINKSVR_AUTH_LEVEL = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_LINKSVR_AUTH_LEVEL');	
			$PARAM_ACC_LINKSVR_IS_SELF = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_LINKSVR_IS_SELF');	
			$PARAM_ACC_LINKSVR_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_LINKSVR_STATUS');	
			$PARAM_ACC_ACCOUNT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_ACCOUNT_ID');	
			$PARAM_ACC_ACCOUNT_SERVER_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_ACCOUNT_SERVER_ID');	
			$PARAM_ACC_ACCOUNT_ACC_LEVEL_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_ACCOUNT_ACC_LEVEL_ID');	
			$PARAM_ACC_ACCOUNT_ACC_GROUP_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_ACCOUNT_ACC_GROUP_ID');	
			$PARAM_ACC_ACCOUNT_ADD_RESOURCE_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_ACCOUNT_ADD_RESOURCE_ID');	
			$PARAM_ACC_ACCOUNT_USERNAME = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_USERNAME');	
			$PARAM_ACC_ACCOUNT_PASSWORD = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_PASSWORD');	
			$PARAM_ACC_ACCOUNT_AUTH_CODE = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_AUTH_CODE');	
			$PARAM_ACC_ACCOUNT_FIRST_NAME = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_FIRST_NAME');	
			$PARAM_ACC_ACCOUNT_MIDDLE_NAME = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_MIDDLE_NAME');	
			$PARAM_ACC_ACCOUNT_LAST_NAME = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_LAST_NAME');	
			$PARAM_ACC_ACCOUNT_POSITION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_ACC_ACCOUNT_POSITION');	
			$PARAM_ACC_ACCOUNT_SYS_GENDER_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_ACC_ACCOUNT_SYS_GENDER_ID');	
			$PARAM_ACC_ACCOUNT_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_ACCOUNT_STATUS');	
			$PARAM_ACC_ACCOUNT_SYSTEM_GENERATED = PHPCUS_PARAM::CUS_READ_INT('PARAM_ACC_ACCOUNT_SYSTEM_GENERATED');	
			
			$PARAM_ORDER_FIELD = PHPCUS_PARAM::CUS_READ_SORT_FIELD
			(
					'PARAM_ORDER_FIELD',
					[
						'REC_CHLDCOLLECT_ID', 
						'REC_CHLDCOLLECT_ACC_GROUP_ID', 
						'REC_CHLDCOLLECT_REC_POSDEVICE_ID', 
						'REC_CHLDCOLLECT_ACC_LINKSVR_ID', 
						'REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID', 
						'REC_CHLDCOLLECT_LINKSVR_DATE', 
						'REC_CHLDCOLLECT_DESCRIPTION', 
						'REC_CHLDCOLLECT_AMOUNT', 
						'REC_CHLDCOLLECT_REMARKS', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_BANK', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_CASH', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_CARD', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_CHECK', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER', 
						'REC_CHLDCOLLECT_LINKSVR_PAID_OTHER', 
						'REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN', 
						'REC_CHLDCOLLECT_ACC_ACCOUNT_ID', 
						'REC_CHLDCOLLECT_DATE', 
						'REC_CHLDCOLLECT_STATUS'
						, 
						'ACC_GROUP_ID',		
						'ACC_GROUP_DESCRIPTION',		
						'ACC_GROUP_STATUS',		
						'ACC_GROUP_SYSTEM_GENERATED',		
						'REC_POSDEVICE_ID',		
						'REC_POSDEVICE_ACC_GROUP_ID',		
						'REC_POSDEVICE_DESCRIPTION',		
						'REC_POSDEVICE_MODEL',		
						'REC_POSDEVICE_CODE',		
						'REC_POSDEVICE_OS',		
						'REC_POSDEVICE_MACHINE_ID',		
						'REC_POSDEVICE_PERMIT_NUMBER',		
						'REC_POSDEVICE_DATE_ACCREDITED',		
						'REC_POSDEVICE_ADDRESS',		
						'REC_POSDEVICE_CONTACT',		
						'REC_POSDEVICE_TIN',		
						'REC_POSDEVICE_RESET_COUNT',		
						'REC_POSDEVICE_REGISTRATION_ACC_ACCOUNT_ID',		
						'REC_POSDEVICE_DATE_REGISTERED',		
						'REC_POSDEVICE_PROCESSED_ACC_ACCOUNT_ID',		
						'REC_POSDEVICE_DATE_PROCESSED',		
						'REC_POSDEVICE_STATUS',		
						'ACC_LINKSVR_ID',		
						'ACC_LINKSVR_ACC_GROUP_ID',		
						'ACC_LINKSVR_BRANCH_ID',		
						'ACC_LINKSVR_DESCRIPTION',		
						'ACC_LINKSVR_USERNAME',		
						'ACC_LINKSVR_PASSWORD',		
						'ACC_LINKSVR_HASH_KEY',		
						'ACC_LINKSVR_PUBLIC_KEY',		
						'ACC_LINKSVR_URL',		
						'ACC_LINKSVR_AUTH_LEVEL',		
						'ACC_LINKSVR_IS_SELF',		
						'ACC_LINKSVR_STATUS',		
						'ACC_ACCOUNT_ID',		
						'ACC_ACCOUNT_SERVER_ID',		
						'ACC_ACCOUNT_ACC_LEVEL_ID',		
						'ACC_ACCOUNT_ACC_GROUP_ID',		
						'ACC_ACCOUNT_ADD_RESOURCE_ID',		
						'ACC_ACCOUNT_USERNAME',		
						'ACC_ACCOUNT_PASSWORD',		
						'ACC_ACCOUNT_AUTH_CODE',		
						'ACC_ACCOUNT_FIRST_NAME',		
						'ACC_ACCOUNT_MIDDLE_NAME',		
						'ACC_ACCOUNT_LAST_NAME',		
						'ACC_ACCOUNT_POSITION',		
						'ACC_ACCOUNT_SYS_GENDER_ID',		
						'ACC_ACCOUNT_STATUS',		
						'ACC_ACCOUNT_SYSTEM_GENERATED'		
					]
			);		
			$PARAM_ORDER_TYPE = PHPCUS_PARAM::CUS_READ_SORT_TYPE('PARAM_ORDER_TYPE');
			$PARAM_SKIP	= PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_SKIP');
			$PARAM_LIMIT = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_LIMIT');
			
			// ------------------------------------------------------------------
			
			
			// Populate Map Array
			// ...........................................
			$GET_MAP_ARRAY = PHPCUS_RECORD_CHILD_COLLECTION::CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
			
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_ID'] = $PARAM_REC_CHLDCOLLECT_ID;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_ACC_GROUP_ID'] = $PARAM_REC_CHLDCOLLECT_ACC_GROUP_ID;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_REC_POSDEVICE_ID'] = $PARAM_REC_CHLDCOLLECT_REC_POSDEVICE_ID;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_ACC_LINKSVR_ID'] = $PARAM_REC_CHLDCOLLECT_ACC_LINKSVR_ID;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_ACC_GROUP_ID_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_DATE_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_DESCRIPTION'] = $PARAM_REC_CHLDCOLLECT_DESCRIPTION;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_AMOUNT_FROM'] = $PARAM_REC_CHLDCOLLECT_AMOUNT_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_AMOUNT_TO'] = $PARAM_REC_CHLDCOLLECT_AMOUNT_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_REMARKS'] = $PARAM_REC_CHLDCOLLECT_REMARKS;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_BANK_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CASH_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CARD_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_CHECK_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_LOYALTY_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_VOUCHER_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_PAID_OTHER_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_FROM'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_TO'] = $PARAM_REC_CHLDCOLLECT_LINKSVR_LOYALTY_EARN_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_ACC_ACCOUNT_ID'] = $PARAM_REC_CHLDCOLLECT_ACC_ACCOUNT_ID;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_DATE_FROM'] = $PARAM_REC_CHLDCOLLECT_DATE_FROM;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_DATE_TO'] = $PARAM_REC_CHLDCOLLECT_DATE_TO;
			$GET_MAP_ARRAY['PARAM_REC_CHLDCOLLECT_STATUS'] = $PARAM_REC_CHLDCOLLECT_STATUS;
			
			$GET_MAP_ARRAY['PARAM_ACC_GROUP_ID'] = $PARAM_ACC_GROUP_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_GROUP_DESCRIPTION'] = $PARAM_ACC_GROUP_DESCRIPTION;	
			$GET_MAP_ARRAY['PARAM_ACC_GROUP_STATUS'] = $PARAM_ACC_GROUP_STATUS;	
			$GET_MAP_ARRAY['PARAM_ACC_GROUP_SYSTEM_GENERATED'] = $PARAM_ACC_GROUP_SYSTEM_GENERATED;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_ID'] = $PARAM_REC_POSDEVICE_ID;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_ACC_GROUP_ID'] = $PARAM_REC_POSDEVICE_ACC_GROUP_ID;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DESCRIPTION'] = $PARAM_REC_POSDEVICE_DESCRIPTION;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_MODEL'] = $PARAM_REC_POSDEVICE_MODEL;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_CODE'] = $PARAM_REC_POSDEVICE_CODE;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_OS'] = $PARAM_REC_POSDEVICE_OS;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_MACHINE_ID'] = $PARAM_REC_POSDEVICE_MACHINE_ID;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_PERMIT_NUMBER'] = $PARAM_REC_POSDEVICE_PERMIT_NUMBER;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DATE_ACCREDITED_FROM'] = $PARAM_REC_POSDEVICE_DATE_ACCREDITED_FROM;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DATE_ACCREDITED_TO'] = $PARAM_REC_POSDEVICE_DATE_ACCREDITED_TO;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_ADDRESS'] = $PARAM_REC_POSDEVICE_ADDRESS;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_CONTACT'] = $PARAM_REC_POSDEVICE_CONTACT;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_TIN'] = $PARAM_REC_POSDEVICE_TIN;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_RESET_COUNT_FROM'] = $PARAM_REC_POSDEVICE_RESET_COUNT_FROM;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_RESET_COUNT_TO'] = $PARAM_REC_POSDEVICE_RESET_COUNT_TO;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_REGISTRATION_ACC_ACCOUNT_ID'] = $PARAM_REC_POSDEVICE_REGISTRATION_ACC_ACCOUNT_ID;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DATE_REGISTERED_FROM'] = $PARAM_REC_POSDEVICE_DATE_REGISTERED_FROM;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DATE_REGISTERED_TO'] = $PARAM_REC_POSDEVICE_DATE_REGISTERED_TO;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_PROCESSED_ACC_ACCOUNT_ID'] = $PARAM_REC_POSDEVICE_PROCESSED_ACC_ACCOUNT_ID;	
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DATE_PROCESSED_FROM'] = $PARAM_REC_POSDEVICE_DATE_PROCESSED_FROM;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_DATE_PROCESSED_TO'] = $PARAM_REC_POSDEVICE_DATE_PROCESSED_TO;
			$GET_MAP_ARRAY['PARAM_REC_POSDEVICE_STATUS'] = $PARAM_REC_POSDEVICE_STATUS;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_ID'] = $PARAM_ACC_LINKSVR_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_ACC_GROUP_ID'] = $PARAM_ACC_LINKSVR_ACC_GROUP_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_BRANCH_ID'] = $PARAM_ACC_LINKSVR_BRANCH_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_DESCRIPTION'] = $PARAM_ACC_LINKSVR_DESCRIPTION;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_USERNAME'] = $PARAM_ACC_LINKSVR_USERNAME;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_PASSWORD'] = $PARAM_ACC_LINKSVR_PASSWORD;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_HASH_KEY'] = $PARAM_ACC_LINKSVR_HASH_KEY;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_PUBLIC_KEY'] = $PARAM_ACC_LINKSVR_PUBLIC_KEY;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_URL'] = $PARAM_ACC_LINKSVR_URL;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_AUTH_LEVEL'] = $PARAM_ACC_LINKSVR_AUTH_LEVEL;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_IS_SELF'] = $PARAM_ACC_LINKSVR_IS_SELF;	
			$GET_MAP_ARRAY['PARAM_ACC_LINKSVR_STATUS'] = $PARAM_ACC_LINKSVR_STATUS;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_ID'] = $PARAM_ACC_ACCOUNT_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_SERVER_ID'] = $PARAM_ACC_ACCOUNT_SERVER_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_ACC_LEVEL_ID'] = $PARAM_ACC_ACCOUNT_ACC_LEVEL_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_ACC_GROUP_ID'] = $PARAM_ACC_ACCOUNT_ACC_GROUP_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_ADD_RESOURCE_ID'] = $PARAM_ACC_ACCOUNT_ADD_RESOURCE_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_USERNAME'] = $PARAM_ACC_ACCOUNT_USERNAME;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_PASSWORD'] = $PARAM_ACC_ACCOUNT_PASSWORD;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_AUTH_CODE'] = $PARAM_ACC_ACCOUNT_AUTH_CODE;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_FIRST_NAME'] = $PARAM_ACC_ACCOUNT_FIRST_NAME;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_MIDDLE_NAME'] = $PARAM_ACC_ACCOUNT_MIDDLE_NAME;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_LAST_NAME'] = $PARAM_ACC_ACCOUNT_LAST_NAME;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_POSITION'] = $PARAM_ACC_ACCOUNT_POSITION;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_SYS_GENDER_ID'] = $PARAM_ACC_ACCOUNT_SYS_GENDER_ID;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_STATUS'] = $PARAM_ACC_ACCOUNT_STATUS;	
			$GET_MAP_ARRAY['PARAM_ACC_ACCOUNT_SYSTEM_GENERATED'] = $PARAM_ACC_ACCOUNT_SYSTEM_GENERATED;	
			
			$GET_MAP_ARRAY["PARAM_ORDER_FIELD"] = $PARAM_ORDER_FIELD;
			$GET_MAP_ARRAY["PARAM_ORDER_TYPE"] = $PARAM_ORDER_TYPE;
			$GET_MAP_ARRAY["PARAM_SKIP"] = $PARAM_SKIP;
			$GET_MAP_ARRAY["PARAM_LIMIT"] = $PARAM_LIMIT;
			
			
			// Execute Stored Procedure
			// ...........................................
			$DATA_SET = PHPCUS_RECORD_CHILD_COLLECTION::CUS_GET_ALL_MA($GET_MAP_ARRAY);
			
						
			// Return JSON response
			// ...........................................
			if(empty($DATA_SET) === False)
			{
				PHPCUS_PARAM::CUS_JSON_SUCCESS($DATA_SET);
			}
			else
			{
				PHPCUS_PARAM::CUS_JSON_SUCCESS('');
			}
			
		}
		Catch(Exception $ERR)
		{		
			PHPVC_LOG::VAR_REPORT_ERROR($ERR, 0);
			if(isset($_SERVER['HTTP_ORIGIN']))
			{
			    PHPVC_LOG::VAR_ERROR('HTTP_ORIGIN', $_SERVER['HTTP_ORIGIN']);
			}
			if(isset($_SERVER['HTTP_HOST']))
			{
			    PHPVC_LOG::VAR_ERROR('HTTP_HOST', $_SERVER['HTTP_HOST']);
			}		
			if(isset($_SERVER['HTTP_REFERER']))
			{
			    PHPVC_LOG::VAR_ERROR('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
			}
			if(isset($_SERVER['REMOTE_ADDR']))
			{
			    PHPVC_LOG::VAR_ERROR('REMOTE_ADDR', $_SERVER['REMOTE_ADDR']);
			}
			
			PHPCUS_PARAM::CUS_JSON_ERROR($ERR->getMessage());
		}
	}
	else
	{
		PHPCUS_PARAM::CUS_JSON_ERROR('Missing parameters');
	}

?>