Example #1
0
 public function searchCelestialAction()
 {
     $line = new stdClass();
     $line->locations = array();
     $text = Input::get('q');
     // did we get passed an ID?
     if (ctype_digit($text)) {
         $result = MapItem::where('itemID', '=', $text)->whereIn('groupID', array('7', '8'))->where('security', '<', '0.8')->take(1)->get();
         if ($result != false) {
             $result = $result[0];
             $line->locations = array('text' => $result->itemName, 'id' => $result->itemID);
             goto endGetLocation;
             // OH GOD AAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
             // MY EYES MY EYES ARE BURNING WITH ACID IT HURTS OHHHHH GODDDD IT HUURRRTTTTTSSSSSSSss..
         }
     }
     $search = MapItem::where('itemName', 'like', $text . '%')->whereIn('groupID', array('7', '8'))->where('security', '<', '0.8')->take(40)->get();
     foreach ($search as $row) {
         $line->locations[] = array('text' => $row->itemName, 'id' => $row->itemID);
     }
     // GOTO END
     endGetLocation:
     if (!Input::has('callback')) {
         return Response::json($line);
     } else {
         return Response::json($line)->setCallback(Input::get('callback'));
     }
 }