Beispiel #1
0
    $start = $_REQUEST['start'];
}
if (!empty($_REQUEST['total'])) {
    $total = $_REQUEST['total'];
}
if (array_key_exists('listViewStartButton', $_REQUEST)) {
    $start = 0;
} elseif (array_key_exists('listViewPrevButton', $_REQUEST)) {
    $start = max($start - $amount, 0);
} elseif (array_key_exists('listViewNextButton', $_REQUEST)) {
    $start = min($start + $amount, $total);
} elseif (array_key_exists('listViewEndButton', $_REQUEST)) {
    $start = floor($total / $amount) * $amount;
}
if ($queryString) {
    $res = doSearch($index, $queryString, $start, $amount);
    $total = $res['total'];
    $hits = $res['hits'];
}
?>
<form name='UnifiedSearchAdvancedMain' action='index.php' method='POST' class="search_form">
    <input type='hidden' name='query_string' value='test'>
    <input type='hidden' name='action' value='UnifiedSearch'>
    <input id='searchFieldMain' class='searchField' type='text' size='80' name='query_string' placeholder='<?php 
echo translate("LBL_SEARCH_QUERY_PLACEHOLDER", "AOD_Index");
?>
' value='<?php 
echo $queryString;
?>
'>
    <input type="submit" class="button primary" value="<?php 
Beispiel #2
0
}
//specify what to do on which action
switch ($_GET["action"]) {
    case "showhighscore":
        $r = doShowhighscore();
        if ($r === false) {
            doError("Error while getting highscore");
        } else {
            doOutput($r, "showhighscore");
        }
        break;
    case "search":
        if (!isset($_POST["keyword"])) {
            doError("No keyword specified");
        }
        $r = doSearch($_POST["keyword"]);
        if ($r === false) {
            doError("Error while searching");
        } else {
            doOutput($r, "search");
        }
        break;
    case "vote":
        if (!isset($_GET["id"])) {
            doError("No id specified");
        }
        $r = doVote($_SERVER['REMOTE_ADDR'], $_GET["id"]);
        doOutput($r, "vote");
        break;
    case "voteFolder":
        if (!isset($_GET["id"])) {
Beispiel #3
0
 $oFrontRenderer = new FrontRenderer();
 $arguments = explode('?', $_SERVER['REQUEST_URI']);
 $arguments = strtolower($arguments[0]);
 $arguments = explode('/', $arguments);
 array_shift($arguments);
 $c = count($arguments);
 $subject = $arguments[0];
 if ($c >= 2) {
     $nefubId = $arguments[1];
 }
 // Handle requests
 switch ($subject) {
     case 'ajax':
         if ($nefubId == 'search') {
             $search = urldecode($arguments[2]);
             $results = doSearch($search);
             echo json_encode($results);
             exit;
         }
         break;
     case 'retrieve.php':
         if (isset($_GET['retrieve'])) {
             $key = 1;
             if ($_GET['retrieve'] == $key) {
                 $cronHandler = CronHandler::getInstance();
                 if (isset($_GET['gamesonly']) && $_GET['gamesonly'] == 1) {
                     $cronHandler->runGames();
                 } elseif (isset($_GET['locationsonly']) && $_GET['locationsonly'] == 1) {
                     $cronHandler->runLocations();
                 } else {
                     $cronHandler->run();
Beispiel #4
0
                case "getPage":
                    getPage();
                    break;
                case "doSearch":
                    doSearch();
                    break;
                case "getDrinkInfo":
                    getDrinkInfo();
                    break;
            }
        }
    } else {
        switch ($_POST["action"]) {
            case "getAllDrinks":
                getAllDrinks();
                break;
            case "getNumPages":
                getNumPages();
                break;
            case "getPage":
                getPage();
                break;
            case "doSearch":
                doSearch();
                break;
            case "getDrinkInfo":
                getDrinkInfo();
                break;
        }
    }
}
Beispiel #5
0
        break;
    case REQUEST_GET_ALL_GIVEN_LIST_OF_MINE:
        # API-20
        doGetAllGivenListOfMine($JSON);
        break;
    case REQUEST_GET_ALL_TAKEN_LIST_OF_MINE:
        # API-21
        doGetAllTakenListOfMine($JSON);
        break;
    case REQUEST_ADD_DONATE:
        # API-22
        doAddDonate($JSON);
        break;
    case REQUEST_DO_SEARCH:
        # API-23
        doSearch($JSON);
        break;
    case REQUEST_GET_ALL_GIVEN_LIST_BY_RADIUS:
        # API-24
        getAllGivenListByRadius($JSON);
        break;
    case REQUEST_GET_ALL_GIVEN_LIST_BY_CITY:
        # API-25
        getAllGivenListByCity($JSON);
        break;
    default:
        giveResponseAPIRequestKeyInvalid();
        break;
}
exit;
/* ===========================================================================================================================================================================
Beispiel #6
0
<form id="searchForm" name="searchForm" method="post">
<div class="searchBarBlock"> 
<center>
<table><tr><td>
<input type="text" id="searchText" name="searchText" value="<?php 
echo $searchText;
?>
" style="width:400px;"/>
</td><td onclick="doSearch()" class="searchButtonBlock">d i G G</td></table>
</center>
</div>

<?php 
if ($action == 'doSearch') {
    $srchStr = $_REQUEST['searxhText'];
    $resultItems = doSearch($srchStr);
    $i = 0;
    while ($row = mysql_fetch_assoc($resultItems)) {
        $i++;
        $itemDets = getItemDet($row['val']);
        while ($itemRow = mysql_fetch_assoc($itemDets)) {
            echo "<table style='background-image:url(images/res_bg.gif)' class='resultBlock' width=100%>";
            echo "<tr><td width='50px'><img src='images/no_item_img.gif'/>";
            echo "</td><td>";
            echo "<div class='resItem'>" . $itemRow['prod_name'] . "</div>";
            echo "<div class='resClass'>" . $itemRow['class_name'] . "</div>";
            echo "<p class='resDesc'>" . $itemRow['prod_desc'] . "</div>";
            echo "<div>" . $itemRow['rating'] . "</div>";
            echo "</td></tr></table>";
        }
    }
Beispiel #7
0
    return array($result['min'], $result['max']);
}
$results = array();
try {
    require_once 'classes/functions.php';
    require_once 'classes/Configuration.php';
    require_once 'classes/Configurator.php';
    require_once 'classes/Logger.php';
    require_once 'classes/DB.php';
    if (isset($_GET['s'])) {
        $search = strtolower(trim(sget('s')));
        $replacements = getReplacementsMap();
        $searchWords = getSearchWords($search, $replacements);
        $words = doSearch(array(), $searchWords, RESULTS_COUNT, 'searchKurdishStartingWith');
        if (count($words) < RESULTS_COUNT) {
            $words = doSearch($words, $searchWords, RESULTS_COUNT - count($words), 'searchKurdishContaining');
            if (count($words) < RESULTS_COUNT) {
                $words = removeDuplicates(array_merge($words, searchEnglishContaining($search, RESULTS_COUNT - count($words))));
            }
        }
        foreach ($words as $word) {
            $results[] = array('label' => sprintf('<b>%s</b>', trim($word['original'])) . ' ' . $word['description'], 'value' => trim($word['original']));
        }
    } else {
        if (isset($_GET['random'])) {
            /*        list($minId, $maxId) = getMinMaxIds();
            
                    $word = null;
                    $attempts = 0;
                    while(is_null($word) && ($attempts < 10)) {
                        $word = DB::getInstance()->selectOneByField('KurDictionary', 'id', mt_rand($minId, $maxId));