% layout 'default', title => 'Sme server 2 - datetime'; % content_for 'module' => begin %= javascript 'js/datetime.js' %= stylesheet 'css/datetime.css'
% if (config->{debug} == 1) {

%= dumper $c->current_route %= dumper $dat_data

% } %if ($c->stash('first')) {

%=$c->render_to_string(inline =>$c->l($c->stash('first')))

%} elsif ($c->stash('success')) {
%= $c->l($c->stash('success'));
%} elsif ($c->stash('error')) {
%= $c->l($c->stash('error'));
%}

<%= $title %>


%= $modul <% my $btn = l('SAVE'); %>

% if ($dat_data->{ntpstatus} eq 'disabled') {

%=l 'dat_NTP_ENABLE_DESC'
% } else { % my $current_year = $dat_data->{year}; % my $year_options = [ map { [ $_, $_ ] } ($current_year..($current_year+30)) ]; % my $month_options = [ map { [ sprintf('%02d', $_), sprintf('%02d', $_) ] } (1..12) ]; % my $hour_options = [ map { [ sprintf('%02d', $_), sprintf('%02d', $_) ] } (0..23) ]; % my $mode_options = [ % [ $c->l('dat_ntp_server'), 'dat_ntp_server' ], % [ $c->l('dat_manually_set'), 'dat_manually_set' ] % ];

<%= $c->l('Time Configuration') %>

%= form_for "datetimeu" => (method => 'post') => begin %= hidden_field 'Old_ntpstatus' => $dat_data->{ntpstatus}; %= hidden_field 'trt' => $dat_data->{trt}; %= label_for time_mode => $c->l('Time Setting Mode:') % param 'time_mode' => $dat_data->{time_mode} unless param 'time_mode'; %= select_field time_mode => ($mode_options, id => 'time_mode_select')

%= $c->l('dat_NTP_CONFIGURE_DESC')

%= label_for ntpserver => $c->l('dat_NTP_Server_URL')
% my $server_check = '^([a-zA-Z0-9][a-zA-Z0-9\.\-]{0,253}[a-zA-Z0-9]|(\d{1,3}\.){3}\d{1,3})$'; % param 'ntpserver' => $dat_data->{ntpserver} unless param 'ntpserver'; %= text_field ntpserver => placeholder => 'e.g. smeserver.pool.ntp.org',id => 'ntpserver', pattern => $server_check, title => 'Enter a valid hostname or IPv4 address',required => 'required'

%= $c->l('dat_NTP_DISABLE_DESC')

%= label_for 'datetime_manual' => $c->l('dat_set_manually')
<%= $c->l('Date') %> %= label_for year => $c->l('Year:') % param 'year' => ($dat_data->{year}) unless param 'year'; %= select_field year => ($year_options, id => 'year'), required => 'required'   %= label_for month => $c->l('Month:') % param 'month' => ($dat_data->{month}) unless param 'month'; %= select_field month => ($month_options, id => 'month'), required => 'required'   %= label_for day => $c->l('Day:') % param 'day' => ($dat_data->{day}) unless param 'day'; %= text_field day => id => 'day', size => 2, maxlength => 2, placeholder => 'DD', pattern => '^(0[1-9]|[12][0-9]|3[01])$', title => 'Day (01-31)', required => 'required', inputmode => 'numeric', autocomplete => 'off'
<%= $c->l('Time') %> %= label_for hour => $c->l('Hour:') % param 'hour' => ($dat_data->{hour}) unless param 'hour'; %= select_field hour => ($hour_options, id => 'hour'), required => 'required'   %= label_for minute => $c->l('Minute:') % param 'minute' => ($dat_data->{minute}) unless param 'minute'; %= text_field minute => id => 'minute', size => 2, maxlength => 2, placeholder => 'MM', pattern => '^[0-5][0-9]$', title => 'Minute (00-59)', required => 'required', inputmode => 'numeric', autocomplete => 'off'   %= label_for second => $c->l('Second:') % param 'second' => ($dat_data->{second}) unless param 'second'; %= text_field second => id => 'second', size => 2, maxlength => 2, placeholder => 'SS', pattern => '^[0-5][0-9]$', title => 'Second (00-59)', required => 'required', inputmode => 'numeric', autocomplete => 'off'
%=l 'dat_TZ'
% param 'Timezone' => $c->getTimezone() unless param 'Timezone'; %= select_field 'Timezone' => $c->getZone_list(), class => 'input'
%= submit_button $btn, class => 'action' % end % }
% end 1;