예제 #1
0
} elseif ($src == "db") {
    $where = explode(",", $_REQUEST["where"]);
    $qW = "";
    $i = 0;
    foreach ($where as $a => $b) {
        $e = explode(":", $b);
        $qW .= getRelation($e[1], $e[0], $e[2]);
        if ($i < sizeOf($where) - 1) {
            $qW .= " AND ";
        }
        $i++;
    }
    $_REQUEST["where"] = $qW;
    $q = generateSelectFromArray($_REQUEST, array("table" => "tbl"));
    $result = _dbQuery($q);
    dispatchData(_db()->fetchAllData($result, "array"));
    _db()->freeResult($result);
}
exit;
function dispatchData($sql, $cols, $sys = false)
{
    $format = "json";
    if (isset($_REQUEST['format'])) {
        $format = $_REQUEST['format'];
    }
    if ($format == "json") {
        dispatchJSONData($sql, $cols, $sys);
    } elseif ($format == "selector") {
        dispatchSelectorData($sql, $cols, $sys);
    } else {
        dispatchJSONData($sql, $cols, $sys);
예제 #2
0
        array_push($path, ROOT . MISC_FOLDER . "lookups/");
    }
    foreach ($path as $a => $p) {
        if (file_exists($p . $dict . ".dat")) {
            $data = file_get_contents($p . $dict . ".dat");
            $data = explode("\n", $data);
            foreach ($data as $a => $b) {
                if (strlen($term) > 0) {
                    if (strpos("#" . strtolower($b), strtolower($term)) == 1) {
                    } elseif (strpos($b, "=") > 1 && strpos(strtolower($b), strtolower("=" . $term)) == strpos($b, "=")) {
                    } else {
                        unset($data[$a]);
                    }
                }
            }
            dispatchData($data);
            if (getConfig("ALLOW_LOOKUP_CONCATANATION") == "false") {
                break;
            }
        } elseif (file_exists($p . $dict . ".xml")) {
            //echo $p.$dict.".dat";
        }
    }
}
function dispatchData($data)
{
    $format = "json";
    if (isset($_REQUEST['format'])) {
        $format = $_REQUEST['format'];
    }
    if ($format == "json") {