1 |
8 |
ahitrov@rambler.ru |
<& "/contenido/components/select.msn", name => $name.'_day', values => \@days, check => $day &>\ |
2 |
|
|
<& "/contenido/components/select.msn", name => $name.'_month', values => $months, check => $month &>\ |
3 |
|
|
<& "/contenido/components/select.msn", name => $name.'_year', values => \@years, check => $year &> |
4 |
|
|
<%ARGS> |
5 |
|
|
$name => undef |
6 |
|
|
$check => undef |
7 |
|
|
</%ARGS> |
8 |
|
|
<%INIT> |
9 |
|
|
|
10 |
|
|
my @localtime = localtime(); $localtime[4]++; $localtime[5] += 1900; |
11 |
|
|
|
12 |
|
|
# Формируем данные для select'а... |
13 |
|
|
my @days = map { $_ => $_ } (' ', 1 .. 31); |
14 |
|
|
my $months = $m->comp('/contenido/components/get_months.msn'); unshift @$months, ' '; unshift @$months, ' '; |
15 |
|
|
my @years = map { $_ => $_ } (' ', 1940 .. $localtime[5] + 5); |
16 |
|
|
|
17 |
|
|
# Устанавалием текущие даты... |
18 |
|
|
my ($year,$month,$day); |
19 |
|
|
if ($check) |
20 |
|
|
{ |
21 |
|
|
$check =~ /(\d{4})-(\d{1,2})-(\d{1,2})/; |
22 |
|
|
($year, $month, $day) = ($1+0, $2+0, $3+0); |
23 |
|
|
} |
24 |
|
|
else |
25 |
|
|
{ |
26 |
|
|
($day,$month,$year) = (' ', ' ', ' '); |
27 |
|
|
} |
28 |
|
|
</%INIT> |
29 |
|
|
|