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

PHP json_error_show函数代码示例

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

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



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

示例1: search

function search()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $sock = new sockets();
    $q = new mysql();
    $database = "artica_events";
    $t = $_GET["t"];
    $search = '%';
    $page = 1;
    $FORCE_FILTER = null;
    $total = 0;
    $table = "last_boot";
    $data = array();
    $data['page'] = $page;
    $data['total'] = 0;
    $data['rows'] = array();
    $fontsize = 20;
    $style = "style='font-size:18px'";
    $dataX = unserialize($sock->GET_INFO("InfluxDBRestoreArray"));
    $c = 0;
    $tpl = new templates();
    while (list($path, $size) = each($dataX)) {
        $c++;
        $ms5 = md5($path);
        $color = "black";
        $size = FormatBytes(intval($size) / 1024);
        $data['rows'][] = array('id' => $ms5, 'cell' => array("<span {$style}>{$path}</a></span>", "<span {$style}>{$size}</a></span>"));
    }
    if ($c == 0) {
        json_error_show("no data");
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:articatech,项目名称:artica,代码行数:35,代码来源:influx.incompatiblev1.php


示例2: databases_items

function databases_items()
{
    $tpl = new templates();
    $sock = new sockets();
    $sock->getFrameWork("squid2.php?cached-kerberos-tickets=yes");
    $dataZ = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/web/kerberos-tickets-squid"));
    if (!is_array($dataZ)) {
        $dataZ = array();
    }
    $data = array();
    $data['page'] = 1;
    $data['total'] = count($dataZ);
    $data['rows'] = array();
    if (count($dataZ) == 0) {
        json_error_show("no data", 1);
    }
    $fontsize = "22";
    while (list($num, $DB) = each($dataZ)) {
        $color = "black";
        $date = strtotime($DB["DATE"]);
        $zdate = $tpl->time_to_date($date, true);
        $KVNO = $DB["NUM"];
        $TICKET = $DB["ticket"];
        if (!preg_match("#HTTP\\/#", $TICKET)) {
            $color = "#AFAFAF";
        }
        $data['rows'][] = array('id' => md5(serialize($DB)), 'cell' => array("<center style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$KVNO}</center>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$zdate}</a></span>", "<span style='font-size:18px;font-weight:normal;color:{$color}'>{$TICKET}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:30,代码来源:squid.adker.kerberos-tickets.php


示例3: popup_list

function popup_list()
{
    $ou = base64_decode($_GET["ou"]);
    $tpl = new templates();
    $gpid = $_GET["gpid"];
    if ($_POST["query"] != null) {
        $tofind = $_POST["query"];
    }
    $groups = new groups($gpid);
    $group_members = $groups->members_array;
    $ldap = new clladp();
    if ($tofind == null) {
        $tofind = '*';
    } else {
        $tofind = "*{$tofind}*";
    }
    $tofind = str_replace("**", "*", $tofind);
    $filter = "(&(objectClass=userAccount)(|(cn={$tofind})(mail={$tofind})(displayName={$tofind})(uid={$tofind}) (givenname={$tofind})))";
    $attrs = array("displayName", "uid", "mail", "givenname", "telephoneNumber", "title", "sn", "mozillaSecondEmail", "employeeNumber");
    $dn = "ou={$ou},dc=organizations,{$ldap->suffix}";
    $hash = $ldap->Ldap_search($dn, $filter, $attrs, 150);
    if (strlen(trim($ldap->ldap_last_error)) > 5) {
        json_error_show("Error:" . $ldap->ldap_last_error);
    }
    $number = $hash["count"];
    $data = array();
    $data['page'] = 1;
    $data['total'] = $number;
    $data['rows'] = array();
    $c = 0;
    for ($i = 0; $i < $number; $i++) {
        $exist = false;
        $userARR = $hash[$i];
        $uid = $userARR["uid"][0];
        if ($uid == null) {
            continue;
        }
        $md = md5($uid);
        $c++;
        if ($uid == "squidinternalauth") {
            continue;
        }
        if ($group_members[$uid]) {
            $exist = true;
        }
        $js = "add_already_member_add('" . base64_encode($uid) . "','{$md}');";
        $mail = texttooltip($userARR["mail"][0], "{add}:{$uid}", $js, null, 0, "font-size:13px");
        $color = "black";
        $add = imgsimple("arrow-right-24.png", "{add}:{$uid}", $js);
        if ($exist) {
            $add = "&nbsp;";
            $color = "#8a8a8a";
        }
        $data['rows'][] = array('id' => "uidS{$md}", 'cell' => array("<span style='font-size:14px;color:{$color}'>{$uid}</span>", "<span style='font-size:14px;color:{$color}'>{$mail}</span>", "<span style='font-size:14px;color:{$color}'>{$add}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:domains.import.user.php


示例4: items

function items()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $freeweb = new freeweb($_GET["servername"]);
    $page = 1;
    $t = $_GET["t"];
    $search = '%';
    $total = 0;
    $params = $freeweb->Params["ZPUSH"]["STORES"];
    if (count($params) == 0) {
        json_error_show("No data", 1);
    }
    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'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    $search = string_to_flexregex();
    $c = 0;
    while (list($ID, $folder) = each($params)) {
        if ($search != null) {
            if (!preg_match("#{$search}#", $folder["F"])) {
                continue;
            }
        }
        $type = "{$folder["T"]}";
        $img = "icon_mailfolder.gif";
        if ($type == "SYNC_FOLDER_TYPE_USER_APPOINTMENT") {
            $img = "icon_calendar.gif";
        }
        if ($type == "SYNC_FOLDER_TYPE_USER_CONTACT") {
            $img = "icon_contact.gif";
        }
        $delete = imgtootltip("delete-24.png", null, "StoreDelete{$t}('{$ID}')");
        $c++;
        $data['rows'][] = array('id' => $ID, 'cell' => array("<img src='img/{$img}'>", "<span style='font-size:18px'>{$folder["U"]}::{$folder["F"]}</span>\n\t\t\t\t\t\t<div style='text-align:right;font-size:12px'>{$ID}</div>\n\t\t\t\t\t\t", $delete));
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:53,代码来源:freeweb.zpush.php


示例5: items

function items()
{
    //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();
    $t = $_GET["t"];
    $FORCE_FILTER = null;
    $cache_file = "/usr/share/artica-postfix/ressources/logs/web/monit.status.all";
    $sock = new sockets();
    if (!is_file($cache_file)) {
        $sock->getFrameWork("monit.php?chock-status=yes");
        json_error_show("No cache file");
    }
    $array = unserialize(@file_get_contents($cache_file));
    $sock->getFrameWork("monit.php?chock-status=yes");
    if (count($array) == 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_flexregex();
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $data = array();
    $data['page'] = $page;
    $data['total'] = count($array);
    $data['rows'] = array();
    while (list($product, $array2) = each($array)) {
        if (trim($product) == null) {
            continue;
        }
        $val = 0;
        $id = md5($product);
        $product = $tpl->_ENGINE_parse_body("{{$product}}");
        $status = $array2["status"];
        $uptime = $array2["uptime"];
        $children = $array2["children"];
        $mem = $array2["memory kilobytes total"];
        $cpu = $array2["cpu percent total"];
        $mem = FormatBytes($mem);
        $data['rows'][] = array('id' => "{$id}", 'cell' => array("<span style='font-size:14px;'>{$product}</a></span>", "<span style='font-size:14px;'>{$status}</span>", "<span style='font-size:14px;'>{$uptime}</span>", "<span style='font-size:14px;'>{$children}</span>", "<span style='font-size:14px;'>{$mem}</span>", "<span style='font-size:14px;'>{$cpu}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:51,代码来源:monit.php


示例6: show_list

function show_list()
{
    $tpl = new templates();
    $page = 1;
    $FORCE_FILTER = null;
    $total = 0;
    $cpu = $_GET["cpu"];
    include_once dirname(__FILE__) . "/ressources/class.squid.manager.inc";
    $cache_manager = new cache_manager();
    $datas = explode("\n", $cache_manager->makeQuery("ntlmauthenticator"));
    if (!$cache_manager->ok) {
        json_error_show("Err!");
    }
    $CPU_NUMBER = 0;
    while (list($num, $ligne) = each($datas)) {
        if (preg_match("#by kid([0-9]+)#", $ligne, $re)) {
            $CPU_NUMBER = $re[1];
            continue;
        }
        if (!preg_match("#([0-9]+)\\s+([0-9]+)\\s+([0-9]+)\\s+([0-9]+)\\s+([0-9]+)\\s+(.*?)\\s+([0-9\\.]+)#", $ligne, $re)) {
            continue;
        }
        $pid = $re[3];
        $rqs = $re[4];
        $rply = $re[5];
        $flags = $re[6];
        $time = $re[7];
        $MAIN[$CPU_NUMBER][$pid]["PID"] = $pid;
        $MAIN[$CPU_NUMBER][$pid]["RQS"] = $rqs;
        $MAIN[$CPU_NUMBER][$pid]["RPLY"] = $rply;
        $MAIN[$CPU_NUMBER][$pid]["FLAG"] = $flags;
        $MAIN[$CPU_NUMBER][$pid]["TIME"] = $time;
    }
    //print_r($MAIN);
    $data = array();
    $data['page'] = 1;
    $data['total'] = count($MAIN[$cpu]);
    $data['rows'] = array();
    while (list($pid, $ligne) = each($MAIN[$cpu])) {
        $md5 = md5(serialize($ligne));
        $PID = numberFormat($ligne["PID"], 0, "", " ");
        $RQS = numberFormat($ligne["RQS"], 0, "", " ");
        $RPLY = numberFormat($ligne["RPLY"], 0, "", " ");
        $FLAG = $ligne["FLAG"];
        $TIME = $ligne["TIME"];
        $data['rows'][] = array('id' => $md5, 'cell' => array("<span style='font-size:16px'>{$PID}</a></span>", "<span style='font-size:16px'>{$RQS}</a></span>", "<span style='font-size:16px'>{$RPLY}</span>", "<span style='font-size:16px'>{$RQS}</span>", "<span style='font-size:16px'>{$FLAG}</span>", "<span style='font-size:16px'>{$TIME}</span>"));
    }
    echo json_encode($data);
}
开发者ID:articatech,项目名称:artica,代码行数:49,代码来源:squid.ntmlauthenticators.php


示例7: dmesg_search

function dmesg_search()
{
    $sock = new sockets();
    $array = unserialize(base64_decode($sock->getFrameWork("services.php?dmesg=yes")));
    if (!is_array($array)) {
        json_error_show("Fatal, no such data");
    }
    $search = string_to_regex($_POST["query"]);
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $pageEnd = $pageStart + $rp;
    if ($pageEnd <= 0) {
        $pageEnd = $rp;
    }
    //json_error_show("Start:$pageStart, end:$pageEnd");
    if ($_POST["sortorder"] == "desc") {
        krsort($array);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = count($array);
    $data['rows'] = array();
    $c = 0;
    while (list($key, $line) = each($array)) {
        if ($line == null) {
            continue;
        }
        if ($search != null) {
            if (!preg_match("#{$search}#i", $line)) {
                continue;
            }
        }
        $c++;
        if ($c <= $pageStart) {
            continue;
        }
        if ($c > $pageEnd) {
            break;
        }
        $data['rows'][] = array('id' => md5($line), 'cell' => array("{$spanOn}{$line}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:48,代码来源:syslog.dmesg.php


示例8: item_rules

function item_rules()
{
    $t = $_GET["t"];
    $sock = new sockets();
    if ($_POST["query"] != null) {
        $search = "&search=" . base64_encode(string_to_regex($_POST["query"]));
    }
    $datas = unserialize(base64_decode($sock->getFrameWork("services.php?iptables-dump=yes&rp={$_POST["rp"]}{$search}")));
    if (count($datas) == 0) {
        json_error_show("No data");
    }
    $tpl = new templates();
    $data = array();
    $data['page'] = 1;
    $data['total'] = 0;
    $data['rows'] = array();
    $c = 0;
    while (list($num, $val) = each($datas)) {
        if (substr($val, 0, 1) == "#") {
            continue;
        }
        if (!preg_match("#(^[0-9]+)\\s+(.+?)\\s+(.+?)\\s+(.+?)\\s+(.+?)\\s+(.+)#", $val, $re)) {
            continue;
        }
        $index = $re[1];
        $target = $re[2];
        $protocol = $re[3];
        $opt = $re[4];
        $src = $re[5];
        $dest = $re[6];
        $c++;
        if (strpos($dest, "/") > 0) {
            $tt = explode("/", $dest);
            $dest = $tt[0];
        }
        if (preg_match("#(.+?)\\s+tcp(.+)#", $dest, $re)) {
            $dest = $re[1];
            $protocol = $re[2];
        }
        $protocol = str_replace("dpt:ssh", "SSH (22)", $protocol);
        $dest = str_replace("anywhere", "{anywhere}", $dest);
        $line = $tpl->_ENGINE_parse_body("{$target} {from} <strong>{$src}</strong> {to} {$dest} {protocol} {$protocol}");
        $del = imgsimple("delete-24.png", null, "Delete{$t}('{$index}')");
        $data['rows'][] = array('id' => "{$num}", 'cell' => array("<span style='font-size:12px;color:{$color}'>[{$index}]: {$line}</a></span>", "<span style='font-size:12px;color:{$color}'>{$del}</a></span>"));
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:48,代码来源:system.iptables.save.php


示例9: servers_list

function servers_list()
{
    $tpl = new templates();
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $hash = unserialize(base64_decode($main->GET_BIGDATA("check_client_access")));
    if (!is_array($hash) or count($hash) == 0) {
        json_error_show("no rule");
    }
    $page = 1;
    $search = string_to_flexregex();
    $c = 0;
    while (list($ipaddr, $action) = each($hash)) {
        if (trim($ipaddr) == null) {
            continue;
        }
        if (isset($aL[$ipaddr])) {
            continue;
        }
        $md5 = md5("{$ipaddr}{$action}");
        if ($search != null) {
            if (!preg_match("#{$search}#", $ipaddr)) {
                continue;
            }
        }
        $aL[$md5] = true;
        $img = "48-server.png";
        if ($action == "REJECT") {
            $img = '48-server-ban.png';
        }
        $c++;
        $delete = imgsimple('delete-48.png', '{delete}', "DeleteServer{$_GET["t"]}('{$ipaddr}');");
        $data['rows'][] = array('id' => $md5, 'cell' => array("<span style='font-size:16px;font-weight:bold'><img src='img/{$img}'></a></span>", "<span style='font-size:32px'>{$ipaddr} ({$action})</a></span>", $delete));
    }
    $data['page'] = $page;
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:37,代码来源:domains.postfix.multi.reject.php


示例10: search

function search()
{
    $hostname = $_GET["hostname"];
    $tpl = new templates();
    $page = CurrentPageName();
    $main = new maincf_multi($_GET["hostname"]);
    $datas = unserialize(base64_decode($main->GET_BIGDATA("debug_peer_list")));
    if (count($datas) == 0) {
        json_error_show("No data...");
    }
    $t = $_GET["t"];
    if ($_POST["query"] != null) {
        $search = string_to_regex($_POST["query"]);
    }
    $data = array();
    $data['page'] = 1;
    $data['total'] = $total;
    $data['rows'] = array();
    $c = 0;
    while (list($num, $ligne) = each($datas)) {
        if ($num == null) {
            continue;
        }
        if ($search != null) {
            if (!preg_match("#{$search}#i", $num)) {
                continue;
            }
        }
        $id = md5($num);
        $delete = imgsimple("delete-32.png", "{delete}", "debug_peer_list_del('{$num}','{$id}')");
        $c++;
        $data['rows'][] = array('id' => $id, 'cell' => array("<strong style='font-size:18px;style='color:{$color}'>{$href}{$num}</a></strong>", $delete));
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:36,代码来源:postfix.debug.php


示例11: ssh_connect_list

function ssh_connect_list()
{
    $uid = $_GET["uid"];
    if (!is_file("ressources/logs/web/{$uid}.ssh")) {
        json_error_show("No lines...");
    }
    $f = file("ressources/logs/web/{$uid}.ssh");
    $data = array();
    $data['page'] = 1;
    $data['total'] = 0;
    $data['rows'] = array();
    if ($_POST["sortorder"] == "desc") {
        krsort($f);
    }
    if ($_POST["query"] != null) {
        $search = $_POST["query"];
        $search = str_replace(".", "\\.", $search);
        $search = str_replace("*", ".*?", $search);
    }
    $c = 0;
    while (list($num, $ligne) = each($f)) {
        $c++;
        if (!preg_match("#{$search}#", $ligne)) {
            continue;
        }
        if (preg_match("#Bytes per second#", $ligne)) {
            $ligne = "<strong style='color:blue'>{$ligne}</strong>";
        }
        if (preg_match("#Transferred: sent#", $ligne)) {
            $ligne = "<strong style='color:blue'>{$ligne}</strong>";
        }
        $data['rows'][] = array('id' => md5($ligne), 'cell' => array("{$ligne}"));
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:36,代码来源:sshd.tests.php


示例12: items

function items()
{
    $sock = new sockets();
    $datas = unserialize(base64_decode($sock->getFrameWork("squid.php?squid-sessions=yes")));
    if (count($datas) == 0) {
        json_error_show("No data");
    }
    $data = array();
    $data['page'] = 1;
    $data['total'] = 0;
    $data['rows'] = array();
    $c = 0;
    while (list($num, $val) = each($datas)) {
        if ($val["USER"] == null) {
            $val["USER"] = $val["CLIENT"];
        } else {
            $val["USER"] = $val["USER"] . "<br><i style='font-size:11px'>{$val["CLIENT"]}</i>";
        }
        $c++;
        $data['rows'][] = array('id' => "{$num}", 'cell' => array("<span style='font-size:12px;color:{$color}'>{$val["USER"]}</a></span>", "<span style='font-size:12px;color:{$color}'>{$val["URI"]}</a></span>", "<span style='font-size:12px;color:{$color}'>{$val["SINCE"]}</span>"));
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:24,代码来源:squid.squidclient.clientlist.php


示例13: items

function items()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $RULEID = $_GET["RULEID"];
    $search = '%';
    $table = "UserAgents";
    $page = 1;
    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 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
        if (!$q->ok) {
            json_error_show("{$q->mysql_error}");
        }
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}`";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
        if (!$q->ok) {
            json_error_show("{$q->mysql_error}");
        }
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM `{$table}` WHERE 1 {$searchstring} {$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) {
        $data['rows'][] = array('id' => $ligne[time()], 'cell' => array($sql, "", "", ""));
        json_encode($data);
        return;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $pattern_enc = urlencode($ligne["pattern"]);
        $data['rows'][] = array('id' => md5($ligne["pattern"]), 'cell' => array("<span style='font-size:14px;'>{$ligne["pattern"]}</span>", imgtootltip("plus-24.png", null, "Loadjs('squid.browsers-rules.php?ruleid-js=0&pattern={$pattern_enc}');") . "</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:62,代码来源:squid.browsers.php


示例14: groups_list

function groups_list()
{
    $tpl = new templates();
    $q = new mysql();
    $MyPage = CurrentPageName();
    $table = "activedirectorygroups";
    $database = "artica_backup";
    $page = 1;
    $FORCE_FILTER = "";
    if ($q->COUNT_ROWS($table, $database) == 0) {
        json_error_show($tpl->_ENGINE_parse_body("TABLE:{$table}<br>{error_no_datas}"));
    }
    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"]);
        $search = $_POST["query"];
        if (strpos(" {$search}", "%") > 0) {
            $FILTER = "AND (`{$_POST["qtype"]}` LIKE '{$search}') {$FORCE_FILTER}";
        }
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FILTER}{$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
        if (!$q->ok) {
            json_error_show("{$q->mysql_error}\n{$sql}");
        }
        $total = $ligne["TCOUNT"];
    } else {
        if ($FORCE_FILTER != null) {
            $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER}";
            $ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
            if (!$q->ok) {
                json_error_show("{$q->mysql_error}\n{$sql}");
            }
            $total = $ligne["TCOUNT"];
        } else {
            $total = $q->COUNT_ROWS($table, $database);
        }
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if ($FILTER == null) {
        $FILTER = $FORCE_FILTER;
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT * FROM {$table} WHERE 1 {$FILTER} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    $results = $q->QUERY_SQL($sql, $database);
    if (!$q->ok) {
        json_error_show("{$q->mysql_error}");
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $ligne["group"] = utf8_decode($ligne["group"]);
        $data['rows'][] = array('id' => $ligne["gpid"], 'cell' => array("<img src='img/win7groups-32.png'>", "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$MyPage}?members-js=yes&gpid={$ligne["gpid"]}');\" style='font-size:16px;text-decoration:underline'>{$ligne["group"]}</span>", "<span style='font-size:18px'>{$ligne["UsersNum"]}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:70,代码来源:samba.activedirectory.php


示例15: find_member_active_directory

function find_member_active_directory()
{
    if ($_POST["query"] != null) {
        $search = $_POST["query"];
    }
    $GLOBALS["NOUSERSCOUNT"] = false;
    $ou = base64_decode($_GET["ou"]);
    $sock = new sockets();
    $page = CurrentPageName();
    $tpl = new templates();
    if ($_POST["qtype"] == "group") {
        $_POST["qtype"] = "groupname";
    }
    if ($_POST["qtype"] == "find-member") {
        $_POST["qtype"] = "groupname";
    }
    $t = $_GET["t"];
    $tt = $_GET["tt"];
    if ($_POST["sortname"] == "pattern") {
        $_POST["sortname"] = "groupname";
    }
    $error = "No dn";
    if (strlen($_GET["dn"]) > 0) {
        $table = "activedirectory_groupsNames";
        $database = "artica_backup";
        $_GET["dn"] = urldecode($_GET["dn"]);
        $FORCE_FILTER = "AND oudn='{$_GET["dn"]}'";
        $error = null;
    }
    $styla = "style='font-size:14px;text-decoration:underline;font-weight:bold'";
    $styleNum = "style='font-size:16px;font-weight:bold'";
    $q = new mysql();
    if ($q->COUNT_ROWS($table, $database) == 0) {
        json_error_show("{$table}: No item {$error}", 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();
    if ($search != 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 (!$q->ok) {
        json_error_show("{$q->mysql_error}<br>\n{$sql}", 1);
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("No item: {$sql}", 1);
    }
    $data = array();
    $data['page'] = 1;
    $data['total'] = $total;
    $data['rows'] = array();
    $_GET["dn"] = urlencode($_GET["dn"]);
    while ($ligne = mysql_fetch_assoc($results)) {
        $color = "black";
        $text = utf8_encode($ligne["description"]);
        $dn = urlencode($ligne["dn"]);
        $js = "javascript:Loadjs('domains.edit.group.php?js=yes&group-id={$dn}&ou={$_GET["ou"]}&dn={$_GET["dn"]}&encoded=yes&tt={$t}&ttt={$tt}')";
        $data['rows'][] = array('id' => md5($ligne["groupname"]), 'cell' => array("<a href=\"javascript:blur();\" OnClick=\"{$js}\" {$styla}>{$ligne["groupname"]}</a>", "<span {$styleNum}>{$ligne["UsersCount"]}</span>", "<span style='font-size:14px'>{$text}</span>", "&nbsp;"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:81,代码来源:domains.find.groups.php


示例16: 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


示例17: 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


示例18: firewall_rules

function firewall_rules(){
	$tpl=new templates();
	$MyPage=CurrentPageName();
	$q=new mysql();
	$database="artica_backup";
	$search='%';
	$table="iptables";
	$page=1;
	$ORDER=null;
	$FORCE="flux='INPUT'";
	$allow=null;
	
	$total=0;
	if($q->COUNT_ROWS($table,$database)==0){json_error_show("no data");;}
	
	if($_POST["query"]<>null){
		$search="%{$_POST["query"]}%";
		$search=str_replace("*", "%", $search);
		$search=str_replace("%%", "%", $search);
		$search=str_replace("%%", "%", $search);
	}else{
		$search="%";
	}
	if(is_numeric($_GET["allow"])){$allow="AND allow={$_GET["allow"]}";}
	
	
	if(preg_match("#service=(.+)#", $_POST["qtype"],$re)){
		$servcie="AND `service`='{$re[1]}'";
		
	}
	$FORCE="(flux='INPUT' $allow $servcie  AND `servername` LIKE '$search') OR (flux='INPUT' $allow $servcie AND `serverip` LIKE '$search')";
	
	
	
	
	if(isset($_POST["sortname"])){if($_POST["sortname"]<>null){$ORDER="ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";}}	
	if(isset($_POST['page'])) {$page = $_POST['page'];}
	
	
	
	
	$table="(SELECT * FROM iptables WHERE ($FORCE)) as t";
	$sql="SELECT COUNT(*) as TCOUNT FROM $table";
	$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 $ORDER $limitSql";	
	writelogs($sql,__FUNCTION__,__FILE__,__LINE__);
	$results = $q->QUERY_SQL($sql,$database);
	if(mysql_num_rows($results)==0){json_error_show("no data $sql");}
		
	$data = array();
	$data['page'] = $page;
	$data['total'] = $total;
	$data['rows'] = array();
	
	if(!$q->ok){json_error_show($q->mysql_error);}	
	$updated_from_co 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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