Esempio n. 1
0
 public static function xajax()
 {
     edk_xajax::xajax();
 }
Esempio n. 2
0
<?php

/**
 * Core ajax functions are included in this page. Registered functions are
 * called once all mods are initialised.
 * @package EDK
 */
require_once 'common/xajax/xajax.php';
$xajax->register(XAJAX_FUNCTION, "doAjaxSearch");
$xajax->register(XAJAX_FUNCTION, "getComments");
$xajax->register(XAJAX_FUNCTION, "postComments");
edk_xajax::xajax();
/**
 * Search function for the search.php page.
 *
 * @param string $searchphrase
 * @param string $type
 * @param integer $limit
 * @return xajaxResponse
 */
function doAjaxSearch($searchphrase = '', $type = 'pilot', $limit = 10)
{
    $qry = new DBPreparedQuery();
    switch ($type) {
        case "pilot":
            $sql = "select plt.plt_name as name1, crp.crp_name as name2, plt.plt_id as id\n\t\t\t\t  from kb3_pilots plt, kb3_corps crp\n\t\t\t\t where plt.plt_name  like ?\n\t\t\t\t   and plt.plt_crp_id = crp.crp_id\n\t\t\t\t order by plt.plt_name LIMIT {$limit}";
            break;
        case "corp":
            $sql = "select crp.crp_name as name1, ali.all_name as name2, crp.crp_id as id\n\t\t\t\t  from kb3_corps crp, kb3_alliances ali\n\t\t\t\t where crp.crp_name like  ?\n\t\t\t\t   and crp.crp_all_id = ali.all_id\n\t\t\t\t order by crp.crp_name LIMIT {$limit}";
            break;
        case "alliance":