oppure...
#-#############################################
# Sub: Display Item
# This displays a particular item, its
# description, and its associated bids.
sub dispitem {
my ($title, $reserve, $inc, $desc, $image, @bids) = &read_item_file($form{'category'},$form{'item'} );
&oops("<font face=Verdana size=-1 class=classe12>L\'articolo $form{'item'} non può essere aperto. Quest'asta è chiusa, puoi consultare l'offerta conclusiva utilizzando il link <A HREF=$ENV{'SCRIPT_NAME'}\?action=closed>Aste chiuse</A>.</font>") if $title eq '';
my $nowtime = localtime(time);
my $closetime = localtime($form{'item'});
print "<table width=100\% border=0 cellspacing=0 cellpadding=0><tr><td><table width=100\% border=0 cellspacing=0 cellpadding=0><tr><td width=100\% valign=top><font size=-2 face=Verdana class=classe10><a href=$ENV{'SCRIPT_NAME'}><font color=#000000>Home Page</font></a><img src=../images/percorso.gif width=16 height=7><A HREF=$ENV{'SCRIPT_NAME'}\?category=$form{'category '}><font color=#000000>$category{$form{'category'}}</font></a><img src=../images/percorso.gif width=16 height=7><font color=#666666>Pagina corrente:</font> $title</font></td><td><img src=../images/1x1.gif width=1 height=18></td></tr></table></td></tr><tr bgcolor=#738B41><td><img src=../images/1x1.gif width=1 height=1></td></tr><tr><td><img src=../images/1x1.gif width=1 height=30></td></tr></table><table width=100\% border=0 cellspacing=0 cellpadding=0><tr><td><img src=../images/articolo.gif width=30 height=21></td><td width=100\%><font face=Verdana size=-2 class=classe12>Articolo proposto</font></td></tr></table><table width=100\% border=0 cellspacing=0 cellpadding=0><tr><td><img src=../images/1x1.gif width=1 height=20></td></tr></table>\n";
print "<table width=100\% border=0 cellspacing=0 cellpadding=0><TR>";
print "<TD><table width=10\% border=1 cellpadding=5 cellspacing=0 bordercolordark=#cccccc bordercolorlight=#FFFFFF><TR><TD><font face=Verdana size=-1 class=classe12>$title</font></TD></TR><TR><TD bgcolor=#f0f0f0><font face=Verdana size=-1 class=classe12>Categoria: <A HREF=$ENV{'SCRIPT_NAME'}\?category=$form{'category '}>$category{$form{'category'}}</A></font></TD></TR><TR><TD bgcolor=#f0f0f0>";
my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[0]); # read first bid
print "<font face=Verdana size=-1 class=classe12>Proposto da: <A HREF=mailto:$email>$alias</A></font></TR></TD><TR><TD bgcolor=#f0f0f0 nowrap><font face=Verdana size=-1 class=classe12>Chiusura dell'asta: $closetime</font></TD></TR><TR><TD bgcolor=#f0f0f0><font face=Verdana size=-1 class=classe12>Offerte ricevute: $#bids</font></TD></TR><TR><TD bgcolor=#f0f0f0 nowrap>";
my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[$#bids]); # read last bid
print "<font face=Verdana size=-1 class=classe12>Ultima offerta: €$bid </font>";
print "<FONT face=Verdana SIZE=-2 class=classe11>(L'offerta non soddisfa il prezzo minimo richiesto)</FONT>" if ($bid < $reserve);
print "<FONT face=Verdana SIZE=-2 class=classe11>(L'offerta soddisfa il prezzo minimo richiesto)</FONT>" if (($bid >= $reserve) and ($reserve > 0));
print "</TD></TR></TABLE></TD></tr><tr><td width=30><img src=../images/1x1.gif width=30 height=30></td></tr>\n";
print "<tr><TD width=100\% BGCOLOR=FFFFFF valign=top><IMG SRC=$image></TD>" if ($image);
print "</TR></TABLE>\n";
print "<table width=100\% border=0 cellspacing=0 cellpadding=0><tr><td><img src=../images/1x1.gif width=1 height=20></td></tr></table><FONT face=Verdana SIZE=-2 class=classe11>Descrizione</FONT>
<FONT face=Verdana SIZE=-2 class=classe11>$desc</FONT>";
print "
<FONT face=Verdana SIZE=-2 class=classe11>Offerte ricevute</FONT>
\n";
my $lowest_new_bid;
if ($#bids) {
for (my $i=1; $i<scalar(@bids); $i++) {
my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[$i]);
my $bidtime = localtime($time);
print "<FONT face=Verdana SIZE=-2 class=classe11>$alias \($bidtime\) ha offerto €$bid</FONT>
";
}
$lowest_new_bid = &parsebid($bid+$inc);
}
else {
print "<FONT face=Verdana SIZE=-2 class=classe11>Ancora nessuna offerta</FONT>
";
$lowest_new_bid = (&read_bid($bids[0]))[2];
}
# either the item is closed or we will display a bid form
my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bids[$#bids]); # read the last bid
if ((time > int($form{'item'})) && (time > (60 * $config{'aftermin'} + $time))) {
print "<FONT face=Verdana SIZE=-1 class=classe12><font COLOR=#aa3300>
L'asta è chiusa</FONT></FONT>
";
&closeit($form{'category'},$form{'item'});
}
else {
print <<"EOF";
<FORM ACTION=$ENV{'SCRIPT_NAME'} METHOD=POST>
<table width=100\% border=0 cellspacing=0 cellpadding=0><tr><td bgcolor=#738B41><img
src=../images/1x1.gif width=1 height=1></td><td bgcolor=#738B41 width=100\%><img
src=../images/1x1.gif width=1 height=1></td><td bgcolor=#738B41><img
src=../images/1x1.gif width=1 height=1></td></tr><tr><td bgcolor=#738B41><img
src=../images/1x1.gif width=1 height=1></td><td bgcolor=#EBF0F4 width=100\%><table width=100\% border=0 cellspacing=0 cellpadding=5><tr><td><font face=Verdana size=-2 class=classe11><img src=../images/frecciagiu.gif width=15 height=9>Fai la tua offerta</font></td></tr></table></td><td bgcolor=#738B41><img
src=../images/1x1.gif width=1 height=1></td></tr><tr><td bgcolor=#738B41><img
src=../images/1x1.gif width=1 height=1></td><td bgcolor=#738B41 width=100\%><img
src=../images/1x1.gif width=1 height=1></td><td bgcolor=#738B41><img
src=../images/1x1.gif width=1 height=1></td></tr></table>
<INPUT TYPE=HIDDEN NAME=action VALUE=procbid>
<INPUT TYPE=HIDDEN NAME=ITEM VALUE="$form{'item'}">
<INPUT TYPE=HIDDEN NAME=CATEGORY VALUE="$form{'category'}">
<FONT face=Verdana SIZE=-1 class=classe12>L'offerta più alta: €$bid
Il minimo che puoi offrire: €$lowest_new_bid
Tieni presente che facendo un'offerta stai sottoscivendo un accordo tra te stesso e chi vende. Una volta fatta un'offerta, non è corretto ritirarla!
EOF
if ($config{'regdir'}) {
print <<"EOF";
<FONT face=Verdana SIZE=-2 class=classe11>Devi essere un utente registrato per fare un'offerta. Se non lo sei vai alla pagina di <A HREF=$ENV{'SCRIPT_NAME'}?action=reg>registrazione nuovo utente</A>. Se sei già un utente registrato procedi con l'offerta.</font>
</font>
<table width=100\% border=0 cellpadding=2>
<tr>
<td width=20\% nowrap><font face=Verdana size=-1 class=classe12>Il tuo nome Diriflesso:</font></td>
<td
width=80\%>
<input name=ALIAS type=TEXT size=30 maxlength=30>
</td>
</tr>
<tr>
<td nowrap><font face=Verdana size=-1 class=classe12>La tua Password:</font></td>
<td>
<input name=PASSWORD type=PASSWORD size=30>
</td>
</tr>
<tr><td colspan=2><img src=../images/1x1.gif width=1 height=5></td></tr>
<tr><td colspan=2><font face=Verdana size=-2 class=classe11><font color=#cc3300>Attenzione</font>: scrivi il prezzo (nel caso tu voglia variare quello che già appare con l'incremento stabilito da chi vende) senza modificare i centesimi (es. scrivi 125.00 non 125,00). Potresti causare un errore al sistema, grazie.</font></td></tr>
<tr><td colspan=2><img src=../images/1x1.gif width=1 height=5></td></tr>
<tr>
<td><font face=Verdana size=-1 class=classe12>La tua offerta:</font></td>
<td><font face=Verdana size=-1 class=classe12>€<input name=BID type=TEXT size=10 value="$lowest_new_bid"></font></td>
</tr>
</table>
EOF
}
else {
print <<"EOF";
Il tuo nome Diriflesso: <INPUT NAME=ALIAS TYPE=TEXT SIZE=30 MAXLENGTH=30>
Il tuo indirizzo e-mail: <INPUT NAME=EMAIL TYPE=TEXT SIZE=30>
La tua offerta: €<INPUT NAME=BID TYPE=TEXT SIZE=7 VALUE="$lowest_new_bid">
Contatto: (Consultabile solo da chi vende l'articolo)
<TT>Nome e cognome: </TT>
<INPUT NAME=ADDRESS1 TYPE=TEXT SIZE=30>
<TT>Via (o piazza) e n° civico: </TT>
<INPUT NAME=ADDRESS2 TYPE=TEXT SIZE=30>
<TT>CAP, Città, Prov., Stato: </TT>
<INPUT NAME=ADDRESS3 TYPE=TEXT SIZE=30>
EOF
}
print <<"EOF";
<input type='image' src='../images/invia_offerta.gif' alt='Invia la tua offerta per questo articolo' name='submit'>
EOF
}
}
#-#############################################
ciao e grazie, marcello