<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
*/

$query_builder = TRUE;

/**
 * Default: LOCALHOST (laragon / xampp)
 * ------------------------------------
 * - host: localhost
 * - user: root
 * - db  : hsidb
 */
$db['default'] = array(
    'dsn'      => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'hsidb',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt'  => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

/**
 * HOSTING / CPANEL
 * -----------------
 * - host     : biasanya localhost di cPanel
 * - database : nokanosi_hsidb
 * - user     : nokanosi_hsi
 * - password : Kangdendyhsi8990$#
 */
$db['hosting'] = array(
    'dsn'      => '',
    'hostname' => 'localhost',
    'username' => 'nokanosi_hsi',
    'password' => 'Kangdendyhsi8990$#',
    'database' => 'nokanosi_hsidb',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt'  => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

/**
 * PILIH ACTIVE GROUP OTOMATIS
 * ---------------------------
 * - kalau jalan di domain portalregistrasihsiacademy.com  -> pakai 'hosting'
 * - kalau di localhost / 192.168.x.x dll                  -> pakai 'default'
 */
$active_group = 'default'; // default: lokal

if (isset($_SERVER['HTTP_HOST'])) {
    $host = $_SERVER['HTTP_HOST'];

    // list domain yang dianggap "hosting"
    $hosting_domains = array(
        'portalregistrasihsiacademy.com',
        'www.portalregistrasihsiacademy.com'
    );

    if (in_array($host, $hosting_domains, true)) {
        $active_group = 'hosting';
    }
}
