<?php
error_reporting(E_ALL);
error_reporting(-1);
ini_set('error_reporting', E_ALL);

ob_start();
session_start();
date_default_timezone_set("Asia/Jakarta");

include('../config/koneksi.php');
// Menambahkan class HGI
include('../config/class.hgi.php'); 

// Inisialisasi object HGI agar bisa dipakai di semua halaman
$hgi = new HypergateAPI();

$sql_0 = mysqli_query($conn,"SELECT * FROM `tb_seo` WHERE cuid = 1") or die(mysqli_error());
$s0 = mysqli_fetch_array($sql_0);
$urlweb = $s0['urlweb'];
$urlwebs = $s0['urlweb'];

if (empty($_SESSION['user']) AND empty($_SESSION['pass'])){
  header('location:'.$urlwebs.'/login/?notif=2');
  exit;
}

$user = mysqli_query($conn,"SELECT * FROM `tb_user` WHERE username = '".$_SESSION['user']."'") or die (mysqli_error());
$u = mysqli_fetch_array($user);
$email = $u['email'];
$users = $u['username']; // Ini yang akan digunakan sebagai parameter username di API HGI
$userID = $u['cuid'];
?>