Perl - AYUDA CON PERL

 
Vista:

AYUDA CON PERL

Publicado por JESUS ROJAS (1 intervención) el 13/10/2004 22:39:15
tengo este codigo para realizar una seleccion de año mes y dia , mi pregunta es, como le puedo hacer para que se ponga automaticamente el año el mes y el dia que tiene el servidor, que no lo tenga que selccionar yo que por default ponga la fecha HOY


</%perl>

<table width="100%" border=0 cellpadding=0 cellspacing=0>
<tr>
<td width="15%" align=left>
<input type=image src="<%$m->base_comp->attr('origen')%>/img/sis/flechai.gif" width="20" height="18" border="0" onClick="document.form1.dd.value--; submit(this.form);">Día Anterior
</td>
<td width="20%" align=center>Año:
<select name=yyyy size=1 onChange="submit(this.form);">
<option value=""></option>
<%perl>
for(my $y=2004; $y<=2010; $y++) {
my $select=($JLL{'yyyy'} eq $y) ? 'selected': '';
$m->out("<option value=\"$y\" $select>$y</option>");
}
</%perl>
</select>
</td>
<td width="20%" align=center>Mes:
<select name=mm size=1 onChange="submit(this.form);">
<option value=""></option>
<%perl>
if($JLL{'yyyy'} ne '') {
# my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday)=gmtime(time);
for(my $mm=1; $mm<=12; $mm++) {
my $select=($JLL{'mm'} eq $mm) ? 'selected': '';
$m->out("<option value=\"$mm\" $select>",ucfirst(Month_to_Text($mm)),"</option>");
}
}
</%perl>
</select>
</td>
<td width="20%" align=center>Día:
<select name=dd size=1 onChange="submit(this.form);">
<option value=""></option>
<%perl>
if($JLL{'yyyy'} ne '' && $JLL{'mm'} ne '') {
for(my $dd=1; $dd<=Days_in_Month($JLL{'yyyy'}, $JLL{'mm'}); $dd++) {
my $select=($JLL{'dd'} eq $dd) ? 'selected': '';
$m->out("<option value=\"$dd\" $select>$dd</option>");
}
}
</%perl>
</select>
</td>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder