Example #1
0
<?php

ob_start();
define('CID', false);
require_once '../../../include.php';
ModuleManager::load_modules();
if (!Base_AclCommon::is_user()) {
    return;
}
if (isset($_GET['crit']) && $_GET['crit'] != "" && isset($_GET['q']) && $_GET['q'] != "") {
    $arrResult = array();
    $id = $_GET['crit'];
    $txt = trim(urldecode($_GET['q']));
    $arrTxt = explode(" ", $txt);
    $arrayQuick = Applets_QuickSearchCommon::getRecordsetAndFields($id);
    $format = Applets_QuickSearchCommon::getResultFormat();
    $formatString = Applets_QuickSearchCommon::parseFormatString($format);
    $arrayKey = array();
    $array_keys = array_keys($arrayQuick);
    foreach ($array_keys as $key) {
        $fieldsArray = Applets_QuickSearchCommon::parse_array($arrayQuick[$key]);
        $sql = substr("select * from " . $key . "_data_1 where " . Applets_QuickSearchCommon::constructLikeSQL($arrTxt, $fieldsArray), 0, -3);
        $qry = DB::SelectLimit($sql, 20, 0);
        if ($qry) {
            $arrRow = array();
            $result = "";
            while ($rowValue = $qry->FetchRow()) {
                $rowValue["RECORD_SET"] = $key;
                $arrayKey[] = $rowValue;
            }
        }