$_SESSION[baloo][ar_ra][ar_utente]='; print_r($_SESSION['baloo']['ar_ra']['ar_utente']);
$fl_debug = false;
//$fl_debug = true;
if (!isset($_SESSION['debug'])) $_SESSION['debug'] = '0';
if (!isset($_SESSION['stop'])) $_SESSION['stop'] = '_';
if ('1' == $_SESSION['debug']) $fl_debug = true;
if ($fl_debug) {
echo ' BREAKPOINT AT ';
switch ($_SESSION['stop']) {
case '_':
//no breakpoint
break;
default:
echo $_SESSION['stop'];
break;
}
echo ' *** START PAGEDIN ***';
}
// ^^^^^^^^^^^^^^^^
// modifica per permettere link a pagine e notizie da Social
// vengono impostate le variabili di sessione indispensabili
// script basato su esperienza con bd.php
if (!isset($_SESSION['baloo']['web'])) {
$_SESSION['baloo']['web'] = 'baloo';
$_SESSION['baloo']['lan'] = 'it';
}
// ^^^^^^^^^^^^^^^^
// LOGOUT E REINTEGRO WEB IN CASO DI LOGOUT
if ($fl_debug) echo ' reintegro web in caso di logout';
if (isset($_SESSION['baloo']['web'])) {
if ($fl_debug) echo ' preparo reintegro web in caso di logout';
$web = $_SESSION['baloo']['web'];
//$mob = $_SESSION['baloo']['mob'];
if (isset($_SESSION['baloo']['mob'])) {
$mob = $_SESSION['baloo']['mob'];
} else {
$mob = '0';
$_SESSION['baloo']['mob'] = '0';
}
//$okc = $_SESSION['baloo']['ok_cookie'];
if (isset($_SESSION['baloo']['ok_cookie'])) {
$okc = $_SESSION['baloo']['ok_cookie'];
} else {
$okc = '0';
$_SESSION['baloo']['ok_cookie'] = '0';
}
$lan = $_SESSION['baloo']['lan'];
if (isset($_SESSION['baloo']['lan'])) {
$lan = $_SESSION['baloo']['lan'];
} else {
$lan = 'it';
$_SESSION['baloo']['lan'] = 'it';
}
} else {
if ($fl_debug) echo ' eseguo reintegro web in caso di logout';
$_SESSION['baloo']['ok_cookie'] = '0';
if (isset($_POST['htv_web'])) {
$web = $_POST['htv_web'];
$_SESSION['baloo']['web'] = $web;
} else if (isset($_GET['web'])) {
$web = $_GET['web'];
$_SESSION['baloo']['web'] = $web;
} else {
echo 'ERRORE NECESSARIA DISAMBIGUAZIONE';
exit;
}
if ($fl_debug) echo ' eseguo reintegro modalità navigazione in caso di logout';
if (isset($_POST['htv_mob'])) {
$mob = $_POST['htv_mob'];
$_SESSION['baloo']['mob'] = $mob;
} else if (isset($_GET['mob'])) {
$mob = $_GET['mob'];
$_SESSION['baloo']['mob'] = $mob;
} else {
$_SESSION['baloo']['mob'] = '0';
}
if ($fl_debug) echo ' eseguo reintegro ok cookie in caso di logout';
if (isset($_POST['htv_okc'])) {
$okc = $_POST['htv_okc'];
$_SESSION['baloo']['ok_cookie'] = $okc;
} else if (isset($_GET['okc'])) {
$okc = $_GET['okc'];
$_SESSION['baloo']['ok_cookie'] = $okc;
} else {
$_SESSION['baloo']['ok_cookie'] = '0';
}
}
// uso scelta lingua per censurare shortcut
if ($fl_debug) echo ' uso scelta lingua per censurare shortcut';
if (isset($_SESSION['baloo']['lan'])) {
$lan = $_SESSION['baloo']['lan'];
} else {
if (isset($_POST['htv_lan'])) {
$lan = $_POST['htv_lan'];
$_SESSION['baloo']['lan'] = $lan;
} else if (isset($_GET['lan'])) {
$lan = $_GET['lan'];
$_SESSION['baloo']['lan'] = $lan;
} else {
unset($_SESSION['baloo']['lan']);
}
}
if (isset($_SESSION['baloo']['lan'])) {
// CARICO FILTRI E CREDENZIALI
if ($fl_debug) echo ' carico filtri e credenziali';
include ('../struttura/sp.php');
include ('../struttura/chkmobile.php');
include ($sp1.'aa_gatorA.php');
// lingua navigazione preferita
$lan = 'it';
if (isset($_SESSION['baloo']['lan'])) {
$lan = $_SESSION['baloo']['lan'];
}
if ($fl_debug) echo ' lingua navigazione preferita='.$lan;
// INPUT DATI UTENTE
//echo ' $_SESSION[baloo][ar_ra][ar_utente]='; print_r($_SESSION['baloo']['ar_ra']['ar_utente']);
if ($fl_debug) echo ' carico dati utente';
// per default metto gruppo N=navi e matricola = 0
$gruppo = 'N';
$matricola = 0;
// utente loggato?
if (!isset($_SESSION['baloo']['lin'])) {
$_SESSION['baloo']['lin'] = false;
$ar_utente = array();
$superutente = 0;
} else if ($_SESSION['baloo']['lin']) {
// utente ha fatto log-in:
// *************************
$ar_ra = $_SESSION['baloo']['ar_ra'];
$ar_utente = $ar_ra['ar_utente'];
$ar_aria = $ar_ra['ar_aria'];
$ar_cisa = $ar_ra['ar_cisa'];
$ar_rocca = $ar_ra['ar_rocca'];
$ar_profi = $ar_ra['ar_profi'];
$ar_fisco = $ar_ra['ar_fisco'];
// *************************
$matricola = $ar_utente['matricola'];
// per default metto gruppo G=guest
$gruppo = 'G';
//if ('1' == $ar_aria['socio']) $gruppo = 'S';
if ('S' == $ar_utente['gruppo']) $gruppo = 'S';
// per default metto superutente=0
$superutente = 0;
} else {
$superutente = 0;
}
if ($fl_debug) echo '
** matricola = '.$matricola.' gruppo = '.$gruppo;
//echo '
** matricola = '.$matricola.' gruppo = '.$gruppo;
// INPUT DATI PAGINA
if ($fl_debug) echo ' input dati pagina';
// carico puntatore a script di creazione del contenuto
// e trasferisco tutti i parametri del metodo a $ar_var
// 1) init tipo_input e array_zattera
$tipin = 'nn';
$ar_var = array();
if (isset($_POST['cod'])) {
// 2) tento con metodo POST
$codice = $_POST['cod'];
$ar_var = $_POST;
$ar_var['page_cod'] = $codice;
$tipin = 'post';
} else if (isset($_POST['htv_cod'])) {
$codice = $_POST['htv_cod'];
$ar_var = $_POST;
$ar_var['page_cod'] = $codice;
$tipin = 'post';
} else if (isset($_GET['cod'])){
// 3) se POST fallisce tento con metodo GET
$codice = $_GET['cod'];
$ar_var = $_GET;
$ar_var['page_cod'] = $codice;
$tipin = 'get';
}
if ($fl_debug) echo ' codice pagina='.$ar_var['page_cod'];
// ********************************************
// tool diagnosi
if (('home' == $codice) && (isset($ar_var['d']))) {
if ('1' == $ar_var['d']) {
$_SESSION['debug'] = '1';
if (isset($ar_var['stop'])) $_SESSION['stop'] = $ar_var['stop'];
} else {
$_SESSION['debug'] = '0';
$_SESSION['stop'] = '';
}
}
// ********************************************
// ********************************************
// è da eliminare uniformando fra POST e GET
if (isset($ar_var['htv_st_cod'])) {
$ar_var['st_cod'] = $ar_var['htv_st_cod'];
} else if (isset($ar_var['st_cod'])) {
$ar_var['htv_st_cod'] = $ar_var['st_cod'];
} else if (isset($ar_var['st'])) {
$ar_var['st_cod'] = $ar_var['st'];
$ar_var['htv_st_cod'] = $ar_var['st'];
} else {
$ar_var['st_cod'] = 'uc';
$ar_var['htv_st_cod'] = 'uc';
}
// ^^^^^^^^^^^^^^^^^
// modifica 2018-09-03
//$ar_ra['ar_utente'] = $ar_utente;
$ar_utente['struttura_attiva'] = $ar_var['st_cod'];
$_SESSION['baloo']['ar_ra']['ar_utente']['struttura_attiva'] = $ar_var['st_cod'];
// ^^^^^^^^^^^^^^^^^
if ($fl_debug) echo '
codice struttura='.$ar_var['st_cod'];
if ($fl_debug) { echo '
****** ar_utente : '; print_r($ar_utente); }
// ********************************************
// 4) se necessario aggiorno codice struttura dopo aver filtrato input
$st_cod = 'uc';
$in_area = 'acco01';
if(isset($ar_var['st_cod'])) {
switch ($ar_var['st_cod']) {
case 'ae':
case 'ai':
case 'am':
case 'as':
$st_cod = $ar_var['st_cod'];
$st_tipo = 'soc';
$in_area = 'macco01';
break;
case 'ad':
case 'bn':
case 'bo':
case 'cas':
case 'cl':
case 'ct':
case 'lg':
case 'lu':
case 'mi':
case 'na':
case 'pa':
case 'pu':
case 'rm':
case 'sa':
case 'taa':
case 'to':
case 'ts':
case 'tun':
case 've':
$st_cod = $ar_var['st_cod'];
$st_tipo = 'sez';
$in_area = 'macco01';
break;
case 'pp':
if ($ar_utente['superutente'] >= 9) {
$st_cod = $ar_var['st_cod'];
$st_tipo = 'sez';
$in_area = 'macco01';
}
break;
default:
$st_cod = 'uc';
$st_tipo = 'uc';
$in_area = 'acco01';
break;
}
$_SESSION['baloo']['st_cod'] = $st_cod;
}
//echo ' SESSION[baloo][lin]='.$_SESSION['baloo']['lin'].'* ***SESSION[baloo][st_cod]='.$_SESSION['baloo']['st_cod'].'*** stop a '.$_SESSION['stop'].' ';
/*
// 4) filtro su codice per sicurezza: il filtro è in pkdick.php
if (!preg_match($rexp_codice, $codice)) {
$codice = 'home';
$ar_var = array();
$tipin = 'nn';
}
*/
// 5) dopo filtro su codice pagina aggiorno "caption"
$_SESSION['baloo']['cap'] = $codice;
if ($fl_debug) echo ' caption='.$_SESSION['baloo']['cap'];
// 6) aggiungo preferenza lingua
// se c'è stata scelta con clic su bandierina allora $ar_var['lan'] esiste
if(!isset($ar_var['lan'])) {
$ar_var['lan'] = $lan;
} else {
switch ($ar_var['lan']) {
case 'en':
case 'de':
case 'es':
case 'fr':
$lan = $ar_var['lan'];
break;
default:
$lan = 'it';
break;
}
$_SESSION['baloo']['lan'] = $lan;
if ($fl_debug) echo ' prefernza lingua='.$_SESSION['baloo']['lan'];
// eventualmente memorizzo nel profilo la scelta
if (isset($_SESSION['baloo']['lin'])) {
if ($_SESSION['baloo']['lin']) {
if ($fl_debug) echo ' memorizzo nel profilo la scelta della lingua preferita';
$cn_nme = mysqli_connect($db_hst,$usn,$pwd,$db_aa) or die ("Errore PAGEDIN.01");
if(intval($matricola) >= 1) {
$qr_upd = 'UPDATE profi SET lan = "'.$lan.'" WHERE matricola = "'.$matricola.'" LIMIT 1';
} else {
$qr_upd = 'UPDATE profi SET lan = "'.$lan.'" WHERE temporanea LIKE "'.$temporanea.'" LIMIT 1';
}
$qr_ars = mysqli_query($cn_nme,$qr_upd) or die ('Errore PAGEDIN.02');
mysqli_close($cn_nme);
}
}
}
// verifico se devo attivare mobile (per attivare uso $_SESSION[baloo][mob])
if ($fl_debug) echo ' verifico se attivare mobile';
// preliminarmente verifico se la modalità è stata forzata per debug
if (isset($_SESSION['baloo']['forzamob'])) {
if ($fl_debug) echo ' forzamob ='.$_SESSION['baloo']['forzamob'];
if ('1' == $_SESSION['baloo']['forzamob']) {
$_SESSION['baloo']['mob'] = '1';
} else {
$_SESSION['baloo']['mob'] = chkmobile();
}
} else {
$_SESSION['baloo']['mob'] = chkmobile();
}
// $_SESSION['baloo']['mob'] = chkmobile();
//if (chkmobile()) $mob .= '&mob=1';
if ($fl_debug) echo ': mobile ='.$_SESSION['baloo']['mob'];
// verifico se devo attivare superutente
if ($fl_debug) echo ' verifico se attivare superutente';
//$superutente = 0;
if (isset($ar_utente['superutente'])) {
if ($ar_utente['superutente'] >0) {
if (stripos($ar_utente['strutture'],$st_cod) !== false) $superutente = $ar_utente['superutente'];
}
}
if ($fl_debug) echo ': superutente ='.$superutente;
// ELEMENTI PER COSTRUZIONE PAGINA
// 1) connessione a database
$cn_aun = mysqli_connect($db_hst,$usn,$pwd,$db_au) or die ("Errore PAGEDIN.03");
if ($fl_debug) echo ' carico elementi per costruzione pagina';
// 2) ricavo elementi per costruzione
$qr_sel = 'SELECT * FROM layout WHERE nome_layout LIKE "baloo" LIMIT 1';
if ($fl_debug) echo ' qr_sel = '.$qr_sel;
$qr_ars = mysqli_query($cn_aun,$qr_sel) or die ('Errore PAGEDIN.04');
$qr_vtr = mysqli_fetch_array($qr_ars);
// *******************************************
// 2a) elementi per costruzione contenitore
$body_bgcolor = $qr_vtr['body_bgcolor'];
$width_box = $qr_vtr['width_box'];
$width_sx = $qr_vtr['width_sx'];
$width_dx = $qr_vtr['width_dx'];
$width_cornice = $width_sx + $width_box + $width_dx;
$frame = $qr_vtr['frame'];
// *******************************************
// 2b) elementi per costruzione header
$ar_head = array();
$ar_head['bg_img'] = $qr_vtr['image_epig_bg'];
$ar_head['logo_img'] = $qr_vtr['image_logo'];
$ar_head['logo_height'] = $qr_vtr['height_logo'];
$ar_head['logo_url'] = $qr_vtr['link_logo'];
$ar_head['mnu_smt'] = $qr_vtr['menu_smart'];
$ar_head['mnu_opt'] = $qr_vtr['menu_opt'];
$ar_head['tab_title'] = $qr_vtr['tab_title'];
// *******************************************
// 2c) elementi per costruzione menu
// $ar_menu = array();
// $ar_menu['kngroup'] = $qr_vtr['menu_knapp'];
// *******************************************
// 2d) elementi per costruzione red bar
$ar_bar = array();
// $ar_bar['color'] = $qr_vtr['bar_color'];
$ar_bar['path'] = $qr_vtr['redbar'];
$ar_bar['bg_img'] = $qr_vtr['bar_bg'];
$ar_knapp = explode('|',$qr_vtr['bar_knapp']);
$ar_bar['knapp_area'] = $ar_knapp[0];
$ar_bar['knapp_acco'] = $ar_knapp[1];
$ar_bar['bg_area'] = $ar_knapp[2];
// *******************************************
// 2e) elementi per costruzione footer
$ar_foot = array();
$ar_foot['owner'] = $qr_vtr['owner'];
$ar_foot['copy_owner'] = $qr_vtr['copyright_owner'];
$ar_foot['copy_init'] = $qr_vtr['copyright_init'];
$ar_foot['webmaster'] = $qr_vtr['webmaster'];
// *******************************************
// 2f) social e lingue per costruzione red bar
$ar_foot['path'] = $qr_vtr['footer'];
$qr_sel = 'SELECT social, lingue FROM strutture WHERE st_cod LIKE "'.$st_cod.'" LIMIT 1';
if ($fl_debug) echo ' qr_sel = '.$qr_sel;
$qr_ars = mysqli_query($cn_aun,$qr_sel) or die ('Errore PAGEDIN.05');
$qr_vtr = mysqli_fetch_array($qr_ars);
$ar_bar['social'] = $qr_vtr['social'];
$ar_bar['lingue'] = $qr_vtr['lingue'];
// footer con social
$ar_foot['social'] = $qr_vtr['social'];
// *******************************************
// 2g) incremento numero quotidiano pagine scaricate
// aggiorno numero pagine del sito visitate
$chiaday = 0;
$oggi = date('Y-m-d');
$soci = 0;
$guest = 0;
$altri = 0;
$qr_sel = 'SELECT * FROM visite WHERE data = "'.$oggi.'" LIMIT 1';
if ($fl_debug) echo ' '.$qr_sel;
$qr_ars = mysqli_query($cn_aun,$qr_sel) or die ('Errore PAGEDIN.05bis');
$qr_vtr = mysqli_fetch_array($qr_ars);
if (isset($qr_vtr['chiave'])) $chiaday = $qr_vtr['chiave'];
if (isset($qr_vtr['altri'])) $altri = $qr_vtr['altri'];
if (isset($qr_vtr['guest'])) $guest = $qr_vtr['guest'];
if (isset($qr_vtr['soci'])) $soci = $qr_vtr['soci'];
switch ($gruppo) {
case 'S':
$soci++;
break;
case 'G':
$guest++;
break;
default:
$altri++;
break;
}
$visite = $soci + $guest + $altri;
if ($chiaday > 0) {
$qr_rep = 'UPDATE visite SET soci = '.$soci.', guest = '.$guest.', altri = '.$altri.', visite = '.$visite.' WHERE chiave = '.$chiaday.' LIMIT 1';
} else {
$qr_rep = 'INSERT INTO visite SET data = "'.$oggi.'", soci = '.$soci.', guest = '.$guest.', altri = '.$altri.', visite = '.$visite;
}
if ($fl_debug) echo ' '.$qr_rep;
$qr_rsl = mysqli_query($cn_aun,$qr_rep) or die ('Errore PAGEDIN.05ter');
mysqli_close($cn_aun);
// *******************************************
// definisco database su cui operare:
// nel caso di gestione di debug, manifestazioni, notizie, albo si opera SEMPRE su db aunt!
// Negli altri casi si opera su db aunt o su db str-st_cod in base a st_cod!
/* switch ($ar_var['page_cod']) {
case 'debug':
case 'agen01':
case 'agen02':
case 'agen21':
case 'agen23':
case 'mani01':
$db_nme = $db_au;
break;
default:
$db_nme = $db_au;
if (($st_cod != '') && ($st_cod != 'uc')) $db_nme = 'str-'.$st_cod;
break;
}
*/
$db_nme = $db_au;
if (($st_cod != '') && ($st_cod != 'uc')) {
// eseguo un test sul db della strutture per verificare se esiste recipe per il codice
$db_tst = 'str-'.$st_cod;
if ($fl_debug) echo ' apro connessione di test a db struttura: '.$db_tst;
$cn_tst = mysqli_connect($db_hst,$usn,$pwd,$db_tst) or die ("Errore PAGEDIN.05quater");
$qr_sel = 'SELECT chiave FROM '.$recipes.' WHERE codice LIKE "'.$codice.'" LIMIT 1';
$qr_ars = mysqli_query($cn_tst,$qr_sel) or die ('Errore PAGEDIN.05quinques');
$qr_vtr = mysqli_fetch_array($qr_ars);
$chiave = $qr_vtr['chiave'];
if ((isset($chiave)) && ($chiave > 0)) $db_nme = 'str-'.$st_cod;
mysqli_close($cn_tst);
}
$ar_var['db_nme'] = $db_nme;
// apro connessione a db struttura
if ($fl_debug) echo ' apro connessione a db struttura: '.$db_nme;
$cn_nme = mysqli_connect($db_hst,$usn,$pwd,$db_nme) or die ("Errore PAGEDIN.06");
// *******************************************
// 3) ricavo nome script da includere per preparazione body tenendo conto status funzione
if ($fl_debug) echo ' ricavo nome script da includere per preparazione body tenendo conto status funzione';
//
// nota: mantengo separate le tabelle "pages" e "recipes" per analogia ai minisiti miSW
// in cui la prima è modificabile da web-admin mentre modifica di "recipes" è riservata a sys-admin
$qr_sel = 'SELECT * FROM '.$recipes.' WHERE codice LIKE "'.$codice.'" LIMIT 1';
if ($fl_debug) echo ' qr_sel = '.$qr_sel;
$qr_ars = mysqli_query($cn_nme,$qr_sel) or die ('Errore PAGEDIN.07');
$qr_vtr = mysqli_fetch_array($qr_ars);
$script_inc = $qr_vtr['script'];
$ar_var['ro_pag'] = $qr_vtr['robot'];
$ar_var['st_pag'] = $qr_vtr['status'];
// *******************************************
// *** EVENTUALE HTML4 AUTOFOCUS ***
if ((isset($qr_vtr['autofocus'])) && ($qr_vtr['autofocus'] != '')) {
$autofocus = $qr_vtr['autofocus'];
$body_onload = ' onLoad="document.'.$autofocus.'.focus()"';
//
} else {
$autofocus = '';
$body_onload = '';
}
// *******************************************
mysqli_close($cn_nme);
$db_nme = $db_au;
if (($st_cod != '') && ($st_cod != 'uc')) $db_nme = 'str-'.$st_cod;
$cn_nme = mysqli_connect($db_hst,$usn,$pwd,$db_nme) or die ("Errore PAGEDIN.09");
// 4) costruisco codice html per menu
if ($st_cod != 'uc') {
include ('menumin.php');
$html_menu = menumin($cn_nme,$st_cod,$st_tipo,$ar_var['lan'],$gruppo,$superutente);
} else {
include ('menu.php');
$html_menu = menu($cn_nme,$ar_var['lan'],$gruppo,$superutente);
}
// *******************************************
mysqli_close($cn_nme);
if ($fl_debug) echo ' ar_var[page_cod]='.$ar_var['page_cod'];
if ($fl_debug) echo ' script_inc='.$script_inc;
// INDIVIDUO EVENTUALE SCRIPT DI EDITING AD USO WEB-ADMIN
if ($fl_debug) echo '
cerco eventuale script di editing ad uso admin';
// nel caso separo codice pagina
if (strpos($script_inc,'?')) {
$ar_script = explode('?',$qr_vtr['script']);
$script_inc = $ar_script[0];
$ar_var['page_cod'] = $ar_script[1];
if ($fl_debug) echo ' TROVATO!';
}
if ($fl_debug) echo ' ar_var[page_cod]='.$ar_var['page_cod'];
// NEL CASO DI LOGIN AGGIUNGO WEBMASTER AD $AR_VAR (???)
$ar_var['webmaster'] = $ar_foot['webmaster'];
// if ('login.php' == $script_inc) $ar_var['webmaster'] = $ar_foot['webmaster'];
// BANNER per GDPR
if ($fl_debug) echo '
genero banner per GDPR';
switch ($_SESSION['baloo']['lan']) {
case 'en':
case 'de':
case 'es':
case 'fr':
$gdpr1 = 'AEIT websites place cookies on your device to give you the best user experience. By using AEIT websites, you agree to the placement of these cookies.';
$gdpr2 = 'Accept & Close';
$gdpr3 = 'To learn more, read AEIT Privacy Policy';
$gdpr4 = 'https://www.aeit.it/aeit/documenti/struttura/Privacy_AEIT.pdf';
break;
default:
$gdpr1 = 'I siti AEIT salvano alcuni cookie nel tuo dispositivo per migliorare la navigazione. Usando un sito AEIT accetti il salvataggio di tali cookie.';
$gdpr2 = 'Accetta & Chiudi';
$gdpr3 = 'Per saperne di più: leggi la Privacy Policy AEIT';
$gdpr4 = 'https://www.aeit.it/aeit/documenti/struttura/Privacy_AEIT.pdf';
break;
}
$html_gdpr = PHP_EOL;
$html_gdpr .= ''.PHP_EOL;
$html_gdpr .= ''.PHP_EOL;
// PREPARO CODICE HTML PER HEAD E BODY
include ('head.php');
include ('redbar.php');
include ('registrati.php');
include ('quality.php');
include ('riviste.php');
include ('banner.php');
include ('caani.php');
include ('social.php');
// include ('copyright.php');
// include ('greybar.php');
// *****************************
// COSTRUZIONE BODY TAG
$body_tag = $body_onload.' leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="'.$body_bgcolor.'"';
// *****************************
// COSTRUZIONE BODY CORE
// 1) includo script
include ($script_inc);
if ($fl_debug) echo ' incluso script: '.$script_inc;
// 2) divido path e isolo nome script
$ar_func = explode ('/',$script_inc);
$func = end($ar_func);
// 3) elimino estensione da nome e trovo nome funzione master
$master = substr($func,0,-4);
if ($fl_debug) echo '
*** script master='.$master.' *** ';
// 4) chiamo funzione master passando array zattera dati
if ($fl_debug) echo ' ar_var[page_cod]='.$ar_var['page_cod'];
$html_core = $master($ar_var);
// **************
$fl_stop = false;
if (('1' == $_SESSION['debug']) && ($master == $_SESSION['stop'])) $fl_stop = true;
// *****************************
// COSTRUZIONE HEAD CORE
// 1) titolo della pagina
if ($html_core['nome'] != '') {
$head_title = $ar_head['tab_title'].$html_core['nome'];
} else {
$head_title = '';
}
// 2) gestione Pragma no cache
switch ($codice) {
case 'home':
case 'iscrizioni':
case 'borse':
case 'convenzioni':
$head_nocache1 = '';
$head_nocache2 = '';
break;
default :
$head_nocache1 = '';
$head_nocache2 = '';
break;
}
// *****************************
// ECCEZIONE per gestire logout:
// in caso di logout master() attiva session_destroy()
// ed è pertanto necessario ripristinare ora:
// 1) il nome del sito web
// 2) la modalità di navigazione
// 3) la lingua
// 4) il consenso ai cookie
// usando le variabili private $web, $mob, $lan, $okc presenti in questo script
if ('../struttura/logout.php' == $script_inc) {
$_SESSION['baloo']['web'] = $web;
$_SESSION['baloo']['mob'] = $mob;
$_SESSION['baloo']['lan'] = $lan;
$_SESSION['baloo']['ok_cookie'] = $okc;
}
// *****************************
if ($_SESSION['baloo']['mob'] != '1') {
// *****************************
// LAYOUT CONVENZIONALE
// *****************************
if ($fl_debug) echo '
layout desktop';
$viewport = ''; // nella versione mobile serve per costruire meta tag in html head
$html_body = ''.PHP_EOL;
$html_body .= '
'.PHP_EOL;
// $html_body .= '
'.PHP_EOL;
/*
// WARNING COOKIE : se non è stato fatto clic su cancella banner visualizza warning.
if ($fl_debug) echo ' warning cookie';
if (($_SESSION['baloo']['ok_cookie'] != '1') && ('home' == $codice)) {
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
}
*/
// WARNING COOKIE
$html_body .= $html_gdpr;
if ($fl_debug) echo ' tabella principale contenitore';
$html_body .= '
'.PHP_EOL;
// TOP BAR
if ($fl_debug) echo ' top bar';
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
// EDGE SX
$html_body .= '
'.PHP_EOL;
// ****** BOX ********
$html_body .= '
'.PHP_EOL;
// $html_body .= '
'.PHP_EOL;
// $html_body .= '
';
// L1 - TESTA
if ($fl_debug) echo ' testata';
$html_body .= head($ar_head,$db_hst,$usn,$pwd,$db_au,$st_cod);
// L2 - BARRA LINGUA - SOCIAL
if ($fl_debug) echo ' redbar';
$blu = '';
if (isset($_SESSION['baloo']['blu'])) $blu = $_SESSION['baloo']['blu'];
if (isset($_SESSION['baloo']['super'])) $blu .= ' (web-admin)';
//$html_body .= redbar($ar_bar, $blu, $codice);
$html_body .= redbar($ar_bar, $blu, $ar_var);
// L3 - CORPO PRINCIPALE
if ($fl_debug) echo ' tabella contenuto';
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
// *************************
// MENU SX
if ($fl_debug) echo ' colonna menu sx';
$html_body .= '
'.$html_menu.'
'.PHP_EOL;
// *************************
// CONTENITORE CN
// (default 938px)
if ($fl_debug) echo ' colonna principale centro';
$html_body .= '
'.PHP_EOL;
if ($fl_debug) echo ' chiama registrati()';
$html_body .= registrati($lan).PHP_EOL;
if ($fl_debug) echo ' chiama caani()';
$html_body .= caani().PHP_EOL;
if ($fl_debug) echo ' chiama quality()';
$html_body .= quality().PHP_EOL;
if ($fl_debug) echo ' chiama riviste()';
$html_body .= riviste().PHP_EOL;
if ($fl_debug) echo ' chiama banner()';
$html_body .= banner($st_cod).PHP_EOL; // deve leggere banner locale
if ($fl_debug) echo ' fine colonna dx';
$html_body .= '
'.PHP_EOL;
$html_body .= ''.PHP_EOL;
// *********************************
// *** censuro Internet Explorer ***
// *********************************
if ('ie' == $_SESSION['baloo']['browser']) {
$html_body = '
'.PHP_EOL;
if ('en' == $_SESSION['baloo']['lan']) {
$html_body .= 'YOUR BROWSER IS OUTDATED AND NOT SUITABLE FOR THIS WEB SITE'.PHP_EOL;
} else {
$html_body .= 'QUESTO BROWSER E\' OBSOLETO E NON ADATTO PER QUESTO SITO WEB'.PHP_EOL;
}
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
$html_body .= '
'.PHP_EOL;
}
// *****************************
// FINE LAYOUT CONVENZIONALE
// *****************************
} else {
// *****************************
// LAYOUT MOBILE
// *****************************
if ($fl_debug) echo '
'.PHP_EOL;
/*
// WARNING COOKIE : se non è stato fatto clic su cancella banner visualizza warning.
if (($_SESSION['baloo']['ok_cookie'] != '1') && ('home' == $codice)) {
$info_cookie = 'Questo sito utilizza cookie tecnici per consentirti una navigazione più agevole. ';
$info_cookie .= 'I cookie potranno essere usati per memorizzare i dati di login e rendere automatico il Tuo riconoscimento nella sessione. ';
$info_cookie .= 'Se vuoi saperne di più clicca sul pulsante "Privacy". ';
$info_cookie .= 'Se accedi ad un qualunque elemento sottostante questo banner acconsenti all\'uso dei cookie.';
$html_body .= '
';
// L1 - TESTA
$html_body .= head($ar_head,$db_hst,$usn,$pwd,$db_au,$st_cod);
// L2 - BARRA LINGUA - SOCIAL
$blu = '';
if (isset($_SESSION['baloo']['blu'])) $blu = $_SESSION['baloo']['blu'];
if (isset($_SESSION['baloo']['super'])) $blu .= ' (web-admin)';
//$html_body .= redbar($ar_bar, $blu, $codice);
$html_body .= redbar($ar_bar, $blu, $ar_var);
*/
// L3 - CORPO PRINCIPALE
// *************************
// LOGO e MENU TOP
$html_body .= '
'.PHP_EOL;
if ($fl_debug) echo ' inserisco link a menu mobile';
$html_body .= '