<?php

    // Check Config
    // ...........................................
    $GET_MAP_ARRAY = PHPCUS_ACCOUNT_LEVEL::CUS_PREPARE_MAPPED_ARRAY_FOR_GET();
    //$GET_MAP_ARRAY['PARAM_ORDER_FIELD'] = 'ACC_LEVEL_ID';
    //$GET_MAP_ARRAY['PARAM_ORDER_TYPE'] = 'ASC';
    $GET_MAP_ARRAY['PARAM_LIMIT'] = 10000;
    
    
    // Execute Stored Procedure
    // ...........................................
    $DATA_SET = PHPCUS_ACCOUNT_LEVEL::CUS_GET_MA($GET_MAP_ARRAY);
    $DATA_SET["IS_SUCCESS"] = "TRUE";
    
    
    // Reault To JSON
    // ...........................................
    $RESULT_VALUE = PHPRC_PDO_MYSQL_ARRAY::REF_TO_JSON($DATA_SET);
    $RESULT_VALUE = PHPVC_STR::VAR_REPLACE($RESULT_VALUE, "'", "\'");
    $RESULT_VALUE = PHPVC_STR::VAR_REPLACE($RESULT_VALUE, "\n", '\\n');
    //$RESULT_VALUE = PHPVC_STR::VAR_REPLACE($RESULT_VALUE, "\\", '\\\\');
    
    
    // Return as Javascript variable
    // ...........................................
    header('Content-Type: application/javascript');
    echo "JSCUS_SQL._ACCOUNT._LEVEL.CUS_GET_QUICK = function(){ return '" . $RESULT_VALUE . "'; };";
    exit;

?>