<?php
ob_start();
session_start();
require_once('api/nexus.php');
$user =mysqli_query($conn,"SELECT * FROM `tb_user` WHERE user = '".$_SESSION['user']."'") or die (mysqli_error());
$u = mysqli_fetch_array($user);
$externalPlayerId = $u['extplayer'];
$cuids = $u['cuid'];

$sql_255 = mysqli_query($conn, "SELECT * FROM `tb_apigames` WHERE cuid = 1") or die(mysqli_error($conn));
$s255 = mysqli_fetch_array($sql_255);
 
$sql_balance = mysqli_query($conn, "SELECT * FROM `tb_balance` WHERE userID = $cuids") or die(mysqli_error());
$sb = mysqli_fetch_array($sql_balance);           

$getBalanceResponse = $NG->info_member($externalPlayerId);
$getBalanceResponse1 = $sb['active'];
// Cek apakah respons memiliki status sukses dan balance tersedia
mysqli_query($conn, "UPDATE tb_balance SET active = '$getBalanceResponse1' WHERE userID = '$cuids'") or die(mysqli_error());

?>