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


PHP json_error_show函数代码示例

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


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


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