Viewing file: grafica.php (43.18 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> <?php $this->HeaderStandard(); ?> <?php $this->codiciMonitoraggioGoogle()?> </head> <body class="stretched">
<!-- Document Wrapper ============================================= --> <div id="wrapper" class="clearfix"> <!--header --> <?php $this-> headerHTML() ?> <!--header end--> <!-- CONTENT AREA --> <?php corpo_pagina() ?> <!-- /CONTENT AREA --> <!--footer --> <?php $this->Footer()?> <!--footer end--> <!-- Go To Top ============================================= --> <div id="gotoTop" class="icon-angle-up"></div> <!-- script footer --> <?php $this->ScriptFooter(); if (function_exists('scriptFooterAggiuntivi')) scriptFooterAggiuntivi(); ?> <!-- script footer end -->
<script type="text/javascript"> var _iub = _iub || []; _iub.csConfiguration = {"askConsentAtCookiePolicyUpdate":true,"countryDetection":true,"enableLgpd":true,"enableUspr":true,"floatingPreferencesButtonDisplay":"bottom-left","lgpdAppliesGlobally":false,"perPurposeConsent":true,"reloadOnConsent":true,"siteId":2674991,"whitelabel":false,"cookiePolicyId":87838967,"lang":"it", "banner":{ "acceptButtonColor":"#1CC691","acceptButtonDisplay":true,"backgroundOverlay":true,"closeButtonDisplay":false,"customizeButtonDisplay":true,"explicitWithdrawal":true,"listPurposes":true,"position":"bottom","rejectButtonColor":"#E10F21","rejectButtonDisplay":true }}; </script> <script type="text/javascript" src="//cdn.iubenda.com/cs/gpp/stub.js"></script> <script type="text/javascript" src="//cdn.iubenda.com/cs/iubenda_cs.js" charset="UTF-8" async></script> </body> </html> <?php } function HeaderStandard() { ?> <!-- Basic --> <title><?php echo costantiP::TITOLO_GENERALE?> </title> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="description" content="<?php echo $this->description?>" /> <meta name="keywords" content="<?php echo $this->keywords?>" /> <meta name="content-language" content="<?php echo costantiP::LINGUA?>" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <?php 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" /> <?php 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"> <?php $menuAttivo=(costantiP::LINGUA=='it')?' current ':'' ?> <a href="<?php echo costantiP::BASE_URL?>it/index.php" class="<?php echo $menuAttivo?>">IT</a> . <?php $menuAttivo=(costantiP::LINGUA=='en')?' current ':'' ?> <a href="<?php echo costantiP::BASE_URL?>en/index.php" class="<?php echo $menuAttivo?>">EN</a> . <?php $menuAttivo=(costantiP::LINGUA=='de')?' current ':'' ?> <a href="<?php echo costantiP::BASE_URL?>de/index.php" class="<?php echo $menuAttivo?>">DE</a> . <?php $menuAttivo=(costantiP::LINGUA=='ru')?' current ':'' ?> <a href="<?php echo costantiP::BASE_URL?>ru/index.php" class="<?php echo $menuAttivo?>">RU</a> . <?php $menuAttivo=(costantiP::LINGUA=='jp')?' current ':'' ?> <a href="<?php echo costantiP::BASE_URL?>jp/index.php" class="<?php echo $menuAttivo?>">JA</a> . </div><!-- #top-language end --> <div id="logo"> <a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/index.php" class="standard-logo"><img src="../images/logo.png" alt="Logo"></a> <a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/index.php" class="retina-logo"><img src="../images/logo@2x.png" alt="Logo"></a> </div><!-- #logo end --> </div> <div id="header-wrap"> <!-- Primary Navigation ============================================= --> <nav id="primary-menu" class="style-2"> <div class="container clearfix">
<div id="primary-menu-trigger"><i class="icon-reorder"></i></div>
<ul> <?php $menuAttivo=($this->codicePagina==costantiP::CP_HOMEPAGE)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/index.php"><div><?php echo traduci('','HOME')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_MONASTERO)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/monastero.php"><div><?php echo traduci('','IL_MONASTERO')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_MUSEO)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/museo.php"><div><?php echo traduci('','MUSEO')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_STORE)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/store.php"><div><?php echo traduci('','STORE')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_AFFITTO)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/affitto.php"><div><?php echo traduci('','AFFITTO_SPAZI')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_TAVERNA)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/taverna.php"><div><?php echo traduci('','LA_TAVERNA')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_GALLERY)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/gallery.php"><div><?php echo traduci('','GALLERY')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_SPONSOR)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/sponsor.php"><div><?php echo traduci('','SPONSOR')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_HOTELTURISMO)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/turismo.php"><div><?php echo traduci('','HOTEL_E_TURISMO')?></div></a></li> <?php $menuAttivo=($this->codicePagina==costantiP::CP_NEWSEVENTI)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/newseventi.php"><div><?php echo traduci('','NEWS')?></div></a></li> <!-- <?php $menuAttivo=($this->codicePagina==costantiP::CP_RASSEGNA_STAMPA)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/rassegna_stampa.php"><div><?php echo traduci('','RASSEGNA_STAMPA')?></div></a></li> --> <?php $menuAttivo=($this->codicePagina==costantiP::CP_CONTATTI)?' current ':'' ?> <li class="<?php echo $menuAttivo?>"><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/contatti.php"><div><?php echo traduci('','CONTATTI')?></div></a></li> </ul> </div>
</nav><!-- #primary-menu end -->
</div>
</header><!-- #header end -->
<?php }
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><?php echo costantiP::RAGIONE_SOCIALE?><br><?php echo costantiP::TELEFONO?><br><a href="mailto:<?php echo costantiP::EMAIL_CONTATTO_PRINCIPALE?>"><?php echo costantiP::EMAIL_CONTATTO_PRINCIPALE?></a><br><?php echo costantiP::INDIRIZZO?><br><?php echo costantiP::INDIRIZZO2?></p> </div> </div> <div class="col-md-3 col-sm-2 col-xs-6 bottommargin-sm widget_links"> <ul> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/monsatero.php"><?php echo traduci('','IL_MONASTERO')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/museo.php"><?php echo traduci('','MUSEO')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/store.php"><?php echo traduci('','STORE')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/affitto.php"><?php echo traduci('','AFFITTO_SPAZI')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/taverna.php"><?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="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/gallery.php"><?php echo traduci('','GALLERY')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/sponsor.php"><?php echo traduci('','SPONSOR')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/turismo.php"><?php echo traduci('','HOTEL_E_TURISMO')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/blog.php"><?php echo traduci('','NEWS')?></a></li> <li><a href="<?php echo costantiP::BASE_URL.costantiP::LINGUA?>/rassegna_stampa.php"><?php echo traduci('','RASSEGNA_STAMPA')?></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-md-6"> <h4><?php echo traduci('','ORARI_FOOTER')?></h4> Copyrights © 2018-2024 All Rights Reserved by Museo Mille Miglia - P.Iva <?php echo costantiP::PIVA?> <div class="copyright-links"><a href="https://www.iubenda.com/privacy-policy/87838967" class="iubenda-nostyle no-brand iubenda-noiframe iubenda-embed iub-legal-only iubenda-noiframe " title="Privacy Policy ">Privacy</a><script type="text/javascript">(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener){w.addEventListener("load", loader, false);}else if(w.attachEvent){w.attachEvent("onload", loader);}else{w.onload = loader;}})(window, document);</script> & <a href="https://www.iubenda.com/privacy-policy/87838967/cookie-policy" class="iubenda-nostyle no-brand iubenda-noiframe iubenda-embed iubenda-noiframe " title="Cookie Policy ">Cookie Policy</a><script type="text/javascript">(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener){w.addEventListener("load", loader, false);}else if(w.attachEvent){w.attachEvent("onload", loader);}else{w.onload = loader;}})(window, document);</script> / <a href="http://www.clickitsolutions.it">Developed by Click It</a> / <a href="http://www.previcinidesign.com/">Designed by PreviciniDesign</a></div> </div> <div class="col-md-6 text-right"> <p style="font-size:10px"><?php echo traduci('','CONTRIBUTO_FOOTER')?></p> </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 }
function codiciMonitoraggioGoogle() { //analyitcs ?> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '<?php echo 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: <?php echo 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><?php echo 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><?php echo 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> <?php }
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 estraiStampa($anno,$order=-1) {global $grafica;
$conn = $grafica->Connessione; $limit2 = ''; $limit = ''; $or = ''; $orderBy = 'ordinamento ASC'; $limit2 = $limit; $stampaArray = array(); $where = ''; if ($anno != -1) { $where .= " and data_pubblicazione_inizio BETWEEN '".$anno."-01-01' AND '".$anno."-12-31'"; } if ($order!='-1') { if ($order=='date') { $orderBy = 'data_pubblicazione_inizio DESC'; } if ($order=='rand') { $orderBy = ' rand()'; }
}
$query = 'select stampa.id, stampa.data_pubblicazione_inizio, stampa.titolo_'.costantiP::LINGUA.' AS titolo, stampa.testo_'.costantiP::LINGUA.' AS testo, stampa.ordinamento, stampa.pubblicato, stampa.img, stampa.didascalia, stampa.allegato, stampa.testata from stampa where stampa.pubblicato = 1 '.$where.' order by '.$orderBy.' '.$limit2;
$result=mysqli_query($conn,$query); //echo $query; while ($row=mysqli_fetch_assoc($result)) { $stampaA['id']=$row['id']; $stampaA['data']=$row['data_pubblicazione_inizio']; $stampaA['titolo']=$row['titolo']; $stampaA['testo']=$row['testo']; $stampaA['img']=$row['img']; $stampaA['allegato']=$row['allegato']; $stampaA['testata']=$row['testata']; $stampaArray[]=$stampaA; } return $stampaArray; }
function estraiAnni() {global $grafica; $conn = $grafica->Connessione; $anni = array(); $query = 'select distinct YEAR ( data_pubblicazione_inizio ) AS anno from stampa where pubblicato = 1 order by YEAR ( data_pubblicazione_inizio ) desc'; $result=mysqli_query($conn,$query); while ($row=mysqli_fetch_assoc($result)) { $anno['anno']=$row['anno']; $anni[]=$anno; } return $anni; }
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="") { ?> <?php switch ($prodotto['id_categoria']) { case 1: $class = 'pf-congressi'; break; case 0: $class = 'pf-ristorazione'; break; default: $class = ''; } ?> <article class="portfolio-item <?php echo $class?>"> <div class="portfolio-image"> <a href="<?php echo $url?>?id=<?php echo $prodotto['id']?>"> <img src="<?php echo costantiP::BASE_URL.'archivio_img/img_o/'.$prodotto['img']?>" alt="Sala Congressi"> </a> <div class="portfolio-overlay"> <a href="<?php echo $url?>?id=<?php echo $prodotto['id']?>" class="right-icon"><i class="icon-line-plus"></i></a> </div> </div> <div class="portfolio-desc text-center"> <h3><?php echo $prodotto['titolo_prodotto'] ?></h3> <a href="<?php echo $url?>?id=<?php echo $prodotto['id']?>"><?php echo traduci('','VEDI_DETTAGLI_SALA')?></a> </div> </article> <?php } function stampaAnteprimaArticoli($contenuto,$url,$nProdottiRiga='4',$label="") {global $elencoConfigurazioniImmagini; $immagine = imgPubb ($elencoConfigurazioniImmagini[IMG_CROP_GALLERY_ELENCO_COMPLETO], $contenuto['img'], Timg::RESTITUISCI_URL_IMG ); ?> <div class="entry clearfix"> <?php if ($contenuto['allegato']!='') { ?> <div class="entry-image"> <a href="<?php echo costantiP::BASE_URL.'archivio_doc/'. $contenuto['allegato']?>" target="_blank"><img class="image_fade" src="<?php echo $immagine?>" alt="" /></a> </div> <?php } else {?> <div class="entry-image"> <img class="image_fade" src="<?php echo $immagine?>" alt="" /> </div> <?php } ?> <div class="entry-title"> <h2><?php echo $contenuto['titolo'] ?></h2> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> <?php echo estraiDataNews($contenuto['data'],1) ?></li> <li><i class="icon-folder-open"></i> <?php echo $contenuto['testata'] ?></li> </ul> <?php if ($contenuto['allegato']!='') { ?> <div class="entry-content"> <a href="<?php echo costantiP::BASE_URL.'archivio_doc/'. $contenuto['allegato']?>" class="more-link" target="_blank"><?php echo traduci('','LEGGI')?></a> </div> <?php } ?> </div> <?php }
function stampaAnteprimaNews($news,$url,$nProdottiRiga='4',$label="") { ?> <div class="entry clearfix"> <div class="entry-image"> <a href="<?php echo $url?>?id=<?php echo $news['id']?>"><img class="image_fade" src="<?php echo costantiP::BASE_URL.'archivio_img/img_o/'.$news['img']?>" alt="" /></a> </div> <div class="entry-title"> <h2><a href="<?php echo $url?>?id=<?php echo $news['id']?>"><?php echo $news['titolo'] ?></a></h2> </div> <ul class="entry-meta clearfix"> <li><i class="icon-calendar3"></i> <?php echo estraiDataNews($news['data'],1) ?></li> <li><i class="icon-folder-open"></i> <a href="<?php echo $url?>?id=<?php echo $news['id']?>">News</a></li> </ul> <div class="entry-content"> <p><?php echo TagliaStringa($news['testo'],190) ?></p> <a href="<?php echo $url?>?id=<?php echo $news['id']?>" class="more-link"><?php echo traduci('','LEGGI')?></a> </div> </div> <?php }
function stampaNewsRecenti($news,$url,$nProdottiRiga='4',$label="") { ?> <div class="spost clearfix"> <div class="entry-image"> <a href="<?php echo $url?>?id=<?php echo $news['id']?>" class="nobg"><img src="<?php echo costantiP::BASE_URL.'archivio_img/img_o/'.$news['img']?>" alt="" /></a> </div> <div class="entry-c"> <div class="entry-title"> <h4><a href="<?php echo $url?>?id=<?php echo $news['id']?>"><?php echo $news['titolo'] ?></a></h4> </div> <ul class="entry-meta"> <li><?php echo estraiDataNews($news['data'],1) ?></li> </ul> </div> </div> <?php } function stampaAnteprimaGallery($prodotto,$url,$nProdottiRiga='4',$label="") { ?> <?php switch ($prodotto['id_categoria']) { case 1: $class = 'pf-congressi'; break; case 0: $class = 'pf-ristorazione'; break; default: $class = ''; } ?> <article class="portfolio-item <?php echo $class?>"> <div class="portfolio-image"> <a href="<?php echo $url?>?id=<?php echo $prodotto['id']?>"> <img src="<?php echo costantiP::BASE_URL.'archivio_img/img_o/'.$prodotto['img']?>" alt="Sala Congressi"> </a> <div class="portfolio-overlay"> <a href="<?php echo $url?>?id=<?php echo $prodotto['id']?>" class="right-icon"><i class="icon-line-plus"></i></a> </div> </div> <div class="portfolio-desc text-center"> <h3><?php echo $prodotto['titolo_prodotto'] ?></h3> <a href="<?php echo $url?>?id=<?php echo $prodotto['id']?>"><?php echo traduci('','VEDI_IMMAGINI')?></a> </div> </article> <?php }
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=<?php echo $pagina-1?>">← <?php echo traduci('','NUOVI_POST')?> </a></li> <?php } } 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=<?php echo $pagina+1?>"><?php echo traduci('','VECCHI_POST')?>→</a></li> <?php } }?>
|