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


PHP mysql_squid_builder::UID_FROM_MAC方法代码示例

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


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

示例1: synthesis

function synthesis()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $table = $_GET["table"];
    $user = $_GET["user"];
    $field = $_GET["field"];
    $t = $_GET["divkey"];
    $year = substr($table, 0, 4);
    $month = substr($table, 4, 2);
    $day = substr($table, 6, 2);
    $time = strtotime("{$year}-{$month}-{$day} 00:00:00");
    $dayTitle = date('{l}, {F} Y', $time);
    $TITLE_PAGE = "&laquo;{$user}&raquo; ({{$field}}) <br>{$dayTitle}";
    if ($field == "MAC") {
        $userText = $q->UID_FROM_MAC($user);
        if ($userText != null) {
            $TITLE_PAGE = "{$userText} ({$user}) <br>{$dayTitle}";
        }
    }
    $html = "\n\t\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t<tr>\n\t\t<td width=1%><img src='img/postmaster-48.png'></td>\n\t\t<td><div style='width:100%;font-size:16px;font-weight:bold'>{$TITLE_PAGE}</div></td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t<table style='width:100%'>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td width=50% valign='top'><div id='paragraphe1'></div></td>\n\t\t\t<td width=50% valign='top'><div id='paragraphe2'></div></td>\n\t\t</tr>\n\t</tbody>\n\t</table>\n\t<script>\n\t\tfunction LoadUserSearchSection(){\n\t\t\tif(!document.getElementById('week-search-users-list')){alert('week-search-users-list no such id');}\n\t\t\tLoadAjaxTiny('week-search-users-list','{$page}?users-form=yes&table={$table}&user={$user}&field={$field}');\n\t\t}\n\t\t\n\t\tLoadUserSearchSection();\n\t</script>\n\t\t\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:24,代码来源:squid.traffic.statistics.day.user.php

示例2: uris_list

function uris_list()
{
    $q = new mysql_squid_builder();
    $MyPage = CurrentPageName();
    $tpl = new templates();
    if ($_GET["field"] == "ipaddr") {
        $_GET["field"] = "CLIENT";
    }
    $_GET["xtime"] = strtotime("{$_GET["day"]} 00:00:00");
    $page = 1;
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $tablesource = "dansguardian_events_" . date("Ymd", $_GET["xtime"]);
    $table = "(SELECT DATE_FORMAT(zDate,'%Hh') as zDate,QuerySize as size,hits,uri FROM  {$tablesource} WHERE {$_GET["field"]}='{$_GET["value"]}' AND sitename LIKE '%{$_GET["familysite"]}') as t";
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"] + 1;
    }
    $sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql}";
    $line = $tpl->_ENGINE_parse_body("{line}");
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_events");
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (mysql_num_rows($results) == 0) {
        json_error_show("No data {$sql}");
    }
    $style = "style='font-size:12px'";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $style = "style='font-size:12px'";
        if ($ligne["size"] > 10000000) {
            $style = "style='font-size:12px;font-weight:bold'";
        }
        if (trim($ligne["category"]) == null) {
            $ligne["category"] = "<span style='color:#D70707'>{categorize_this_website}</span>";
        }
        $id = md5(@implode("", $ligne));
        if (trim($ligne["uid"]) == "-") {
            $ligne["uid"] = null;
        }
        if (trim($ligne["uid"]) == null) {
            $ligne["uid"] = $q->UID_FROM_MAC($ligne["MAC"]);
        }
        $ttz = $ligne["size"];
        $ligne["size"] = FormatBytes($ligne["size"] / 1024);
        $data['rows'][] = array('id' => $id, 'cell' => array("<span {$style}>{$ligne["zDate"]}</span>", "<span {$style}>{$ligne["uri"]}</span>", "<span {$style}>{$ligne["size"]}</span>", "<span {$style}>{$ligne["hits"]}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:68,代码来源:squid.traffic.statistics.days.memberAndWebsite.php

示例3: rows_members

function rows_members()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $day = $_GET["day"];
    $time = strtotime("{$day} 00:00:00");
    $table = date("Ymd", $time) . "_hour";
    $textcss = "<span style='font-size:12px'>";
    $search = '%';
    $page = 1;
    $total = 0;
    if ($q->COUNT_ROWS($table, "artica_events") == 0) {
        $data['page'] = $page;
        $data['total'] = $total;
        $data['rows'] = array();
        echo json_encode($data);
        return;
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if ($_POST["query"] != null) {
        $_POST["query"] = "*" . $_POST["query"] . "*";
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("*", "%", $_POST["query"]);
        $search = $_POST["query"];
        $searchstring = "HAVING (`{$_POST["qtype"]}` LIKE '{$search}')";
        $sql = "SELECT SUM(size) as tsize, SUM(hits) as thits,client,uid,MAC,hostname FROM `{$table}` GROUP BY client,uid,MAC,hostname {$searchstring}";
        $results = $q->QUERY_SQL($sql, "artica_events");
        $total = mysql_numrows($results);
    } else {
        $sql = "SELECT SUM(size) as tsize, SUM(hits) as thits,client,uid,MAC,hostname FROM GROUP BY client,uid,MAC,hostname `{$table}`";
        $results = $q->QUERY_SQL($sql, "artica_events");
        $total = mysql_numrows($results);
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT SUM(size) as tsize, SUM(hits) as thits,client,uid,MAC,hostname FROM `{$table}` GROUP BY client,uid,MAC,hostname {$searchstring} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_events");
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (!$q->ok) {
        $data['rows'][] = array('id' => $ligne[time() + 1], 'cell' => array($q->mysql_error, "", "", ""));
        $data['rows'][] = array('id' => $ligne[time()], 'cell' => array($sql, "", "", ""));
        echo json_encode($data);
        return;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $jsweb = "\n\t\t<a href=\"javascript:blur()\"\n\t\tOnClick=\"javascript:Loadjs('squid.traffic.statistics.days.php?today-zoom=yes&type=req&familysite={$ligne["familysite"]}&day={$_GET["day"]}')\"\n\t\tstyle='font-size:12px;text-decoration:underline'>";
        $jsjscat = "Loadjs('squid.categorize.php?www={$ligne["sitename"]}&day={$_GET["day"]}&week=&month=');";
        $jscat = "<a href=\"javascript:blur()\"\n\t\tOnClick=\"javascript:{$jsjscat}\"\n\t\tstyle='font-size:12px;text-decoration:underline'>\n\t\t";
        $ligne["tsize"] = FormatBytes($ligne["tsize"] / 1024);
        $uid = ahref_member("uid", $ligne["uid"], $table);
        if ($ligne["uid"] == null) {
            $ligne["uid"] = $q->UID_FROM_MAC($ligne["MAC"]);
            $uid = $ligne["uid"];
        }
        $data['rows'][] = array('id' => $ligne['MAC'], 'cell' => array($textcss . $uid . "</a></span>", $textcss . ahref_member("hostname", $ligne["hostname"], $table) . "</a></span>", $textcss . ahref_member("client", $ligne["client"], $table) . "</span>", $textcss . ahref_member("MAC", $ligne["MAC"], $table) . "</span>", $textcss . $ligne["thits"] . "</span>", $textcss . $ligne["tsize"] . "</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:74,代码来源:squid.traffic.table.days.php

示例4: youtube_array_to_sql

function youtube_array_to_sql($array)
{
    $q = new mysql_squid_builder();
    while (list($key, $val) = each($array)) {
        $val = str_replace("'", "`", $val);
        $val = mysql_escape_string2($val);
        $array[$key] = addslashes($val);
    }
    $VIDEOID = $array["VIDEOID"];
    $clientip = $array["clientip"];
    $username = $array["username"];
    $time = $array["time"];
    $mac = $array["mac"];
    $hostname = $array["hostname"];
    if ($username == "-") {
        $username = null;
    }
    if (strlen($username) < 3) {
        $username = null;
    }
    if (!__IsPhysicalAddress($mac)) {
        $mac = null;
    }
    if ($mac == null) {
        $mac = GetMacFromIP($clientip);
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "{$mac}:: {$VIDEOID} -> \n";
    }
    if (!youtube_infos($VIDEOID)) {
        youtube_events("youtube_infos:: {$VIDEOID} -> FAILED", __LINE__);
    }
    $timeint = strtotime($time);
    $timeKey = date('YmdH', $timeint);
    $account = 0;
    if ($mac != null) {
        if ($username == null) {
            $username = $q->UID_FROM_MAC($mac);
        }
    }
    if ($clientip != null) {
        if ($username == null) {
            $username = $q->UID_FROM_IP($clientip);
        }
    }
    youtube_events("{$timeKey} => ('{$time}','{$clientip}','{$hostname}','{$username}','{$mac}','{$account}','{$VIDEOID}')", __LINE__);
    return array($timeKey, "('{$time}','{$clientip}','{$hostname}','{$username}','{$mac}','{$account}','{$VIDEOID}')");
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:48,代码来源:exec.squid-tail-injector.php

示例5: items

function items()
{
    $page = 1;
    $q = new mysql();
    $table = "nmap_scannet";
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if (!$q->TABLE_EXISTS("nmap_scannet", "artica_backup")) {
        $sql = "CREATE TABLE IF NOT EXISTS `nmap_scannet` (\n\t\t`MAC` varchar(90) NOT NULL,\n\t\t`ipaddr` varchar(90) NOT NULL,\n\t\t`vendor` varchar(90) NOT NULL DEFAULT '',\n\t\t`zDate` datetime NOT NULL,\n\t\tPRIMARY KEY (`MAC`),\n\t\tKEY `ipaddr` (`ipaddr`),\n\t\tKEY `vendor` (`vendor`)\n\t\t) ENGINE=MYISAM;";
        $q->QUERY_SQL($sql, "artica_backup");
    }
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if (!is_numeric($rp)) {
        $rp = 50;
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql}";
    if (isset($_GET["verbose"])) {
        echo "<hr><code>{$sql}</code></hr>";
    }
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        json_error_show($q->mysql_error, 1);
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("{$table} no data", 1);
    }
    $fontsize = "26px";
    $data = array();
    $data['page'] = 1;
    $data['total'] = mysql_num_rows($results);
    $data['rows'] = array();
    //if(mysql_num_rows($results)==0){$data['rows'][] = array('id' => $ligne[time()],'cell' => array($sql,"", "",""));}
    $computer = new computers();
    $tpl = new templates();
    $dhcpfixed = $tpl->_ENGINE_parse_body("{dhcpfixed}");
    $q2 = new mysql_squid_builder();
    while ($ligne = mysql_fetch_assoc($results)) {
        $ipaddr = $ligne["ipaddr"];
        $infoZ = array();
        $mac = strtolower($ligne["MAC"]);
        $vendor = $ligne["vendor"];
        $uid = null;
        $uid = $computer->ComputerIDFromMAC($mac);
        $view = "&nbsp;";
        $jslink = null;
        $jsfiche = null;
        $infos = null;
        $macenc = urlencode($ligne["MAC"]);
        if ($uid != null) {
            $jslink = "<a href=\"javascript:blur();\"\n\t\t\t\tOnClick=\"javascript:" . MEMBER_JS($uid, 1, 1) . "\"\n\t\t\t\tstyle='font-size:{$fontsize};text-decoration:underline'>";
            $computer = new computers($uid);
            if ($computer->dhcpfixed == 1) {
                $infoZ[] = "<a href=\"javascript:blur();\"\n\t\t\t\t\t\t\tOnClick=\"javascript:Loadjs('dhcpd.fixed.hosts.php?modify-dhcpd-settings-js=yes&mac={$macenc}');\"\n\t\t\t\t\t\t\tstyle='text-decoration:underline'>{$dhcpfixed}</a> - ";
            }
            if (trim($computer->DisplayName) != null) {
                $infoZ[] = $computer->DisplayName;
            }
            if (trim($computer->ComputerMachineType) != null) {
                $infoZ[] = $computer->ComputerMachineType;
            }
            if (trim($computer->ComputerOS) != null) {
                $infoZ[] = $computer->ComputerOS;
            }
            $infos = @implode(" - ", $infoZ);
        } else {
            $ocs = new ocs($mac);
            if (trim($ocs->HARDWARE_ID > 0)) {
                if ($ocs->dhcpfixed == 1) {
                    $infos = "<a href=\"javascript:blur();\"\n\t\t\t\t\t\tOnClick=\"javascript:Loadjs('dhcpd.fixed.hosts.php?modify-dhcpd-settings-js=yes&mac={$macenc}');\n\t\t\t\t\t\tstyle='text-decoration:underline'>{$dhcpfixed}</a> - ";
                }
                $infos = $infos . $ocs->ComputerName . " - " . $computer->ComputerOS;
            }
        }
        $macenc = urlencode($mac);
        $proxy_alias = $q2->UID_FROM_MAC($mac);
        if ($proxy_alias != null) {
            $proxy_alias = "\n\t\t\t\t<a href=\"javascript:blur();\"\n\t\t\t\tstyle=\"text-decoration:underline\"\n\t\t\t\tOnClick=\"javascript:Loadjs('squid.nodes.php?node-infos-js=yes&MAC={$macenc}');\"\n\t\t\t\t>{$proxy_alias}</a>";
        }
        if ($proxy_alias == null) {
            $proxy_alias = $q2->UID_FROM_IP($ipaddr);
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:nmap.ping.php

示例6: ParseDB_FILE

function ParseDB_FILE($path, $uuid = null, $asmeta = false)
{
    $unix = new unix();
    if (!is_file($path)) {
        return;
    }
    echo "Open {$path}\n";
    $db_con = dba_open($path, "r", "db4");
    if (!$db_con) {
        if ($asmeta) {
            meta_admin_mysql(1, "DB open failed {$path}", null, __FILE__, __LINE__);
        }
        echo "DB open failed\n";
        die;
    }
    $mainkey = dba_firstkey($db_con);
    while ($mainkey != false) {
        $val = 0;
        $data = unserialize(dba_fetch($mainkey, $db_con));
        $mainkey = dba_nextkey($db_con);
        if (!is_array($data)) {
            continue;
        }
        $q = new mysql_squid_builder();
        $qCommon = new mysql_squid_builder();
        if ($uuid != null) {
            $q = new mysql_stats($uuid);
        }
        if ($asmeta) {
            $q = new mysql_meta();
        }
        if (!isset($data["HOURLY"])) {
            continue;
        }
        if (!isset($data["WWW"])) {
            continue;
        }
        $category = null;
        $ipaddr = mysql_escape_string2($data["IPADDR"]);
        if (isset($data["MAC"])) {
            $mac = mysql_escape_string2($data["MAC"]);
        }
        $uid = mysql_escape_string2($data["UID"]);
        $familysite = mysql_escape_string2($data["WWW"]);
        if (isset($data["category"])) {
            $category = mysql_escape_string2($data["category"]);
        }
        if ($uid == null) {
            $uid = $qCommon->UID_FROM_MAC($data["MAC"]);
        }
        if ($uid == null) {
            $uid = $qCommon->UID_FROM_IP($data["IPADDR"]);
        }
        $uid = mysql_escape_string2($uid);
        $length = strlen($ipaddr) + strlen($mac) + strlen($uid) + strlen($familysite);
        if ($length == 0) {
            continue;
        }
        while (list($day, $array) = each($data["HOURLY"])) {
            while (list($hour, $size) = each($array)) {
                $md5 = md5("'{$ipaddr}','{$mac}','{$uid}','{$familysite}','{$day}','{$hour}','{$size}','{$category}'");
                $wwwUH[] = "('{$md5}','{$ipaddr}','{$mac}','{$uid}','{$familysite}','{$day}','{$hour}','{$size}','{$category}')";
                if ($GLOBALS["VERBOSE"]) {
                    echo "('{$md5}','{$ipaddr}','{$mac}','{$uid}','{$familysite}','{$day}','{$hour}','{$size}','{$category}')\n";
                }
            }
        }
    }
    dba_close($db_con);
    $TABLE_WEEK_RTTH = "WEEK_RTTH";
    $ENGINE = "MEMORY";
    if ($asmeta) {
        $TABLE_WEEK_RTTH = "{$uuid}_WEEK_RTTH";
        $ENGINE = "MYISAM";
    }
    if ($asmeta) {
        xmeta_events("DROP TABLE `{$TABLE_WEEK_RTTH}`", __FUNCTION__, __FILE__, __LINE__);
    }
    $q->QUERY_SQL("DROP TABLE `{$TABLE_WEEK_RTTH}`");
    if ($asmeta) {
        xmeta_events("CREATE TABLE `{$TABLE_WEEK_RTTH}`", __FUNCTION__, __FILE__, __LINE__);
    }
    $q->QUERY_SQL("CREATE TABLE IF NOT EXISTS `{$TABLE_WEEK_RTTH}` (\n\t\t\t`zmd5` varchar(90) NOT NULL,\n\t\t\t`familysite` varchar(128) NOT NULL,\n\t\t\t`ipaddr` varchar(50) NOT NULL DEFAULT '',\n\t\t\t`day` smallint(2) NOT NULL,\n\t\t\t`hour` smallint(2) NOT NULL,\n\t\t\t`uid` varchar(128) NOT NULL,\n\t\t\t`MAC` varchar(20) NOT NULL,\n\t\t\t`size` BIGINT UNSIGNED NOT NULL,\n\t\t\t`category` varchar(90) NOT NULL,\n\t\t\tPRIMARY KEY `zmd5` (`zmd5`),\n\t\t\tKEY `familysite` (`familysite`),\n\t\t\tKEY `ipaddr` (`ipaddr`),\n\t\t\tKEY `uid` (`uid`),\n\t\t\tKEY `category` (`category`),\n\t\t\tKEY `hour` (`hour`),\n\t\t\tKEY `day` (`day`),\n\t\t\tKEY `MAC` (`MAC`)\n\t) ENGINE={$ENGINE};");
    if (!$q->ok) {
        if ($asmeta) {
            meta_admin_mysql(1, "MySQL error", $q->mysql_error, __FILE__, __LINE__);
        }
        echo $q->mysql_error;
        return;
    }
    $q->QUERY_SQL("INSERT IGNORE INTO `{$TABLE_WEEK_RTTH}` ( `zmd5`,`ipaddr`,`MAC`,`uid`,familysite,`day`,`hour`,`size`,`category`) VALUES " . @implode(",", $wwwUH));
    if (!$q->ok) {
        if ($asmeta) {
            meta_admin_mysql(1, "MySQL error", $q->mysql_error, __FILE__, __LINE__);
        }
        echo $q->mysql_error;
        return;
    }
    if ($asmeta) {
        xmeta_events("Success parsing {$path} adding " . count($wwwUH) . " elements", __FUNCTION__, __FILE__, __LINE__);
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.stats-appliance-parse-dbs.php

示例7: SearchComputers


//.........这里部分代码省略.........
        $color = "#7D7D7D";
        $md = md5($ligne["MACADDR"]);
        $uri = strtolower($ligne["NAME"]);
        if ($EnableIntelCeleron == 0) {
            $uid = $computer->ComputerIDFromMAC($ligne["MACADDR"]);
        }
        $view = "&nbsp;";
        $jslink = null;
        $jsfiche = null;
        $ISDB = "ok32-grey.png";
        $DHCP = "ok32-none.png";
        $SQUID = "ok32-none.png";
        if ($DHC_MAIN) {
            $DHCP = "ok32-grey.png";
            if ($computer->dhcpfixedFromMac($ligne["MACADDR"])) {
                $DHCP = "ok32.png";
            }
        }
        if ($SQUID_MAIN) {
            $ligne2 = mysql_fetch_array($q2->QUERY_SQL("SELECT enabled FROM computers_time WHERE `MAC`='{$ligne["MACADDR"]}'", "artica_backup"));
            if (intval($ligne2["enabled"]) != 0) {
                $SQUID = "warning24.png";
            }
        }
        if ($uid != null) {
            $ISDB = "ok32.png";
            $jsfiche = MEMBER_JS($uid, 1, 1);
            $view = "<a href=\"javascript:blur();\" \n\t\t\tOnClick=\"javascript:{$jsfiche}\" \n\t\t\tstyle='font-size:{$fontsize};text-decoration:underline'>" . str_replace("\$", "", strtolower($uid)) . "</a>";
            $jslink = "<a href=\"javascript:blur();\" \n\t\t\tOnClick=\"javascript:{$jsfiche}\" \n\t\t\tstyle='font-size:{$fontsize};text-decoration:underline'>";
        } else {
            $uid = $ligne["NAME"];
            if (preg_match("#^[0-9]+\\.[0-9]+\\.[0-9]+#", $uid)) {
                $q = new mysql_squid_builder();
                $NAME2 = $q->UID_FROM_MAC($ligne["MACADDR"]);
                if ($NAME2 != null) {
                    $uid = $NAME2;
                }
            }
            if ($uid == null) {
                $uid = "Unknown";
            }
            $jsfiche = "Loadjs('domains.computer.autoadd.php?mac=" . urlencode($ligne["MACADDR"]) . "&ipaddr=" . urlencode($ligne["IPADDRESS"]) . "&computername=" . urlencode($uid) . "&t={$_GET["t"]}')";
            if ($EnableIntelCeleron == 1) {
                $jsfiche = "Loadjs('domains.computer.mysql.php?HARDWARE_ID={$HARDWARE_ID}&t={$_GET["t"]}')";
            }
            $jslink = "<a href=\"javascript:blur();\"\n\t\t\tOnClick=\"javascript:{$jsfiche}\"\n\t\t\tstyle='font-size:{$fontsize};text-decoration:underline'>";
            $view = "<a href=\"javascript:blur();\"\n\t\t\tOnClick=\"javascript:{$jsfiche}\"\n\t\t\tstyle='font-size:{$fontsize};text-decoration:underline'>{$uid}</a>";
        }
        $js[] = "LoadAjaxTiny('cmp-{$md}','{$page}?compt-status={$ligne["IPADDRESS"]}');";
        $icon = "<img src='img/{$ISDB}'>";
        if ($ligne["OSNAME"] != null) {
            $OSNAME = "<div style='font-size:9px'><i>{$ligne["OSNAME"]}</i></div>";
        }
        if ($_GET["callback"] != null) {
            $color = "black";
            if ($_GET["fullvalues"] == 1) {
                $viewjs = "{$_GET["callback"]}('{$uid}','{$ligne["IPADDRESS"]}','{$ligne["MACADDR"]}')";
            } else {
                $viewjs = "{$_GET["callback"]}('{$uid}')";
            }
            $view = "<a href=\"javascript:blur();\" \n\t\t\t\t\t\tOnClick=\"javascript:{$viewjs}\" \n\t\t\t\t\t\tstyle='font-size:{$fontsize};text-decoration:underline'>" . str_replace("\$", "", strtolower($uid)) . "</a>";
            $icon = imgtootltip("arrow-blue-left-32.png", null, $viewjs);
        }
        if (!IsPhysicalAddress($ligne["MACADDR"])) {
            if ($_GET["CorrectMac"] == 1) {
                continue;
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:67,代码来源:ocs.search.php

示例8: search

function search()
{
    $Mypage = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $t = time();
    $fontsize = 13;
    $type = $_GET["type"];
    $field_query = "size";
    $field_query2 = "SUM(size)";
    $table_field = "{size}";
    $category = $tpl->_ENGINE_parse_body("{category}");
    $table = "WEEK_RTTH";
    $member = $tpl->_ENGINE_parse_body("{member}");
    $sitename = $tpl->_ENGINE_parse_body("{website}");
    $search = '%';
    $page = 1;
    $ORDER = "ORDER BY ID DESC";
    $ip = new IP();
    $Select = "MAC";
    $FORCE_FILTER = " AND `MAC`='{$_GET["MAC"]}'";
    if ($ip->isIPAddress($_GET["ipaddr"])) {
        $Select = "ipaddr";
        $FORCE_FILTER = "ipaddr='{$_GET["ipaddr"]}'";
    }
    if ($ip->IsvalidMAC($_GET["MAC"])) {
        $Select = "MAC";
        $FORCE_FILTER = "MAC='{$_GET["MAC"]}'";
    }
    $table = "(SELECT `day`,SUM(size) as size,{$Select} FROM WEEK_RTTH GROUP BY `day`,{$Select} HAVING {$FORCE_FILTER}) as t";
    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'];
    }
    $search = string_to_flexquery();
    if ($search != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT* FROM {$table} WHERE 1 {$search} {$ORDER} {$limitSql}";
    $results = $q->QUERY_SQL($sql);
    $data = array();
    $data['page'] = 0;
    $data['total'] = $total;
    $data['rows'] = array();
    if (!$q->ok) {
        json_error_show($q->mysql_error);
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("no data");
    }
    $data['total'] = mysql_num_rows($results);
    $style = "style='font-size:22px'";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ligne["size"] = FormatBytes($ligne["size"] / 1024);
        $categorize = "Loadjs('squid.categorize.php?www={$ligne["sitename"]}')";
        if (trim($ligne["category"]) == null) {
            $ligne["category"] = "<span style='color:#D70707'>{categorize_this_website}</span>";
        }
        $id = md5(@implode("", $ligne));
        if (trim($ligne["uid"]) == "-") {
            $ligne["uid"] = null;
        }
        if (trim($ligne["uid"]) == null) {
            $ligne["uid"] = $q->UID_FROM_MAC($ligne["MAC"]);
        }
        if (trim($ligne["uid"]) == null) {
            $ligne["uid"] = $q->UID_FROM_IP($ligne["CLIENT"]);
        }
        $categorize = "<a href=\"javascript:blur()\" \n\t\tOnClick=\"javascript:{$categorize}\" \n\t\tstyle='font-size:{$fontsize}px;text-decoration:underline'>";
        $familysite = $q->GetFamilySites($ligne["sitename"]);
        $TrafficHour = "<a href=\"javascript:blur()\" \n\t\tOnClick=\"javascript:Loadjs('squid.traffic.statistics.hours.php?familysite={$ligne["sitename"]}&day={$_GET["day"]}')\" \n\t\tstyle='font-size:{$fontsize}px;text-decoration:underline'>";
        $dd = date("Y-m");
        $D = $q->time_to_date(strtotime("{$dd}-{$ligne["day"]} 00:00:00"));
        $data['rows'][] = array('id' => $id, 'cell' => array("<span {$style}>{$D}</span>", "<span {$style}>{$ligne["size"]}</a></span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:95,代码来源:squid.nodes.access.php

示例9: today_zoom_popup_history_list

function today_zoom_popup_history_list(){
	$Mypage=CurrentPageName();
	$tpl=new templates();		
	$q=new mysql_squid_builder();	
	$t=time();
	$fontsize=13;
	$type=$_GET["type"];
	$field_query="size";
	$field_query2="SUM(size)";	
	$table_field="{size}";
	$category=$tpl->_ENGINE_parse_body("{category}");
	if($_GET["day"]==date('Y-m-d')){$_GET["day"]=$q->HIER();}
	$hour_table=date('Ymd',strtotime($_GET["day"]))."_hour";
	$member=$tpl->_ENGINE_parse_body("{member}");
	$sitename=$tpl->_ENGINE_parse_body("{website}");
	
	
	if (isset($_POST['rp'])) {$rp = $_POST['rp'];}
	if(isset($_POST["sortname"])){if($_POST["sortname"]<>null){$ORDER="ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";}}
	if (isset($_POST['page'])) {$page = $_POST['page'];}
	$pageStart = ($page-1)*$rp;
	$limitSql = "LIMIT $pageStart, $rp";
	
	if($type=="req"){
		$field_query="hits";
		$field_query2="SUM(hits)";
		$table_field="{hits}";	
	}	
		
	
	$table="(SELECT $field_query2 as thits, uid,client,MAC,sitename,category,familysite FROM $hour_table 
	GROUP BY uid,client,sitename,MAC,category,familysite HAVING familysite='{$_GET["familysite"]}' ) as t";
	
	
	$searchstring=string_to_flexquery();
	if($searchstring<>null){
	
		$sql="SELECT COUNT(*) as TCOUNT FROM $table WHERE 1 $searchstring";
		$ligne=mysql_fetch_array($q->QUERY_SQL($sql));
		$total = $ligne["TCOUNT"];
	
	}else{
		$sql="SELECT COUNT(*) as TCOUNT FROM $table WHERE 1";
		$ligne=mysql_fetch_array($q->QUERY_SQL($sql));
		$total = $ligne["TCOUNT"]+1;
	}
	
	
	
	$sql="SELECT * FROM $table WHERE 1 $searchstring $ORDER $limitSql";	
	
	
	$results=$q->QUERY_SQL($sql);
	
	$data = array();
	$data['page'] = 0;
	$data['total'] = $total;
	$data['rows'] = array();	
	
	
	if(!$q->ok){json_error_show($q->mysql_error);};	
	if(mysql_num_rows($results)==0){json_error_show("No data");}
	
	$data['total'] = mysql_num_rows($results);
	
	$style="style='font-size:{$fontsize}px'";
	
	while($ligne=@mysql_fetch_array($results,MYSQL_ASSOC)){
		
		if($type<>"req"){$ligne["thits"]=FormatBytes($ligne["thits"]/1024);}
		
		$categorize="Loadjs('squid.categorize.php?www={$ligne["sitename"]}')";
		if(trim($ligne["category"])==null){$ligne["category"]="<span style='color:#D70707'>{categorize_this_website}</span>";}
	
						
		$id=md5(@implode("", $ligne));
		
		if(trim($ligne["uid"])=="-"){$ligne["uid"]=null;}
		if(trim($ligne["uid"])==null){$ligne["uid"]=$q->UID_FROM_MAC($ligne["MAC"]);}
		
		$categorize="<a href=\"javascript:blur()\" 
		OnClick=\"javascript:$categorize\" 
		style='font-size:{$fontsize}px;text-decoration:underline'>";
		
		
		$familysite=$q->GetFamilySites($ligne["sitename"]);
		$TrafficHour="<a href=\"javascript:blur()\" 
		OnClick=\"javascript:Loadjs('squid.traffic.statistics.hours.php?familysite={$ligne["sitename"]}&day={$_GET["day"]}')\" 
		style='font-size:{$fontsize}px;text-decoration:underline'>";
		
		
		$data['rows'][] = array(
			'id' => $id,
			'cell' => array(
			"<span $style>{$ligne["uid"]}</span>",
			"<span $style>{$ligne["MAC"]}</span>",
			"<span $style>{$ligne["client"]}</span>",
			"<span $style>$TrafficHour{$ligne["sitename"]}</a></span>",
			"<span $style>{$ligne["thits"]}</span>",
			"<span $style>$categorize{$ligne["category"]}</a></span>"
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:squid.traffic.statistics.days.php

示例10: items

function items()
{
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $uid = $_GET["uid"];
    $users = new usersMenus();
    $sock = new sockets();
    if (!$users->AsMailBoxAdministrator) {
        $uid = $_SESSION["uid"];
    }
    $search = '%';
    $table = "UserAuthDaysGrouped";
    $database = "artica_backup";
    $page = 1;
    $FORCE_FILTER = null;
    if (isset($_GET["ByUid"])) {
        $FORCE_FILTER = " AND LENGTH(uid)>1";
    }
    if (isset($_GET["ByMAC"])) {
        $FORCE_FILTER = " AND LENGTH(MAC)>1";
    }
    if (!$q->TABLE_EXISTS($table, $database)) {
        json_error_show("{$table} doesn't exists...");
    }
    if ($q->COUNT_ROWS($table, $database) == 0) {
        json_error_show("No rules");
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER} {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM {$table} WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, $database);
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (!$q->ok) {
        json_error_show($q->mysql_error);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $zmd5 = md5(serialize($ligne));
        $delete = imgsimple("delete-24.png", "", "Delete{$t}('{$zmd5}')");
        $enabled = Field_checkbox("enable_{$zmd5}", 1, $ligne["enabled"], "Enable{$t}('{$zmd5}')");
        $color = "black";
        $urljs = "<a href=\"javascript:blur();\" \n\tOnClick=\"javascript:GItem{$t}('{$zmd5}','{$ligne["imapserv"]}/{$ligne["account"]}')\"\n\tstyle='font-size:14px;text-decoration:underline;color:{$color}'>";
        $ligne["hits"] = numberFormat($ligne["hits"], 0, "", " ");
        $ligne["QuerySize"] = FormatBytes($ligne["QuerySize"] / 1024);
        if ($ligne["MAC"] != null) {
            if (strlen($ligne["uid"]) < 2) {
                $ligne["uid"] = $q->UID_FROM_MAC($ligne["MAC"]);
            }
        }
        if ($ligne["ipaddr"] != null) {
            if ($ligne["uid"] == null) {
                $ligne["uid"] = $q->UID_FROM_IP($ligne["ipaddr"]);
            }
        }
        $data['rows'][] = array('id' => "{$zmd5}", 'cell' => array("<span style='font-size:14px;color:{$color}'>{$urljs}{$ligne["ipaddr"]}</a></span>", "<span style='font-size:14px;color:{$color}'>{$urljs}{$ligne["MAC"]}</a></span>", "<span style='font-size:14px;color:{$color}'>{$urljs}{$ligne["hostname"]}</a></span>", "<span style='font-size:14px;color:{$color}'>{$urljs}{$ligne["uid"]}</span>", "<span style='font-size:14px;color:{$color}'>{$urljs}{$ligne["QuerySize"]}</span>", "<span style='font-size:14px;color:{$color}'>{$ligne["hits"]}</span>"));
    }
    echo json_encode($data);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:84,代码来源:miniadm.webstats.members.php

示例11: today_zoom_popup_history_list

function today_zoom_popup_history_list(){
	$Mypage=CurrentPageName();
	$tpl=new templates();		
	$q=new mysql_squid_builder();	
	$t=time();
	$fontsize=13;
	$type=$_GET["type"];
	$field_query="size";
	$field_query2="SUM(size)";	
	$table_field="{size}";
	$category=$tpl->_ENGINE_parse_body("{category}");
	$hour_table=date('Ymd',strtotime($_GET["day"]))."_hour";
	$member=$tpl->_ENGINE_parse_body("{member}");
	$sitename=$tpl->_ENGINE_parse_body("{website}");
	
	if($type=="req"){
		$field_query="hits";
		$field_query2="SUM(hits)";
		$table_field="{hits}";	
	}	
		
	
	$sql="SELECT $field_query2 as thits, uid,client,MAC,sitename,category,familysite FROM $hour_table 
	GROUP BY uid,client,sitename,MAC,category,familysite HAVING familysite='{$_GET["familysite"]}' ORDER BY thits DESC LIMIT 0,100";
	$results=$q->QUERY_SQL($sql);
	
	$data = array();
	$data['page'] = 0;
	$data['total'] = $total;
	$data['rows'] = array();	
	
	
	if(!$q->ok){$data['rows'][] = array('id' => $ligne[time()],'cell' => array($sql,"$q->mysql_error", "",""));echo json_encode($data);return;}	
	if(mysql_num_rows($results)==0){array('id' => $ligne[time()],'cell' => array(null,"", "",""));echo json_encode($data);return;}
	
	$data['total'] = mysql_num_rows($results);
	
	$style="style='font-size:{$fontsize}px'";
	
	while($ligne=@mysql_fetch_array($results,MYSQL_ASSOC)){
		
		if($type<>"req"){$ligne["thits"]=FormatBytes($ligne["thits"]/1024);}
		
		$categorize="Loadjs('squid.categorize.php?www={$ligne["sitename"]}')";
		if(trim($ligne["category"])==null){$ligne["category"]="<span style='color:#D70707'>{categorize_this_website}</span>";}
	
						
		$id=md5(@implode("", $ligne));
		
		if(trim($ligne["uid"])=="-"){$ligne["uid"]=null;}
		if(trim($ligne["uid"])==null){$ligne["uid"]=$q->UID_FROM_MAC($ligne["MAC"]);}
		
		$categorize="<a href=\"javascript:blur()\" 
		OnClick=\"javascript:$categorize\" 
		style='font-size:{$fontsize}px;text-decoration:underline'>";
		
		
		$familysite=$q->GetFamilySites($ligne["sitename"]);
		$TrafficHour="<a href=\"javascript:blur()\" 
		OnClick=\"javascript:Loadjs('squid.traffic.statistics.hours.php?familysite={$ligne["sitename"]}&day={$_GET["day"]}')\" 
		style='font-size:{$fontsize}px;text-decoration:underline'>";
		
		
		$data['rows'][] = array(
			'id' => $id,
			'cell' => array(
			"<span $style>{$ligne["uid"]}</span>",
			"<span $style>{$ligne["MAC"]}</span>",
			"<span $style>{$ligne["client"]}</span>",
			"<span $style>$TrafficHour{$ligne["sitename"]}</a></span>",
			"<span $style>{$ligne["thits"]}</span>",
			"<span $style>$categorize{$ligne["category"]}</a></span>"
			)
			);		
		
		
	}

echo json_encode($data);	
		
	
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:82,代码来源:squid.traffic.statistics.days.graphs.php


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