

<?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('login');



} 



$user = Auth::user();



$iduserlogin=$user->present()->id;

$nameuser=$user->present()->name;

$emailuser=$user->present()->email;

$idcompany=$user->present()->idcompany;

$langid=$user->present()->langid;

$privacyacc=$user->present()->privacyaccepted;

$loginusername=$user->present()->username;

$roleuser=$user->present()->role_id;





//$user = "1";

//$iduserlogin="1";

//$idcompany="1";

$companyname="Company Name";

//$nameuser="Claudio";

//$emailuser="info@acscreativesolutions.com";







?>

<?php require_once('../Connections/cmctrfdb.php'); ?>

<?php require_once('../webassist/mysqli/rsobj.php'); ?>

<?php // require_once('@@RSObjectPath@@'); ?>



<?php  require_once('../webassist/mysqli/queryobj.php'); ?>

<?php // require_once("../webassist/form_validations/wavt_scripts_php.php"); ?>

<?php include('generalsettings.php'); ?>





<?php 

if (session_status() == PHP_SESSION_NONE) {

    session_start();

}



	if (!isset($_SESSION["idowneruser"])) {

		$_SESSION["iduserlogin"]=$iduserlogin;

	}

$iduserlog=$_SESSION["iduserlogin"];

$_SESSION["nameuser"]=$nameuser;

$_SESSION["emailuser"]=$emailuser;



if (!isset($_SESSION["tempcode"])) {

$timestampnow=time();

$temporarycode=$iduserlog."-".$timestampnow;

$_SESSION["tempcode"]=$temporarycode;

$tempcode=$_SESSION["tempcode"];

	} else { $tempcode=$_SESSION["tempcode"]; }

?>

<?php 

if (isset($_GET['info'])) {

$infobox=$_GET['info'];

$_SESSION["infobox"]=$infobox;

} 

if (isset($_SESSION["infobox"])) {

	$infobox=$_SESSION["infobox"];

	} 

?>





        <?php include('languages/it/general.php');

include('languages/it/questionaire.php'); 

?>







<!-- query languages -->

<?php

$langselect = new WA_MySQLi_RS("langselect",$cmctrfdb,1);

$langselect->setQuery("SELECT * FROM languages WHERE languages.idlanguages='$langid'");

$langselect->execute();

$lang=$langselect->getColumnVal("acronym_languages");

?>

<?php

$languageselection = new WA_MySQLi_RS("languageselection",$cmctrfdb,0);

$languageselection->setQuery("SELECT * FROM languages WHERE languages.active_languages='Y' ORDER BY languages.name_languages");

$languageselection->execute();





?>

<?php

$avat = new WA_MySQLi_RS("avat",$cmctrfdb,0);

$avat->setQuery("SELECT avatar,id FROM auth_users WHERE auth_users.id='$iduserlogin'");

$avat->execute();

$avatarname=$avat->getColumnVal("avatar");



?>

<?php

//$companydetails = new WA_MySQLi_RS("companydetails",$cmctrfdb,1);

//$companydetails->setQuery("SELECT * FROM company WHERE company.idcompany='1'");

//$companydetails->execute();

if (isset($idcompany)) {

$companydetails = mysqli_query($cmctrfdb, "SELECT * FROM company WHERE company.idcompany='$idcompany'");

$companyData = mysqli_fetch_assoc($companydetails);

//echo $companyData["companyname_company"];



	}

//include('securitycheck.php');



?>









