public function indexAction()
 {
     Select2::injectDependencies();
     $keys = array('package', 'package_version', 'brand', 'phone_model', 'product', 'os_version', 'country');
     $values = array();
     foreach ($keys as $key) {
         $values[$key] = Input::hasGet($key) ? Input::get($key) : null;
     }
     return View::create('base')->with('title', 'Live Feed')->with('page', 'live-feed')->with('values', $values);
 }
 public function searchAction()
 {
     $title = 'Search results';
     if (sizeof(Input::get()) == 1) {
         if (Input::hasGet('provider_id')) {
             $e = Provider::fetchOne(Input::get('provider_id'));
             $title = "Search results for internet provider <strong>{$e->name}</strong>";
         } else {
             if (Input::hasGet('brand_id')) {
                 $e = Brand::fetchOne(Input::get('brand_id'));
                 $title = "Search results for brand <strong>{$e->name}</strong>";
             } else {
                 if (Input::hasGet('package_id')) {
                     $e = Package::fetchOne(Input::get('package_id'));
                     $title = "Search results for package <strong>{$e->name}</strong>";
                 } else {
                     if (Input::hasGet('package_version_id')) {
                         $e = Package\Version::fetchOne(Input::get('package_version_id'));
                         $p = Package::fetchOne($e->package_id);
                         $title = "Search results for <strong>{$p->name}</strong> version {$e->value}";
                     }
                 }
             }
         }
     }
     $packageId = (int) Input::get('package_id');
     $packageVersionId = (int) Input::get('package_version_id');
     $brandId = (int) Input::get('brand_id');
     $osVersionId = (int) Input::get('os_version_id');
     $countryId = (int) Input::get('country_id');
     $providerId = (int) Input::get('provider_id');
     $productId = (int) Input::get('product_id');
     $modelId = (int) Input::get('model_id');
     $dateFrom = Input::get('date_from');
     $dateTo = Input::get('date_to');
     $stackTraceId = (int) Input::get('stack_trace_id');
     $table = BootstrapUI::tableRemote()->title($title)->extraParams(array('package_id' => $packageId, 'package_version_id' => $packageVersionId, 'brand_id' => $brandId, 'os_version_id' => $osVersionId, 'country_id' => $countryId, 'provider_id' => $providerId, 'product_id' => $productId, 'model_id' => $modelId, 'date_from' => $dateFrom, 'date_to' => $dateTo, 'stack_trace_id' => $stackTraceId))->column('country_name', '', 20)->column('created_at', 'time', 85)->column('package_name', 'package')->column('package_version', 'version')->column('brand_name', 'brand')->column('os_version_name', 'OS version', 105)->column('country', '')->column('action', '', 30)->sortableColumns(array('created_at', 'package_name', 'package_version', 'brand_name', 'os_version_name', 'cnt'))->sortField('created_at', 'desc');
     $table->panel()->addHeaderElement(Bootstrap::button('Back')->color('red')->size('xs')->setAttribute('onclick', 'window.history.back()'));
     return View::create('base')->with('title', $title)->with('content', Bootstrap::row()->add(12, $table));
 }