Example #1
0
function ntpd_main_config()
{
    $ntp = new ntpd(true);
    $array = $ntp->ServersList();
    while (list($num, $val) = each($array)) {
        $i[$num] = $num;
    }
    $i[null] = "{choose}";
    $choose = Field_array_Hash($i, 'ntpd_servers_choosen', null, null, null, 0, 'font-size:14px;padding:3px');
    $page = CurrentPageName();
    $form = "\n\t <table style='width:100%'>\n\t <tr>\n\t \t<td valign='top' style='width:2%;padding-top:5px'>{$choose}</td>\n\t \t<td style='width:100%' align='left' valign='top'>" . button('{apply}', "ntpd_choose_server()") . "</td>\n\t </tr>\n\t </table>\n\t <div style='font-size:11px'>{how_to_find_timeserver}</div><hr>\n\n\t \n\t\n\t\t<div style='text-align:right;width:100%'>" . button("{add}", "ntpdAdd()") . "&nbsp;|&nbsp;" . button("{ntpd_apply}", "ntpdSave()") . "</div>\n\t \t<div id=serverlist style='width:100%;height:250px;overflow:auto'>" . main_server_list() . "</div>\n\t \t<hr>\n\t \t<div style='text-align:right;width:100%'></div>\n\t \t\n\t \t\n\t \t<script>\n\t \t\tfunction ntpd_choose_server(){\n\t\t\t\tvar XHR = new XHRConnection();\n\t      \t\tXHR.appendData('country',document.getElementById('ntpd_servers_choosen').value);\n\t      \t\tdocument.getElementById('serverlist').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';\n\t      \t\tXHR.sendAndLoad('{$page}', 'GET',X_ntpd_choose_server);    \n\t\t\t}\n\t \t\t\n\t\tvar X_ntpd_choose_server= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshTab('ntpd_main_config');\n\t\t\t}\t\t\n\t\t\n\t\n\t \t\t\n\t \t</script>\n\t\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body("{$entete}{$form}");
}
Example #2
0
function ntpd_main_config()
{
    $ntp = new ntpd(true);
    $sock = new sockets();
    $array = $ntp->ServersList();
    $arrayTimzone = $ntp->timezonearray();
    $timezone_def = trim($sock->GET_INFO('timezones'));
    $t = time();
    while (list($num, $val) = each($array)) {
        $i[$num] = $num;
    }
    $i[null] = "{choose}";
    $choose = Field_array_Hash($i, 'ntpd_servers_choosen', null, null, null, 0, 'font-size:14px;padding:3px');
    $page = CurrentPageName();
    $form = "\n\t <table style='width:99%' class=form>\n\t <tr>\n\t \t<td valign='middle' class=legend nowrap style='font-size:14px'>{servers}:</td>\n\t \t<td valign='top' style='width:2%;padding-top:5px'>{$choose}</td>\n\t \t\n\t </tr>\n\t<tr>\n\t\t<td valign='middle' class=legend nowrap style='font-size:14px'>{timezone}:</td>\n\t\t<td valign='top'>" . Field_array_Hash($arrayTimzone, "timezones{$t}", $timezone_def, null, null, "style:font-size:14px;padding:3px") . "</td>\n\t\t\n\t</tr> \n\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t\t\t<div style='font-size:11px;text-align:right'><i>{today}: " . date("{l} d {F} Y H:i:s") . "</i></div>\n\t\t\t\t<hr>" . button('{apply}', "ntpd_choose_server()", 14) . "</td>\n\t</tr>\n\t\t\t\t\n\t\t\t\t\n\t </table>\n\t <div class=text-info>{how_to_find_timeserver}</div><hr>\n\n\t \n\t\n\t\t<div style='text-align:right;width:100%'>" . button("{add}", "ntpdAdd()") . "&nbsp;|&nbsp;" . button("{ntpd_apply}", "ntpdSave()") . "</div>\n\t \t<div id=serverlist style='width:100%;height:250px;overflow:auto'>" . main_server_list() . "</div>\n\t \t<hr>\n\t \t<div style='text-align:right;width:100%'></div>\n\t \t\n\t \t\n\t \t<script>\n\t \t\tfunction ntpd_choose_server(){\n\t\t\t\tvar XHR = new XHRConnection();\n\t      \t\tXHR.appendData('country',document.getElementById('ntpd_servers_choosen').value);\n\t      \t\tXHR.appendData('timezones',document.getElementById('timezones{$t}').value);\n\t      \t\tAnimateDiv('serverlist');\n\t      \t\tXHR.sendAndLoad('{$page}', 'POST',X_ntpd_choose_server);    \n\t\t\t}\n\t \t\t\n\t\tvar X_ntpd_choose_server= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshTab('ntpd_main_config');\n\t\t\t}\t\t\n\t\t\n\t\n\t \t\t\n\t \t</script>\n\t\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body("{$entete}{$form}");
}