query($sql_scheda) or die ("MySql dice: ". $mysqli_obj->error); if ($result_scheda->num_rows>0) { $row=$result_scheda->fetch_array(); $titolo=ucwords($row['titolo']); $tabella=$row['tabella']; if ($titolo_img=="") { $titolo_img=$row['titolo_img']; } //$sotto_titolo=ucwords($tabella). " - " .ucwords($regione); } // query di tutte le immagini $sql="select * from media_tusci where codice=$codice and tabella='$tabella' order by ordine"; //echo $sql; $result=$mysqli_obj->query($sql) or die ("MySql dice: ". $mysqli_obj->error); // output html della galleria $percorso="../../galleria/".$tabella; $num_rows=$result->num_rows; if ($num_rows>0) { $num_ele=0; //echo "num records ".$result->num_rows; //$gallery=''; $document_root=$_SERVER['DOCUMENT_ROOT']; $dir=dirname($_SERVER['PHP_SELF']); //$percorso=$document_root."/".$dir."/../imm_preview/tours/".$tabella."/".$codice; $percoros_rel="../../galleria/".$tabella; $percoros=$percoros_rel; if ($num_pagina=="" ) { if ($pos_foto!="") { $num_pagina=ceil($pos_foto/$foto_x_pag); } else { $num_pagina=1; $pos_foto=1; } } $start_foto=($num_pagina-1)*$foto_x_pag; if ($pos_foto=="") { $pos_foto=$start_foto; } if ($pos_foto<=0) { $pos_foto=1; } if ($result->data_seek($start_foto)) { for ($prg_foto=$start_foto;$prg_foto<($start_foto+$foto_x_pag) && $prg_foto<$num_rows ;$prg_foto++) { $row=$result->fetch_array(); if ($num_ele % $num_colonne ==0) { $gallery.=''; } $num_ele++; $nome_file=$row['nome_file']; //echo "$percorso/$nome_file
"; if (file_exists($percorso."/thumb/".$nome_file)) { list($width, $height, $type, $attr) =getimagesize($percorso."/thumb/".$nome_file); $gallery.='ingrandisci'; } if ($num_ele % $num_colonne ==0) { $gallery.=''; } } } } // controllo limiti $gest_avanti_indietro=new gest_avanti_indietro (); $gest_avanti_indietro->pos_elemento=$pos_foto; $gest_avanti_indietro->num_rows=$num_rows; $gest_avanti_indietro->calcola(); $pos_indietro=$gest_avanti_indietro->pos_indietro; $pos_avanti=$gest_avanti_indietro->pos_avanti; // require_once("../../classi/classi.img.php"); $immagine=new immagine(); if ($result->data_seek($pos_foto-1)) { $row=$result->fetch_array(); $nome_file=$row['nome_file']; $img_primo_piano=$percoros_rel."/foto/".$nome_file; //echo $img_primo_piano; $abs_img_primo_piano=$percorso."/foto/".$nome_file; //echo $abs_img_primo_piano; if (file_exists($abs_img_primo_piano)) { list($width, $height, $type, $attr) =getimagesize($abs_img_primo_piano); $immagine->resize($width,$height); $height=$immagine->resized_height; $width=$immagine->resized_width; } else { $img_primo_piano=""; } } // $href_indietro="?pos_foto=$pos_indietro&codice=$codice"; $href_avanti="?pos_foto=$pos_avanti&codice=$codice"; $home_page_gallery=""; } else { $http=$_SERVER['HTTP_USER_AGENT']; if (strpos(strtolower($http),"msie")>0) { $ie=TRUE; } if ($ie==TRUE) { $span_open=""; $span_close=""; } else { $span_open=""; $span_close=""; } $titolo_img="photo_gallery.gif"; // Home Page Gallery $gallery="$span_open$span_close

"; $gallery.="$span_open
$span_close

"; $gallery.="$span_open
$span_close

"; $gallery.="$span_open
$span_close

"; } echo ' Hotel nella Maremma Toscana tra natura mare e benessere - Corte dei Tusci
'; echo ''; if ($codice!="") { echo ' '; } else { echo ' '; } //if ($codice!="") //{ echo ''; //} echo '
   Foto gallery - Corte dei Tusci - Village Palace, Puntone Toscana
Corte dei Tusci
Corte dei Tusci
'; if ($codice!="") { echo '
'; } echo ''; } $gallery_prev.=''; echo $gallery_prev; echo '
'; // tasti sopra if ($pos_indietro<$pos_foto) { $gallery_prev.='back'; } else { $gallery_prev.=" "; } if ($codice!="") { $gallery_prev.=' '.($pos_foto).' of '.$num_rows.' images'; if ($pos_avanti>$pos_foto) { $gallery_prev.='next'; } else { $gallery_prev.=" "; } $gallery_prev.='
'; if ($codice!="") { echo '
'; $img_torna_home=str_repeat(" ",12).""; } echo ' '; if ($codice!="" && $voce_tlb1_img!="") { echo ''; // echo ' // // '; } echo ''; if ($codice!="") { echo '
'; } echo '
Foto gallery'.$img_torna_home.'
'.$voce_tlb1_alt.'
'.$voce_tlb1_alt.''.$voce_tlb2_alt.''.$voce_tlb3_alt.'
'; if ($codice!="") { echo '
'; } echo ''; echo $gallery; echo '
'; ?>