コード例 #1
0
 function simpleSearchFieldCombo($fNamesArr, $selOpt)
 {
     $options = "";
     $settings = new ProjectSettings($this->tName);
     if (sizeof($settings->getGoogleLikeFields()) != 0) {
         $options = '<option value="" >' . "Any field" . '</option>';
     }
     foreach ($fNamesArr as $fName) {
         $fLabel = GetFieldLabel(GoodFieldName($this->tName), GoodFieldName($fName));
         $options .= '<option value="' . $fName . '" ' . ($selOpt == $fName ? 'selected' : '') . '>' . $fLabel . '</option>';
     }
     return $options;
 }
コード例 #2
0
$searchFor = postvalue('searchFor');
// if nothing to search
if ($searchFor == '') {
    echo printJSON(array('success' => true, 'result' => ''));
    return;
}
$_connection = $cman->byTable($strTableName);
// array of vals
$response = array();
$searchOpt = postvalue("start") ? "Starts with" : "Contains";
$searchField = GoodFieldName(postvalue('searchField'));
$strSecuritySql = SecuritySQL("Search", $strTableName);
$numberOfSuggests = GetGlobalData("searchSuggestsNumber", 10);
$pSet = new ProjectSettings($strTableName, PAGE_SEARCH);
if ($searchField == "") {
    $allSearchFields = $pSet->getGoogleLikeFields();
} else {
    // array of fields which were added in wizard for search
    $allSearchFields = $pSet->getAllSearchFields();
}
require_once getabspath('classes/controls/EditControlsContainer.php');
$detailKeys = array();
$masterWhere = "";
$cipherer = new RunnerCipherer($strTableName);
$controls = new EditControlsContainer(null, $pSet, PAGE_LIST, $cipherer);
if (@$_SESSION[$strTableName . "_mastertable"] != "") {
    $masterTablesInfoArr = $pSet->getMasterTablesArr($strTableName);
    for ($i = 0; $i < count($masterTablesInfoArr); $i++) {
        if ($_SESSION[$strTableName . "_mastertable"] != $masterTablesInfoArr[$i]['mDataSourceTable']) {
            continue;
        }
コード例 #3
0
 /**
  * Get google like fields from dashboard
  * @return Array
  */
 function getGoogleLikeFieldsFromDashboard()
 {
     $result = array();
     $dashSettings = new ProjectSettings($this->dashTName, PAGE_DASHBOARD);
     $dashGoogleLikeFields = $dashSettings->getGoogleLikeFields();
     $dashSearchFields = $dashSettings->getDashboardSearchFields();
     foreach ($dashGoogleLikeFields as $i => $field) {
         foreach ($dashSearchFields[$field] as $j => $data) {
             if ($data['table'] != $this->tName) {
                 continue;
             }
             $result[] = $data['field'];
         }
     }
     return $result;
 }
コード例 #4
0
ファイル: searchsuggest.php プロジェクト: aagusti/padl-tng
$sessionPrefix = $strTableName;
$cipherer = new RunnerCipherer($strTableName);
$pSet = new ProjectSettings($strTableName, PAGE_SEARCH);
// array of fields which were added in wizard for search
$allSearchFields = $pSet->getAllSearchFields();
// SearchClause class stuff
if (isset($_SESSION[$sessionPrefix . '_advsearch'])) {
    $searchClauseObj = unserialize($_SESSION[$sessionPrefix . '_advsearch']);
} else {
    $params = array();
    $params['tName'] = $strTableName;
    $params['cipherer'] = $cipherer;
    $params['searchFieldsArr'] = $allSearchFields;
    $params['sessionPrefix'] = $sessionPrefix;
    $params['panelSearchFields'] = $pSet->getPanelSearchFields();
    $params['googleLikeFields'] = $pSet->getGoogleLikeFields();
    $searchClauseObj = new SearchClause($params);
}
// array of vals
$response = array();
if (postvalue("start")) {
    $suggestAllContent = false;
}
$searchFor = postvalue('searchFor');
$searchField = GoodFieldName(postvalue('searchField'));
$strSecuritySql = SecuritySQL("Search", $strTableName);
$detailKeys = array();
$masterWhere = "";
if ($searchField == "") {
    $allSearchFields = $pSet->getGoogleLikeFields();
}
コード例 #5
0
ファイル: searchclause.php プロジェクト: aagusti/padl-tng
 function SearchClause(&$params)
 {
     global $strTableName;
     $this->searchOptions["contains"] = array("option" => "Contains", "not" => false);
     $this->searchOptions["equals"] = array("option" => "Equals", "not" => false);
     $this->searchOptions["startswith"] = array("option" => "Starts with", "not" => false);
     $this->searchOptions["morethan"] = array("option" => "More than", "not" => false);
     $this->searchOptions["lessthan"] = array("option" => "Less than", "not" => false);
     $this->searchOptions["between"] = array("option" => "Between", "not" => false);
     $this->searchOptions["empty"] = array("option" => "Empty", "not" => false);
     $this->searchOptions["notcontain"] = array("option" => "Contains", "not" => true);
     $this->searchOptions["notequal"] = array("option" => "Equals", "not" => true);
     $this->searchOptions["notstartwith"] = array("option" => "Starts with", "not" => true);
     $this->searchOptions["notmorethan"] = array("option" => "More than", "not" => true);
     $this->searchOptions["notlessthan"] = array("option" => "Less than", "not" => true);
     $this->searchOptions["notbetween"] = array("option" => "Between", "not" => true);
     $this->searchOptions["notempty"] = array("option" => "Empty", "not" => true);
     $this->tName = $params['tName'] ? $params['tName'] : $strTableName;
     $this->sessionPrefix = $params['sessionPrefix'] ? $params['sessionPrefix'] : $this->tName;
     $this->searchFieldsArr = $params['searchFieldsArr'];
     $this->cipherer = $params['cipherer'];
     $settings = new ProjectSettings($this->tName, PAGE_SEARCH);
     $this->panelSearchFields = $params['panelSearchFields'] ? $params['panelSearchFields'] : $settings->getPanelSearchFields();
     $this->googleLikeFields = $params['googleLikeFields'] ? $params['googleLikeFields'] : $settings->getGoogleLikeFields();
 }