Tengo este código para realizar una selección de año mes y dia. Mi pregunta es, ¿cómo le puedo hacer para que se ponga automáticamente el año, el mes y el día que tiene el servidor, que no lo tenga que seleccionar yo, que por default ponga la fecha HOY?
Código:
</%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>