<?php
$DEBUG = 1;
ini_set('max_execution_time', 900); //300 seconds = 5 minutes
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set('display_errors', "1");
$hostname = trim(`hostname`);
$dev = preg_match("/frank\//", __FILE__);
$dbuser = 'root';
$dbpassword = 'leer';
//$dbname = 'securvita_abgleich_lite';
$dbname = 'securvita_healthmiles_vwtool_20210607';
$dbport = '3306';
$webroot = '/Users/frank/Webserver/Development-Frank/SECURVITA/healthmiles.de/';
$rooturl = '/';
$tmpdir = '/tmp';
$dbhost = 'localhost';
$zipbin = '/usr/bin/zip';
$salt = '0911056a0dc2c3edb191d372499435068072bb114dfb9b435683b8933d563dc40200db33bac51b0e368393dfd0270e94c50514f305a1fc45cb6481d965972112';
set_include_path('/Applications/MAMP/bin/php/php5.6.40/lib/php' . PATH_SEPARATOR
    . get_include_path());

if ($hostname == 'www.healthmiles.de' || $hostname == 'ht95iun7.healthmiles.de') {
    $rooturl = '/';
    /* Setzte Cookie-Domain auf "*.healthmiles.de" */
    session_set_cookie_params(18600, '/', 'healthmiles.de', false, false);
    $dbhost = 'localhost';
    $webroot = '/var/www/html';
    if ($dev) {
        $dbname = 'healthmiles_dev';
        $webroot = '/var/www/html/dev';
    }
} elseif ($hostname == 'ernie.local' || $hostname == 'bert.local') {
    $dbname = 'healthmiles';
    ini_set('error_reporting', E_ALL & ~E_NOTICE);
    ini_set('display_errors', 1);
    date_default_timezone_set('Europe/Berlin');
    $dbport = '/Applications/MAMP/tmp/mysql/mysql.sock';
    $dbpassword = 'root';
    $webroot = '/Users/carstens/Desktop/htdocs/healthmiles';
    $rooturl = '/healthmiles/';
    $dev = true;
    $zipbin = 'zip';
} elseif ($hostname == 'cww244') {
    $rooturl = '/';
    set_include_path('/usr/home/healthmi/pear/pear/php' . PATH_SEPARATOR
        . get_include_path());
    $dbname = 'healthmiles_de';
    $dbuser = 'healthmiles_de';
    $dbpassword = 'k96OBTu1ugM0';
    $dbhost = '217.110.74.244';
    ini_set('error_reporting', E_ALL & ~E_NOTICE);
    ini_set('display_errors', 0);
    ini_set('display_startup_errors', 0);
    date_default_timezone_set('Europe/Berlin');
    $webroot = '/home/pages/healthmiles.de/htdocs';
    $dev = false;
    if (preg_match('/preview.healthmiles.de/', dirname(__FILE__)) ||
        $_SERVER['HTTP_HOST'] == 'preview.healthmiles.de') {
        $dev = true;
        $rooturl = '/';
        $dbname = 'p_healthmiles_de';
        ini_set('display_errors', 1);
        $webroot = '/home/pages/preview.healthmiles.de/htdocs';
    }
}


$exportpath = "$webroot/admin/exportfiles";
$maxLinesPerTable = 30;
$adminEmail = 'securvita@frankschuessler.de';
$adminTel = '000';
# IP-Adresse Securvita GmbH: '80.152.156.241', BKK: '62.206.180.250';
# $allowedIps=array('80.152.156.241','62.206.180.250','213.39.162.99');
# BKK-IP gesperrt, Gem 3.12.10, Bogisch
# 80.152.156.241 <- Martens
# P4: 88.198.14.56
$allowedIps = [
    '127.0.0.1',
    '::1',
    '87.157.61.45',
    '80.152.156.241',
    '87.129.246.178',
    '88.198.14.56',
    '2A02:8108:45C0:CE4:1DB8:7361:BEAB:CEA7',
    '90.187.20.117',
    '31.16.99.53',
    '31.17.207.69'
];
//  $eucountries = array('Deutschland','Belgien','Dänemark','Estland','Finnland','Frankreich','Griechenland','Irland','Italien','Lettland','Litauen','Luxemburg','Malta','Niederlande','Österreich','Polen','Portugal','Rumänien','Schweden','Schweiz','Slowakei','Slowenien','Spanien','Tschechien','Ungarn','Vereinigtes Königreich','Zypern');
$eucountries = [
    'DE' => 'Deutschland',
    'BE' => 'Belgien',
    'DK' => 'Dänemark',
    'EE' => 'Estland',
    'FR' => 'Frankreich',
    'FI' => 'Finnland',
    'GR' => 'Griechenland',
    'IE' => 'Irland',
    'IT' => 'Italien',
    'LV' => 'Lettland',
    'LT' => 'Litauen',
    'LU' => 'Luxemburg',
    'MT' => 'Malta',
    'NL' => 'Niederlande',
    'AU' => 'Österreich',
    'PL' => 'Polen',
    'PT' => 'Portugal',
    'RO' => 'Rumänien',
    'SE' => 'Schweden',
    'CH' => 'Schweiz',
    'SK' => 'Slowakei',
    'SI' => 'Slowenien',
    'ES' => 'Spanien',
    'CZ' => 'Tschechien',
    'HU' => 'Ungarn',
    'GB' => 'Vereinigtes Königreich',
    'CY' => 'Zypern'
];
foreach ($eucountries as $key => $value) {
    $eucountries[$key] = utf8_decode($value);
}
$monatsarray = [
    'Januar',
    'Februar',
    'März',
    'April',
    'Mai',
    'Juni',
    'Juli',
    'August',
    'September',
    'Oktober',
    'November',
    'Dezember'
];
for ($i = 0; $i < count($monatsarray); $i++) {
    $monatsarray[$i] = utf8_decode($monatsarray[$i]);
}
