Certo! posto la parte della pagina corpo.php:
Codice PHP:
// 3 - Form seleziona foto
if($option==3){
$txt='<table class="testo" border="0" width="100%">';
$max=15;
$query="SELECT COUNT(id) as tot
FROM ".$dbname.".upload
WHERE utente='".$_SESSION['id']."' AND utente_select=0";
$ris=mysql_query($query) or die(mysql_error());
$conta=mysql_fetch_array($ris);
if($conta['tot']>0){
$txt.='<tr>
<td class="testo" align="right" colspan="3">Selezionare barrando l\'apposita casella le immagine che si vogliono utilizzare.
Una volta eseguita la scelta delle immagini, confermare l\'operazione cliccando il pulsante "CONFERMA".
Riceverete una mail con le indicazioni per lo scaricamento delle immagini in alta risoluzione.
</td>
</tr>
<tr>
<td height="10" colspan="5"><hr></td>
</tr>
<tr><form id="cancella" name="cancella" method="POST" action="utente.php?option=4"> ';
if(!isset($_GET['limit']))
$_GET['limit']=0;
$i=0;
$u=0;
$query="SELECT * FROM ".$dbname.".upload
WHERE utente=".$_SESSION['id']." AND utente_select=0";
$ris=mysql_query($query) or die(mysql_error());
while($foto=mysql_fetch_array($ris)){
if($i==3){
$txt.='</tr>
<tr>
<td height="20" colspan="5"><hr></td>
</tr>
<tr>';
$i=0;
}
$file="../public/small/resized_".$foto['nome']."";
$vett=getimagesize($file); //funzione per recuperare le dimensioni dell'immagine (creazione popup)
$width=$vett[0]+50; //definire la larghezza
$height=$vett[1]+150; //definire l'altezza
$txt.='<td align="center" width="140">'.$foto['nome'].'
<a href="#" onClick="popup(\'foto.php?id='.$foto['id'].'\', \''.$foto['id'].'\', '.$width.', '.$height.');">
[img]../public/small/resized_'.$foto['nome'].'[/img]</a>
Seleziona <input type="checkbox" name="select[]" value="'.$foto['id'].'">
';
$i++;
}
$txt.='</tr>
<tr>
<td height="5" colspan="5"><hr></td>
</tr>
<tr>
<td colspan="5" align="center"></td>
</tr>
<tr>
<td colspan="5" align="center">
';
$txt.='<input name="submit" value="Conferma" type="image" src="image/submit.gif"
onmouseover="this.src=\'image/submit2.gif\'" onmouseout="this.src=\'image/submit.gif\'" >
ATTENZIONE
L\'avvenuta operazione conferma l\'utilizzo dell\'immagine,
verrà quindi emesso relativo consuntivo con gli estremi di pagamento.
</td>
</tr>
</form>
</table>';
}else{
$txt.='<tr>
<td height="5" align="center">[img]image/attenzione2.jpg[/img]</td>
</tr>
<tr>
<td height="15" align="center"></td>
</tr>
<tr>
<td height="5" align="center">Non sono presenti foto caricate.
Scegliere dal menù a sinistra un\'opzione per continuare</td>
</tr>
</form>
</table>';
}
echo $txt;
}
// 4 - Query seleziona foto
if($option==4){
include('pclzip.lib.php');
$zipname=md5($_SESSION['id']);
$archivio = new PclZip('../public/'.$zipname.'.zip');
$elenco='';
$array=array();
$i=1;
foreach($_POST['select'] as $chiave=>$valore){
$query="SELECT nome FROM ".$dbname.".upload WHERE id='".$_POST['select'][$chiave]."'";
$ris=mysql_query($query) or die(mysql_error());
$foto=mysql_fetch_array($ris);
$query3="SELECT * FROM ".$dbname.".utenti WHERE id='".$_SESSION['id']."'";
$ris3=mysql_query($query3) or die(mysql_error());
$cliente=mysql_fetch_array($ris3);
if(file_exists("../public/".$foto['nome']."")){
$query2="UPDATE ".$dbname.".upload
SET utente_select=1
WHERE id='".$_POST['select'][$chiave]."'";
$ris2=mysql_query($query2) or die(mysql_error());
}
$elenco.='../public/'.$foto['nome'].',';
$array[$i]=$foto['nome'];
$i++;
$v_list = $archivio->create($elenco, PCLZIP_OPT_REMOVE_PATH, 'download');
if ($v_list == 0)
die("Error : ".$archivio->errorInfo(true));
}
$to = "".$cliente['email']."";
$subject = "Selezione Immagini AFC image";
$message = "Buongiorno,
vi confermiamo l'avvenuta selezione delle immagini.
Cliccate sul link sottostante per effettuare il download dell'alta risoluzione::
<a href=\"http://www.afc-image.it/public/".$zipname.".zip\">DOWNLOAD IMMAGINI</a>
In caso di problemi contattateci all'indirizzo: <a href=\"mailto:staff@afc-image.it\">staff@afc-image.it</a>
Buona giornata
Lo staff di AFC Image
<a href=\"http://www.afc-image.it\">[url]www.afc-image.it[/url]</a>";
$header = "From: AFC Image <staff@afc-image.it>\r\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$header .= "Content-Transfer-Encoding: 7bit\n\n";
mail($to, $subject, $message, $header);
$to = "staff@afc-image.it";
$subject = "Selezione immagini ".$cliente['nome']."";
$message = "Cliente: ".$cliente['nome']."
ELENCO IMMAGINI SELEZIONATE:
";
while($i>0){
$message.="".$array[$i]."
";
$i--;
}
$message .= "
Segnare l'utilizzo delle immagini sopra riportate.
Seguire normale procedura di fatturazione.
Buon Lavoro";
$header = "From: AFC Image <staff@afc-image.it>\r\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$header .= "Content-Transfer-Encoding: 7bit\n\n";
mail($to, $subject, $message, $header);
$txt='<table class="testo" border="0">
<tr>
<td class="titolo2">IMMAGINI SELEZIONATE CON SUCCESSO
</tr>
<tr>
<td align="center">[img]image/Symbol_OK.png[/img]
</tr>
<tr>
<td>A breve riceverete mail con link per il download delle immagini selezionate
in alta risoluzione.
Seguirà emissione del consuntivo per la fatturazione.
</td>
</tr>
</table>';
echo $txt;
}
Ho postato tutto! se c'è bisogno di altro, ditemelo!