Beispiel #1
0
function handleMessage($msg)
{
    if (!$msg) {
        return;
    }
    $Opt = $msg['operation'];
    $data = $msg;
    $Response = array();
    switch ($Opt) {
        case 'count':
            $Response = handleCount($data);
            break;
        case 'regist':
            $Response = handleRegist($data);
            break;
        case 'login':
            $Response = handleLogin($data);
            break;
        case 'updatePW':
            $Response = handleUpdatePW($data);
            break;
        case 'userdata':
            $Response = handleUserData($data);
            break;
        case 'updateUserData':
            $Response = handleUpdateUserData($data);
            break;
        case 'logout':
            $Response = handleLogout($data);
            break;
        case 'search':
            $Response = handleSearch($data, false);
            break;
        case 'searchAll':
            $Response = handleSearch($data, true);
            break;
        case 'uploadHeadImage':
            $Response = handleUploadHeadImage($data);
        default:
            break;
    }
    echo json_encode($Response);
}
Beispiel #2
0
                if ($results = handleSearch('service', $term)) {
                    $html = "<h3>Services</h3>";
                    $html .= formatSearchResults($results, 'service', $term, 5);
                    $html .= printMoreSearchTypeButton('service', $term);
                }
                if ($results = handleSearch('host', $term)) {
                    $html .= "<h3>Hosts</h3>";
                    $html .= formatSearchResults($results, 'hostname', $term, 5);
                    $html .= printMoreSearchTypeButton('host', $term);
                }
                if ($results = handleSearch('generic_reports', $term)) {
                    $html .= "<h3>Weekly Reports</h3>";
                    $html .= formatSearchResults($results, 'report', $term, 3);
                    $html .= printMoreSearchTypeButton('report', $term);
                }
                if ($results = handleSearch('meeting_notes', $term)) {
                    $html .= "<h3>Meeting Notes</h3>";
                    $html .= formatSearchResults($results, 'notes', $term, 2);
                    $html .= printMoreSearchTypeButton('meeting', $term);
                }
                break;
        }
    }
} else {
    $header = "Search";
    $no_search = true;
}
$page_title = getTeamName() . " Weekly Updates - Search results for {$title}";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>
Beispiel #3
0
/**
 * 
 * Searches the API and returns the results
 *
 * @author Ross Carlson
 * @since 4/21/05
 * 
 **/
function search()
{
    global $jzUSER, $this_site, $root_dir;
    // What kind of output?
    $type = getFormatFromRequest();
    // Let's setup our objects
    // The display object is just a set of functions related to display
    // Like returning images and links
    $display = new jzDisplay();
    // Let's search
    // This will search the API and return an array of objects
    $st = isset($_REQUEST['search_type']) ? $_REQUEST['search_type'] : 'best';
    $query = '';
    if (!empty($_REQUEST['search'])) {
        $query = $_REQUEST['search'];
    }
    $results = handleSearch($query, $st);
    /*
    // Now let's make sure we had results
    if (count($results) == 0){
    	// Now let's output
    	switch ($type){
    		case "xml":
    			echoXMLHeader();
    			echo "  <search>false</search>\n";
    			echoXMLFooter();
    			return;
    		break;
    	}
    }
    */
    print_results($results, $type);
}
Beispiel #4
0
 /**
  * Draws the search results page.
  * 
  * @author Ben Dodson
  * @version 12/18/04
  * @since 11/20/04
  */
 function searchResults($string, $type, $power_search = false)
 {
     global $cms_type, $jzSERVICES;
     $display =& new jzDisplay();
     $blocks =& new jzBlocks();
     $tracks = array();
     $nodes = array();
     // remember, $this is a frontend.
     // This has to go before SQL querries.
     // If our keywords say to play the results
     // we cannot print any HTML.
     if ($power_search === false) {
         $check = splitKeywords($string);
         if (!muteOutput($check['keywords'])) {
             $display->preheader('Search Results', $this->width, $this->align);
             $this->pageTop('Search Results');
         }
         $results = handleSearch($string, $type);
         if (sizeof($results) == 0 && muteOutput($check['keywords'])) {
             $display->preheader('Search Results', $this->width, $this->align);
             $this->pageTop('Search Results');
         }
     } else {
         // Power search:
         $display->preheader('Search Results', $this->width, $this->align);
         $this->pageTop('Search Results');
         $root = new jzMediaNode();
         $results = $root->powerSearch();
     }
     echo '<table width="100%" cellpadding="3"><tr><td>';
     foreach ($results as $val) {
         if ($val->isLeaf()) {
             $tracks[] = $val;
         } else {
             $nodes[] = $val;
         }
     }
     // show the page
     if (sizeof($tracks) > 0) {
         $blocks->blockHeader(sizeof($tracks) . " " . word("Matching Tracks") . " " . word("for search") . ' "' . $_POST['search_query'] . '"');
         $blocks->blockBodyOpen();
         $blocks->trackTable($tracks, "search");
         $blocks->blockBodyClose();
         $blocks->blockSpacer();
     }
     if (sizeof($nodes) > 0) {
         $blocks->blockHeader(sizeof($nodes) . " " . word("Other Matches") . " " . word("for search") . ' "' . $_POST['search_query'] . '"');
         $blocks->blockBodyOpen();
         $blocks->nodeTable($nodes, "search");
         $blocks->blockBodyClose();
         $blocks->blockSpacer();
     }
     if (sizeof($nodes) == 0 && sizeof($tracks) == 0) {
         $blocks->blockHeader(word("No matches found"));
     }
     $this->footer();
     $jzSERVICES->cmsClose();
 }