<?php

// Script to test if the CURL extension is installed on this server

// Define function to test
function _is_curl_installed() {
    if  (in_array  ('curl', get_loaded_extensions())) {
        return true;
    }
    else {
        return false;
    }
}

// Ouput text to user based on test
if (_is_curl_installed()) {
  echo "cURL is <span style=\"color:blue\">installed</span> on this server";
} else {
  echo "cURL is NOT <span style=\"color:red\">installed</span> on this server";
}
phpinfo();

include("config/config.php");
$json = '{
    "authentication": {
        "api_key": "swtDY75W3lB923mLxiSAE4EpNuVJpGh3",
        "vertical": "individual",
        "invoice_data": {
            "Space Rent": 24840975,
            "miscellaneous": 8000,
            "Space Rent - Conference Centre": 287500,
            "loyaltyDisc": 2512847,
            "CancellationCharges": 500000,
            "Air Conditioning / Compressed Air": 1380000,
            "Security Services Expenses": 300000,
            "Light Pole Charges": 2300,
            "Power Connection": 45000,
            "Night Working Charges": 110000,
            "Medical Services Expenses": 24000,
            "Repair \u0026 Maintenance Exp - Others": 5000,
            "Buggies": 30000,
            "Telephone Connection": 4000,
            "Hoardings / Signages": 1150000,
            "code": "BIEC Appli",
            "street": "Bangalore  ",
            "cityDescription": "Bangalore",
            "cityCode": "blre",
            "stateDescription": "Karnataka",
            "stateCode": "KA",
            "country": "India",
            "countryCode": null,
            "zipCode": 560010,
            "currency": "INR",
            "eventCode": "EVT0000081",
            "invoiceNumber": null,
            "invoiceDate": "11/03/2016"
        }
    }
}';
$json_data = json_decode($json, true);
$insert_data = array();
foreach ($json_data["authentication"]["invoice_data"] as $key => $value) {
    if(array_key_exists($key, $accounts_array)){

        $column_name = $accounts_array[$key];
        $insert_data[$column_name] = $value;
    }
}
print_r($insert_data);
?>