-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incluindo informações iniciais de patrimonios
- Loading branch information
Showing
6 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\Patrimonio; | ||
use Illuminate\Http\Request; | ||
|
||
class PatrimonioController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function index() | ||
{ | ||
$this->authorize('perfiladmin'); | ||
$patrimonios = Patrimonio::all(); | ||
|
||
return view('patrimonios.index', compact('patrimonios')); | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function create() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
* | ||
* @param int $numpat | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function show($numpat) | ||
{ | ||
$this->authorize('perfiladmin'); | ||
|
||
$patrimonio = Patrimonio::where('numpat', $numpat)->first(); | ||
return view('patrimonios.show', compact('patrimonio')); | ||
dd($patrimonio->responsavel(), $patrimonio->marcaModeloTipo()); | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
* | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function edit($id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function update(Request $request, $id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param int $id | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function destroy($id) | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
@parent | ||
@include('laravel-usp-theme::blocos.datatable-simples') | ||
|
||
<table class="table table-sm datatable-simples"> | ||
<thead> | ||
<tr> | ||
<th>Numpat</th> | ||
<th>Chamados</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach ($patrimonios as $p) | ||
<tr> | ||
<td><a href="{{ route('patrimonios.show', $p->numpat) }}">{{ $p->numpat }}</a></td> | ||
<td>{{ $p->chamados->count() }}</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
@parent | ||
|
||
{{ $patrimonio->numpat }}<br> | ||
|
||
Resp.: {{ $patrimonio->responsavel() }}<br> | ||
{{ $patrimonio->marcaModeloTipo() }}<br> | ||
|
||
@foreach ($patrimonio->chamados as $c) | ||
{{ $c->nro }}/{{ $c->created_at->format('Y') }} | | ||
|
||
@if ($c->fechado_em) | ||
fechado em {{ $c->fechado_em->format('d/m/Y') }} | ||
@else | ||
aberto | ||
@endif | ||
|
||
| <a href="{{ route('chamados.show', $c->id) }}">{{ $c->assunto }}</a><br> | ||
@endforeach | ||
<br> | ||
<div> | ||
<pre>{{ json_encode($patrimonio->replicado(), JSON_PRETTY_PRINT) }}</pre> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters