<?php

// DATABASE connection script  
// database Connection variables
define('HOST', 'localhost'); // Database host name ex. localhost
define('USER', 'devknestlms_dbuser'); 
define('PASSWORD', 'Narahari1!'); // Database user password  (if password is not set for user then keep it empty )
define('DATABASE', 'devknestlms_imocha'); // Database name
//Production
//define('HOST', 'localhost'); // Database host name ex. localhost
//define('USER', 'learnknestlms_dbuser'); 
//define('PASSWORD', 'Narahari1!'); // Database user password  (if password is not set for user then keep it empty )
//define('DATABASE', 'learnknestlms_multi'); // Database name
define('CHARSET', 'utf8');
define('ROOT_PATH', dirname(__DIR__) . '/');
define('CONFIG_PROP', 'config.properties');
define('ADMIN_PATH', 'https://dev.knestlms.com/admin_imocha/');
define('CLIENT_PATH', 'https://dev.knestlms.com/client_imocha/');
define('ADMIN_HTTP_PATH', 'https://dev.knestlms.com/admin_imocha/');
define('CLIENT_HTTP_PATH', 'https://dev.knestlms.com/client_imocha/');
define('DEFAULT_COURSE_IMAGE', 'assets/images/course/course.jpg');
define('DEFAULT_USER_IMAGE', 'assets/images/user/user1.png');
date_default_timezone_set('Asia/Kolkata');
$date_time = date("Y-m-d H:i:s");
$date = date("Y-m-d");
$timeout = 7200;
//LTI Specific
define('LMS_NAME', 'K-nest LMS');
define('LMS_VERSION', '1.0.4');
define('LMS_CODE', 'knest_lms');
define('LTI_VERSION_1P3', '1.3.0');
define('LTI_SETTING_NEVER', 0);
define('LTI_SETTING_ALWAYS', 1);
define('LTI_SETTING_DELEGATE', 2);
define('LTI_LAUNCH_CONTAINER_DEFAULT', 1);
define('LTI_LAUNCH_CONTAINER_EMBED', 2);
define('LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS', 3);
define('LTI_LAUNCH_CONTAINER_WINDOW', 4);
define('LTI_LAUNCH_CONTAINER_REPLACE_WINDOW', 5);
define('LTI_JWT_CLAIM_PREFIX', 'https://purl.imsglobal.org/spec/lti');
define('FORMAT_PLAIN', '2');
global $SESSION;
$SESSION = new stdClass();


//ini_set('display_errors', 1);
//error_reporting(E_ALL);


require_once 'i18n.php';

function DBConnection() {
    static $instance;
    if ($instance === null) {
        $opt = array(
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES => FALSE,
        );
        $dsn = 'mysql:host=' . HOST . ';dbname=' . DATABASE . ';charset=' . CHARSET;
        $instance = new PDO($dsn, USER, PASSWORD, $opt);
    }
    return $instance;
}
//$api_key="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";
//$api_key = "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";
$api_key="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";
$iMocha_apiKey = '4883e305ad3a498caab9149d67d9667d';

$baseUrl = "https://edforce-staging.nuvepro.io/webservice/rest/server.php?moodlewsrestformat=json";
$wstoken = "032ff35e9682f81534d12c0abe1f5ba9";
?>