% layout 'AdminLTE', title => "Sme server 2 - datetime";

% content_for 'module' => begin

<div class="card-body">

    % if (config->{debug} == 1) {
    <p>
    %= dumper $c->current_route
    %= dumper $dat_datas
    </p>
    % }

    % if ( stash 'error' ) {
    <br>
    <div class="">
        %= $c->render_to_string(inline => stash 'error') 
    </div>
    %}

    <h1><%= $title %></h1><br>
    %= $modul
    <% my $btn = l('SAVE'); %>

    %= form_for '/datetime' => (method => 'POST') => begin
    <p>
    %= hidden_field 'Old_ntpstatus' => $dat_datas->{ntpstatus};

    % param 'Ntpstatus' => $dat_datas->{ntpstatus} unless param 'Ntpstatus';
    %= radio_button Ntpstatus => 'enabled'
    <span class="">
    %=l 'dat_NTP_CONFIGURE_TITLE'
    </span>
    <br>
    % if ($dat_datas->{ntpstatus} eq 'disabled') {
    <div class="">
        %=l 'dat_NTP_ENABLE_DESC'
        <br>
    </div>  
    % } else {
    <div class="">
        %=l 'dat_NTP_CONFIGURE_DESC'
        <br><br>
        <p>
        %=l 'dat_CURRENT_SETTING'
        <b>
        %= $dat_datas->{now_string}
        </b>
        </p>
        <p>
        <br>
        <span class="">
        %=l 'dat_NTP_SERVER'
        </span>
        <span class="">
        %= text_field 'Ntpserver' =>  $dat_datas->{ntpserver}, class => ""
        </span>
        </p>
    </div>
    % } 
    %= radio_button Ntpstatus => 'disabled'
    <span class="">
    %=l 'dat_NTP_DISABLE_TITLE'
    </span>

    % if ($dat_datas->{ntpstatus} eq 'enabled') {

    <br><BR>
    <div class="">
        %=l 'dat_NTP_DISABLE_DESC'
    </div>  
    % } else {
    <div class="">
        <br>
        </p>
        <p>
        %=l 'dat_CURRENT_SETTING'
        <b>
        %= $dat_datas->{now_string}
        </b>
        <br>
        <span class="">
        %=l 'dat_NEW_M/D/Y'
        </span>
        <span class="">
        % param 'Month' => $dat_datas->{month} unless param 'Month';
        %= select_field 'Month' => $c->getMonth_list(), class => ""
        </span>
        <span class="">
        % param 'Day' => $dat_datas->{day} unless param 'Day';
        %= text_field 'Day', size => '2', class => ""
        </span>
        <span class="">
        % param 'Year' => $dat_datas->{year} unless param 'Year';
        %= text_field 'Year', size => '4', class => ""
        </span>
        <br>
        <span class="">
        %=l 'dat_NEW_H/M/S'
        </span>
        <span class="">
        % param 'Hour' => $dat_datas->{hour} unless param 'Hour';
        %= text_field 'Hour', size => '2', class => ""
        </span>
        <span class="">
        % param 'Minute' => $dat_datas->{minute} unless param 'Minute';
        %= text_field 'Minute', size => '2', class => ""
        </span>
        <span class="">
        % param 'Second' => $dat_datas->{second} unless param 'Second';
        %= text_field 'Second', size => '2', class => ""
        </span>
        <br>
        <span class="">
        %=l 'dat_AM/PM_AND_TZ'
        </span>
        <span class="">
        % param 'Ampm' => $dat_datas->{ampm} unless param 'Ampm';
        %= select_field 'Ampm' =>  ['AM', 'PM'], class => ""
        </span>
        <span class="">
        % param 'Timezone' => $c->getTimezone() unless param 'Timezone';
        %= select_field 'Timezone' =>  $c->getZone_list(), class => ""
        </span>
        </p>
    </div>  
    % }
    <p>
    <br>
    %= submit_button "$btn", class => ""
    </p>

    % end    

</div>
%end