public function index() { if (Auth::user()->isAdmin() || Auth::user()->isSuperAdmin()) { $filter = \DataFilter::source(Vehicle::with('Device', 'Account')->whereHas('Account', function ($query) { $query->where('company_id', Auth::user()->company_id); })); $filter->add('plate', 'Placa', 'text')->scope(function ($query, $value) { return $query->whereRaw("plate LIKE '%" . strtoupper($value) . "%'"); }); $filter->add('brand', 'Marca', 'text'); $filter->add('model', 'Modelo', 'text'); $filter->add('year', 'Ano', 'text'); $filter->add('color', 'Cor', 'text'); $filter->add('hasdevice', 'Atribuído', 'select')->options(array(0 => 'Todos', 1 => 'Com Rastreador', 2 => 'Sem Rastreador'))->scope('hasdevice'); $filter->submit('Buscar'); $filter->reset('Limpar'); $filter->build(); $grid = \DataGrid::source($filter); $grid->label('Veículos'); $grid->attributes(array("class" => "table table-striped")); $grid->add('Account.name', 'Cliente', 'account_id'); $grid->add('plate', 'Placa', true); $grid->add('brand', 'Marca', true); $grid->add('model', 'Modelo', true); $grid->add('year', 'Ano', true); $grid->add('color', 'Cor', true); $grid->add('Device.serial', 'Aparelho'); $grid->edit('vehicles/edit', 'Ações', 'show|modify|delete'); $grid->link('vehicles/edit', "Novo Veículo", "TR"); $grid->paginate(10); return view('vehicles::index', compact('filter', 'grid')); } else { return redirect()->back()->with('error', 'Você não tem permissão para acessar esse módulo!'); } }
/** * Display a listing of mailings * * @return Response */ public function index() { $filter = DataFilter::source(new Mailing()); $filter->add('email', 'Email', 'text'); $filter->add('nome', 'Nome', 'text'); $filter->add('phone', 'Telefone', 'text'); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('email', 'Email', true); //field name, label, sortable $grid->add('nome', 'Nome', true); //field name, label, sortable $grid->add('phone', 'Telefone', true); //field name, label, sortable $grid->add(' <a class="text-danger" title="Deletar" href="admin/mailing/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a> ', 'Ações'); //$grid->edit('admin/mailing/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions $grid->orderBy('email', 'asc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); // $mailing = Mailing::find(1); // echo $mailing->destino->{'nome_br'}; // dd(); return View::make('admin.mailing.index', compact('filter', 'grid')); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Pessoas()); $this->filter->add('nome', 'Nome', 'text'); $this->filter->add('id_grupo', 'Grupo', 'text'); $this->filter->add('id_programa', 'Programa', 'text'); $this->filter->submit('buscar'); $this->filter->reset('resetar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('nome', 'Nome'); $this->grid->add('sexo', 'Sexo'); $this->grid->add('nascimento', 'nascimento'); $this->grid->add('responsavel', 'Responsável'); $this->grid->add('email', 'Email'); $this->grid->add('tel-fixo', 'Telefone Fixo'); $this->grid->add('rua', 'Logradouro'); $this->grid->add('numero', 'Numero'); $this->grid->add('bairro', 'bairro'); $this->grid->add('id_grupo', 'Grupo'); $this->grid->add('id_programa', 'Programa'); $this->addStylesToGrid(); return $this->returnView(); }
public static function gridForAdmins(&$filter, &$grid) { $filter = \DataFilter::source(News::with('createdBy', 'approvedBy', 'status')); //->where('status_id', '<>', 1) $filter->add('title', 'Title', 'text'); $filter->add('content', 'Content', 'text'); $filter->add('createdBy.name', 'created_by', 'text'); $filter->add('approvedBy.name', 'approved_by', 'text'); $filter->add('updated_at', 'Last update date', 'daterange')->format('m/d/Y', 'en'); $filter->add('created_at', 'Create date', 'daterange')->format('m/d/Y', 'en'); $filter->submit('search'); $filter->reset('reset'); $filter->build(); $grid = DataGrid::source($filter); $grid->attributes(array("class" => "table table-striped")); $grid->add('title', 'Title', true); $grid->add('updated_at|strtotime|date[m/d/Y]', 'Last update date', true); $grid->add('created_at|strtotime|date[m/d/Y]', 'Create date', true); $grid->add('content|strip_tags|substr[0,20]', 'Content'); $grid->add('createdBy.name', 'created_by'); $grid->add('approvedBy.name', 'approved_by'); $grid->add('status.title', 'Status'); $grid->add('view', 'View')->cell(function ($value, $row) { return '<a class="btn btn-responsive" href="' . url('admin-news/view') . "/" . $row->id . '"><i class="glyphicon glyphicon-eye-open"></i></a>'; }); $grid->add('status.id', 'Approve')->cell(function ($value, $row) { if ($value == 2) { return '<a class="btn btn-success btn-responsive" href="' . url('admin-news/approve') . "/" . $row->id . '"><i class="glyphicon glyphicon-ok"></i> Approve</a>'; } return ''; }); $grid->orderBy('id', 'desc'); $grid->paginate(10); }
/** * Display a listing of the resource. * GET /admcontinentes * * @return Response */ public function index() { $filter = DataFilter::source(new Continente()); $filter->add('name_pt', 'Nome - PT', 'text'); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('name_pt', 'Nome PT', true); //field name, label, sortable $grid->add(' <a class="" title="Modificar" href="admin/continente/{{$code}}/edit"><span class="glyphicon glyphicon-edit"> </span></a> ', 'Ações'); //$grid->edit('admin/hotel/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions $grid->orderBy('name_pt', 'desc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); // $hotel = Hotel::find(1); // echo $hotel->destino->{'nome_br'}; // dd(); return View::make('admin.continente.index', compact('filter', 'grid')); }
public function index() { if (Auth::user()->isAdmin() || Auth::user()->isSuperAdmin()) { $filter = \DataFilter::source(Account::where('company_id', Auth::user()->company_id)); $filter->add('name', 'Nome', 'text'); $filter->add('cpf_cnpj', 'CPF/CNPJ', 'text'); $filter->add('hasvehicle', 'Veículo', 'select')->options(array(0 => 'Todos', 1 => 'Com Veículos', 2 => 'Sem Veículos'))->scope('hasvehicle'); $filter->submit('Buscar'); $filter->reset('Limpar'); $filter->build(); $grid = \DataGrid::source($filter); $grid->label('Clientes'); $grid->attributes(array("class" => "table table-striped")); $grid->add('name', 'Nome', true); $grid->add('cpf_cnpj', 'CPF/CNPJ', true); $grid->add('phone1', 'Telefone'); $grid->add('phone2', 'Telefone'); $grid->edit('accounts/edit', 'Ações', 'show|modify|delete'); $grid->link('accounts/edit', "Novo Cliente", "TR"); $grid->orderBy('name', 'asc'); return view('accounts::index', compact('filter', 'grid')); } else { return view('errors.503'); } }
/** * Display a listing of the resource. * GET /admpedido * * @return Response */ public function index() { $filter = DataFilter::source(new User()); $filter->add('nome', 'Nome do Cliente', 'text'); $filter->add('email', 'Email do Cliente', 'text'); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('id', 'Id Cliente', true); //field name, label, sortable $grid->add('nome', 'Nome do Cliente', true); //field name, label, sortable $grid->add('email', 'Email do Cliente'); //relation.fieldname $grid->add(' <a class="" title="Criar Produtos" href="admin/produto-personalizado/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a> ', 'Ações'); //$grid->edit('admin/serviconoturno/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions $grid->orderBy('id', 'desc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); return View::make('admin.produtopersonalizado.index', compact('filter', 'grid')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $filter = \DataFilter::source(User::with('faction')); $filter->add('name', 'Name', 'text'); $filter->add('faction.name', 'Faction', 'autocomplete'); $filter->add('updated_at', 'Last change', 'daterange')->format('m/d/Y', 'en'); $filter->submit('search'); $filter->reset('reset'); $filter->build(); $grid = \DataGrid::source($filter)->attributes(['class' => 'table table-hover table-striped']); $grid->add('id', 'ID', true)->cell(function ($value) { return link_to(action('Admin\\UserController@edit') . '?show=' . $value, $value); }); $grid->add('status', 'Status', true); $grid->add('name', 'Name', true); $grid->add('faction.name', 'Faction', true); $grid->add('reputation', 'Reputation', true); $grid->add('alignment', 'Alignment', true); $grid->add('affiliation', 'Affiliation', true); $grid->add('created_at', 'Created', true); $grid->add('updated_at', 'Last change', true); $grid->add('email', 'Email address'); $grid->edit(action('Admin\\UserController@edit'), 'Edit', 'modify|delete'); return view('admin.user.index', compact('filter', 'grid')); }
/** * Display a listing of the resource. * GET /admpedido * * @return Response */ public function index() { $filter = DataFilter::source(Pedido::with('cliente', 'status')); $filter->add('nome', 'Nome do Cliente', 'text'); $filter->add('email', 'Email do Cliente', 'text'); $filter->add('status.nome', 'Status do pedido', 'select')->options(PedidoStatus::lists("nome_br", "id")); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('id', 'Id Pedido', true); //field name, label, sortable $grid->add('nome', 'Nome do Cliente', true); //field name, label, sortable $grid->add('email', 'Email do Cliente'); //relation.fieldname $grid->add('status.nome_br', 'Status do Pedido'); //relation.fieldname $grid->add('total', 'Valor do Pedido'); $grid->add('created_at', 'Data do Pedido', true); $grid->add(' <a class="" title="Modificar" href="admin/pedido/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a> <a class="text-danger" title="Deletar" href="admin/pedido/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a> ', 'Ações'); //$grid->edit('admin/serviconoturno/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions $grid->orderBy('id', 'desc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); return View::make('admin.pedido.index', compact('filter', 'grid')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show(Variable $variable, Request $request) { if ($request->ajax()) { //use query builder instead of eloquent $rawData = DB::table('data_values')->join('entities', 'data_values.fk_ent_id', '=', 'entities.id')->join('times', 'data_values.fk_time_id', '=', 'times.id')->where('data_values.fk_var_id', $variable->id)->get(); $data = []; $index = 1; foreach ($rawData as $d) { if (!array_key_exists($d->name, $data)) { $obj = new \StdClass(); $obj->id = $index; $obj->key = $d->name; $obj->values = []; $data[$d->name] = $obj; $index++; } $data[$d->name]->values[] = ["x" => intval($d->label), "y" => intval($d->value)]; } return ['success' => true, 'data' => ['variable' => $variable, 'data' => $data]]; } else { //data /*$source = DB::table( 'data_values' ) ->leftJoin( 'entities', 'data_values.fk_ent_id', '=', 'entities.id' ) ->leftJoin( 'times', 'data_values.fk_time_id', '=', 'times.id' ) ->select( DB::raw( 'data_values.*, times.label, entities.name' ) );*/ $source = DataValue::grid()->where('fk_var_id', '=', $variable->id); //$source = DataValue::with( array('Entity','Time') )->where( 'fk_var_id', '=', $variable->id ); $entityList = DataValue::where('fk_var_id', '=', $variable->id)->lists('fk_var_id'); $entities = Entity::whereIn('id', $entityList); //datagrid & filter $filter = \DataFilter::source($source); $filter->attributes(array('class' => 'form-inline')); $filter->add('value', 'Value', 'text'); $entitiesList = Entity::lists('name', 'name'); $entitiesList[''] = 'All'; $filter->add('Entities.name', 'Entity', 'select')->options($entitiesList); $filter->add('Times.label', 'Time', 'text'); $filter->submit('search'); $filter->build(); $grid = \App\Components\BatchDataGrid::source($filter); $grid->add('id', 'ID', true)->style('width:100px'); $grid->add('value', 'Value', true); $grid->add('name', 'Entity', true); $grid->add('label', 'Time', true); $grid->add('description', 'Description'); $grid->add('<a href="' . route('values.index') . '/{{$id}}/edit">Edit</a>', 'Edit'); $grid->paginate(50); //is csv export? if (Input::has('export') && Input::get('export') == 'csv') { return $grid->buildCSV('export_variable', 'Y-m-d.His'); } //construct csv export url $exportUrl = $request->fullUrl() . '&export=csv'; return view('variables.show', compact('variable', 'values', 'grid', 'filter', 'exportUrl')); } }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Grupo()); $this->filter->add('nome', 'Name', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('nome', 'Name'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Area()); $this->filter->add('nombre', 'Nombre', 'text'); $this->filter->submit('Buscar'); $this->filter->reset('Limpiar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('nombre', 'Nombre'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Admins()); $this->filter->add('first_name', 'Nome', 'text'); $this->filter->submit('buscar'); $this->filter->reset('resetar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('first_name', 'Name'); $this->grid->add('email', 'Email'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Categoria()); $this->filter->add('name', 'Nome', 'text'); $this->filter->submit('buscar'); $this->filter->reset('resetar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID'); $this->grid->add('name', 'Nome'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Newsletter()); $this->filter->add('name', 'Nome', 'text'); $this->filter->submit('Buscar'); $this->filter->reset('resetar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('name', 'Nome'); $this->grid->add('email', 'Email'); $this->grid->add('bairro', 'Bairro'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new Admin()); $this->filter->add('id', 'ID', 'text'); $this->filter->add('name', 'Name', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID', true)->style("width:100px"); $this->grid->add('first_name', 'first name'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Video()); $this->filter->add('Nome', 'Nome', 'text'); $this->filter->submit('Buscar'); $this->filter->reset('Resetar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('nome', 'Nome'); $this->grid->add('url', 'url'); $this->grid->add('description', 'Descrição'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(\App\Movement::with('person', 'category', 'group')); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('fecha', 'Fecha', 'date'); $this->grid->add('tipo', 'Tipo'); $this->grid->add('monto', 'Monto'); $this->grid->add('{{ $category->nombre }}', 'Categoría', 'category_id'); $this->grid->add('{{ $person->nombre }}', 'Persona', 'person_id'); $this->grid->add('{{ $group->nombre }}', 'Grupo', 'group_id'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new Permission()); $this->filter->add('id', 'ID', 'text'); $this->filter->add('name', 'Name', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID', true)->style("width:100px"); $this->grid->add('name', 'Url')->style('width:100px'); $this->grid->add('label', 'Description'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Mark()); $this->filter->add('name', 'Nome', 'text'); $this->filter->submit('buscar'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('address', 'Endereço'); $this->grid->add('description', 'Descrição'); $this->grid->add('name', 'Nome'); $this->grid->add('email', 'E-mail'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Blog()); $this->filter->add('id', 'ID', 'text'); $this->filter->add('title', 'Title', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID', true)->style("width:100px"); $this->grid->add('title', 'title'); $this->grid->add('socialPoint', 'social Point'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new Link()); $this->filter->add('id', 'ID', 'text'); $this->filter->add('name', 'Name', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID', true)->style("width:100px"); $this->grid->add('display', 'Disasfasfasfasplay'); $this->grid->add('url', 'Masfasfasfodel'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Posts()); $this->filter->add('name', 'Nome', 'text'); $this->filter->submit('buscar'); $this->filter->reset('limpar'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'id'); $this->grid->add('name', 'Nome'); $this->grid->add('description', 'Descrição'); $this->grid->add('date_old', 'Data'); $this->addStylesToGrid(); return $this->returnView(); }
/** * Display a listing of hotels * * @return Response */ public function index() { $filter = DataFilter::source(Hotel::with('pais')); $filter->add('nome_br', 'Nome - PT', 'text'); $filter->add('pais.name', 'Paises', 'text'); $filter->add('estrelas', 'Tipo (Estrelas)', 'select')->options(array('' => 'Tipo (Estrelas)', 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5)); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('nome_br', 'Nome PT', true); //field name, label, sortable $grid->add('nome_en', 'Nome EN'); //relation.fieldname $grid->add('publicado', 'Publicado', true); $grid->add('pais.name', 'Pais'); $grid->add('<div title="" class="five-stars-container" data-toggle="tooltip" data-placement="bottom" data-original-title="{{$estrelas or 0}} Estrelas"> <span class="five-stars" style="width: {{$estrelas * 20}}%;"></span> </div>', 'Estrelas'); $grid->add(' <a class="" title="Visualizar" href="admin/hotel/{{$id}}"><span class="glyphicon glyphicon-eye-open"> </span></a> <a class="" title="Modificar" href="admin/hotel/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a> <a class="text-danger" title="Deletar" href="admin/hotel/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a> ', 'Ações'); //$grid->edit('admin/hotel/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions $grid->link('admin/hotel/create', "Adicionar Novo", "TR"); //add button $grid->orderBy('id', 'desc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0 $grid->row(function ($row) { if ($row->cell('publicado')->value == 1) { $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>'; } else { $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>'; } }); // $hotel = Hotel::find(1); // echo $hotel->destino->{'nome_br'}; // dd(); return View::make('admin.hotel.index', compact('filter', 'grid')); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\Slider()); $this->filter->add('active', 'Active', 'select')->options(\App\Slider::lists("Active", "active")->all()); $this->filter->add('weight', 'Weight', 'text'); $this->filter->add('img_url', 'Image', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('active', 'Active', 'active'); $this->grid->add('weight', 'Weight', 'weight'); $this->grid->add('img_url', 'Image'); $this->addStylesToGrid(); return $this->returnView(); }
/** * Display a listing of users * * @return Response */ public function getIndex() { $filter = DataFilter::source(new User()); $filter->add('nome', 'Nome completo', 'text'); $filter->add('username', 'Login', 'text'); $filter->add('email', 'E-mail', 'text'); $filter->add('is_admin', 'Administrador', 'select')->options(array('' => 'Todos', 0 => 'Clientes', 1 => 'Administradores')); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('nome', 'Nome completo', true); //field name, label, sortable $grid->add('email', 'E-mail', true); //relation.fieldname $grid->add('publicado', 'Habilitado', true); $grid->add('confirmed', 'Confirmado', true); $grid->edit('admin/usuario/crud', 'Ações', 'show|modify|delete'); //shortcut to link DataEdit actions $grid->link('admin/usuario/crud', "Adicionar Novo", "TR"); //add button $grid->orderBy('id', 'desc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0 $grid->row(function ($row) { if ($row->cell('publicado')->value == 1) { $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>'; } else { $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>'; } if ($row->cell('confirmed')->value == 1) { $row->cell('confirmed')->value = '<span class="label label-success"> Confirmado </span>'; } else { $row->cell('confirmed')->value = '<span class="label label-danger"> Não Confirmado </span>'; } }); // $user = user::find(1); // echo $user->destino->{'nome_br'}; // dd(); return View::make('admin.user.index', compact('filter', 'grid')); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(Role::with('permissions')); $this->filter->add('id', 'ID', 'text'); $this->filter->add('name', 'Name', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID', true)->style("width:100px"); $this->grid->add('name', 'Name')->style('width:100px'); $this->grid->add('label', 'Description'); $this->grid->add('{{ implode(", ", $permissions->lists("name")->all()) }}', 'name'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\People()); $this->filter->add('name', 'Nombre', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('nombre', 'Nombre'); $this->grid->add('{{ $area->nombre }}', 'Area', 'area_id'); $this->grid->add('sueldo', 'Sueldo'); $this->grid->add('aporte', 'Aporte'); $this->grid->add('egresos', 'Gastos'); $this->addStylesToGrid(); return $this->returnView(); }
public function all($entity) { parent::all($entity); $this->filter = \DataFilter::source(new \App\OpinionFinderSentiments()); $this->filter->add('opinionfinder', 'OpinionFinder', 'text'); $this->filter->submit('search'); $this->filter->reset('reset'); $this->filter->build(); $this->grid = \DataGrid::source($this->filter); $this->grid->add('id', 'ID', true); $this->grid->add('date', 'Date', true); $this->grid->add('symbol_id', 'Symbol ID', true); $this->grid->add('polarity', 'Polarity', true); $this->grid->add('created_at', 'Created At', true); $this->grid->add('updated_at', 'Updated At', true); return $this->returnView(); }
/** * Display a listing of evento * * @return Response */ public function index() { $filter = DataFilter::source(PacoteDestaque::with('pais')); $filter->add('nome_br', 'Nome - PT', 'text'); $filter->add('tipo', 'Tipo', 'select')->options(array('' => 'Tipo', 'Restaurante' => 'Restaurante', 'Evento' => 'Evento', 'Boate' => 'Boate')); $filter->add('pais.name', 'Paises', 'text'); $filter->submit('Filtrar'); $filter->reset('Limpar Filtro'); $filter->build(); $grid = DataGrid::source($filter); //same source types of DataSet $grid->attributes(array("class" => "table table-striped table-hover")); $grid->add('nome_br', 'Nome PT', true); //field name, label, sortable $grid->add('nome_en', 'Nome EN'); //relation.fieldname $grid->add('publicado', 'Publicado', true); $grid->add('pais.name', 'Pais'); $grid->add('tipo', 'Tipo'); $grid->add(' <a class="" title="Visualizar" href="admin/pacote-destaque/{{$id}}"><span class="glyphicon glyphicon-eye-open"> </span></a> <a class="" title="Modificar" href="admin/pacote-destaque/{{$id}}/edit"><span class="glyphicon glyphicon-edit"> </span></a> <a class="text-danger" title="Deletar" href="admin/pacote-destaque/delete/{{$id}}"><span class="glyphicon glyphicon-trash"> </span></a> ', 'Ações'); //$grid->edit('admin/pacote-destaque/crud', 'Ações','show|modify|delete'); //shortcut to link DataEdit actions $grid->link('admin/pacote-destaque/create', "Adicionar Novo", "TR"); //add button $grid->orderBy('id', 'desc'); //default orderby $grid->paginate(10); //pagination $grid->attributes(array('class' => 'table table-striped table-hover')); //Transforma TinyInteger de Publicado em Sim ou Não ao invez de 1 ou 0 $grid->row(function ($row) { if ($row->cell('publicado')->value == 1) { $row->cell('publicado')->value = '<span class="label label-success"> Sim </span>'; } else { $row->cell('publicado')->value = '<span class="label label-danger"> Não </span>'; } }); // $evento = PacoteDestaque::find(1); // echo $evento->destino->{'nome_br'}; // dd(); return View::make('admin.pacotedestaque.index', compact('filter', 'grid')); }