Commit 9e2252d3 authored by Marcos Albano's avatar Marcos Albano 💬

Atualizacao do show

parent 1d822319
...@@ -30,15 +30,12 @@ class TituloController extends Controller ...@@ -30,15 +30,12 @@ class TituloController extends Controller
{ {
$documentosPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->get(); $documentosPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->get();
foreach ($documentosPessoa as $documentoPessoa) { foreach ($documentosPessoa as $documentoPessoa) {
//echo "Documento/Pessoa: " . "{$documentoPessoa}<hr>";
$pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote')->get(); $pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote')->get();
foreach ($pessoasLote as $pessoaLote) { foreach ($pessoasLote as $pessoaLote) {
//echo "Pessoa/Pessoa_Lote: " . "{$pessoaLote}<hr>";
$lotes = Lote::where('id', $pessoaLote->lote_id)->with('lotesTramites', 'municipio')->get(); $lotes = Lote::where('id', $pessoaLote->lote_id)->with('lotesTramites', 'municipio')->get();
foreach ($lotes as $lote) { foreach ($lotes as $lote) {
$lotesTramites = LoteTramite::where('lote_id', $lote->id)->get(); $lotesTramites = LoteTramite::where('lote_id', $lote->id)->get();
foreach ($lotesTramites as $loteTramite) { foreach ($lotesTramites as $loteTramite) {
//echo "LOte/Tramite: " . "{$loteTramite}<hr>";
$tramites = Tramite::where('id', $loteTramite->tramite_id)->where('documento_tipo', 'TITULO DO IMOVEL') $tramites = Tramite::where('id', $loteTramite->tramite_id)->where('documento_tipo', 'TITULO DO IMOVEL')
->where('id', 67) ->where('id', 67)
->get(); ->get();
...@@ -47,7 +44,8 @@ class TituloController extends Controller ...@@ -47,7 +44,8 @@ class TituloController extends Controller
foreach ($titulos as $titulo) { foreach ($titulos as $titulo) {
// echo "<b>Município: {$lote->municipio->nome}" . " | Título: {$titulo->numero_titulo}" . " | Proprietário: {$lote->proprietario}" . // echo "<b>Município: {$lote->municipio->nome}" . " | Título: {$titulo->numero_titulo}" . " | Proprietário: {$lote->proprietario}" .
// " | CPF: {$documentoPessoa->cpf}" . " | Tramite Nome: {$tramite->nome}" . " | Localizacao: {$loteTramite->localizacao_nova}" . " | Lote: {$lote->numero}" . " | Cancelado?: {$titulo->flag_cancelamento} </b><hr>"; // " | CPF: {$documentoPessoa->cpf}" . " | Tramite Nome: {$tramite->nome}" . " | Localizacao: {$loteTramite->localizacao_nova}" .
// " | Lote: {$lote->numero}" . " | Cancelado?: {$titulo->flag_cancelamento} </b><hr>";
//echo "Titulo: " . "{$titulo}<hr>"; //echo "Titulo: " . "{$titulo}<hr>";
return view( return view(
...@@ -108,24 +106,18 @@ class TituloController extends Controller ...@@ -108,24 +106,18 @@ class TituloController extends Controller
if (!$lotes = Lote::find($id)) { if (!$lotes = Lote::find($id)) {
return redirect()->back(); return redirect()->back();
} else { } else {
foreach ($lotes as $lote) { return view('admin.pages.titulos.show', [
return view('admin.pages.titulos.show', [ 'lotes' => $lotes,
'lotes' => $lotes, ]);
]);
}
} }
if (!$titulos = Titulo::where('lote_id', $id)->get()) { if (!$titulos = Titulo::where('lote_id', $id)->get()) {
return redirect()->back(); return redirect()->back();
}else{ } else {
foreach ($titulos as $titulo) { return view('admin.pages.titulos.show', [
return view('admin.pages.titulos.show', [ 'titulos' => $titulos,
'titulos' => $titulos, ]);
]);
}
} }
} }
/** /**
......
...@@ -5,16 +5,6 @@ ...@@ -5,16 +5,6 @@
@section('content_header') @section('content_header')
@endsection @endsection
@section('content') @section('content')
{{-- <div class="card card-outline card-success">
<div class="card-body">
<form action="{{ route('titulos.search') }}" class="form form-inline" method="POST">
@csrf
<input type="text" name="filter" placeholder="Filtrar:" class="form-control"
value="{{ $filters['filter'] ?? '' }}">
<button type="submit" class="btn btn-info">Pesquisar</button>
</form>
</div>
</div> --}}
<div class="header_listagem small-box bg-gradient-success"> <div class="header_listagem small-box bg-gradient-success">
@foreach ($documentosPessoa as $documentoPessoa) @foreach ($documentosPessoa as $documentoPessoa)
@foreach ($lotes as $lote) @foreach ($lotes as $lote)
...@@ -25,22 +15,18 @@ ...@@ -25,22 +15,18 @@
@endforeach @endforeach
@endforeach @endforeach
</div> </div>
<!-- <h1></h1> -->
<div class="card card-outline card-success"> <div class="card card-outline card-success">
<div class="card-header"> <div class="card-header">
<h3 class="card-title"><b>Listagem dos Títulos</b></h3> <h3 class="card-title"><b>Listagem dos Títulos</b></h3>
</div> </div>
<!-- /.card-header -->
<div class="card-body"> <div class="card-body">
<table class="table table-striped" > <table class="table table-striped" >
<thead> <thead>
<tr align="center"> <tr align="center">
<th>MUNICÍPIO</th> <th>MUNICÍPIO</th>
<th>PROPRIETÁRIO</th> <th>PROPRIETÁRIO</th>
<th>NÚMERO TÍTULO</th>
<th>CPF</th> <th>CPF</th>
<th>TRAMITE</th> <th>TRAMITE</th>
<th>LOCALIZAÇÃO</th>
<th width="100">AÇÕES</th> <th width="100">AÇÕES</th>
</tr> </tr>
</thead> </thead>
...@@ -51,10 +37,8 @@ ...@@ -51,10 +37,8 @@
<tr align="center"> <tr align="center">
<td>{{ $lote->municipio->nome }}</td> <td>{{ $lote->municipio->nome }}</td>
<td>{{ $lote->proprietario }}</td> <td>{{ $lote->proprietario }}</td>
<td>{{ $titulo->numero_titulo }}</td>
<td>{{ $documentoPessoa->cpf }}</td> <td>{{ $documentoPessoa->cpf }}</td>
<td>{{ $tramite->nome }}</td> <td>{{ $tramite->nome }}</td>
<td>{{ $loteTramite->localizacao_nova }}</td>
<td> <td>
<a href="{{ route('titulos.show', $lote->id) }}" <a href="{{ route('titulos.show', $lote->id) }}"
class="badge bg-green">Detalhes</a> class="badge bg-green">Detalhes</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment