<?php

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

    include_once('setting.php');
    include_once(LIBRARY.'db.php');
    $db = NEW \DB\DB(DBSERVER,DBUSER,DBPASS,DBTABLE);
    include_once(LIBRARY.'functions.php');
    $func = NEW \FUNCTIONS\FUNCTIONS();
    include_once(LIBRARY.'customer.php');
    $customer = NEW \CUSTOMER\CUSTOMER($db);
    include_once(LIBRARY.'location.php');
    $location = NEW \LOCATION\LOCATION();
    include_once(LIBRARY.'session.php');
    $session = NEW \SESSION\SESSION();
    include_once(LIBRARY.'error.php');
    $error = NEW \ERROR\ERROR($session);
    $success = NEW \ERROR\SUCCESS($session);



    require_once LIBRARY.'mail/Exception.php';
    require_once LIBRARY.'mail/PHPMailer.php';
    require_once LIBRARY.'mail/SMTP.php';

    use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\Exception;

    $mail = new PHPMailer(false);
    //Server settings
    $mail->SMTPDebug = SMTP_DEBUG;                                 // Enable verbose debug output
    $mail->isSMTP();                                      // Set mailer to use SMTP
    $mail->Host = SMTP_HOST;  // Specify main and backup SMTP servers
    $mail->SMTPAuth = true;                               // Enable SMTP authentication
    $mail->Username = SMTP_USER;                 // SMTP username
    $mail->Password = SMTP_PASS;                           // SMTP password
    $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
    $mail->Port = SMTP_PORT;                                    // TCP port to connect to


$konum = strpos($_SERVER['REQUEST_URI'], 'login.php');
$konum2 = strpos($_SERVER['REQUEST_URI'], 'ajax.php');
if($konum===false && $konum2===false){
    //if(!$customer->isLogged()) $location->redirect('login');
}
