<?php
if($_REQUEST['debug'] == 1){
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
}
session_start();

#require_once __DIR__.'/MYB.ErrorHandler.php';
#require_once __DIR__.'/config/config__'.$_SERVER['SERVER_NAME'].'.php';

DEFINE('MAIN_DB_HOST', '127.0.0.1');
DEFINE('MAIN_DB_USER', 'gogovest_boocard_user');
DEFINE('MAIN_DB_PSWD', '-=TtACX%^)H*');
DEFINE('MAIN_DB_NAME', 'gogovest_boocard');
DEFINE('SMTP_SERVER', 'smtp.sendgrid.net');
DEFINE('SMTP_PORT', 2525);
DEFINE('SMTP_USER', 'apikey');
DEFINE('SMTP_PSWD', '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');

DEFINE('SMSTO_API_KEY', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2F1dGg6ODA4MC9hcGkvdjEvdXNlcnMvYXBpL2tleXMvZ2VuZXJhdGUiLCJpYXQiOjE3MDA1OTk5NDMsIm5iZiI6MTcwMDU5OTk0MywianRpIjoiMEZqSzRSWWl2Q3pYQnppZyIsInN1YiI6NDMzOTgyLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qYaGkrgCx5HPXR3C4KTMwDiZGWNjcK8pNe-3rXZEakk');
DEFINE('OPENAPI_SMS_TOKEN', '655d24ca071147fec502ff68');
DEFINE('PROGRESSIER_PWA_ID', false);



$BASE_URL="//boocard.it";
$BASE_URL_HTTP="http://boocard.it";
$BASE_URL_HTTPS="https://boocard.it";
$HOST = "//boocard.it";
$HOST_HTTPS = "https://boocard.it";

DEFINE('BASE_URL_HTTPS', $BASE_URL_HTTPS);
DEFINE('BASE_URL', $BASE_URL);
DEFINE('HOST_HTTPS', $HOST_HTTPS);


function db_init() {
        $mysqli = new mysqli(MAIN_DB_HOST, MAIN_DB_USER, MAIN_DB_PSWD, MAIN_DB_NAME);
        $mysqli->set_charset('utf8mb4');

        return $mysqli;
}

$mysqli = db_init();
$ADDRESS="//{$_SERVER['SERVER_NAME']}";
$ADDRESS_HTTPS="https://{$_SERVER['SERVER_NAME']}";
$HOST = "//".preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']);
$HOST_HTTPS = "https://".preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $_SERVER['HTTP_HOST']);


function check_login(){
global $_SESSION;
global $_COOKIE;


if(!isset($_COOKIE['member_id'])) {
    if($_SERVER['PHP_SELF'] !== '/login.php') {
      header("Location: {$ADDRESS}/login.php");
    }
  }


}

$admin_token = "y36#rr%kiM";

setlocale(LC_ALL, 'it_IT.UTF-8');

