• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP string_to_flexquery函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中string_to_flexquery函数的典型用法代码示例。如果您正苦于以下问题:PHP string_to_flexquery函数的具体用法?PHP string_to_flexquery怎么用?PHP string_to_flexquery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: section_websites_search

function section_websites_search()
{
    $boot = new boostrap_form();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $table = "visited_sites_tot";
    $searchstring = string_to_flexquery("sites-search");
    $ORDER = $boot->TableOrder(array("size" => "ASC"));
    if ($q->COUNT_ROWS($table) == 0) {
        senderrors("no data");
    }
    $sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        senderrors($q->mysql_error . "<br>{$sql}");
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $md = md5(serialize($ligne));
        $ligne["size"] = FormatBytes($ligne["size"] / 1024);
        $sitenameenc = urlencode($ligne["familysite"]);
        $js = "Loadjs('miniadm.webstats.familysite.all.php?familysite={$sitenameenc}')";
        $link = $boot->trswitch($js);
        $tr[] = "\n\t\t<tr id='{$md}'>\n\t\t\t<td style='font-size:16px' width=10% nowrap {$link}>{$ligne["familysite"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["hits"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["size"]}</td>\n\t\t</tr>\n\t\t";
    }
    echo $boot->TableCompile(array("familysite" => "{familysite}", "hits" => "{hits}", "size" => "{size}"), $tr);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:27,代码来源:miniadm.webstats.bywebsites.php


示例2: showlist

function showlist()
{
    $page = 1;
    $q = new mysql_squid_builder();
    $tablesrc = "quotatemp_" . date("YmdH");
    $table = "(SELECT SUM(size) as size,ipaddr,familysite,uid,MAC FROM `{$tablesrc}` GROUP BY ipaddr,familysite,uid,MAC) as t";
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $q = new mysql_squid_builder();
    $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_events"));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_events"));
        $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_events");
    if (!$q->ok) {
        json_error_show($q->mysql_error, 1);
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("{$table} no data", 1);
    }
    $data = array();
    $data['page'] = 1;
    $data['total'] = $total;
    $data['rows'] = array();
    //if(mysql_num_rows($results)==0){$data['rows'][] = array('id' => $ligne[time()],'cell' => array($sql,"", "",""));}
    while ($ligne = mysql_fetch_assoc($results)) {
        $ipaddr = $ligne["ipaddr"];
        $mac = $ligne["MAC"];
        $familysite = $ligne["familysite"];
        $uid = $ligne["uid"];
        $size = FormatBytes($ligne["size"] / 1024);
        $data['rows'][] = array('id' => md5(serialize($ligne)), 'cell' => array("<span style='font-size:14px'>{$uid}</span>", "<span style='font-size:14px'>{$ipaddr}</span>", "<span style='font-size:14px'>{$mac}</span>", "<span style='font-size:14px'>{$familysite}</span>", "<span style='font-size:14px'>{$size}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:59,代码来源:squid.users-size-hour.php


示例3: search

function search()
{
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_mailarchive_builder();
    $sock = new sockets();
    $search = '%';
    $table = "`" . date("Ymd") . "`";
    $page = 1;
    $FORCE_FILTER = "";
    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);
    if (mysql_num_rows($results) == 0) {
        json_error_show("{$table} no data", 1);
    }
    $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)) {
        $color = "black";
        $zDate = $ligne["zDate"];
        $mailfrom = $ligne["mailfrom"];
        $mailto = $ligne["mailto"];
        $subject = utf8_encode($ligne["subject"]);
        $MessageID = $ligne["MessageID"];
        $data['rows'][] = array('id' => "{$MessageID}", 'cell' => array("<span style='font-size:14px;color:{$color}'>{$zDate}</a></span>", "<span style='font-size:14px;color:{$color}'>{$mailfrom}</a></span>", "<span style='font-size:14px;color:{$color}'>{$mailto}</a></span>", "<span style='font-size:14px;color:{$color}'>{$subject}</a></span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:58,代码来源:postfix.archiver.database.php


示例4: items

function items()
{
    //1.4.010916
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql();
    $search = '%';
    $table = "mimedefang_autocompress";
    $database = "artica_backup";
    $page = 1;
    $FORCE_FILTER = "";
    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 = $ligne["zmd5"];
        $delete = imgsimple("delete-24.png", "", "DeleteAutCompress{$t}('{$zmd5}')");
        $urljs = "<a href=\"javascript:blur();\" OnClick=\"javascript:GItem{$t}('{$zmd5}','{$ligne["mailfrom"]}&nbsp;&raquo;&nbsp;{$ligne["mailto"]}');\"\n\tstyle='font-size:16px;color:{$color};text-decoration:underline'>";
        if ($ligne["uncompress"] == 0) {
            $explain = $tpl->_ENGINE_parse_body("{automatically_compress_when_attachments_exceed}&nbsp;<strong>{$ligne["maxsize"]}M</strong>");
        } else {
            $explain = $tpl->_ENGINE_parse_body("{automatically_uncompress_attachments}");
        }
        $data['rows'][] = array('id' => "C{$zmd5}", 'cell' => array("<span style='font-size:16px;color:{$color}'>{$urljs}{$ligne["mailfrom"]}</a></span>", "<span style='font-size:18px;color:{$color}'>{$urljs}{$ligne["mailto"]}</a></span>", "<span style='font-size:12px;color:{$color}'>{$explain}</a></span>", "<span style='font-size:16px;color:{$color}'>{$delete}</a></span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:58,代码来源:mimedefang.autocompress.php


示例5: items

function items()
{
    //1.4.010916
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $search = '%';
    $table = "webfilter_avwhitedoms";
    $database = "artica_backup";
    $page = 1;
    $FORCE_FILTER = "";
    if ($q->COUNT_ROWS($table) == 0) {
        json_error_show("no data...");
    }
    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}";
    $results = $q->QUERY_SQL($sql, $database);
    if (mysql_num_rows($results) == 0) {
        json_error_show("no data");
    }
    $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($ligne["websitename"]);
        $delete = imgsimple("delete-32.png", "", "Delete{$t}('{$ligne["websitename"]}','{$zmd5}')");
        $data['rows'][] = array('id' => "{$zmd5}", 'cell' => array("<span style='font-size:26px;color:{$color}'>{$urljs}{$ligne["websitename"]}</a></span>", "<center style='font-size:16px;color:{$color}'>{$delete}</a></center>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:c-icap.wwwex.php


示例6: items

function items()
{
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql();
    $sock = new sockets();
    $search = '%';
    $table = "fetchmail_debug_execute";
    $database = "artica_events";
    $page = 1;
    $FORCE_FILTER = " AND `account_id`={$_GET["ID"]}";
    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 . "<hr>{$sql}");
    }
    $fsize = 14;
    while ($ligne = mysql_fetch_assoc($results)) {
        $ID = $ligne["ID"];
        $color = "black";
        $explain = "{$ligne["subject"]}";
        $explain = str_replace("'", "`", $explain);
        $urljs = "<a href=\"javascript:Blurz();\" OnClick=\"javascript:GItem{$t}('{$ID}','{$explain}');\"\n\t\tstyle=\"font-size:{$fsize}px;color:{$color};text-decoration:underline\">";
        $delete = imgtootltip("delete-24.png", "{delete}", "DeleteAttribute{$t}('{$ligne["ID"]}')");
        $data['rows'][] = array('id' => "DEB{$ID}", 'cell' => array("<span style='font-size:{$fsize}px;color:{$color}'>{$urljs}{$ligne["PID"]}</a></span>", "<span style='font-size:{$fsize}px;color:{$color}'>{$urljs}<strong>{$ligne["zDate"]}</strong>", "<span style='font-size:{$fsize}px;color:{$color}'>{$urljs}{$ligne["subject"]}</a></span>", $delete));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:fetchmail.user.debug.php


示例7: items_list

function items_list()
{
    //ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string','');
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $currentWeek = date("YW");
    $table = "{$currentWeek}_not_cached";
    $search = '%';
    $page = 1;
    if ($q->COUNT_ROWS("{$table}") == 0) {
        json_error_show("No datas");
    }
    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));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
        $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 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        json_error_show($q->mysql_error . "\n{$sql}");
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (mysql_num_rows($results) == 0) {
        json_error_show($q->mysql_error);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $val = 0;
        $familysite = $ligne["familysite"];
        $size = FormatBytes($ligne["size"] / 1024);
        $hits = FormatNumber($ligne["hits"]);
        $data['rows'][] = array('id' => "{$familysite}", 'cell' => array("<span style='font-size:16px;'>{$familysite}</span>", "<span style='font-size:16px;font-weight:bold'>{$size}</span>", "<span style='font-size:16px;font-weight:bold'>{$hits}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:admin.index.loadvg.squid.notcached-week.php


示例8: liste

function liste()
{
    $Mypage = CurrentPageName();
    $table = "UserAuthDays";
    $page = 1;
    $data = array();
    $data['rows'] = array();
    $field = $_GET["field"];
    $value = $_GET["value"];
    $tpl = new templates();
    $q = new mysql_squid_builder();
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $table = "(SELECT {$field},zDate,SUM(hits) as hits, SUM(QuerySize) as size FROM {$table} \n\tGROUP BY  {$field},zDate HAVING {$field}='{$value}' ) as t";
    $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));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"] + 1;
    }
    $rp = 50;
    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);
    if (!$q->ok) {
        json_error_show("{$q->mysql_error}");
    }
    $data['page'] = $page;
    $data['total'] = $total;
    $style = "style='font-size:15px'";
    $stylehReF = "style='font-size:15px;text-decoration:underline'";
    while ($ligne = mysql_fetch_assoc($results)) {
        $ligne["size"] = FormatBytes($ligne["size"] / 1024);
        $ligne["hits"] = FormatNumber($ligne["hits"]);
        $zdtTime = strtotime($ligne["zDate"]);
        $tableDest = date("Ymd", $zdtTime) . "_hour";
        $zdtTimeT = $tpl->_ENGINE_parse_body(date("{l} {F} d", $zdtTime)) . " [ " . date("Y-m-d", $zdtTime) . " ]";
        $uriUid = "Loadjs('squid.traffic.statistics.day.user.php?user={$value}&field={$field}&table={$tableDest}');";
        $data['rows'][] = array('id' => md5(serialize($ligne)), 'cell' => array("<span {$style}><a href=\"javascript:blur();\" OnClick=\"javascript:{$uriUid}\" {$stylehReF}>{$zdtTimeT}</a></span>", "<span {$style}>{$ligne["size"]}</span>", "<span {$style}>{$ligne["hits"]}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:squid.UserAuthDays.php


示例9: rules_list

function rules_list()
{
    $search = '%';
    $page = 1;
    $q = new mysql();
    $tpl = new templates();
    $searchstring = string_to_flexquery();
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) AS TCOUNT FROM suricata_rules_packages WHERE 1 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) AS tcount FROM suricata_rules_packages";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT * FROM suricata_rules_packages WHERE 1 {$searchstring} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        json_error_show($q->mysql_error, 1);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = mysql_num_rows($results);
    $data['rows'] = array();
    if (mysql_num_rows($results) == 0) {
        json_error_show("No data", 1);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $color = "black";
        $icon = "checkbox-on-24.png";
        if ($ligne["enabled"] == 0) {
            $icon = "checkbox-off-24.png";
            $color = "#8a8a8a";
        }
        $explain = $tpl->_ENGINE_parse_body("{{$ligne["rulefile"]}}");
        $explain = wordwrap($explain, 110, "<br>");
        $data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<strong style='font-size:18px;color:{$color}'>{$ligne["rulefile"]}</strong>", "<center style='font-size:18px;color:{$color}'>{$ligne["category"]}</center>", "<span style='font-size:16px;color:{$color}'>{$explain}</span>", "<center>" . imgsimple($icon, null, "SuricataRuleEnabled('{$ligne["rulefile"]}')") . "</center>"));
    }
    echo json_encode($data);
}
开发者ID:articatech,项目名称:artica,代码行数:55,代码来源:suricata.rules.php


示例10: table_list

function table_list()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $sock = new sockets();
    $q = new mysql_squid_builder();
    $search = '%';
    $table = "(SELECT title,zmd5,values_size FROM reports_cache WHERE report_type='{$_GET["report_type"]}') as t";
    $page = 1;
    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();
    $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$searchstring}";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $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} {$ORDER} {$limitSql}";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        json_error_show($q->mysql_error);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    while ($ligne = mysql_fetch_assoc($results)) {
        $zmd5 = $ligne["zmd5"];
        $title = $tpl->javascript_parse_text($ligne["title"]);
        $values_size = $ligne["values_size"];
        if ($values_size > 1024) {
            $values_size = FormatBytes($values_size / 1024);
        } else {
            $values_size = "{$values_size} Bytes";
        }
        $ligne["title"] = $tpl->javascript_parse_text($ligne["title"]);
        $delete = imgsimple("delete-32.png", null, "Loadjs('squid.statistics.flow.php?remove-cache-js=yes&zmd5={$zmd5}')");
        $data['rows'][] = array('id' => $zmd5, 'cell' => array("<span style='font-size:18px'>{$linkfamily}{$ligne["title"]}</a></span>", "<span style='font-size:18px'>{$values_size}</a></span>", $delete));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:50,代码来源:squid.statistics.browse-cache.php


示例11: SearchTask

function SearchTask()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $q = new mysql_squid_builder();
    $tpl = new templates();
    $CheckRunningTasks = base64_decode(unserialize($sock->getFrameWork("squid.php?CheckRunningTasks=yes")));
    $table = "webfilters_schedules";
    $searchstring = string_to_flexquery("SearchTask");
    $sql = "SELECT * FROM {$table} WHERE TaskType={$_GET["TaskID"]} {$searchstring}";
    $results = $q->QUERY_SQL($sql);
    $q2 = new mysql();
    $MyPage = CurrentPageName();
    $schedules = new system_tasks();
    while ($ligne = mysql_fetch_assoc($results)) {
        $sincerun = null;
        $tools = array();
        $delete = imgtootltip("delete-24.png", "{delete} {$ligne['ID']}", "SquidTaskDelete('{$ligne['ID']}')");
        $disabled = null;
        if (isset($CheckRunningTasks[$ligne['ID']])) {
            $run_icon = "preloader.gif";
        }
        //print_r($ligne);
        $TimeText = $tpl->_ENGINE_parse_body($schedules->PatternToHuman($ligne["TimeText"]));
        $TimeText = str_replace("<br>", "", $TimeText);
        if (intval($ligne["enabled"]) == 0) {
            $disabled = $tpl->_ENGINE_parse_body("<span class='label label-info'>{disabled}</span> ");
        }
        if (isset($CheckRunningTasks[$ligne['ID']])) {
            $sincerun = "<br><i>{$CheckRunningTasks[$ligne['ID']]}</i>";
        }
        $tablename = "TaskSq{$ligne['ID']}";
        if ($q2->TABLE_EXISTS($tablename, "artica_events")) {
            $evs = $q2->COUNT_ROWS($tablename, "artica_events");
            if ($evs > 0) {
                $tools[] = "<i class='icon-info-sign'></i> {$evs} {events}";
            }
        }
        $js = $boot->trswitch("Loadjs('miniadm.ajax.proxy.schedule.php?ID={$ligne['ID']}');");
        $ligne["TimeDescription"] = utf8_encode($ligne["TimeDescription"]);
        $delete = "<td {$js} width=1% style='text-align:center'>{$delete}</td>";
        $delete = null;
        $tr[] = "\n\t\t<tr class='{$class}'>\n\t\t<td {$js} width=1%>{$ligne['ID']}</td>\n\t\t<td {$js} >{$disabled}<strong style='font-size:16px;font-weight:bold'>{$ligne["TimeDescription"]}</strong>{$sincerun}<div>{$TimeText}</div><div style='font-size:11px'>" . $tpl->_ENGINE_parse_body(@implode("&nbsp;|&nbsp;", $tools)) . "</div></td>\n\t\t\n\t\t</tr>\n\t\t";
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body("<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th width=1%>{ID}</th>\n\t\t\t\t\t<th width=98%>{task}</th>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\n\t\t\t</table>\n";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:47,代码来源:miniadm.ajax.squid.schedules.php


示例12: search_records

function search_records()
{
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $tpl = new templates();
    $limitSql = "LIMIT 0,150";
    $t = time();
    $searchstring = string_to_flexquery("search-records");
    $sql = "SELECT * FROM (SELECT SUM(hits) as hits,SUM(size) as size,MAC FROM members_mac GROUP BY MAC ORDER BY size DESC,hits DESC) as t WHERE 1 {$searchstring}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql);
    $sock = new sockets();
    $boot = new boostrap_form();
    if (!$q->ok) {
        echo "<p class=text-error>{$q->mysql_error}<hr><code>{$sql}</code></p>";
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $ligne["MAC"] = strtolower($ligne["MAC"]);
        $ligne["MAC"] = str_replace("-", ":", $ligne["MAC"]);
        $ligne["size"] = FormatBytes($ligne["size"] / 1024);
        $ligne["hits"] = FormatNumber($ligne["hits"]);
        $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT uid FROM webfilters_nodes WHERE MAC='{$ligne["MAC"]}'"));
        $uid = $ligne2["uid"];
        $explainMac = null;
        if ($uid != null) {
            $uid = "&nbsp;({$uid})";
        }
        $linkVisit = $boot->trswitch("Loadjs('{$page}?visits-day-js={$ligne["MAC"]}')");
        $ips = array();
        $results2 = $q->QUERY_SQL("SELECT ipaddr FROM members_macip WHERE MAC='{$ligne["MAC"]}' ORDER BY ipaddr");
        while ($ligne2 = mysql_fetch_assoc($results2)) {
            $ips[] = $ligne2["ipaddr"];
        }
        if (count($ips) > 0) {
            $explainMac = "{$explainMac}<div><i style='font-size:11px'>" . @implode(", ", $ips) . "</i></div>";
        }
        $tr[] = "\n\t\t<tr id='{$id}'>\n\t\t<td {$link}><i class='icon-globe'></i> {$ligne["MAC"]}{$uid}</a>{$explainMac}</td>\n\t\t<td {$linkVisit}><i class='icon-download'></i> {$ligne["size"]} </td>\n\t\t<td {$linkVisit}><i class='icon-signal'></i> {$ligne["hits"]} </td>\n\t\t</tr>";
    }
    echo $tpl->_ENGINE_parse_body("\n\n\t\t<table class='table table-bordered table-hover'>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{MAC}</th>\n\t\t\t\t\t<th>{size}</th>\n\t\t\t\t\t<th>{hits}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t</table>\n\t\t\t";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:40,代码来源:miniadm.squid.macbrowser.php


示例13: items_list

function items_list()
{
    //ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string','');
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $ID = $_GET["ID"];
    $FORCE_FILTER = null;
    $search = '%';
    $table = "webfilters_sqitems";
    $page = 1;
    if ($q->COUNT_ROWS($table) == 0) {
        json_error_show("no item");
    }
    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 gpid={$ID} {$FORCE_FILTER} {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE gpid={$ID} {$FORCE_FILTER}";
        $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 gpid={$ID} {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        json_error_show($q->mysql_error);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (mysql_num_rows($results) == 0) {
        json_error_show("no item");
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $val = 0;
        $disable = Field_checkbox("itemid_{$ligne['ID']}", 1, $ligne["enabled"], "EnableDisableItem('{$ligne['ID']}')");
        $macname = $q->MAC_TO_NAME($ligne['pattern']);
        $ligne['pattern'] = utf8_encode($ligne['pattern']);
        $delete = imgtootltip("delete-24.png", "{delete} {$ligne['pattern']}", "DeleteGroupItem('{$ligne['ID']}')");
        $additional_text = null;
        if ($macname) {
            $additional_text = "<div style='font-size:10px'>{$macname}</div>";
        }
        $data['rows'][] = array('id' => "item{$ligne['ID']}", 'cell' => array("<span style='font-size:14px;font-weight:bold'>{$ligne['pattern']}</span>{$additional_text}", "<div style='padding-top:5px'>{$disable}</div>", $delete));
    }
    echo json_encode($data);
}
开发者ID:articatech,项目名称:artica,代码行数:64,代码来源:squid.BrowseAclGroups.php


示例14: bridge_list

function bridge_list(){
	$q=new mysql();
	$tpl=new templates();
	$database="artica_backup";
	$table="nics_bridge";
	$MyPage=CurrentPageName();
	$t=$_GET["t"];
	
	if(!$q->TABLE_EXISTS("nics_bridge", "artica_backup")){
		json_error_show("nics_bridge no such table...",1);
	}
	
	$sock=new sockets();
	$net=new networking();
	$ip=new IP();
	$interfaces=unserialize(base64_decode($sock->getFrameWork("cmd.php?ifconfig-interfaces=yes")));
	$ERROR_NO_PRIVS=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
	$DisableNetworksManagement=$sock->GET_INFO("DisableNetworksManagement");
	if($DisableNetworksManagement==null){$DisableNetworksManagement=0;}
	
	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 $searchstring";
		$ligne=mysql_fetch_array($q->QUERY_SQL($sql,$database));
		if(!$q->ok){json_error_show($q->mysql_error."<hr>".$sql,1);}
		$total = $ligne["tcount"];
	
	}else{
		$total = $q->COUNT_ROWS($table, $database);
	}
	
	if (isset($_POST['rp'])) {$rp = $_POST['rp'];}
	if(!is_numeric($page)){$page=1;}
	if(!is_numeric($rp)){$rp=50;}
	$pageStart = ($page-1)*$rp;
	$limitSql = "LIMIT $pageStart, $rp";
	
	
	
	$sql="SELECT * FROM `$table` WHERE 1 $searchstring $ORDER $limitSql";
	$results = $q->QUERY_SQL($sql,$database);
	if(!$q->ok){json_error_show($q->mysql_error."<hr>".$sql,1);}
	
	
	$data = array();
	$data['page'] = $page;
	$data['total'] = $total;
	$data['rows'] = array();
	if(mysql_num_rows($results)==0){json_error_show("No rule set...",1);}
	
	
	while ($ligne = mysql_fetch_assoc($results)) {
		$md=md5(serialize($ligne));
		$color="black";
		$ip=new IP();
		$cdir=$ligne["cdir"];
		$eth="br{$ligne["ID"]}";
		$eth_text="br{$ligne["ID"]}";
		
		if($ligne["cdir"]==null){
			$ligne["cdir"]=$net->array_TCP[$ligne["nic"]];
			$eth=$ligne["nic"];
		}
		
		if($ligne["cdir"]==null){
			$ligne["cdir"]=$net->array_TCP[$ligne["nic"]];
			$eth=$ligne["nic"];
		}
		$img="folder-network-48.png";
		
			
		$delete=imgsimple("delete-32.png",null,"Loadjs('$MyPage?network-bridge-delete-js={$ligne['ID']}&t=$t',true)");
		
		$js="Loadjs('$MyPage?network-bridge-js=yes&ID={$ligne['ID']}&t=$t',true);";
		$href="<a href=\"javascript:blur();\" OnClick=\"javascript:$js\" style='font-size:18px;color:$color;font-weight:normal;text-decoration:underline'>";
	
		
		$a=$ip->parseCIDR($cdir);
		if($a[0]==0){
			$img="warning-panneau-24.png";
			$cdir="<span style='color:red'>$cdir</span>";
		}
		$delete=imgsimple("delete-32.png",null,"Loadjs('$MyPage?network-bridge-delete-js={$ligne['ID']}&t=$t',true)");
	
		$js="Loadjs('$MyPage?network-bridge-js=yes&ID={$ligne['ID']}&t=$t',true);";
		$href="<a href=\"javascript:blur();\" OnClick=\"javascript:$js\" style='font-size:18px;color:$color;font-weight:normal;text-decoration:underline'>";
		$bridgedTo=bridgedTo($ligne["ID"]);
		$data['rows'][] = array(
			'id' => $ligne['ID'],
			'cell' => array(
				"<span style='font-size:18px;font-weight:bold;color:$color'>{$ligne['ID']}</span>",
				"<span style='font-size:18px;font-weight:normal;color:$color'>$href$eth_text</a></span>",
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:system.network.bridges.interfaces.php


示例15: rules_proxies_search

function rules_proxies_search(){
	//ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string','');
	$tpl=new templates();
	$MyPage=CurrentPageName();
	$q=new mysql_squid_builder();
	$acl=new squid_acls();
	$ID=$_GET["ID"];
	$t0=$_GET["t"];
	$t=$_GET["tt"];
	$FORCE="aclid=$ID";

	$search='%';
	$table="wpad_destination";

	$page=1;

	if($q->COUNT_ROWS($table)==0){json_error_show("No datas");}

	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 $FORCE $searchstring";
		$ligne=mysql_fetch_array($q->QUERY_SQL($sql));
		$total = $ligne["TCOUNT"];

	}else{
		$sql="SELECT COUNT(*) as TCOUNT FROM $table WHERE $FORCE";
		$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 $FORCE $searchstring $ORDER $limitSql";

	$results = $q->QUERY_SQL($sql);
	if(!$q->ok){json_error_show($q->mysql_error."\n$sql");}


	$data = array();
	$data['page'] = $page;
	$data['total'] = $total;
	$data['rows'] = array();
	if(mysql_num_rows($results)==0){json_error_show($q->mysql_error);}
	
	
	while ($ligne = mysql_fetch_assoc($results)) {
		$val=0;
		$mkey=$ligne["zmd5"];
		$delete=imgsimple("delete-32.png",null,"DeleteObjectLinks$t('$mkey')");
		
		$up=imgsimple("arrow-up-32.png",null,"MoveObjectLinks$t('$mkey','up')");
		$down=imgsimple("arrow-down-32.png",null,"MoveObjectLinks$t('$mkey','down')");
		
		$data['rows'][] = array(
				'id' => "$mkey",
				'cell' => array(
						"<span style='font-size:16px;font-weight:bold'><a href=\"javascript:blur();\" 
							OnClick=\"javascript:MoveObjectLinksAsk$t('$mkey','{$ligne["zorder"]}')\"
							style='font-size:16px;font-weight:bold;text-decoration:underline'
							>[{$ligne["zorder"]}]</a></span>",
						"<span style='font-size:16px;font-weight:bold'>{$ligne["proxyserver"]}</span>",
						"<span style='font-size:16px;font-weight:bold'>{$ligne["proxyport"]}</span>",
						"<span style='font-size:16px;font-weight:bold'>$up</span>",
						"<span style='font-size:16px;font-weight:bold'>$down</span>",
						
						
						$delete)
		);
	}
	echo json_encode($data);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:79,代码来源:squid.autoconfiguration.main.php


示例16: showlist

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP string_to_flexregex函数代码示例发布时间:2022-05-23
下一篇:
PHP string_to_camel函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap