Viewing file: grafica_old.php (52.7 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
class Tgrafica
{
private $connessione;
public $Connessione;
private $db;
private $ErrDB;
public $titolo;
public $description;
public $keywords;
public $codiceBody;
public $login;
public $lMenu = true;
public $codicePagina;
public $FunzioneCorpo='';
function __construct($autopaint = true, $verificaLogin = true)
{
$encoding='utf-8';
//connessione al server
$this->Connessione = @mysqli_connect(costanti::DB_HOST, costanti::DB_USER, costanti::DB_PASSWORD);
//connessione al database
if ($this->Connessione)
{
$this->db = @mysqli_select_db($this->Connessione, costanti::DB_NAME);
@mysqli_query($this->Connessione,'SET NAMES \'' . $encoding . '\'');
@mysqli_query($this->Connessione,'SET character_set_results = \'utf8\', character_set_client = \'utf8\', character_set_connection = \'utf8\', character_set_database = \'utf8\', character_set_server = \'utf8\'');
@mysqli_set_charset( "utf8" );
}
if ($autopaint)
$this->Paint();
}
function __destruct()
{
if (isset($this->Connessione))
@mysqli_close($this->Connessione);
if (isset($this->db))
unset($this->db);
if (isset($this->Connessione))
unset($this->Connessione);
}
function Paint()
{
if ($this->FunzioneCorpo == '')
$this->StampaCorpo();
else
{
$FunzioneAlternativa = $this->FunzioneCorpo;
$FunzioneAlternativa();
}
}
function StampaCorpo($CodErrore = -2)
{
?>
<!doctype html>
<html >
<head>
<? $this->HeaderStandard(); ?>
<? $this->codiciMonitoraggioGoogle()?>
</head>
<body class="stretched">
<!-- Document Wrapper
============================================= -->
<div id="wrapper" class="clearfix">
<!--header -->
<? $this-> headerHTML() ?>
<!--header end-->
<!-- CONTENT AREA -->
<? corpo_pagina() ?>
<!-- /CONTENT AREA -->
<!--footer -->
<?$this->Footer()?>
<!--footer end-->
<!-- Go To Top
============================================= -->
<div id="gotoTop" class="icon-angle-up"></div>
<!-- script footer -->
<?$this->ScriptFooter();
if (function_exists('scriptFooterAggiuntivi'))
scriptFooterAggiuntivi();
?>
<!-- script footer end -->
<!--POPUP COVID-->
<!--<div class="demo-container" style="display: none">
<div class="demo-box">
In compliance with the municipal provisions following the Coronavirus alert, the museum will be <b> closed to the public until Sunday 01/03/2020 inclusive </b>. The offices will be operational with the usual hours 09.00-16.30. <br /> <br />
The <b> tavern </b> will be open for lunch only from 11.00 to 15.00. <br>
<br>
<strong> Saturday and Sunday </strong> all facilities will be closed.
</div>
</div>-->
</body>
</html>
<?
}
function HeaderStandard()
{
?>
<!-- Basic -->
<title><?=costantiP::TITOLO_GENERALE?> </title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="<?=$this->description?>" />
<meta name="keywords" content="<?=$this->keywords?>" />
<meta name="content-language" content="<?=costantiP::LINGUA?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?
if (function_exists('HeaderSeoAggiuntivi'))
HeaderSeoAggiuntivi();
?>
<!-- Stylesheets
============================================= -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,400i,700,700i" rel="stylesheet">
<link rel="stylesheet" href="../css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link rel="stylesheet" href="../css/dark.css" type="text/css" />
<link rel="stylesheet" href="../css/font-icons.css" type="text/css" />
<link rel="stylesheet" href="../css/animate.css" type="text/css" />
<link rel="stylesheet" href="../css/magnific-popup.css" type="text/css" />
<link rel="stylesheet" href="../css/privacy.css" type="text/css" />
<link rel="stylesheet" href="../css/responsive.css" type="text/css" />
<?
if (function_exists('headerAggiuntivi'))
HeaderAggiuntivi();
}
function headerHTML()
{
?>
<!-- Header
============================================= -->
<header id="header">
<div class="container clearfix">
<!-- Top Search
============================================= -->
<div id="top-search">
<a href="#" id="top-search-trigger"><i class="icon-search3"></i><i class="icon-line-cross"></i></a>
<form action="search.html" method="get">
<input type="text" name="q" class="form-control" value="" placeholder="Type & Hit Enter..">
</form>
</div><!-- #top-search end -->
<ul class="header-extras">
<li><a href="https://www.facebook.com/Museo1000Miglia" target="_blank"><i class="i-circled i-small icon-facebook"></i></a></li>
<li><a href="https://www.instagram.com/museo_mille_miglia/" target="_blank"><i class="i-circled i-small icon-instagram"></i></a></li>
</ul>
<div id="top-language">
<? $menuAttivo=(costantiP::LINGUA=='it')?' current ':'' ?>
<a href="<?=costantiP::BASE_URL?>it/index.php" class="<?echo $menuAttivo?>">IT</a> .
<? $menuAttivo=(costantiP::LINGUA=='en')?' current ':'' ?>
<a href="<?=costantiP::BASE_URL?>en/index.php" class="<?echo $menuAttivo?>">EN</a> .
<? $menuAttivo=(costantiP::LINGUA=='de')?' current ':'' ?>
<a href="<?=costantiP::BASE_URL?>de/index.php" class="<?echo $menuAttivo?>">DE</a> .
<? $menuAttivo=(costantiP::LINGUA=='ru')?' current ':'' ?>
<a href="<?=costantiP::BASE_URL?>ru/index.php" class="<?echo $menuAttivo?>">RU</a> .
<? $menuAttivo=(costantiP::LINGUA=='jp')?' current ':'' ?>
<a href="<?=costantiP::BASE_URL?>jp/index.php" class="<?echo $menuAttivo?>">JA</a> .
</div><!-- #top-language end -->
</div>
<div id="header-wrap">
<!-- Primary Navigation
============================================= -->
<nav id="primary-menu" class="style-2">
<div class="container clearfix">
<div id="logo">
<a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/index.php" class="standard-logo"><img src="../images/logo.png" alt="Logo"></a>
<a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/index.php" class="retina-logo"><img src="../images/logo@2x.png" alt="Logo"></a>
</div><!-- #logo end -->
<div id="primary-menu-trigger"><i class="icon-reorder"></i></div>
<ul>
<? $menuAttivo=($this->codicePagina==costantiP::CP_HOMEPAGE)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/index.php"><div><?echo traduci('','HOME')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_MONASTERO)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/monastero.php"><div><?echo traduci('','IL_MONASTERO')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_MUSEO)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/museo.php"><div><?echo traduci('','MUSEO')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_STORE)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/store.php"><div><?echo traduci('','STORE')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_AFFITTO)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/affitto.php"><div><?echo traduci('','AFFITTO_SPAZI')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_TAVERNA)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/taverna.php"><div><?echo traduci('','LA_TAVERNA')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_GALLERY)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/gallery.php"><div><?echo traduci('','GALLERY')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_SPONSOR)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/sponsor.php"><div><?echo traduci('','SPONSOR')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_HOTELTURISMO)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/turismo.php"><div><?echo traduci('','HOTEL_E_TURISMO')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_NEWSEVENTI)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/newseventi.php"><div><?echo traduci('','NEWS')?></div></a></li>
<? $menuAttivo=($this->codicePagina==costantiP::CP_CONTATTI)?' current ':'' ?>
<li class="<?=$menuAttivo?>"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/contatti.php"><div><?echo traduci('','CONTATTI')?></div></a></li>
</ul>
</div>
</nav><!-- #primary-menu end -->
</div>
</header><!-- #header end -->
<?
}
function Footer()
{
?>
<!-- Footer
============================================= -->
<footer id="footer">
<div class="container">
<!-- Footer Widgets
============================================= -->
<div class="footer-widgets-wrap clearfix">
<div class="col-md-5 col-sm-6 col-xs-12">
<div class="widget clearfix">
<img src="../images/logo.png" alt="" class="alignleft">
<p><?= costantiP::RAGIONE_SOCIALE?><br><?= costantiP::TELEFONO?><br><a href="mailto:<?= costantiP::EMAIL_CONTATTO_PRINCIPALE?>"><?= costantiP::EMAIL_CONTATTO_PRINCIPALE?></a><br><?= costantiP::INDIRIZZO?><br><?= costantiP::INDIRIZZO2?></p>
</div>
</div>
<div class="col-md-3 col-sm-2 col-xs-6 bottommargin-sm widget_links">
<ul>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/monsatero.php"><?echo traduci('','IL_MONASTERO')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/museo.php"><?echo traduci('','MUSEO')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/store.php"><?echo traduci('','STORE')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/affitto.php"><?echo traduci('','AFFITTO_SPAZI')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/taverna.php"><?echo traduci('','LA_TAVERNA')?></a></li>
</ul>
</div>
<div class="col-md-2 col-sm-2 col-xs-6 bottommargin-sm widget_links">
<ul>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/gallery.php"><?echo traduci('','GALLERY')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/sponsor.php"><?echo traduci('','SPONSOR')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/turismo.php"><?echo traduci('','HOTEL_E_TURISMO')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/blog.php"><?echo traduci('','NEWS')?></a></li>
<li><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/contatti.php"><?echo traduci('','CONTATTI')?></a></li>
</ul>
</div>
<div class="col-md-2 col-sm-2 col-xs-12 social_links">
<a href="https://www.instagram.com/museo_mille_miglia/" target="_blank"><i class="i-circled i-small icon-instagram"></i></a>
<a href="https://www.facebook.com/Museo1000Miglia" target="_blank"><i class="i-circled i-small icon-facebook"></i></a>
</div>
</div><!-- .footer-widgets-wrap end -->
</div>
<!-- Copyrights
============================================= -->
<div id="copyrights">
<div class="container clearfix">
<div class="col_full center">
<h4><?echo traduci('','ORARI_FOOTER')?></h4>
Copyrights © 2018 All Rights Reserved by Museo Mille Miglia - P.Iva <?= costantiP::PIVA?>
<div class="copyright-links"><a href="<?=costantiP::BASE_URL.costantiP::LINGUA?>/privacy-cookie-policy.php">Privacy and Cookie Policy</a> / <a href="http://www.clickitsolutions.it">Developed by Click It</a> / <a href="http://www.previcinidesign.com/">Designed by PreviciniDesign</a></div>
</div>
</div>
</div><!-- #copyrights end -->
</footer><!-- #footer end -->
</div><!-- #wrapper end -->
<?
}
function ScriptFooter()
{
?>
<!-- External JavaScripts
============================================= -->
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/plugins.js"></script>
<!-- Footer Scripts
============================================= -->
<script type="text/javascript" src="../js/functions.js"></script>
<?php
if(!isset($_COOKIE['eucookie']))
{ ?>
<div id="eucookielaw" >
<p><?echo traduci('','PRIVACY_FOOTER')?> <a id="more" href="privacy-cookie-policy.php"><strong>Privacy & Cookie Policy</strong></a>.</p>
<a id="removecookie"><div class="btn-cookie"><strong><?echo traduci('','PRIVACY_FOOTER_BUTTON')?></strong></div></a>
</div>
<?php } ?>
<?php
if(!isset($_COOKIE['eucookie']))
{ ?>
<script type="text/javascript">
function SetCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+";path=/"+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
</script>
<script type="text/javascript">
if( document.cookie.indexOf("eucookie") ===-1 ){
$("#eucookielaw").show();
}
$("#removecookie").click(function () {
SetCookie('eucookie','eucookie',365*10)
$("#eucookielaw").remove();
});
</script>
<?php }
$_SESSION['alertPopup']=session_id();
if (!isset($_COOKIE['alertPopup']) || $_COOKIE['alertPopup'] != session_id()){ ?>
<script type="text/javascript" src="../js/alert/jAlert.js"></script>
<script type="text/javascript" src="../js/alert/jAlert-functions.js"></script>
<link rel="stylesheet" href="../js/alert/jAlert.css" />
<!--POPUP COVID-->
<!--<script>
$(document).ready(function () {
$.jAlert({
'title': 'Chiusure straordinarie',
'blurBackground':true,
'content': $( "div.demo-container" ).html(),
'closeBtn': false,
'closeOnEsc': false,
'theme': 'red',
'btns': { 'text': 'Chiudi' }
});
});
SetCookie('alertPopup','<?=$_SESSION['alertPopup']?>',365*10);
</script>-->
<?
}
}
function codiciMonitoraggioGoogle()
{
//analyitcs
?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?=costanti::CODICE_ANALYTICS?>']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<?
//monitoraggio web
?>
<meta name="google-site-verification" content="XXXX" />
<?
}
}
function moduloContatti($testoMessaggio)
{
?>
<div id="box-contatti">
<h1>Richiedi informazioni</h1>
<div class="form">
<form id="ContactForm" method="POST" action="contatti_action.php">
<p><b>Nome e Cognome:</b></p>
<input class="input-text" type="text" name="nome" id="nome"/>
<p><b>Email:</b></p>
<input class="input-text" type="text" name="email" id="email"/>
<p><b>Telefono:</b></p>
<input class="input-text" type="text" name="telefono" id="telefono" />
<p><b>Messaggio:</b></p>
<textarea name="messaggio" id="messaggio" cols="30" rows="10" class="input-text" style="height:150px">Buongiorno, vi scrivo per chiedervi maggiori informazioni in merito alle calzature: <?=chr(13).chr(13).$testoMessaggio.chr(13).chr(13)?>Cordialmente</textarea>
<br clear="all" />
<br clear="all" />
<br clear="all" />
<p><a id="inline" href="#privacy">Leggi informativa sulla Privacy</a></p>
<div style="display:none"><div id="privacy"><h3>Informativa sulla Privacy</h3><p>Ai sensi del D. Lgs. 196/03, i dati raccolti verranno utilizzati esclusivamente per informare periodicamente in merito alle attività ed alle iniziative di <b><?=costantiP::RAGIONE_SOCIALE?></b> e non verranno diffusi a terzi.
<br /><br />
Il conferimento dei dati è facoltativo, tuttavia senza riferimenti personali non sarà possibile fornire i servizi richiesti. L'interessato può esercitare i diritti di cui all'art. 7 del D. Lgs. 196/03. Il titolare del trattamento dati è <b><?=costantiP::RAGIONE_SOCIALE?></b></p></div></div>
<p style="margin-top:7px;"><input name="" type="checkbox" value="" checked /> Acconsento</p>
<script type="text/javascript">
document.getElementById('nome').value=contattiNome;
</script>
<a href="#" class="link1" onClick="spedisci()"><div class="button"><span>Invia richiesta</span></div></a>
</form>
</div> <!--close box form-->
</div>
<?
}
function stampaData($data,$nGiorno)
{
dbdate_decode($data,$giorno,$mese,$anno);
$w=date('w',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$D=date('d',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$m=date('m',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$Y=date('Y',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$arr_set=array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
$arr_mesi=array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
$w = $arr_set[$w];
$m = $arr_mesi[(int)($m-1)];
$data = "".$w." ".$D." ".$m." ".$Y."";
return $data;
}
function stampaDataContratta($data,$nGiorno)
{
dbdate_decode($data,$giorno,$mese,$anno);
$w=date('w',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$D=date('d',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$m=date('m',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$Y=date('Y',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$arr_set=array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
$arr_mesi=array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
$w = $arr_set[$w];
$m = $arr_mesi[(int)($m-1)];
//$data = "".$w." ".$D." ".$m." ".$Y."";
$data = "".$D." ".$m."";
return $data;
}
function estraiMese($data,$nGiorno)
{
dbdate_decode($data,$giorno,$mese,$anno);
$w=date('w',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$D=date('d',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$m=date('m',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$Y=date('Y',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$arr_set=array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
$arr_mesi=array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
$w = $arr_set[$w];
$m = $arr_mesi[(int)($m-1)];
$data = "".$m." ".$Y."";
return $data;
}
function estraiDataNews($data,$nGiorno)
{
if ($data=='')
$data = date('Y-m-d');
dbdate_decode($data,$giorno,$mese,$anno);
$w=date('w',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$D=date('d',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$m=date('m',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$Y=date('Y',mktime(0,0,0,$mese,$giorno+($nGiorno-1),$anno));
$arr_set=array("Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato");
switch (costantiP::LINGUA) {
case "it":
$arr_mesi=array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
break;
case "en":
$arr_mesi=array("January","February","March","April","May","June","July","August","September","October","November","December");
break;
case "de":
$arr_mesi=array("Januar","Februar","März","April","Mai","Juni","Juni","August","September","Oktober","November","Dezember");
break;
case "ru":
$arr_mesi=array("Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь");
break;
case "jp":
$arr_mesi=array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
break;
default:
$arr_mesi=array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");
}
$w = $arr_set[$w];
$m = $arr_mesi[(int)($m-1)];
$data = $D." ".$m." ".$Y;
return $data;
}
function estraiCategorie()
{
$categorie = array();
$query = 'select
categorie.titolo_categoria_'.costantiP::LINGUA.' as titolo_categoria,
categorie.class,
categorie.id,
img,
img1,
img2
from
categorie
where
categorie.pubblicato = 1
order by
categorie.titolo_categoria_'.costantiP::LINGUA.' asc';
$result=mysql_query($query);
while ($row=mysql_fetch_assoc($result)) {
$categoria['id']=$row['id'];
$categoria['titolo_categoria']=$row['titolo_categoria'];
$categoria['class']=$row['class'];
$categoria['img']=$row['img'];
$categoria['img1']=$row['img1'];
$categoria['img2']=$row['img2'];
$categorie[]=$categoria;
}
return $categorie;
}
function estraiCategoria($idCat)
{
$sql = 'select
categorie.id,
categorie.titolo_categoria_'.costantiP::LINGUA.' as titolo_categoria,
categorie.class,
categorie.img,
categorie.codice,
categorie.desc_'.costantiP::LINGUA.' as descrizione,
categorie.fondo_'.costantiP::LINGUA.' as fondo,
categorie.corpo_'.costantiP::LINGUA.' as corpo,
categorie.maniglia_'.costantiP::LINGUA.' as maniglia
from
categorie
where
categorie.pubblicato = 1 and id ='.$idCat.'
order by
categorie.ordinamento desc';
//echo $sql;
GetRecord( $sql , $row);
return $row;
}
function estraiProdotti($idCat='-1',$idTipologia='-1',$pagina='0', $numeroRecordPerPagina='12', $order='-1',$price=null, $nContenutiDaEstrarre='0')
{global $grafica;
$conn = $grafica->Connessione;
$limit2 = '';
$limit = '';
//echo 'pagina:'.$pagina;
// echo 'nContenutiDaEstrarre:'.$nContenutiDaEstrarre;
//print_r($price);
$prezzoQ = '';
$or = '';
//echo 'count price: '.count($price);
if (count($price)>0)
{
foreach ($price as $prezzo)
{
switch ($prezzo[0]) {
case '1':
$or = '';
$prezzoQ .= " prezzo < 100";
break;
case '2':
if($prezzoQ != '')
$or = ' OR ';
$prezzoQ .= $or."prezzo between 100 AND 250 ";
break;
case '3':
if($prezzoQ != '')
$or = ' OR ';
$prezzoQ .= $or."prezzo between 250 AND 500 ";
break;
case '4':
if($prezzoQ != '')
$or = ' OR ';
$prezzoQ .= $or."prezzo between 500 AND 1000 ";
break;
case '5':
if($prezzoQ != '')
$or = ' OR ';
$prezzoQ .= $or."prezzo > 1000 ";
break;
}
}
}
if ($prezzoQ != '')
$prezzoQ = ' and ('.$prezzoQ.') ';
if ($nContenutiDaEstrarre>0)
$limit = ' limit 0,'.$nContenutiDaEstrarre;
else
{
// echo 'pagina:'.$pagina;
if ($pagina>0)
$limit=' limit '.(($pagina-1)*$numeroRecordPerPagina).','.$numeroRecordPerPagina;
//$limit=' limit '.(($this->pagina-1)*costantiP::NUMERO_RECORD_PAGINA_SMALL).','.costantiP::NUMERO_RECORD_PAGINA_SMALL;
}
$orderBy = 'ordinamento ASC';
$limit2 = $limit;
$prodotti = array();
$where = '';
if ($idCat!='-1')
$where = ' and prodotti.id_categoria = '.$idCat;
if ($idTipologia!='-1')
$where = ' and prodotti.id_tipologia_prodotto = '.$idTipologia;
if ($order!='-1')
{
if ($order=='price')
{
$orderBy = ' prezzo ASC';
}
if ($order=='price-desc')
{
$orderBy = ' prezzo DESC';
}
if ($order=='date')
{
$orderBy = ' data_pubblicazione_inizio DESC';
}
if ($order=='rand')
{
$orderBy = ' rand()';
}
}
$query = 'select
prodotti.id,
prodotti.id_categoria,
prodotti.titolo_prodotto_'.costantiP::LINGUA.' AS titolo,
prodotti.testo_'.costantiP::LINGUA.' AS testo,
prodotti.capienza_'.costantiP::LINGUA.' AS capienza,
prodotti.utilizzo_'.costantiP::LINGUA.' AS utilizzo,
prodotti.dotazioni_'.costantiP::LINGUA.' AS dotazioni,
prodotti.servizi2_'.costantiP::LINGUA.' AS servizi2,
prodotti.ordinamento,
prodotti.pubblicato,
prodotti.img
from
prodotti
where
prodotti.pubblicato = 1 '.$where.$prezzoQ.'
order by '.$orderBy.' '.$limit2;
$result=mysqli_query($conn, $query);
//echo $query;
while ($row=mysqli_fetch_assoc($result)) {
$prodotto['id']=$row['id'];
$prodotto['id_categoria']=$row['id_categoria'];
$prodotto['titolo_prodotto']=$row['titolo'];
$prodotto['capienza']=$row['capienza'];
$prodotto['utilizzo']=$row['utilizzo'];
$prodotto['dotazioni']=$row['dotazioni'];
$prodotto['servizi2']=$row['servizi2'];
$prodotto['testo']=$row['testo'];
$prodotto['img']=$row['img'];
$prodotti[]=$prodotto;
}
return $prodotti;
}
function estraiNews($idCat='-1',$idTipologia='-1',$pagina='0', $numeroRecordPerPagina='12', $order='-1',$price=null, $nContenutiDaEstrarre='0')
{global $grafica;
$conn = $grafica->Connessione;
$limit2 = '';
$limit = '';
//echo 'pagina:'.$pagina;
// echo 'nContenutiDaEstrarre:'.$nContenutiDaEstrarre;
//print_r($price);
$or = '';
if ($nContenutiDaEstrarre>0)
$limit = ' limit 0,'.$nContenutiDaEstrarre;
else
{
//echo 'pagina:'.$pagina;
if ($pagina>0)
$limit=' limit '.(($pagina-1)*$numeroRecordPerPagina).','.$numeroRecordPerPagina;
//$limit=' limit '.(($this->pagina-1)*costantiP::NUMERO_RECORD_PAGINA_SMALL).','.costantiP::NUMERO_RECORD_PAGINA_SMALL;
//echo $limit.'<br />';
}
$orderBy = 'ordinamento ASC';
$limit2 = $limit;
$prodotti = array();
$newsArray = array();
$where = '';
if ($idCat!='-1')
$where = ' and news.id_categoria = '.$idCat;
if ($idTipologia!='-1')
$where = ' and news.id_tipologia_prodotto = '.$idTipologia;
if ($order!='-1')
{
if ($order=='date')
{
$orderBy = 'data_pubblicazione_inizio DESC';
}
if ($order=='rand')
{
$orderBy = ' rand()';
}
}
$query = 'select
news.id,
news.id_categoria,
news.data_pubblicazione_inizio,
news.titolo_'.costantiP::LINGUA.' AS titolo,
news.testo_'.costantiP::LINGUA.' AS testo,
news.ordinamento,
news.pubblicato,
news.img,
news.didascalia
from
news
where
news.pubblicato = 1 '.$where.'
order by '.$orderBy.' '.$limit2;
$result=mysqli_query($conn,$query);
//echo $query;
while ($row=mysqli_fetch_assoc($result)) {
$news['id']=$row['id'];
$news['id_categoria']=$row['id_categoria'];
$news['data']=$row['data_pubblicazione_inizio'];
$news['titolo']=$row['titolo'];
$news['testo']=$row['testo'];
$news['img']=$row['img'];
$news['didascalia']=$row['didascalia'];
$newsArray[]=$news;
}
return $newsArray;
}
function estraiProdotto($idProd)
{global $grafica;
$conn = $grafica->Connessione;
$query = 'select
prodotti.*
from
prodotti
where
prodotti.pubblicato = 1 and prodotti.id = '.$idProd.'
';
//echo $query;
$result=mysqli_query($conn, $query);
GetRecord($query , $row);
return $row;
}
function estraiNewsDettaglio($idNews)
{global $grafica;
$conn = $grafica->Connessione;
$query = 'select
news.*
from
news
where
news.pubblicato = 1 and news.id = '.$idNews.'
';
//echo $query;
$result=mysqli_query($conn,$query);
GetRecord($query , $row);
return $row;
}
//NEWS PIU RECENTE
function estraiNewsPrec($data_pubblicazione_inizio, $idNews)
{global $grafica;
$conn = $grafica->Connessione;
$orderBy = 'data_pubblicazione_inizio ASC';
$query = 'select
news.id,
news.titolo_'.costantiP::LINGUA.' AS titolo
from
news
where
news.pubblicato = 1 and news.id <> '.$idNews.' and data_pubblicazione_inizio > "'.$data_pubblicazione_inizio.'" ORDER BY '.$orderBy.' LIMIT 1';
$result=mysqli_query($conn,$query);
if (GetRecord($query , $row))
{
echo '<a href="dettaglio_newseventi.php?id='.$row['id'].'">⇐ '.$row['titolo'].'</a>';
}
else
{
echo ' ';
}
}
//NEWS PIU VECCHIA
function estraiNewsSucc($data_pubblicazione_inizio, $idNews)
{global $grafica;
$conn = $grafica->Connessione;
$orderBy = 'data_pubblicazione_inizio DESC';
$query = 'select
news.id,
news.titolo_'.costantiP::LINGUA.' AS titolo
from
news
where
news.pubblicato = 1 and news.id <> '.$idNews.' and data_pubblicazione_inizio < "'.$data_pubblicazione_inizio.'" ORDER BY '.$orderBy.' LIMIT 1';
$result=mysqli_query($conn,$query);
if (GetRecord($query , $row))
{
echo '<a href="dettaglio_newseventi.php?id='.$row['id'].'">'.$row['titolo'].' ⇒</a>';
}
else
{
echo ' ';
}
}
function estraiImmaginiProdotto($idProd)
{global $grafica;
$conn = $grafica->Connessione;
$immagini = array();
$sql = 'select
galleria.id,
galleria.titolo,
galleria.img
from
galleria
where
galleria.id_prodotto ='.$idProd;
$result=mysqli_query($conn, $sql);
while ($row=mysqli_fetch_assoc($result)) {
$immagine['id']=$row['id'];
$immagine['titolo']=$row['titolo'];
$immagine['img']=$row['img'];
$immagini[]=$immagine;
}
return $immagini;
}
function stampaAnteprimaProdotto($prodotto,$url,$nProdottiRiga='4',$label="")
{
?>
<?
switch ($prodotto['id_categoria']) {
case 1:
$class = 'pf-congressi';
break;
case 0:
$class = 'pf-ristorazione';
break;
default:
$class = '';
}
?>
<article class="portfolio-item <?echo $class?>">
<div class="portfolio-image">
<a href="<?echo $url?>?id=<?echo $prodotto['id']?>">
<img src="<?echo costantiP::BASE_URL.'archivio_img/img_o/'.$prodotto['img']?>" alt="Sala Congressi">
</a>
<div class="portfolio-overlay">
<a href="<?echo $url?>?id=<?echo $prodotto['id']?>" class="right-icon"><i class="icon-line-plus"></i></a>
</div>
</div>
<div class="portfolio-desc text-center">
<h3><?echo $prodotto['titolo_prodotto'] ?></h3>
<a href="<?echo $url?>?id=<?echo $prodotto['id']?>"><?echo traduci('','VEDI_DETTAGLI_SALA')?></a>
</div>
</article>
<?
}
function stampaAnteprimaNews($news,$url,$nProdottiRiga='4',$label="")
{
?>
<div class="entry clearfix">
<div class="entry-image">
<a href="<?echo $url?>?id=<?echo $news['id']?>"><img class="image_fade" src="<?echo costantiP::BASE_URL.'archivio_img/img_o/'.$news['img']?>" alt="" /></a>
</div>
<div class="entry-title">
<h2><a href="<?echo $url?>?id=<?echo $news['id']?>"><?echo $news['titolo'] ?></a></h2>
</div>
<ul class="entry-meta clearfix">
<li><i class="icon-calendar3"></i> <?echo estraiDataNews($news['data'],1) ?></li>
<li><i class="icon-folder-open"></i> <a href="<?echo $url?>?id=<?echo $news['id']?>">News</a></li>
</ul>
<div class="entry-content">
<p><?echo TagliaStringa($news['testo'],190) ?></p>
<a href="<?echo $url?>?id=<?echo $news['id']?>" class="more-link"><?echo traduci('','LEGGI')?></a>
</div>
</div>
<?
}
function stampaNewsRecenti($news,$url,$nProdottiRiga='4',$label="")
{
?>
<div class="spost clearfix">
<div class="entry-image">
<a href="<?echo $url?>?id=<?echo $news['id']?>" class="nobg"><img src="<?echo costantiP::BASE_URL.'archivio_img/img_o/'.$news['img']?>" alt="" /></a>
</div>
<div class="entry-c">
<div class="entry-title">
<h4><a href="<?echo $url?>?id=<?echo $news['id']?>"><?echo $news['titolo'] ?></a></h4>
</div>
<ul class="entry-meta">
<li><?echo estraiDataNews($news['data'],1) ?></li>
</ul>
</div>
</div>
<?
}
function stampaAnteprimaGallery($prodotto,$url,$nProdottiRiga='4',$label="")
{
?>
<?
switch ($prodotto['id_categoria']) {
case 1:
$class = 'pf-congressi';
break;
case 0:
$class = 'pf-ristorazione';
break;
default:
$class = '';
}
?>
<article class="portfolio-item <?echo $class?>">
<div class="portfolio-image">
<a href="<?echo $url?>?id=<?echo $prodotto['id']?>">
<img src="<?echo costantiP::BASE_URL.'archivio_img/img_o/'.$prodotto['img']?>" alt="Sala Congressi">
</a>
<div class="portfolio-overlay">
<a href="<?echo $url?>?id=<?echo $prodotto['id']?>" class="right-icon"><i class="icon-line-plus"></i></a>
</div>
</div>
<div class="portfolio-desc text-center">
<h3><?echo $prodotto['titolo_prodotto'] ?></h3>
<a href="<?echo $url?>?id=<?echo $prodotto['id']?>"><?echo traduci('','VEDI_IMMAGINI')?></a>
</div>
</article>
<?
}
function estraiCategorieProdotti()
{
$categorieProdotti = estraiCategorie();
$prodotti = array();
foreach ($categorieProdotti as $categoria)
{
$query = 'select
prodotti.titolo_prodotto_'.costantiP::LINGUA.' AS titolo_prodotto,
prodotti.id
from
prodotti
where
prodotti.pubblicato = 1 and prodotti.id_categoria = '.$categoria['id'].'
order by
prodotti.ordinamento asc';
$result=mysql_query($query);
while ($row=mysql_fetch_assoc($result)) {
$prodotto['id']=$row['id'];
$prodotto['titolo_prodotto']=$row['titolo_prodotto'];
$prodotti[]=$prodotto;
}
$categorieProdotti['prodotti'] = $prodotti;
}
//return $categorieProdotti;
}
function paginaPrecedente($pagina)
{
$sql = 'select count(id) as numero from news where pubblicato = 1';
$numero = getFieldValue($sql,'numero');
$nPagine = (int)($numero / 1);
if (($pagina>1) && ($pagina<=$nPagine))
{
?>
<li class="previous"><a href="newseventi.php?p=<?echo $pagina-1?>">← <?echo traduci('','NUOVI_POST')?> </a></li>
<?
}
}
function paginaSuccessiva($pagina)
{
$sql = 'select count(id) as numero from news where pubblicato = 1';
$numero = getFieldValue($sql,'numero');
$nPagine = (int)($numero / 1);
if (($pagina>=1) && ($pagina<$nPagine))
{
?>
<li class="next"><a href="newseventi.php?p=<?echo $pagina+1?>"><?echo traduci('','VECCHI_POST')?>→</a></li>
<?
}
}
?>
|