// #### DATI DI CONNESSIONE AL DB #### $db_host = "localhost"; $db_user = "juniortennis"; $db_password = "tRY423das9"; $db_name = "juniortennis_db"; $connessione = mysql_connect($db_host, $db_user, $db_password) or die("Connessione non riuscita: " . mysql_error()); mysql_select_db($db_name, $connessione) or die ("Errore nella selezione del database. Verificare i parametri nel file config.inc.php"); ?> function creaImmagineADM($testo,$BGcolor,$TXTcolor,$font_size,$larghezza,$altezza) { //if ($font_size="") $font_size = 18; $font = "../include/TCM_____.TTF"; include("config.inc.php"); //$larghezza = 200; //$altezza = 37; $im = imagecreate($larghezza,$altezza); //PRENDO IL COLORE DELLO SFONDO PASSATO E LO SCOMPONGO IN RGB $bg1=$BGcolor[1].$BGcolor[2]; $bg2=$BGcolor[3].$BGcolor[4]; $bg3=$BGcolor[5].$BGcolor[6]; $bg1=hexdec($bg1); $bg2=hexdec($bg2); $bg3=hexdec($bg3); //PRENDO IL COLORE DEL TESTO PASSATO E LO SCOMPONGO IN RGB $txt1=$TXTcolor[1].$TXTcolor[2]; $txt2=$TXTcolor[3].$TXTcolor[4]; $txt3=$TXTcolor[5].$TXTcolor[6]; $txt1=hexdec($txt1); $txt2=hexdec($txt2); $txt3=hexdec($txt3); //assegno i colori $background = imagecolorallocate($im, $bg1, $bg2, $bg3); $textcolor = imagecolorallocate($im, $txt1, $txt2, $txt3); //$textcolor = imagecolorallocate($im, 0xff, 0xff, 0xff); //creo il clore di sfonto imagefilledrectangle($im, 0, 0, $larghezza, $altezza, $background); //scrivo il testo //$font_size = 20; imagettftext($im, $font_size, 0,10,25, $textcolor , $font, $testo); //salvo l'immagine imagegif($im, "../images/style/img_".$testo.".gif"); imagedestroy($im); } function showmessage($testo) { ?> } function alt_color($color) { $color1 = "FFCC00"; $color2 = "FFCC66"; $color = ($color == $color1) ? $color2 : $color1; return $color; } function getEXT($file) //toglie l'estensione al file $file { $cut = substr($file, -3); return($cut); } function cutEXT($file) //toglie l'estensione al file $file { $cut = substr($file, 0,-4); return($cut); } function DateToSQL($data) { $temp=$data[6].$data[7].$data[8].$data[9]."-".$data[3].$data[4]."-".$data[0].$data[1]; return($temp); } function SQLtoDate($data) { $temp=$data[8].$data[9]."/".$data[5].$data[6]."/".$data[0].$data[1].$data[2].$data[3]; return($temp); } function redirect ($indirizzo) { ?> } function upload($file_name,$destinazione,$fileName) { //echo "upload $destinazione$fileName"; //echo "Il file esiste...
"; $file = $_FILES[$file_name]; if($file['error'] == UPLOAD_ERR_OK and is_uploaded_file($file['tmp_name'])) { $f=$file['name']; $estensione =getEXT($f); $file['name']=$fileName; move_uploaded_file($file['tmp_name'], $destinazione.$file['name']); //echo "FATTO!"; } return $file; } function ridimensiona($img,$dest,$thumbWidth,$thumbHeight) { echo "or : $img - dest: $dest "; $thumbComp = 90; // livello di compressione della miniatura $thumb = imagecreatetruecolor($thumbWidth, $thumbHeight) or die("Impossibile creare la miniatura"); $ext = strtoupper(getEXT($img)); if ($ext=="JPG") $src = imagecreatefromjpeg($img) or die ("Impossibile aprire l'immagine originale"); if ($ext=="GIF") $src = imagecreatefromgif($img) or die ("Impossibile aprire l'immagine originale"); if ($ext=="PNG") $src = imagecreatefrompng($img) or die ("Impossibile aprire l'immagine originale"); imagecopyresized($thumb, $src, 0, 0, 0, 0, $thumbWidth, $thumbHeight, imageSx($src), imageSy($src)) or die("Impossibile ridimensionare l'immagine"); if ($ext=="JPG") imagejpeg($thumb, $dest, $thumbComp) or die ("Impossibile salvare la miniatura"); if ($ext=="GIF") imagegif($thumb, $dest, $thumbComp) or die ("Impossibile salvare la miniatura"); if ($ext=="PNG") imagepng($thumb, $dest, $thumbComp) or die ("Impossibile salvare la miniatura"); // imagejpeg($thumb, $dest, $thumbComp) or die("Impossibile salvare la miniatura"); } function messaggio($idMessaggio,$idlingua) { include_once ("config.inc.php"); $query="select a.id, a.content as ita, b.content as testo from tblMessaggi a, tblMessaggi b where a.id=b.idRif and a.idlingua=1 and b.idlingua=$idlingua and a.id=$idMessaggio"; // echo $query; $result_msg = mysql_query($query); while ($msg = mysql_fetch_array ($result_msg)) { $messaggio=$msg[testo]; } return($messaggio); } function actionCarrello($idSessione) { $ts = time(); $query="UPDATE tblCarrello set timestamp='$ts' where idSessione='$idSessione'"; echo $query; mysql_query($query); } function verificaCarrello() { $ts=time(); $ts-=900; // 10 minuti $query="DELETE FROM tblCarrello where timestamp<$ts"; $resultSessioni = mysql_query($query); } function scorriPage($pagina,$prodotti,$passo,$rif) { $idLingua = $_GET['idlingua']; $last = $pagina -1; $next = $pagina +1; if ($pagina>1) { echo "
Pagina Precedente
"; } echo " "; //echo "pagina : $pagina ; prodotti : $prodotti --->next : $next"; if (($passo*$pagina)<$prodotti) { echo "
Pagina Successiva
";} } ?>
Home
SocietÃ
Centro Sportivo
Dove
Rassegna Stampa
Contatti
Area Sponsor
Link Esterni
ESTATENNIS
CORSI
TORNEI EVENTI
AGONISTICA
STAFF
PHOTO GALLERY
AREA SOCI
PRENOTAZIONE CAMPI
Calcetto
Bar
SOLBIATE CO. Loc. CONCAGNO
Casale Casa Rossa
Tel. +39 347 7744361