<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL | E_STRICT);
// This should be equal to: PATH_TO_VANGUARD_FOLDER/extra/auth.php
include('../../../extra/auth.php');
//require_once __DIR__ . '/extra/auth.php';

// Here we just check if user is not 
// logged in, and in that case we redirect
// the user to vanguard login page.

if (! Auth::check()) {

	redirectTo('../../../public/login');
}

$user = Auth::user();
$iduserlogin = $user->present()->id;
$nameuser = $user->present()->first_name;
$surnameuser = $user->present()->last_name;
$emailuser = $user->present()->email;
$avatarName = $user->avatar;
$createDate = $user->created_at;
$kindofrole = $user->present()->role_id;
$address = $user->present()->address;
$zip = $user->present()->zip;
$city = $user->present()->city;
$user_country_id = $user->country->id;
$name = $user->present()->first_name;
$surname = $user->present()->last_name;
$fiscalcode = $user->present()->fiscalcode;
$phone = $user->present()->phone;
?>
<?php
if (session_status() == PHP_SESSION_NONE) {
	session_start();
}

$_SESSION["iduserlogin"] = $iduserlogin;
$iduserlog = $_SESSION["iduserlogin"];
$_SESSION["nameuser"] = $nameuser;
$_SESSION["surnameuser"] = $surnameuser;
$_SESSION["emailuser"] = $emailuser;
$_SESSION["photouser"] = $avatarName;
$photouser = $_SESSION["photouser"];
?>
<?php require_once('../../Connections/yogiwherequery.php');  ?>
<?php require_once('../../webassist/mysqli/rsobj.php'); ?>
<?php require_once('../../webassist/mysqli/queryobj.php'); ?>
<?php require_once("../../webassist/form_validations/wavt_scripts_php.php"); ?>
<?php //include files
include('../../languages/it/general.php');
//include("generalsettings.php");

?>