<?
$_title0 = Get_TXTArea('_title', $language);
$_description0 = Get_TXTArea('_description', $language);
$_keywords0 = Get_TXTArea('_keywords', $language);
$_keyphrase = Get_TXTArea('_keyphrase', $language);
$_author = Get_TXTArea('_author', $language);
$_footer = Get_TXTArea('_footer', $language);

if(!isset($_tema)) $_tema   = "standard";
if(!isset($_gui))  $_gui    = "standard";

$_szp=$sz;

$sql = "SELECT level, id_parent FROM $tbl_sezioni WHERE sz = $sz";
$mydb->DoSelect($sql);
if (!$r = $mydb->GetRow()) {
    $_levelsez = 0;
} else {
    $_levelsez = $r['level'];

    if ($_levelsez > 0) {
        $sql = "SELECT sz  FROM $tbl_sezioni WHERE id_sezione=" . $r['id_parent'];
        $mydb->DoSelect($sql);
        $rtmp = $mydb->GetRow();
        $_szp = $rtmp['sz'];
    }
}
$_bootstrap = false;

$id_sezione_ = $id_sezione;
if(isset($id_subsezione) && $id_subsezione!="") $id_sezione_ = $id_subsezione;

$sql = "SELECT containers, params FROM $tbl_sezioni WHERE id_sezione = $id_sezione_";
$mydb->DoSelect($sql);
if(!$r=$mydb->GetRow()) {
    $containers = "";
} else {
    $containers = $r['containers'];
    if($r['params']!="" && strstr($r['params'],"|bootstrap|")) $_bootstrap = true;
}

$sql = "SELECT tb1.id_area, tb1.nome FROM $tbl_aree AS tb1, $tbl_sez_aree AS tb2 WHERE tb1.id_area=tb2.id_area AND tb2.id_sezione = $id_sezione AND tb1.extra = 'metatag'";
$a_meta_aree = $mydb->DoSelect($sql);

$i = 0;
if(is_array($a_meta_aree)){
foreach ($a_meta_aree as $i => $r) {

    if (substr($r['nome'], 0, 6) == "_title") {

        $_titlews = Get_TXTArea($r['nome'], $language);
    }
    if (substr($r['nome'], 0, 12) == "_description"){
        $_description = Get_TXTArea($r['nome'], $language);
    }
    if (substr($r['nome'], 0, 9) == "_keywords"){
        $_keywords = Get_TXTArea($r['nome'], $language);
    }
}
}
if (empty($_titlews))
    $_titlews = $_title0;
if (empty($_description))
    $_description = $_description0;
if (empty($_keywords))
    $_keywords = $_keywords0;

#if (isset($xtitlepage) && $xtitlepage != "")
#   $_titlews = $lang['_PREFIX_TITLE'] . " " . $xtitlepage;

$_title = "";

if ($logged == '1')
    $supertopclass = "supertoplogged";
else
    $supertopclass = "supertopnologged";

include "./main/contents/menu0.php";


$stylecb = "display:none";
/*
if ($logged != '1') {

    $_cookiesbanner = Get_TXTArea('_cookiesbanner', $language);

    if ($request_uri == "" || $request_uri == "/" || $request_uri == "\\")
        $stylecb = "";
    else
        $stylecb = "display:none";

    if (($sz > 0 && $sz != 100) || $logged == 1)
        $stylecb = "display:none";
}*/
?>
<title><? echo $_titlews; ?></title>

<base href="<?= $urlbase ?>" target="_self"  />

<meta name="description" content="<? echo $_description ?>" />
<meta name="keywords" content="<? echo $_keywords ?>" />
<meta http-equiv="content-language" content="it">

<!-- Mobile Specific Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<!-- Favicons -- >
<link rel="shortcut icon" href="images/favicon.ico"-->

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

<script src="<?= $extincpath_http ?>contents/common.js?t=<?=$_t?>"   charset="utf-8"></script>
<script src="<?= $extincpath_http ?>contents/commonj.js?t=<?=$_t?>"  charset="utf-8"></script>
<script src="<?= $extincpath_http ?>contents/commonws.js?t=<?=$_t?>"  charset="utf-8"></script>

  <link rel="stylesheet" href="https://code.jquery.com/ui/1.14.0/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
  <script src="https://code.jquery.com/ui/1.14.0/jquery-ui.js"></script>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<!--link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500,600,700&display=swap" rel="stylesheet"-->

<? if(isset($_gui) && $_gui == "modern") { ?>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<? } else { ?>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Lato" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">
<? } ?>

<script src="main/contents/jscode.js?t=<?=$_t?>"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css">

<?
if($logged)
{
?>
    <!-- Admin area CSS: Layout (framework) + Theme (framework) + Project overrides -->
    <style>@import "<?= $extincpath_http ?>_gui/lt.<?= $_gui ?>.css?t=<?=$_t?>";</style>
    <style>@import "<?= $extincpath_http ?>_gui/th.<?= $_tema ?>.css?t=<?=$_t?>";</style>
    <style>@import "<?= $urlbase ?>main/contents/stylel.css?t=<?=$_t?>";</style>
<?
} else { 
?>
<style>@import "<?= $urlbase ?>main/contents/style.css?t=1<?=$_t?>";</style>
<!--style>@import "<?= $urlbase ?>main/contents/main.css?t=1<?=$_t?>";</!--style-->
<? } ?>
<style>@import "<?= $urlbase ?>main/contents/styletxt.css?t=<?=$_t?>";</style>
    
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
