% 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')
%=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;