<?php 
include('../session.php'); 

header('Content-Type: application/json');


$user = $_POST['user'];
$rtp  = $_POST['rtp'];

$postArray = [
    'method'      => 'set_rtp',
    'agent_code'  => NEXUS_AGENT,
    'agent_token' => NEXUS_TOKEN,
    'user_code'   => $user,
    'rtp'         => $rtp
];

$ch = curl_init(NEXUS_URL);
curl_setopt_array($ch,[
    CURLOPT_RETURNTRANSFER=>true,
    CURLOPT_POST=>true,
    CURLOPT_HTTPHEADER=>['Content-Type: application/json'],
    CURLOPT_POSTFIELDS=>json_encode($postArray),
    CURLOPT_TIMEOUT=>10
]);

$res = curl_exec($ch);
curl_close($ch);
echo $res;
