<?php

	// Dismiss Session
	PHPVC_SESSION::VAR_STOP();
	
	// 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. This may slow down server, uncomment this if you requires an extra security
	// PHPCUS_PARAM::CUS_HAS_PERMISSION(PHPCUS_SYSTEM::AUTHORITY_VIEW_ONLY, 'record_stock_card');

	if
	(
		PHPRC_HTTP_PARAM::REF_ISSET_IN_ARRAY
		(
			[
					'PARAM_REC_STOCKCARD_ID',
					'PARAM_REC_STOCKCARD_CAT_PRODUCT_ID',
					'PARAM_REC_STOCKCARD_CAT_STOCKFLOW_ID',
					'PARAM_REC_STOCKCARD_CODE',
					'PARAM_REC_STOCKCARD_QUANTITY_FROM',
					'PARAM_REC_STOCKCARD_QUANTITY_TO',
					'PARAM_REC_STOCKCARD_REMARKS',
					'PARAM_REC_STOCKCARD_ACC_ACCOUNT_ID',
					'PARAM_REC_STOCKCARD_DATE_TRANSACTION_FROM',
					'PARAM_REC_STOCKCARD_DATE_TRANSACTION_TO',
					'PARAM_REC_STOCKCARD_STATUS',
					
					'PARAM_CAT_PRODUCT_ID',	
					'PARAM_CAT_PRODUCT_CAT_UOM_ID',	
					'PARAM_CAT_PRODUCT_BARCODE',	
					'PARAM_CAT_PRODUCT_ITEMCODE',	
					'PARAM_CAT_PRODUCT_DESCRIPTION',	
					'PARAM_CAT_PRODUCT_HAS_RECIPE',	
					'PARAM_CAT_PRODUCT_ING_PRICE_FROM',
					'PARAM_CAT_PRODUCT_ING_PRICE_TO',
					'PARAM_CAT_PRODUCT_ING_NET_CONTENT_FROM',
					'PARAM_CAT_PRODUCT_ING_NET_CONTENT_TO',
					'PARAM_CAT_PRODUCT_MIXTURE_QTY_FROM',
					'PARAM_CAT_PRODUCT_MIXTURE_QTY_TO',
					'PARAM_CAT_PRODUCT_MIXTURE_COST_FROM',
					'PARAM_CAT_PRODUCT_MIXTURE_COST_TO',
					'PARAM_CAT_PRODUCT_STATUS',	
					'PARAM_CAT_PRODUCT_SYSTEM_GENERATED',	
					'PARAM_CAT_STOCKFLOW_ID',	
					'PARAM_CAT_STOCKFLOW_DESCRIPTION',	
					'PARAM_CAT_STOCKFLOW_IS_IN',	
					'PARAM_CAT_STOCKFLOW_IS_MONITORED_FROM',
					'PARAM_CAT_STOCKFLOW_IS_MONITORED_TO',
					'PARAM_CAT_STOCKFLOW_STATUS',	
					'PARAM_CAT_STOCKFLOW_SYSTEM_GENERATED',	
					'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_STOCKCARD_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_STOCKCARD_ID');
			$PARAM_REC_STOCKCARD_CAT_PRODUCT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_STOCKCARD_CAT_PRODUCT_ID');
			$PARAM_REC_STOCKCARD_CAT_STOCKFLOW_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_STOCKCARD_CAT_STOCKFLOW_ID');
			$PARAM_REC_STOCKCARD_CODE = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_STOCKCARD_CODE');
			$PARAM_REC_STOCKCARD_QUANTITY_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_STOCKCARD_QUANTITY_FROM');
			$PARAM_REC_STOCKCARD_QUANTITY_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_REC_STOCKCARD_QUANTITY_TO');
			$PARAM_REC_STOCKCARD_REMARKS = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_REC_STOCKCARD_REMARKS');
			$PARAM_REC_STOCKCARD_ACC_ACCOUNT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_REC_STOCKCARD_ACC_ACCOUNT_ID');
			$PARAM_REC_STOCKCARD_DATE_TRANSACTION_FROM = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_STOCKCARD_DATE_TRANSACTION_FROM');
			$PARAM_REC_STOCKCARD_DATE_TRANSACTION_TO = PHPCUS_PARAM::CUS_READ_DATETIME('PARAM_REC_STOCKCARD_DATE_TRANSACTION_TO');
			$PARAM_REC_STOCKCARD_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_REC_STOCKCARD_STATUS');
			
			$PARAM_CAT_PRODUCT_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_CAT_PRODUCT_ID');	
			$PARAM_CAT_PRODUCT_CAT_UOM_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_CAT_PRODUCT_CAT_UOM_ID');	
			$PARAM_CAT_PRODUCT_BARCODE = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_CAT_PRODUCT_BARCODE');	
			$PARAM_CAT_PRODUCT_ITEMCODE = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_CAT_PRODUCT_ITEMCODE');	
			$PARAM_CAT_PRODUCT_DESCRIPTION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_CAT_PRODUCT_DESCRIPTION');	
			$PARAM_CAT_PRODUCT_HAS_RECIPE = PHPCUS_PARAM::CUS_READ_INT('PARAM_CAT_PRODUCT_HAS_RECIPE');	
			$PARAM_CAT_PRODUCT_ING_PRICE_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_ING_PRICE_FROM');
			$PARAM_CAT_PRODUCT_ING_PRICE_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_ING_PRICE_TO');
			$PARAM_CAT_PRODUCT_ING_NET_CONTENT_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_ING_NET_CONTENT_FROM');
			$PARAM_CAT_PRODUCT_ING_NET_CONTENT_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_ING_NET_CONTENT_TO');
			$PARAM_CAT_PRODUCT_MIXTURE_QTY_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_MIXTURE_QTY_FROM');
			$PARAM_CAT_PRODUCT_MIXTURE_QTY_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_MIXTURE_QTY_TO');
			$PARAM_CAT_PRODUCT_MIXTURE_COST_FROM = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_MIXTURE_COST_FROM');
			$PARAM_CAT_PRODUCT_MIXTURE_COST_TO = PHPCUS_PARAM::CUS_READ_DECIMAL('PARAM_CAT_PRODUCT_MIXTURE_COST_TO');
			$PARAM_CAT_PRODUCT_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_CAT_PRODUCT_STATUS');	
			$PARAM_CAT_PRODUCT_SYSTEM_GENERATED = PHPCUS_PARAM::CUS_READ_INT('PARAM_CAT_PRODUCT_SYSTEM_GENERATED');	
			$PARAM_CAT_STOCKFLOW_ID = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_CAT_STOCKFLOW_ID');	
			$PARAM_CAT_STOCKFLOW_DESCRIPTION = PHPCUS_PARAM::CUS_READ_NVARCHAR('PARAM_CAT_STOCKFLOW_DESCRIPTION');	
			$PARAM_CAT_STOCKFLOW_IS_IN = PHPCUS_PARAM::CUS_READ_INT('PARAM_CAT_STOCKFLOW_IS_IN');	
			$PARAM_CAT_STOCKFLOW_IS_MONITORED_FROM = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_CAT_STOCKFLOW_IS_MONITORED_FROM');
			$PARAM_CAT_STOCKFLOW_IS_MONITORED_TO = PHPCUS_PARAM::CUS_READ_BIGINT('PARAM_CAT_STOCKFLOW_IS_MONITORED_TO');
			$PARAM_CAT_STOCKFLOW_STATUS = PHPCUS_PARAM::CUS_READ_INT('PARAM_CAT_STOCKFLOW_STATUS');	
			$PARAM_CAT_STOCKFLOW_SYSTEM_GENERATED = PHPCUS_PARAM::CUS_READ_INT('PARAM_CAT_STOCKFLOW_SYSTEM_GENERATED');	
			$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_STOCKCARD_ID', 
						'REC_STOCKCARD_CAT_PRODUCT_ID', 
						'REC_STOCKCARD_CAT_STOCKFLOW_ID', 
						'REC_STOCKCARD_CODE', 
						'REC_STOCKCARD_QUANTITY', 
						'REC_STOCKCARD_REMARKS', 
						'REC_STOCKCARD_ACC_ACCOUNT_ID', 
						'REC_STOCKCARD_DATE_TRANSACTION', 
						'REC_STOCKCARD_STATUS'
						, 
						'CAT_PRODUCT_ID',		
						'CAT_PRODUCT_CAT_UOM_ID',		
						'CAT_PRODUCT_BARCODE',		
						'CAT_PRODUCT_ITEMCODE',		
						'CAT_PRODUCT_DESCRIPTION',		
						'CAT_PRODUCT_HAS_RECIPE',		
						'CAT_PRODUCT_ING_PRICE',		
						'CAT_PRODUCT_ING_NET_CONTENT',		
						'CAT_PRODUCT_MIXTURE_QTY',		
						'CAT_PRODUCT_MIXTURE_COST',		
						'CAT_PRODUCT_STATUS',		
						'CAT_PRODUCT_SYSTEM_GENERATED',		
						'CAT_STOCKFLOW_ID',		
						'CAT_STOCKFLOW_DESCRIPTION',		
						'CAT_STOCKFLOW_IS_IN',		
						'CAT_STOCKFLOW_IS_MONITORED',		
						'CAT_STOCKFLOW_STATUS',		
						'CAT_STOCKFLOW_SYSTEM_GENERATED',		
						'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_STOCK_CARD::CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
			
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_ID'] = $PARAM_REC_STOCKCARD_ID;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_CAT_PRODUCT_ID'] = $PARAM_REC_STOCKCARD_CAT_PRODUCT_ID;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_CAT_STOCKFLOW_ID'] = $PARAM_REC_STOCKCARD_CAT_STOCKFLOW_ID;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_CODE'] = $PARAM_REC_STOCKCARD_CODE;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_QUANTITY_FROM'] = $PARAM_REC_STOCKCARD_QUANTITY_FROM;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_QUANTITY_TO'] = $PARAM_REC_STOCKCARD_QUANTITY_TO;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_REMARKS'] = $PARAM_REC_STOCKCARD_REMARKS;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_ACC_ACCOUNT_ID'] = $PARAM_REC_STOCKCARD_ACC_ACCOUNT_ID;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_DATE_TRANSACTION_FROM'] = $PARAM_REC_STOCKCARD_DATE_TRANSACTION_FROM;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_DATE_TRANSACTION_TO'] = $PARAM_REC_STOCKCARD_DATE_TRANSACTION_TO;
			$GET_MAP_ARRAY['PARAM_REC_STOCKCARD_STATUS'] = $PARAM_REC_STOCKCARD_STATUS;
			
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_ID'] = $PARAM_CAT_PRODUCT_ID;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_CAT_UOM_ID'] = $PARAM_CAT_PRODUCT_CAT_UOM_ID;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_BARCODE'] = $PARAM_CAT_PRODUCT_BARCODE;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_ITEMCODE'] = $PARAM_CAT_PRODUCT_ITEMCODE;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_DESCRIPTION'] = $PARAM_CAT_PRODUCT_DESCRIPTION;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_HAS_RECIPE'] = $PARAM_CAT_PRODUCT_HAS_RECIPE;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_ING_PRICE_FROM'] = $PARAM_CAT_PRODUCT_ING_PRICE_FROM;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_ING_PRICE_TO'] = $PARAM_CAT_PRODUCT_ING_PRICE_TO;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_ING_NET_CONTENT_FROM'] = $PARAM_CAT_PRODUCT_ING_NET_CONTENT_FROM;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_ING_NET_CONTENT_TO'] = $PARAM_CAT_PRODUCT_ING_NET_CONTENT_TO;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_MIXTURE_QTY_FROM'] = $PARAM_CAT_PRODUCT_MIXTURE_QTY_FROM;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_MIXTURE_QTY_TO'] = $PARAM_CAT_PRODUCT_MIXTURE_QTY_TO;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_MIXTURE_COST_FROM'] = $PARAM_CAT_PRODUCT_MIXTURE_COST_FROM;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_MIXTURE_COST_TO'] = $PARAM_CAT_PRODUCT_MIXTURE_COST_TO;
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_STATUS'] = $PARAM_CAT_PRODUCT_STATUS;	
			$GET_MAP_ARRAY['PARAM_CAT_PRODUCT_SYSTEM_GENERATED'] = $PARAM_CAT_PRODUCT_SYSTEM_GENERATED;	
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_ID'] = $PARAM_CAT_STOCKFLOW_ID;	
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_DESCRIPTION'] = $PARAM_CAT_STOCKFLOW_DESCRIPTION;	
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_IS_IN'] = $PARAM_CAT_STOCKFLOW_IS_IN;	
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_IS_MONITORED_FROM'] = $PARAM_CAT_STOCKFLOW_IS_MONITORED_FROM;
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_IS_MONITORED_TO'] = $PARAM_CAT_STOCKFLOW_IS_MONITORED_TO;
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_STATUS'] = $PARAM_CAT_STOCKFLOW_STATUS;	
			$GET_MAP_ARRAY['PARAM_CAT_STOCKFLOW_SYSTEM_GENERATED'] = $PARAM_CAT_STOCKFLOW_SYSTEM_GENERATED;	
			$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_STOCK_CARD::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');
	}

?>