<form action="salva_codice.php" method="POST" name="salva"> <input type="hidden" name="id_serata" value="<?php echo("$id"); ?>"> <?php echo("<table border=\"0\" align=\"center\" cellpadding=\"5\" style=\"background:red;\">"); while (list($id_serata,$locale_fld, $mese, $giorno, $anno, $foto, $id_img,$codice, $codice_db)=mysql_fetch_row($carica_serate2)) { $prova="img/serate/$anno/$mese/$giorno/$locale_fld/$foto"; list($width, $height, $type, $attr) = getimagesize("$prova"); if ($i==0) { echo("<tr>"); } echo("<td align=\"center\" valign=\"top\"><a href=\"#\" onClick=\"MyWindow2=window.open('galleria_foto.php ?id_serata=$id_serata&i=$prova','MyWindow2','toolb ar=no ,location=no,directories=no,status=no,menubar=no,s crollbars=yes,resizable=yes,width=700,height=650') ; return false;\">"); if ($width=="640") { $thumb = imagecreatetruecolor(150, 113); } else { if ($width=="480") { $thumb = imagecreatetruecolor(113, 150); } } $source = imagecreatefromjpeg($prova); if ($width=="640") { imagecopyresized($thumb, $source, 0, 0, 0, 0, 150, 113, $width, $height); } else { if ($width=="480") { imagecopyresized($thumb, $source, 0, 0, 0, 0, 113, 150, $width, $height); } } // Salvo l'immagine ridimensionata $foto_tmp=str_replace('.jpg','_tmp.jpg',$foto); //echo("FOTO-$foto_tmp"); $provax="img/serate/$anno/$mese/$giorno/$locale_fld/tmp/$foto_tmp"; imagejpeg($thumb, $provax, 70); echo("<img src=\"$provax\" border=\"1\"></a>"); $utente=$_SESSION['nome']; $profilo=$_SESSION['profilo']; // echo("$utente - $profilo"); if ((!empty ($_SESSION['nome'])) and ($_SESSION['profilo']=="P")) { if ($codice_db<>"") { echo("<p align=center><img src=\"img/codice_ok.png\" border=0 alt=\"SALVA\"></p>"); } else { echo("<p align=center><input type=\"hidden\" name=codice value=\"$codice\"><input type=\"submit\" value=\"Salva Codice\" class=\"but\"></a>"); echo(" <img src=\"img/codice.png\" border=0 alt=\"SALVA\"></p>"); } } echo("</td>"); echo("</form>"); $i++; if ($i==3) { $i=0; echo("</tr>"); } } } ?> </table>