当前位置: 首页>>代码示例>>PHP>>正文


PHP templates::time_to_date方法代码示例

本文整理汇总了PHP中templates::time_to_date方法的典型用法代码示例。如果您正苦于以下问题:PHP templates::time_to_date方法的具体用法?PHP templates::time_to_date怎么用?PHP templates::time_to_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在templates的用法示例。


在下文中一共展示了templates::time_to_date方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: report

function report()
{
    if (!is_file("/usr/share/artica-postfix/ressources/logs/categorized.array")) {
        return;
    }
    $ARRAY = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/categorized.array"));
    $stats_sites = $ARRAY["stats_sites"];
    $stats_categorized = $ARRAY["stats_categorized"];
    $stats_not_categorized = $ARRAY["stats_not_categorized"];
    $SumOflines = $ARRAY["SumOflines"];
    $stats_ip = $ARRAY["stats_ip"];
    $FIRSTTIME = $ARRAY["firsttime"];
    $LASTTIME = $ARRAY["lasttime"];
    $rate = $stats_categorized / $stats_sites;
    $rate = $rate * 100;
    $rate = round($rate, 2);
    $stats_not_categorized = FormatNumber($stats_not_categorized);
    $stats_categorized = FormatNumber($stats_categorized);
    $stats_sites = FormatNumber($stats_sites);
    $stats_ip = FormatNumber($stats_ip);
    $SumOflines = FormatNumber($SumOflines);
    if ($rate > 60) {
        $rate_color = "46a346";
    }
    if ($rate < 60) {
        $rate_color = "d32d2d";
    }
    $tpl = new templates();
    $html = "<div style='width:98%' class=form>\n\t\n\t<div style='font-size:18px;margin-bottom:15px'>{from} " . $tpl->time_to_date($FIRSTTIME) . " {to} " . $tpl->time_to_date($LASTTIME) . " (" . distanceOfTimeInWords($FIRSTTIME, $LASTTIME) . ")</div>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{rate}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong style='font-size:36px;color:{$rate_color}'>{$rate}%</strong></td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{duration}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong>{$ARRAY["DURATION"]}</strong></td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{lines}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong>{$SumOflines}</strong></td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{not_categorized}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong>{$stats_not_categorized}</strong></td>\n\t\t<td><a href=\"ressources/logs/notcategorized.csv\"><img src='img/csv-32.png'></a></td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{categorized}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong>{$stats_categorized}</strong></td>\n\t\t<td><a href=\"ressources/logs/categorized.csv\"><img src='img/csv-32.png'></a></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{ipaddresses}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong>{$stats_ip}</strong></td>\n\t\t<td><a href=\"ressources/logs/ipcategorized.csv\"><img src='img/csv-32.png'></a></td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{websites}:</td>\n\t\t<td style='font-size:22px;text-align:right'><strong>{$stats_sites}</strong></td>\n\t\t<td>&nbsp;</td>\n\t\t\n\t</tr>\t\n\t</table>\n\t</div>\t\t\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:31,代码来源:ufdbcat.check.php

示例2: DATE_START

function DATE_START()
{
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $table = "dashboard_volume_day";
    $sql = "SELECT MIN(TIME) as xmin, MAX(TIME) as xmax FROM {$table} ";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
    $time1 = $tpl->time_to_date(strtotime($ligne["xmin"]), true);
    $time2 = $tpl->time_to_date(strtotime($ligne["xmax"]), true);
    return $tpl->_ENGINE_parse_body("{date_start} {$time1}, {last_date} {$time2}");
}
开发者ID:articatech,项目名称:artica,代码行数:13,代码来源:squid.influx.log.php

示例3: popup

function popup()
{
    $artica_meta = new mysql_meta();
    $LicenseInfos = $artica_meta->LicenseInfos($_GET["uuid"]);
    $page = CurrentPageName();
    $tpl = new templates();
    $FINAL_TIME = 0;
    if (isset($LicenseInfos["FINAL_TIME"])) {
        $FINAL_TIME = intval($LicenseInfos["FINAL_TIME"]);
    }
    $LICT = "Community Edition";
    if ($LicenseInfos["CORP_LICENSE"]) {
        $LICT = "Entreprise Edition";
    }
    if ($LicenseInfos["ExpiresSoon"] > 0) {
        if ($LicenseInfos["ExpiresSoon"] < 31) {
            $LICT = "<span style='color:red'>{trial_mode}</span>";
        }
    }
    if ($FINAL_TIME > 0) {
        $ExpiresSoon = intval(time_between_day_Web($FINAL_TIME));
        if ($ExpiresSoon < 7) {
            $ExpiresSoon_text = "<strong style='color:red;font-size:16px'>&nbsp;{ExpiresSoon}</strong>";
        }
        $licenseTime = "\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{expiredate}:</td>\n\t\t\t\t<td style='font-size:24px'>" . $tpl->time_to_date($FINAL_TIME) . " (" . distanceOfTimeInWords(time(), $FINAL_TIME) . "{$ExpiresSoon_text})</td>\n\t\t\t\t\t</tr>";
    }
    if (is_numeric($LicenseInfos["TIME"])) {
        $tt = distanceOfTimeInWords($LicenseInfos["TIME"], time());
        $last_access = "\n\t\t<tr>\n\t\t<td class=legend style='font-size:24px'>{last_update}:</td>\n\t\t<td style='font-size:24px'>{since} {$tt}</td>\n\t\t</tr>";
    }
    $html = "<div style='font-size:30px'>{$LICT}</div><div style='width:98%' class=form>\n<table style='width:100%'>\n\t</tr>\n\t{$last_access}\n\t<tr>\n\t\t<td class=legend style='font-size:24px'>{company}:</td>\n\t\t<td><span style='font-size:24px;font-weight:bold'>{$LicenseInfos["COMPANY"]}</span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{your_email_address}:</td>\n\t\t\t\t<td><span style='font-size:24px;font-weight:bold'>{$LicenseInfos["EMAIL"]}</span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{nb_employees}:</td>\n\t\t\t\t<td><span style='font-size:24px;font-weight:bold'>" . FormatNumber($LicenseInfos["EMPLOYEES"]) . "</span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{license_number}:</td>\n\t\t\t\t<td style='font-size:24px'>{$LicenseInfos["license_number"]}</td>\n\t\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:24px'>{license_status}:</td>\n\t\t\t<td style='font-size:24px;'>{$LicenseInfos["license_status"]}</td>\n\t\t</tr>\n\t\t{$licenseTime}\n\t</table>\n</td>\n</table></div>";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:33,代码来源:artica-meta.host.license.php

示例4: js

function js()
{
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $title = $tpl->javascript_parse_text("{snapshots}");
    $q = new mysql();
    $ID = $_GET["ID"];
    $sql = "SELECT zDate FROM snapshots WHERE ID='{$ID}'";
    $database = "artica_snapshots";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
    $title = "{restore} " . $tpl->time_to_date(strtotime($ligne["zDate"]), true);
    $title = $tpl->javascript_parse_text($title);
    echo "\n\tYahooWinBrowseHide();\t\t\n\tif(confirm('{$title} ?')){\n\t\tRTMMail('800','{$page}?popup=yes&ID={$_GET["ID"]}','{$title}');\n\t\n\t}";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:15,代码来源:snapshots.restore.php

示例5: page

function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $ARRAY = unserialize(base64_decode($sock->GET_INFO("SquidSiegeConfig")));
    if (!is_numeric($ARRAY["GRAB_URLS"])) {
        $ARRAY["GRAB_URLS"] = 0;
    }
    if (!is_numeric($ARRAY["USE_LOCAL_PROXY"])) {
        $ARRAY["USE_LOCAL_PROXY"] = 1;
    }
    if (!is_numeric($ARRAY["SESSIONS"])) {
        $ARRAY["SESSIONS"] = 150;
    }
    if (!is_numeric($ARRAY["MAX_TIME"])) {
        $ARRAY["MAX_TIME"] = 30;
    }
    $REPORT = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/siege.report.txt"));
    if (isset($REPORT["START_TIME"])) {
        $duration = distanceOfTimeInWords($REPORT["START_TIME"], $REPORT["STOP_TIME"]);
        $ttime = $tpl->time_to_date($REPORT["STOP_TIME"], true);
        unset($REPORT["START_TIME"]);
        unset($REPORT["STOP_TIME"]);
        $f[] = "<div style='width:98%' class=form><table style='width:100%'><tr><td style='font-size:26px' nowrap colsspan=2>{last_report}:</td></tr>";
        $f[] = "\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{date}:</td>\n\t\t<td  style='font-size:22px'>{$ttime}</td>\n\t\t</tr>";
        $f[] = "\n\t\t\t\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{duration}:</td>\n\t\t<td  style='font-size:22px'>{$duration}</td>\n\t\t</tr>";
        while (list($num, $line) = each($REPORT)) {
            $f[] = "\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:22px' nowrap>{$num}:</td>\n\t\t\t\t<td  style='font-size:22px'>{$line}</td>\n\t\t\t</tr>";
        }
        $f[] = "\n\t\t<td style='font-size:26px' nowrap colspan=2 align='right'>" . imgtootltip("delete-42.png", "{delete}", "ReportDelete()") . "</td></tr>\t\t\n\t\t</table></div><p>&nbsp;</p>";
    }
    if (count($f) > 0) {
        $report_text = @implode("\n", $f);
    }
    $t = time();
    $html = "\n\t\t\t\n\t<div style='font-size:32px;margin-bottom:30px'>Stress Tool</div>\n\t<div style='font-size:18px;margin-bottom:30px' class=explain>{squid_siege_explain} </div>\n\t\t\t{$report_text}\n<div style='width:98%' class=form>\n\t\t\t\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px' nowrap>{get_url_from_lastlogs}:</td>\n\t\t\t<td>" . Field_checkbox_design("GRAB_URLS", 1, $ARRAY["GRAB_URLS"]) . "</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px'>{use_local_proxy}:</td>\n\t\t\t<td>" . Field_checkbox_design("USE_LOCAL_PROXY", 1, $ARRAY["USE_LOCAL_PROXY"], "USE_LOCAL_PROXY_CHECK()") . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='vertical-align:middle;font-size:22px'>{remote_proxy}:</td>\n\t\t\t<td style='width:70%;vertical-align:middle;'>\n\t\t\t\t" . Field_text("REMOTE_PROXY", $ARRAY["REMOTE_PROXY"], "font-size:22px;width:300px;") . "\n\t\t\t</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='vertical-align:middle;font-size:22px'>{remote_port}:</td>\n\t\t\t<td style='width:70%;vertical-align:middle;'>\n\t\t\t\t" . Field_text("REMOTE_PROXY_PORT", $ARRAY["REMOTE_PROXY_PORT"], "font-size:22px;width:110px;") . "\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='vertical-align:middle;font-size:22px'>{username}:</td>\n\t\t\t<td style='vertical-align:middle;font-size:22px'>\n\t\t\t\t" . Field_text("USERNAME", $ARRAY["USERNAME"], "font-size:22px;width:300px") . "\n\t\t\t</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='vertical-align:middle;font-size:22px'>{password}:</td>\n\t\t\t<td >\n\t\t\t\t" . Field_password("PASSWORD", $ARRAY["PASSWORD"], "font-size:22px;width:300px;") . "\n\t\t\t</td>\n\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='vertical-align:middle;font-size:22px'>{simulate}:</td>\n\t\t\t<td style='vertical-align:middle;font-size:22px'>\n\t\t\t\t" . Field_text("SESSIONS", $ARRAY["SESSIONS"], "font-size:22px;width:110px;") . "&nbsp;{members}\n\t\t\t</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='vertical-align:middle;font-size:22px' nowrap>{MaxExecutionTime}:</td>\n\t\t\t<td style='vertical-align:middle;font-size:22px'>\n\t\t\t\t" . Field_text("MAX_TIME", $ARRAY["MAX_TIME"], "font-size:22px;width:110px;") . "&nbsp;{seconds}\n\t\t\t</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right' style='padding-top:20px;font-size:36px'>\n\t\t\t\t\t\t<hr>" . button("{launch_test}", "Submit{$t}(true)", 36) . "&nbsp;|&nbsp;" . button("{apply}", "Submit{$t}(false)", 36) . "</td>\n\t\t</tr>\n\t</table>\n\t</div>\n<div style='margin-bottom:50px'>&nbsp;</div>\n<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t}\n\tvar xSubmit2{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tLoadjs('squid.siege.progress.php');\n\t}\t\n\tvar xDelete{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tRefreshTab('debug_squid_config');\n\t}\t\n\t\n\tfunction ReportDelete(){\n\t\tvar XHR = new XHRConnection();\t\n\t\tXHR.appendData('report-delete','yes');\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t}\n\t\n\n\n\tfunction Submit{$t}(run){\n\t\tvar XHR = new XHRConnection();\t\n\t\t\n\t\tif(document.getElementById('GRAB_URLS').checked){XHR.appendData('GRAB_URLS',1);}else{XHR.appendData('GRAB_URLS',0);}\n\t\tif(document.getElementById('USE_LOCAL_PROXY').checked){XHR.appendData('USE_LOCAL_PROXY',1);}else{XHR.appendData('USE_LOCAL_PROXY',0);}\n\t\tXHR.appendData('REMOTE_PROXY',document.getElementById('REMOTE_PROXY').value);\n\t\tXHR.appendData('REMOTE_PROXY_PORT',document.getElementById('REMOTE_PROXY_PORT').value);\n\t\t\n\t\tXHR.appendData('USERNAME',encodeURIComponent(document.getElementById('USERNAME').value));\n\t\tXHR.appendData('PASSWORD',encodeURIComponent(document.getElementById('PASSWORD').value));\n\t\t\n\t\t\n\t\tXHR.appendData('SESSIONS',document.getElementById('SESSIONS').value);\n\t\tXHR.appendData('MAX_TIME',document.getElementById('MAX_TIME').value);\n\t\tif(!run){\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t\t}else{\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit2{$t});\n\t\t}\n\t}\n\t\n\t\n\tfunction USE_LOCAL_PROXY_CHECK(){\n\t\tdocument.getElementById('REMOTE_PROXY').disabled=true;\n\t\tdocument.getElementById('REMOTE_PROXY_PORT').disabled=true;\n\t\tif(!document.getElementById('USE_LOCAL_PROXY').checked){\n\t\t\tdocument.getElementById('REMOTE_PROXY').disabled=false;\n\t\t\tdocument.getElementById('REMOTE_PROXY_PORT').disabled=false;\t\t\n\t\t}\n\t\n\t}\n\tUSE_LOCAL_PROXY_CHECK();\n\tLoadAjax('request-{$t}','{$page}?request-tool-status=yes',true);\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:39,代码来源:squid.siege.php

示例6: global_status_artica_db

function global_status_artica_db()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $date = GetLastUpdateDate();
    $users = new usersMenus();
    $sock = new sockets();
    $q = new mysql();
    $sql = "SELECT avg(progress) as pourcent FROM updates_categories  WHERE filesize>0";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if (!is_numeric($ligne["pourcent"])) {
        $ligne["pourcent"] = 0;
    }
    $pourcent = round($ligne["pourcent"], 2);
    $purc = pourcentage($pourcent);
    $t = $_GET["t"];
    $dateDB = $sock->getFrameWork("squid.php?articadb-version=yes");
    $dateDB_text = $tpl->time_to_date($dateDB);
    $DB_STATUS = unserialize(base64_decode($sock->getFrameWork("ufdbguard.php?databases-percent=yes")));
    $DB_STATUS_TIME = $DB_STATUS["ARTICA"]["LAST_TIME"];
    $DB_STATUS_MAX = $DB_STATUS["ARTICA"]["MAX"];
    $DB_STATUS_COUNT = $DB_STATUS["ARTICA"]["COUNT"];
    $DB_STATUS_PERC = round($DB_STATUS_COUNT / $DB_STATUS_MAX * 100);
    $color = "color:black;";
    $sock = new sockets();
    $scheduledAR = unserialize(base64_decode($sock->getFrameWork("squid.php?schedule-maintenance-exec=yes")));
    $SquidDatabasesArticaEnable = $sock->GET_INFO("SquidDatabasesArticaEnable");
    if (!is_numeric($SquidDatabasesArticaEnable)) {
        $SquidDatabasesArticaEnable = 1;
    }
    if ($SquidDatabasesArticaEnable == 1) {
        $disable_text = "Artica&nbsp;{database}:&nbsp;{enabled}";
    } else {
        $disable_text = "Artica&nbsp;{database}:&nbsp;{disabled}";
        $color = "color:#B6ACAC";
    }
    $CORP_LICENSE = 1;
    if (!$users->CORP_LICENSE) {
        $CORP_LICENSE = 0;
        $SquidDatabasesArticaEnable = 0;
        $disable_text = "Artica&nbsp;{database}:&nbsp;<strong style='color:#BA1010'>{license_inactive}</strong>";
        $color = "color:#B6ACAC";
    }
    $running = "<br><i style='font-size:12px'>{update_task_stopped}</i>";
    if ($scheduledAR["RUNNING"]) {
        $running = "<br><i style='font-size:12px;color:#BA0000'>{update_currently_running_since} {$scheduledAR["TIME"]}Mn</i>";
    }
    $q = new mysql_squid_builder();
    $SQL_ALL_ITEMS = "SELECT SUM( TABLE_ROWS ) AS tcount FROM information_schema.tables WHERE table_schema = 'squidlogs' AND table_name LIKE 'category_%'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($SQL_ALL_ITEMS));
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2>";
    }
    $itemsPerso = $ligne["tcount"];
    $itemsPerso = numberFormat($itemsPerso, 0, "", " ");
    $catz = new mysql_catz();
    $itemsArtica = numberFormat(intval(@file_get_contents("/usr/share/artica-postfix/ressources/UFDB_ARTICA_COUNT")));
    $q = new mysql_squid_builder();
    $backuped_items = $q->COUNT_ROWS("webfilters_backupeddbs");
    $sql = "SELECT SUM(size) as tszie FROM webfilters_backupeddbs";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
    $backuped_items_size = FormatBytes($ligne["tszie"] / 1024);
    $backuped_items_text = "{$backuped_items} {backup_containers} ({$backuped_items_size})";
    $tableau = "\n\t<div style='width:95%;min-height:254px' class=form>\n\t<table style='width:99%'>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:16px;{$color}'>{artica_databases}{$running}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px;font-weight:bold'>{youritems}:</td>\n\t\t\t<td style='font-size:14px;font-weight:bold'>{$itemsPerso}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:14px' align='right'>\n\t\t\t\t<table style='width:2%'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t\t\t\t\t\t<td nowrap><a href=\"javascript:blur();\" \n\t\t\t\t\t\t\tOnClick=\"javascript:Loadjs('dansguardian2.backuped.databases.php');\" \n\t\t\t\t\t\t\tstyle='font-size:12px;text-decoration:underline'>{$backuped_items_text}</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t\t\t\t\t\t<td nowrap><a href=\"javascript:blur();\" \n\t\t\t\t\t\t\tOnClick=\"javascript:Loadjs('dansguardian2.restore.databases.php');\" \n\t\t\t\t\t\t\tstyle='font-size:12px;text-decoration:underline'>{restore_backup}</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=1%><img src='img/arrow-right-16.png' id='emptypersonaldbdiv'>\n\t\t\t\t\t\t\t<td nowrap><a href=\"javascript:blur();\" \n\t\t\t\t\t\t\tOnClick=\"javascript:Loadjs('dansguardian2.restore.databases.php?empty-js=yes');\" \n\t\t\t\t\t\t\tstyle='font-size:12px;text-decoration:underline'>{empty_database}</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t\t\t\t\t\t<td nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('ufdbguard.databases.php?scripts=compile-schedule');\" style='font-size:12px;text-decoration:underline;{$color}'>{compilation_schedule}</a></td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</td>\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:14px;font-weight:bold;{$color}'>{articaitems}:</td>\n\t\t\t<td style='font-size:14px;font-weight:bold;{$color}'>{$itemsArtica} v.{$dateDB} <i style='font-size:11px'>{$dateDB_text}</i></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:12px;font-weight:bold;{$color}'>{update_status}:</td>\n\t\t\t<td>" . pourcentage($DB_STATUS_PERC, 0, "green") . "</td>\n\t\t</tr>\t\t\n\n\t\t\n\n\t\n\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:14px' align='right'>\n\t\t\t<table style='width:2%'>\n\t\t\t<tbody>\n\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t\t\t\t<td nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:ArticaDBDisable();\" style='font-size:12px;text-decoration:underline;{$color}'>{$disable_text}</a></td>\n\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t\t\t<td nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:ArticaDBUpdateNow();\" style='font-size:12px;text-decoration:underline;{$color}'>{update_now}</a></td>\n\t\t\t</tr>\n\t\n\t\t\t\t\t\t\n\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t\n\t\t</tr>\n\t\t\t\n\t</tbody>\n\t</table>\n\t</div>\n\t<script>\n\tvar x_ArticaDBUpdateNow= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t    \tRefreshArticaDBStatus();\n\t\t}\t\n\n\t\tfunction ArticaDBUpdateNow(){\n\t\t\tvar CORP_LICENSE={$CORP_LICENSE};\n\t\t\tif(CORP_LICENSE==0){alert('license error');return;}\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('global-artica-status-update','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_ArticaDBUpdateNow);\n\t\t}\n\t\n\t\t\n\tvar xArticaDBDisable= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t    \tRefreshArticaDBStatus();\n\t\t}\t\n\n\t\t\n\t\tfunction ArticaDBDisable(){\n\t\t\tvar CORP_LICENSE={$CORP_LICENSE};\n\t\t\tif(CORP_LICENSE==0){alert('license error');return;}\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('global-artica-enable-update','{$SquidDatabasesArticaEnable}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xArticaDBDisable);\t\t\n\t\t\n\t\t}\t\t\n\t</script>\n\t\n\t\n\t";
    $html = "<table style='width:100%'>\n\t<tbody>\n\t<tr>\n\t\t<td valign='top' width=1%><img src='img/artica5-64.png'></td>\n\t\t<td valign='top' width=99%>{$tableau}</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . imgtootltip("refresh-24.png", "{refresh}", "LoadAjax('artica-status-databases-{$t}','{$page}?global-artica-status-databases=yes&t={$t}');") . "</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t<script>\n\t\t\n\t\tLoadAjax('tlse-status-databases-{$t}','{$page}?global-tlse-status-databases=yes&t={$t}');\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:67,代码来源:dansguardian2.databases.compiled.php

示例7: restore

function restore()
{
    $ARTICAVERSION = @file_get_contents("/usr/share/artica-postfix/VERSION");
    $unix = new unix();
    $HOSTNAME = $unix->hostname_g();
    $DIALOG = $unix->find_program("dialog");
    $php = $unix->LOCATE_PHP5_BIN();
    $q = new mysql();
    $table = "snapshots";
    $database = "artica_snapshots";
    $sql = "SELECT * FROM {$table}";
    $results = $q->QUERY_SQL($sql, $database);
    if (!$q->ok) {
        if ($q->mysql_error != null) {
            json_error_show(date("H:i:s") . "<br>SORT:{$_POST["sortname"]}:<br>Mysql Error [L." . __LINE__ . "]: {$q->mysql_error}<br>{$sql}", 1);
        }
    }
    if (mysql_num_rows($results) == 0) {
        $f[] = "#!/bin/bash";
        $f[] = "INPUT=/tmp/menu.sh.\$\$";
        $f[] = "OUTPUT=/tmp/output.sh.\$\$";
        $f[] = "trap \"rm \$OUTPUT; rm \$INPUT; exit\" SIGHUP SIGINT SIGTERM";
        $f[] = "DIALOG=\${DIALOG=dialog}";
        $f[] = "\t{$DIALOG} --title \"R E S T O R E\" --msgbox \"Sorry, no snapshot created\" 9 70";
        if ($GLOBALS["VERBOSE"]) {
            echo "Writing /tmp/bash_snapshots_restore.sh\n";
        }
        @file_put_contents("/tmp/bash_snapshots_restore.sh", @implode("\n", $f));
        @chmod("/tmp/bash_snapshots_restore.sh", 0755);
        return;
    }
    $diag[] = "{$DIALOG} --clear  --nocancel --backtitle \"Software version {$ARTICAVERSION} on {$HOSTNAME}\"";
    $diag[] = "--title \"[ S N A P S H O T S  - R E S T O R E - M E N U ]\"";
    $diag[] = "--menu \"You can use the UP/DOWN arrow keys\nChoose the TASK\" 20 100 10";
    $tpl = new templates();
    while ($ligne = mysql_fetch_assoc($results)) {
        $ID = $ligne["ID"];
        $xdate = $ligne["zDate"];
        $xtime = strtotime($xdate);
        $date = $tpl->time_to_date($xtime, true);
        $diag[] = "Restore{$ID} \"Restore {$xdate} - {$date}\"";
        $funcs[] = "function restore_{$ID}(){";
        $funcs[] = "\t{$DIALOG} --title \"Restore a Snapshot\" --yesno \"Do you need to restore {$xdate} - {$date} operation ? Press 'Yes' to continue, or 'No' to exit\" 0 0";
        $funcs[] = "\tcase \$? in";
        $funcs[] = "\t\t0)";
        $funcs[] = "\tif [ -f /tmp/dns.log ]; then";
        $funcs[] = "\t\trm /tmp/dns.log";
        $funcs[] = "\tfi";
        $funcs[] = "\t{$php} /usr/share/artica-postfix/exec.backup.artica.php --snapshot-id {$ID} >/tmp/dns.log &";
        $funcs[] = "\t{$DIALOG} --tailbox /tmp/dns.log  25 150";
        $funcs[] = "\t\treturn;;";
        $funcs[] = "\t1)";
        $funcs[] = "\t\treturn;;";
        $funcs[] = "\t255)";
        $funcs[] = "\t\treturn;;";
        $funcs[] = "\tesac";
        $funcs[] = "}";
        $funcs[] = "";
        $cases[] = "Restore{$ID}) restore_{$ID};;";
    }
    $diag[] = "Quit \"Return to main menu\" 2>\"\${INPUT}\"";
    $f[] = "#!/bin/bash";
    $f[] = "INPUT=/tmp/menu.sh.\$\$";
    $f[] = "OUTPUT=/tmp/output.sh.\$\$";
    $f[] = "trap \"rm \$OUTPUT; rm \$INPUT; exit\" SIGHUP SIGINT SIGTERM";
    $f[] = "DIALOG=\${DIALOG=dialog}";
    @implode("\n", $funcs);
    $f[] = "while true";
    $f[] = "do";
    $f[] = @implode(" ", $diag);
    $f[] = "menuitem=\$(<\"\${INPUT}\")";
    $f[] = "case \$menuitem in";
    $f[] = @implode("\n", $cases);
    $f[] = "Quit) break;;";
    $f[] = "esac";
    $f[] = "done\n";
    if ($GLOBALS["VERBOSE"]) {
        echo "Writing /tmp/bash_snapshots_restore.sh\n";
    }
    @file_put_contents("/tmp/bash_snapshots_restore.sh", @implode("\n", $f));
    @chmod("/tmp/bash_snapshots_restore.sh", 0755);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:82,代码来源:exec.menu.snapshots.php

示例8: statusDB

function statusDB()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $users = new usersMenus();
    $sock = new sockets();
    $backbutton = null;
    if ($_GET["from-ufdbguard"] == "yes") {
        echo $tpl->_ENGINE_parse_body("\n\t\t\t\t<div style='margin:15px;text-align:right'>\n\t\t\t\t" . button("{back_to_webfiltering}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','dansguardian2.mainrules.php')", 18) . "\n\t\t\t\t</div>");
    }
    $q = new mysql_catz();
    $sock = new sockets();
    $ini = new Bs_IniHandler();
    $catz = $q->LIST_TABLES_CATEGORIES();
    $sock->getFrameWork('cmd.php?squid-ini-status=yes');
    $ini->loadFile("/usr/share/artica-postfix/ressources/databases/ALL_SQUID_STATUS");
    $CATZ_ARRAY = unserialize(@file_get_contents("/home/artica/categories_databases/CATZ_ARRAY"));
    $date = $CATZ_ARRAY["TIME"];
    $LOCAL_VERSION = $CATZ_ARRAY["TIME"];
    $title = $tpl->_ENGINE_parse_body("{APP_ARTICADB}");
    $q = new mysql_catz();
    $LOCAL_VERSION_TEXT = $tpl->time_to_date($date);
    $CountDecategories = intval(@file_get_contents("/usr/share/artica-postfix/ressources/UFDB_ARTICA_COUNT"));
    $CountDeDatabases = intval(@file_get_contents("/usr/share/artica-postfix/ressources/UFDB_ARTICA_DBS"));
    if (!is_numeric($CountDecategories)) {
        $CountDecategories = 0;
    }
    $CountDecategories = numberFormat($CountDecategories, 0, "", " ");
    $APP_SQUID_DB = DAEMON_STATUS_ROUND("APP_SQUID_DB", $ini, null, 1);
    $APP_UFDBCAT = DAEMON_STATUS_ROUND("APP_UFDBCAT", $ini, null, 1);
    $DisableCategoriesDatabasesUpdates = intval($sock->GET_INFO("DisableCategoriesDatabasesUpdates"));
    $CategoriesDatabasesUpdatesAllTimes = intval($sock->GET_INFO("CategoriesDatabasesUpdatesAllTimes"));
    $CategoriesDatabasesByCron = $sock->GET_INFO("CategoriesDatabasesByCron");
    if (!is_numeric($CategoriesDatabasesByCron)) {
        $CategoriesDatabasesByCron = 1;
    }
    $CategoriesDatabasesShowIndex = $sock->GET_INFO("CategoriesDatabasesShowIndex");
    if (!is_numeric($CategoriesDatabasesShowIndex)) {
        $CategoriesDatabasesShowIndex = 1;
    }
    $DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics");
    if (!is_numeric($DisableArticaProxyStatistics)) {
        $DisableArticaProxyStatistics = 0;
    }
    $fbdize = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/categories-db.size.db"));
    $DBSIZE = FormatBytes($fbdize["DBSIZE"]);
    $POURC = $fbdize["POURC"];
    if (is_numeric($POURC)) {
        $POURC_TXT = "&nbsp;{$POURC}% {used}";
    }
    $p2 = Paragraphe_switch_img("{disable_udpates}", "{disable_udpates_explain}<br>{APP_ARTICADB_EXPLAIN}", "DisableCategoriesDatabasesUpdates", $DisableCategoriesDatabasesUpdates, null, 700);
    $p3 = Paragraphe_switch_img("{free_update_during_the_day}", "{free_update_during_the_day_explain}", "CategoriesDatabasesUpdatesAllTimes", $CategoriesDatabasesUpdatesAllTimes, null, 700);
    $p = Paragraphe_switch_img("{update_only_by_schedule}", "{articadb_update_only_by_schedule}", "CategoriesDatabasesByCron", $CategoriesDatabasesByCron, null, 700);
    $tt0[] = "<tr><td colspan=2>{$p3}</td></tr>";
    $tt0[] = "<tr><td colspan=2>{$p2}</td></tr>";
    $tt0[] = "<tr><td colspan=2>{$p}</td></tr>";
    $tt0[] = "<tr>\n\t\t\t<td width=1%>" . Field_checkbox_design("CategoriesDatabasesShowIndex", 1, $CategoriesDatabasesShowIndex, "CategoriesDatabasesByCron()") . "</td>\n\t\t\t<td nowrap style='font-size:14px;'>:{display_update_info_index}</a></td>\n\t\t</tr>\n\t\t<tr><td colspan=2 align='right'>" . button("{apply}", "CategoriesDatabasesByCron()", 22) . "</td></tr>\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t";
    /*$tt[]="<tr>
    		<td width=1%><img src='img/arrow-right-16.png'>
    		<td nowrap><a href=\"javascript:blur();\"
    		OnClick=\"javascript:Loadjs('squid.catzdb.manual-update.php');\"
    		style='font-size:14px;text-decoration:underline;'>{manual_update}</a></td>
    		</tr>";		
    		*/
    /*$tt[]="<tr>
    		<td width=1%><img src='img/arrow-right-16.png'>
    		<td nowrap><a href=\"javascript:blur();\"
    		OnClick=\"javascript:Loadjs('squid.catzdb.changedir.php');\"
    		style='font-size:14px;text-decoration:underline;'>{change_directory}</a></td>
    		</tr>";	
    		*/
    if ($DisableArticaProxyStatistics == 1) {
        $tt[] = "<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t<td nowrap><a href=\"javascript:blur();\"\n\t\tOnClick=\"javascript:Loadjs('squid.artica.statistics.php');\"\n\t\tstyle='font-size:14px;text-decoration:underline;color:#D10000'>{ARTICA_STATISTICS} {disabled}</a></td>\n\t\t</tr>";
    } else {
        $tt[] = "<tr>\n\t\t<td width=1%><img src='img/arrow-right-16.png'>\n\t\t<td nowrap><a href=\"javascript:blur();\"\n\t\tOnClick=\"javascript:Loadjs('squid.artica.statistics.php');\"\n\t\tstyle='font-size:14px;text-decoration:underline;color:black'>{ARTICA_STATISTICS}</a></td>\n\t\t</tr>";
    }
    $arrayV = unserialize(base64_decode($sock->getFrameWork("squid.php?articadb-nextversion=yes")));
    $REMOTE_VERSION = $arrayV["TIME"];
    if ($REMOTE_VERSION > $date) {
        $REMOTE_VERSION_TEXT = $tpl->time_to_date($REMOTE_VERSION);
        $newver = "\t<tr>\n\t\t<td colspan=2><div style='font-size:16px;color:#D52210'>{new_version}:&nbsp;{$REMOTE_VERSION} <i style='font-size:11px'>{$REMOTE_VERSION_TEXT}</i>&nbsp</div></td>\n\t</tr>";
        $updaebutton = "<div style='text-align:right'><hr>" . button("{update_now}", "Loadjs('squid.blacklist.upd.php')", 22) . "</div>";
    }
    $nextcheck = $sock->getFrameWork("squid.php?articadb-nextcheck=yes");
    $nextcheck = intval($nextcheck);
    if ($nextcheck > 0) {
        $nextcheck_text = "\t\n\t<tr>\n\t\t<td colspan=2><div style='font-size:16px'>{next_check_in}:&nbsp;{$nextcheck}Mn</div></td>\n\t</tr>";
    }
    if ($nextcheck < 0) {
        $nextcheck = str_replace("-", "", $nextcheck);
        $nextcheckTime = time() - intval($nextcheck) * 60;
        $nextcheckTimeText = distanceOfTimeInWords($nextcheckTime, time());
        $nextcheck_text = "\t\n\t<tr>\n\t\t<td colspan=2><div style='font-size:16px'>{last_check}:&nbsp;{$nextcheckTimeText}</div></td>\n\t</tr>";
    }
    $dbsize = $sock->getFrameWork("squid.php?articadbsize=yes");
    $items = numberFormat($q->COUNT_CATEGORIES(), 0, "", " ");
    $html = "\n\t<div style='width:98%' class=form>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$APP_SQUID_DB}<br>{$APP_UFDBCAT}</td>\n\t<td valign='top'>\n\t<table style='width:100%'>" . @implode("\n", $tt0) . "</table>\n\t<hr>\n\t<table style='width:100%'>\n\t<tbody>\n\t<tr>\n\t\t<td colspan=2><div style='font-size:16px'>{pattern_database_version}:&nbsp;{$date} <i style='font-size:11px'>{$LOCAL_VERSION_TEXT}</i>&nbsp{$POURC_TXT}</div></td>\n\t</tr>\n\t{$newver}\n\t{$nextcheck_text}\n\t<tr>\n\t\t<td colspan=2><div style='font-size:16px'>{categories}:&nbsp;{$CountDeDatabases}</a></div></td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2><div style='font-size:16px'>{categorized_websites}:&nbsp;\n\t\t<a href=\"javascript:Loadjs('squid.catz.php');\" style='font-size:16px;text-decoration:underline'>\n\t\t{$CountDecategories}</a>&nbsp</div></td>\n\t</tr>\n\t" . @implode("", $tt) . "\n\t</tbody>\n\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t{$updaebutton}\n\t<div id='database-progress-status'></div>\n<script>\nvar xCategoriesDatabasesByCron= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>1){alert(results);}\n}\n\t\nfunction CategoriesDatabasesByCron(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('CategoriesDatabasesByCron',document.getElementById('CategoriesDatabasesByCron').value);\n\tXHR.appendData('DisableCategoriesDatabasesUpdates',document.getElementById('DisableCategoriesDatabasesUpdates').value);\n\tXHR.appendData('CategoriesDatabasesUpdatesAllTimes',document.getElementById('CategoriesDatabasesUpdatesAllTimes').value);\n\tif(document.getElementById('CategoriesDatabasesShowIndex').checked){XHR.appendData('CategoriesDatabasesShowIndex','1');}else{XHR.appendData('CategoriesDatabasesShowIndex','0');}\n\tXHR.sendAndLoad('{$page}', 'POST',xCategoriesDatabasesByCron);\n}\n\t\n\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:99,代码来源:dansguardian2.databases.php

示例9: license_status


//.........这里部分代码省略.........
    if ($users->KASPERSKY_WEB_APPLIANCE) {
        $ASWEB = true;
    }
    $unlocklick_hidden = null;
    $your_email_address_color = null;
    $RegisterCloudBadEmail_text = null;
    if ($RegisterCloudBadEmail == 1) {
        $RegisterCloudBadEmail_text = "<p class=text-error style='font-size:18px'>{incorrect_email_address_cloud}</p>";
        $your_email_address_color = ";color:#d32d2d !important";
    }
    $License_explain = "<div class=explain style='font-size:20px;margin:20px'>" . $tpl->_ENGINE_parse_body("{artica_license_explain}") . "</div>";
    $WhichLicense[null] = "{select}";
    $WhichLicense["evaluation"] = "{request_an_evaluation_license}";
    $WhichLicense["cotation"] = "{request_an_corporate_license}";
    $LICENCE_REQUEST_ERROR = $tpl->javascript_parse_text("{LICENCE_REQUEST_ERROR}");
    if (!isset($LicenseInfos["LICENCE_REQUEST"])) {
        $LicenseInfos["LICENCE_REQUEST"] = null;
    }
    $WhichLicense_field = "<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{license_request}:</td>\n\t\t\t\t<td style='font-size:24px;font-weight:bold'>\n\t\t\t\t<input type='hidden' id='LICENCE_REQUEST-{$t}' value='evaluation'>\n\t\t\t{request_an_evaluation_license}</td>\n\t\t\t</tr>";
    $unlocklick = "<td>" . Field_text("UNLOCKLIC-{$t}", $LicenseInfos["UNLOCKLIC"], "font-size:24px;width:240px") . "</td>";
    if ($LicenseInfos["license_status"] == null) {
        $step = 1;
        $LicenseInfos["license_status"] = "{waiting_registration}";
        $star = "{explain_license_free}";
        $button_text = "{request_an_evaluation_license}";
    } else {
        $step = 2;
        $step_text = "{waiting_order}";
        $button_text = "{update_the_request}";
        $star = "{explain_license_order}";
        if ($LicenseInfos["LICENCE_REQUEST"] == "evaluation") {
            $step_text = "{request_an_evaluation_license}";
        }
    }
    if ($LicenseInfos["license_status"] == "{license_active}") {
        $users->CORP_LICENSE = true;
        $WhichLicense_field = null;
        $titleprice = null;
        $License_explain = null;
        if ($LicenseInfos["UNLOCKLIC"] != null) {
            $unlocklick = "\n\t\t<td style='font-size:24px;font-weight:bold'>\n\t\t\t<input type='hidden' id='UNLOCKLIC-{$t}' value='{$LicenseInfos["UNLOCKLIC"]}'>\n\t\t\t<div style='float:right'>" . imgtootltip("delete-32.png", "{delete}:{unlock_license}", "Loadjs('{$page}?remove-lock-lic-js=yes')") . "</div>\n\t\t\t<span style='font-size:24px'>{$LicenseInfos["UNLOCKLIC"]}</span>\n\t\t</td>";
        } else {
            $unlocklick = null;
        }
    }
    if ($users->CORP_LICENSE) {
        $star = null;
        $titleprice = null;
        $WhichLicense_field = null;
        $step = 3;
        $step_text = "{license_active}";
    }
    if (is_numeric($LicenseInfos["TIME"])) {
        $tt = distanceOfTimeInWords($LicenseInfos["TIME"], time());
        $last_access = "\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{last_update}:</td>\n\t\t\t\t<td style='font-size:24px'>{since} {$tt}</td>\n\t\t\t</tr>";
    }
    if ($LicenseInfos["GoldKey"] != null) {
        $LicenseInfos["license_number"] = $LicenseInfos["GoldKey"];
    }
    if (trim($LicenseInfos["license_number"]) != null) {
        $explain = "{explain_license_order}";
    }
    $CORP_LICENSE = 0;
    $textcolor = "black";
    $bt = "<hr>" . button($button_text, "RegisterSave{$t}()", 26);
    if ($unlocklick != null) {
        $unlock_license = "<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{unlock_license}:</td>\n\t\t\t\t{$unlocklick}\n\t\t\t</tr>";
    }
    if ($users->CORP_LICENSE) {
        $CORP_LICENSE = 1;
        $textcolor = "#23A83E";
        $paypal = null;
        $explain = null;
        $LicenseInfos["license_status"] = "{license_active}";
    }
    if ($explain != null) {
        $explain = "<div style='font-size:16px' class=explain>{$titleprice}<br>{$explain}</div>";
    }
    $FINAL_TIME = 0;
    if (isset($LicenseInfos["FINAL_TIME"])) {
        $FINAL_TIME = intval($LicenseInfos["FINAL_TIME"]);
    }
    if ($FINAL_TIME > 0) {
        $ExpiresSoon = intval(time_between_day_Web($FINAL_TIME));
        $distanceOfTimeInWords = distanceOfTimeInWords(time(), $FINAL_TIME);
        if ($ExpiresSoon < 7) {
            $ExpiresSoon_text = "<strong style='color:red;font-size:16px'>&nbsp;{ExpiresSoon}</strong>";
        }
        if ($FINAL_TIME < time()) {
            $ExpiresSoon_text = "<strong style='color:red;font-size:16px'>&nbsp;{expired} <i>{license_expired_explain}</i></strong>";
            $distanceOfTimeInWords = null;
        }
        $licenseTime = "\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{expiredate}:</td>\n\t\t\t\t<td style='font-size:24px'>" . $tpl->time_to_date($FINAL_TIME) . " ({$distanceOfTimeInWords}{$ExpiresSoon_text})</td>\n\t\t\t</tr>";
    }
    if ($LicenseInfos["license_number"] != null) {
        $license_number = "<tr>\n\t<td class=legend style='font-size:24px'>{license_number}:</td>\n\t<td style='font-size:24px'>{$LicenseInfos["license_number"]}</td>\n\t</tr>";
    }
    $html = "\n{$License_explain}\n<div  style='width:98%;min-height:620px' class=form>\n{$RegisterCloudBadEmail_text}\n<table style='width:100%'>\n<tr>\n\t<td valign='top'>\n\t\t<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px;vertical-align:middle;'>{step}:</td>\n\t\t\t\t<td style='font-size:28px;font-weight:bold;color:{$textcolor}'>{$step}: {$step_text}<br>\n\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2 align=right'>\n\t\t\t\t\t\t\t\t\t<div style='text-align:right'><a href=\"javascript:blur();\" \n\t\t\t\t\t\t\tOnClick=\"javascript:Loadjs('artica.settings.php?js=yes&func-ProxyInterface=yes');\"\n\t\t\t\tstyle='text-decoration:underline;font-size:16px'>{http_proxy}</a>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t{$last_access}\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{uuid}:</td>\n\t\t\t\t<td style='font-size:24px'>{$uuid}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{company}:</td>\n\t\t\t\t<td>" . Field_text("COMPANY-{$t}", $LicenseInfos["COMPANY"], "font-size:24px;width:450px") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px{$your_email_address_color}'>{your_email_address}:</td>\n\t\t\t\t<td>" . Field_text("EMAIL-{$t}", $LicenseInfos["EMAIL"], "font-size:24px;width:450px{$your_email_address_color}") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:24px'>{nb_employees}:</td>\n\t\t\t\t<td>" . Field_text("EMPLOYEES-{$t}", FormatNumber($LicenseInfos["EMPLOYEES"]), "font-size:24px;width:80px") . "</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t{$WhichLicense_field}\n\n\t\t\t{$unlock_license}\n\t\t\t{$unlocklick_hidden}\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:24px'>{license_status}:</td>\n\t\t\t<td style='font-size:28px;color:{$textcolor}'>{$LicenseInfos["license_status"]}</td>\n\t\t</tr>\n\t\t{$licenseTime}\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'>{$bt}</td>\n\t\t</tr>\n\t</table>\n</td>\n</table>\n\n\t\n<script>\nvar x_RegisterSave{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);return;}\n\tLoadjs('artica.license.progress.php');\n}\n\t\nfunction RegisterSave{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\tif(document.getElementById('LICENCE_REQUEST-{$t}')){\n\t\tvar LICENCE_REQUEST=document.getElementById('LICENCE_REQUEST-{$t}').value;\n\t\tif(LICENCE_REQUEST==''){alert('{$LICENCE_REQUEST_ERROR}'); return;}\n\t\tXHR.appendData('LICENCE_REQUEST',LICENCE_REQUEST);\n\t}\n\t\n\tXHR.appendData('COMPANY',document.getElementById('COMPANY-{$t}').value);\n\tXHR.appendData('EMAIL',document.getElementById('EMAIL-{$t}').value);\n\tXHR.appendData('EMPLOYEES',document.getElementById('EMPLOYEES-{$t}').value);\n\t\n\tif( document.getElementById('UNLOCKLIC-{$t}') ){\n\t\tXHR.appendData('UNLOCKLIC',document.getElementById('UNLOCKLIC-{$t}').value);\n\t}\n\tXHR.appendData('REGISTER','1');\n\tXHR.sendAndLoad('{$page}', 'POST',x_RegisterSave{$t});\n}\n\t\nfunction CheckCorpLic(){\n\tvar lic={$CORP_LICENSE};\n}\nCheckCorpLic();\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:articatech,项目名称:artica,代码行数:101,代码来源:artica.license.php

示例10: content_table

function content_table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $new_group = $tpl->javascript_parse_text("{new_group}");
    $groups = $tpl->javascript_parse_text("{groups2}");
    $memory = $tpl->javascript_parse_text("{memory}");
    $load = $tpl->javascript_parse_text("{load}");
    $version = $tpl->javascript_parse_text("{version}");
    $servername = $tpl->javascript_parse_text("{servername2}");
    $status = $tpl->javascript_parse_text("{status}");
    $events = $tpl->javascript_parse_text("{events}");
    $global_whitelist = $tpl->javascript_parse_text("{whitelist} (Meta)");
    $policies = $tpl->javascript_parse_text("{policies}");
    $orders = $tpl->javascript_parse_text("{orders}");
    $switch = $tpl->javascript_parse_text("{switch}");
    $link_host = $tpl->javascript_parse_text("{link_host}");
    $link_all_hosts = $tpl->javascript_parse_text("{link_all_hosts}");
    $all = $tpl->javascript_parse_text("{all}");
    $file = $tpl->javascript_parse_text("{file}");
    $size = $tpl->javascript_parse_text("{size}");
    $table = "snapshots";
    $database = null;
    $ID = $_GET["ID"];
    $q = new mysql_meta();
    $sql = "SELECT zDate FROM {$table} WHERE ID='{$ID}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
    $title = $tpl->time_to_date(strtotime($ligne["zDate"]));
    $t = time();
    $buttons = null;
    $html = "\n\n\t<table class='ARTICA_SNAPSHOTS_DETAILS_TABLE' style='display: none' id='ARTICA_SNAPSHOTS_DETAILS_TABLE' style='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#ARTICA_SNAPSHOTS_DETAILS_TABLE').flexigrid({\n\turl: '{$page}?content-search=yes&ID={$ID}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$file}', name : 'zDate', width : 611, sortable : false, align: 'left'},\n\t{display: '{$size}', name : 'size', width : 150, sortable : false, align: 'right'},\n\t\n\t\n\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$all}', name : 'zDate'},\n\t\n\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<strong style=font-size:22px>{$title}</strong>',\n\tuseRp: true,\n\trpOptions: [10, 20, 30, 50,100,200],\n\trp:200,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 400,\n\tsingleSelect: true\n\n});\n});\n\n\n</script>";
    echo $html;
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:34,代码来源:artica-meta.snapshots.php

示例11: rule_popup

function rule_popup()
{
    $q = new mysql_squid_builder();
    $tpl = new templates();
    $page = CurrentPageName();
    $ID = $_GET["ID"];
    $sock = new sockets();
    $ARRAY = unserialize(base64_decode($sock->GET_INFO("SquidDynamicCaches")));
    $SquidCacheLevel = $sock->GET_INFO("SquidCacheLevel");
    if (!is_numeric($SquidCacheLevel)) {
        $SquidCacheLevel = 4;
    }
    if (!is_numeric($ARRAY["MAX_WWW"])) {
        $ARRAY["MAX_WWW"] = 100;
    }
    if (!is_numeric($ARRAY["ENABLED"])) {
        if ($SquidCacheLevel > 2) {
            $ARRAY["ENABLED"] = 1;
        }
    }
    if (!is_numeric($ARRAY["LEVEL"])) {
        $ARRAY["LEVEL"] = 5;
    }
    if (!is_numeric($ARRAY["INTERVAL"])) {
        $ARRAY["INTERVAL"] = 420;
    }
    if (!is_numeric($ARRAY["MAX_TTL"])) {
        $ARRAY["MAX_TTL"] = 15;
    }
    $MAX_TTL = $ARRAY["MAX_TTL"];
    $MAX_TTL = $MAX_TTL * 24;
    $MAX_TTL = $MAX_TTL * 60;
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM main_cache_dyn WHERE familysite='{$ID}'"));
    $t = time();
    for ($i = 1; $i < 11; $i++) {
        $ENFORCE[$i] = "{level} {$i}";
    }
    $ttime = strtotime($ligne['zDate']);
    $ttime = strtotime("+{$MAX_TTL} minutes", $ttime);
    $html = "<div style='font-size:26px;margin-bottom:16px'>{$ID}</div>\n\t<p class=explain style='font-size:16px'>{next_check}:" . $tpl->time_to_date($ttime) . "</p>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{enforce_level}:</td>\n\t\t\t<td>" . Field_array_Hash($ENFORCE, "level-{$t}", $ligne["level"], "style:font-size:18px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{enabled}:</td>\n\t\t\t<td>" . Field_checkbox("enabled-{$t}", $ligne["enabled"], 1, "enabledCheck{$t}()") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{only_pictures}:</td>\n\t\t\t<td>" . Field_checkbox("OnlyImages-{$t}", $ligne["OnlyImages"], 1) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{only_multimedia}:</td>\n\t\t\t<td>" . Field_checkbox("OnlyMultimedia-{$t}", $ligne["OnlyMultimedia"], 1) . "</td>\n\t\t</tr>\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{only_internet_documents}:</td>\n\t\t\t<td>" . Field_checkbox("OnlyeDoc-{$t}", $ARRAY["OnlyeDoc"], 1) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{only_files}:</td>\n\t\t\t<td>" . Field_checkbox("OnlyFiles-{$t}", $ARRAY["OnlyFiles"], 1) . "</td>\n\t\t</tr>\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 26) . "</td>\n\t\t</tr>\n</table>\n</div>\n<script>\nvar xSave{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#flexRT{$_GET["SourceT"]}').flexReload();\n\tYahooWin2Hide();\n\t\n}\n\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('level',document.getElementById('level-{$t}').value);\n\tXHR.appendData('edit-www','{$ID}');\n\tif(document.getElementById('enabled-{$t}').checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n\tif(document.getElementById('OnlyImages-{$t}').checked){XHR.appendData('OnlyImages',1);}else{XHR.appendData('OnlyImages',0);}\n\tif(document.getElementById('OnlyeDoc-{$t}').checked){XHR.appendData('OnlyeDoc',1);}else{XHR.appendData('OnlyeDoc',0);}\n\tif(document.getElementById('OnlyFiles-{$t}').checked){XHR.appendData('OnlyFiles',1);}else{XHR.appendData('OnlyFiles',0);}\t\n\tif(document.getElementById('OnlyMultimedia-{$t}').checked){XHR.appendData('OnlyMultimedia',1);}else{XHR.appendData('OnlyMultimedia',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\nfunction enabledCheck{$t}(){\n\tdocument.getElementById('level-{$t}').disabled=true;\n\tdocument.getElementById('OnlyImages-{$t}').disabled=true;\n\tdocument.getElementById('OnlyeDoc-{$t}').disabled=true;\n\tdocument.getElementById('OnlyFiles-{$t}').disabled=true;\n\tdocument.getElementById('OnlyMultimedia-{$t}').disabled=true;\n\tif(!document.getElementById('enabled-{$t}').checked){return;}\n\tdocument.getElementById('OnlyImages-{$t}').disabled=false;\n\tdocument.getElementById('OnlyeDoc-{$t}').disabled=false;\n\tdocument.getElementById('OnlyFiles-{$t}').disabled=false;\n\tdocument.getElementById('OnlyMultimedia-{$t}').disabled=false;\n\tdocument.getElementById('level-{$t}').disabled=false;\t\n}\nenabledCheck{$t}();\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:42,代码来源:squid.cache.dynamic.rules.php

示例12: build_graph

function build_graph()
{
    $zmd5 = $_GET["zmd5"];
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT params FROM reports_cache WHERE `zmd5`='{$zmd5}'"));
    $params = unserialize($ligne["params"]);
    $from = $tpl->time_to_date($params["FROM"], true);
    $to = $tpl->time_to_date($params["TO"], true);
    $interval = $params["INTERVAL"];
    if ($interval == 0) {
        $interval = "1h";
    }
    $user = $params["USER"];
    $user_data = $params["SEARCH"];
    $title = "{user_report}: {from} {$from} {to} {$to} {$interval} {member}:{$user}/{$user_data}";
    $html = "\n\t<center style='font-size:20px;margin-bottom:20px'>{$title}</center>\n\t<div style='width:1150px;height:550px;margin-bottom:10px' id='graph-{$t}'></div>\n\t\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td width=90%>\n\t\t\t<div style='width:800px;height:550px' id='graph2-{$t}'></div>\n\t\t</td>\n\t\t<td style='width:5%;vertical-align:top'>\n\t\t\t<div id='table1-{$t}'></div>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2><p>&nbsp;</p></td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td width=90%>\n\t\t\t<div style='width:800px;height:550px' id='graph4-{$t}'></div>\n\t\t</td>\n\t\t<td style='width:5%;vertical-align:top'>\n\t\t\t<div  id='table4-{$t}'></div>\n\t\t</td>\n\t</tr>\t\n\t\n\t\n\t</table>\n\t<script>\n\t\tLoadjs('{$page}?graph1=yes&container=graph-{$t}&zmd5={$zmd5}&t={$t}');\n\t</script>\n\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:articatech,项目名称:artica,代码行数:21,代码来源:squid.statistics.report.member.php

示例13: server_status


//.........这里部分代码省略.........
        if ($PostgresInstalled == 0) {
            $jsOn = "Loadjs('influxdb.install.progress.php');";
            if (!$users->AsArticaAdministrator) {
                $jsOn = "blur()";
            }
            $err[] = proxy_status_warning("{influx_not_installed}", "{click_to_install}", $jsOn);
        } else {
            $influxdb_tests = influxdb_tests();
            if ($influxdb_tests != null) {
                $err[] = $influxdb_tests;
            }
        }
    }
    if (isset($LicenseInfos["FINAL_TIME"])) {
        if (is_numeric($LicenseInfos["FINAL_TIME"])) {
            $FINAL_TIME = intval($LicenseInfos["FINAL_TIME"]);
            $ExpiresSoon = intval(time_between_day_Web($FINAL_TIME));
            $jsOn = "GoToArticaLicense()";
            $distanceOfTimeInWords = distanceOfTimeInWords(time(), $FINAL_TIME);
            if (!$users->AsSystemAdministrator) {
                $jsOn = null;
            }
            $corporate_licence_will_expire_explain = $tpl->_ENGINE_parse_body("{corporate_licence_will_expire_explain}");
            $corporate_licence_will_expire_explain = str_replace("%d", $ExpiresSoon, $corporate_licence_will_expire_explain);
            if (time() > $FINAL_TIME) {
                $err[] = proxy_status_warning("{license2}:&nbsp;{license_expired} !!", "{license_expired_explain}", $jsOn);
            }
            if ($FINAL_TIME > time()) {
                if ($ExpiresSoon < 10) {
                    $err[] = proxy_status_warning("{corporate_licence_will_expire} ({$ExpiresSoon} {days})", "{$corporate_licence_will_expire_explain}", $jsOn);
                }
                if ($ExpiresSoon < 31) {
                    $ExpiresSoon = $ExpiresSoon + 1;
                    $warn[] = status_important_event("{license2}:&nbsp;{trial_period} - {$ExpiresSoon} {days} -", "{expiredate}:" . $tpl->time_to_date($FINAL_TIME) . " ({$distanceOfTimeInWords})", $jsOn);
                }
            }
        }
    }
    if (!$users->CGROUPS_INSTALLED) {
        $jsOn = "Loadjs('cgroups.install.progress.php');";
        if (!$users->AsArticaAdministrator) {
            $jsOn = "blur()";
        }
        $warn[] = status_important_event("{cgroups_not_installed}", "{click_to_install}", $jsOn);
    }
    if ($RegisterCloudBadEmail == 1) {
        $warn[] = status_important_event("{incorrect_email_address}", "{incorrect_email_address_cloud}", "GoToArticaLicense()");
    }
    if (!extension_loaded('pgsql')) {
        $warn[] = status_important_event("{missing_postgres_library}", "{missing_postgres_library_explain}", "Loadjs('admin.pgsql.php')");
    } else {
        if (!function_exists("pg_connect")) {
            $warn[] = status_important_event("{missing_postgres_library}", "{missing_postgres_library_explain}", "Loadjs('admin.pgsql.php')");
        }
    }
    if ($BOGOMIPS > 0) {
        if ($users->CGROUPS_INSTALLED) {
            if ($BOGOMIPS < 3500) {
                if ($EnableIntelCeleron == 0) {
                    $jsOn = "Loadjs('system.optimize.celeron.wizard.php');";
                    $err[] = status_important_event("{low_performance}", "{low_performance_link_explain}", $jsOn);
                }
            }
        }
    }
    $q = new mysql();
开发者ID:articatech,项目名称:artica,代码行数:67,代码来源:admin.dashboard.proxy.php

示例14: events_search

function events_search()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    //$_POST["rp"]=intval($_POST["rp"])+10;
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if ($_POST["query"] != null) {
        $search = base64_encode($_POST["query"]);
        $datas = unserialize(base64_decode($sock->getFrameWork("squid.php?cachelogs={$search}&rp={$_POST["rp"]}")));
        $total = count($datas);
    } else {
        $datas = unserialize(base64_decode($sock->getFrameWork("squid.php?cachelogs=&rp={$_POST["rp"]}")));
        $total = count($datas);
    }
    $pageStart = ($page - 1) * $rp;
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            if ($_POST["sortname"] == "zDate") {
                if ($_POST["sortorder"] == "asc") {
                    krsort($datas);
                }
            }
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (count($datas) == 0) {
        json_error_show("no data", 1);
    }
    $c = 0;
    $tpl = new templates();
    $current = date("Y-m-d");
    krsort($datas);
    while (list($key, $line) = each($datas)) {
        $date = "&nbsp;";
        if (preg_match("#^([0-9\\.\\/\\s+:]+)\\s+#", $line, $re)) {
            $line = str_replace($re[1], "", $line);
            $date = strtotime($re[1]);
            $datetext = $tpl->time_to_date($date, true);
        }
        if (preg_match("#You should probably remove#i", $line)) {
            continue;
        }
        if (preg_match("#is ignored to keep splay#i", $line)) {
            continue;
        }
        if (preg_match("#is a subnetwork of#i", $line)) {
            continue;
        }
        if (preg_match("#violates HTTP#i", $line)) {
            continue;
        }
        if (preg_match("#empty ACL#i", $line)) {
            continue;
        }
        if (preg_match("#WARNING#i", $line)) {
            $line = "<span style='color:#f59c44'>{$line}</line>";
        }
        if (preg_match("#FATAL#i", $line)) {
            $line = "<span style='color:#680000'>{$line}</line>";
        }
        if (preg_match("#abnormally#i", $line)) {
            $line = "<span style='color:#680000'>{$line}</line>";
        }
        if (preg_match("#Reconfiguring#i", $line)) {
            $line = "<span style='color:#003D0D;font-weight:bold'>{$line}</line>";
        }
        if (preg_match("#Accepting HTTP#i", $line)) {
            $line = "<span style='color:#003D0D;font-weight:bold'>{$line}</line>";
        }
        if (preg_match("#Ready to serve requests#i", $line)) {
            $line = "<span style='color:#003D0D;font-weight:bold'>{$line}</line>";
        }
        $c++;
        $data['rows'][] = array('id' => md5($line), 'cell' => array("<span style='font-size:16px'>{$datetext}</span>", "<span style='font-size:16px'>{$line}</span>"));
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:articatech,项目名称:artica,代码行数:93,代码来源:squid.cachelogs.php

示例15: node_infos_realtime

function node_infos_realtime()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $events = $tpl->_ENGINE_parse_body("{events}");
    $zdate = $tpl->_ENGINE_parse_body("{zDate}");
    $proto = $tpl->_ENGINE_parse_body("{proto}");
    $uri = $tpl->_ENGINE_parse_body("{url}");
    $member = $tpl->_ENGINE_parse_body("{member}");
    $xtime = $tpl->time_to_date(strtotime('-1 hour'), true);
    $title = $tpl->_ENGINE_parse_body("{today}: {from} {$xtime} | {$_GET["MAC"]} | {$_GET["ipaddr"]} | {realtime_requests}");
    $zoom = $tpl->_ENGINE_parse_body("{zoom}");
    $button1 = "{name: 'Zoom', bclass: 'Search', onpress : ZoomSquidAccessLogs},";
    $stopRefresh = $tpl->javascript_parse_text("{stop_refresh}");
    $logs_container = $tpl->javascript_parse_text("{logs_container}");
    $refresh = $tpl->javascript_parse_text("{refresh}");
    $items = $tpl->_ENGINE_parse_body("{items}");
    $size = $tpl->_ENGINE_parse_body("{size}");
    $SaveToDisk = $tpl->_ENGINE_parse_body("{SaveToDisk}");
    $addCat = $tpl->_ENGINE_parse_body("{add} {category}");
    $date = $tpl->_ENGINE_parse_body("{zDate}");
    $task = $tpl->_ENGINE_parse_body("{task}");
    $new_schedule = $tpl->_ENGINE_parse_body("{new_rotate}");
    $explain = $tpl->_ENGINE_parse_body("{explain_squid_tasks}");
    $run = $tpl->_ENGINE_parse_body("{run}");
    $task = $tpl->_ENGINE_parse_body("{task}");
    $size = $tpl->_ENGINE_parse_body("{size}");
    $filename = $tpl->_ENGINE_parse_body("{filename}");
    $empty = $tpl->_ENGINE_parse_body("{empty}");
    $askdelete = $tpl->javascript_parse_text("{empty_store} ?");
    $files = $tpl->_ENGINE_parse_body("{files}");
    $ext = $tpl->_ENGINE_parse_body("{extension}");
    $back_to_events = $tpl->_ENGINE_parse_body("{back_to_events}");
    $Compressedsize = $tpl->_ENGINE_parse_body("{compressed_size}");
    $realsize = $tpl->_ENGINE_parse_body("{realsize}");
    $delete_file = $tpl->javascript_parse_text("{delete_file}");
    $rotate_logs = $tpl->javascript_parse_text("{rotate_logs}");
    $table_size = 855;
    $url_row = 555;
    $member_row = 276;
    $table_height = 420;
    $distance_width = 230;
    $tableprc = "100%";
    $margin = "-10";
    $margin_left = "-15";
    if (is_numeric($_GET["table-size"])) {
        $table_size = $_GET["table-size"];
    }
    if (is_numeric($_GET["url-row"])) {
        $url_row = $_GET["url-row"];
    }
    $hits = $tpl->javascript_parse_text("{hits}");
    $ipaddr = $tpl->javascript_parse_text("{ipaddr}");
    $error = $tpl->javascript_parse_text("{error}");
    $sitename = $tpl->javascript_parse_text("{sitename}");
    $html = "\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n\t</div>\n\t<script>\n\tvar mem{$t}='';\nfunction StartLogsSquidTable{$t}(){\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?node-infos-RTIME-LIST=yes&MAC={$_GET["MAC"]}&ipaddr={$_GET["ipaddr"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$zdate}', name : 'zDate', width :95, sortable : false, align: 'left'},\n\t{display: '{$sitename}', name : 'events', width : 746, sortable : false, align: 'left'},\n\t{display: '{$hits}', name : 'hits', width : 110, sortable : false, align: 'right'},\n\t{display: '{$size}', name : 'size', width : 110, sortable : false, align: 'right'},\n\t],\n\t\t\n\t\n\t\n\tsearchitems : [\n\t{display: '{$sitename}', name : 'SITE'},\n\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 450,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\t\n\t});\n\t\n}\nsetTimeout('StartLogsSquidTable{$t}()',800);\n</script>\n";
    echo $html;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:59,代码来源:squid.nodes.php


注:本文中的templates::time_to_date方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。