Commit acc32505 authored by Marcos Albano's avatar Marcos Albano 💬

Mostrando todos os lotes

parent 61fc7105
...@@ -31,31 +31,30 @@ class TituloController extends Controller ...@@ -31,31 +31,30 @@ class TituloController extends Controller
{ {
$documentoPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->first(); $documentoPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->first();
if ($documentoPessoa) { if ($documentoPessoa) {
$pessoas = Pessoa::where('id', $documentoPessoa->pessoa_id)->get(); $pessoa = Pessoa::where('id', $documentoPessoa->pessoa_id)->with('pessoaLote', 'documentoPessoa')->first();
foreach ($pessoas as $pessoa) { if ($pessoa) {
$pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote')->get(); $pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote', 'pessoa')->get();
foreach ($pessoasLote as $pessoaLote) { foreach ($pessoasLote as $pessoaLote) {
$lotes = Lote::where('id', $pessoaLote->lote_id) $lotes = Lote::where('id', $pessoaLote->lote->id)->with('municipio', 'pessoaLote', 'lotesTramites')->get();
->with('lotesTramites', 'municipio')
->get();
foreach ($lotes as $lote) { foreach ($lotes as $lote) {
$loteTramite = LoteTramite::where('lote_id', $pessoaLote->lote_id)->max('id'); $loteTramite = LoteTramite::where('lote_id', $pessoaLote->lote_id)->with('tramite')->max('id');
$lotesTramites = LoteTramite::where('id', $loteTramite)->get(); $lotesTramites = LoteTramite::where('id', $loteTramite)->get();
foreach ($lotesTramites as $lotTramite) { foreach ($lotesTramites as $lotTramite) {
$tramites = Tramite::where('id', $lotTramite->tramite_id)->get(); $tramites = Tramite::where('id', $lotTramite->tramite_id)->get();
foreach ($tramites as $tramite) { foreach ($tramites as $tramite) {
if ($tramite->nome === "ARQUIVO PRONTO PARA ENTREGA") { if ($tramite->id === 67) {
$titulos = Titulo::where('lote_id', $lote->id)->where('flag_cancelamento', '<>', 'S')->get(); $titulos = Titulo::where('lote_id', $pessoaLote->lote_id)->where('flag_cancelamento', '<>', 'S')->get();
foreach ($titulos as $titulo) { foreach ($titulos as $titulo) {
$agendamentos = Agendamento::get()->last(); $agendamentos = Agendamento::get()->last();
if ($agendamentos) { if ($agendamentos) {
return view( return view(
'admin.pages.titulos.index', 'admin.pages.titulos.index',
[ [
'titulos' => $titulos, 'pessoasLote' => $pessoasLote,
'lotes' => $lotes, 'lotes' => $lotes,
'documentoPessoa' => $documentoPessoa, 'documentoPessoa' => $documentoPessoa,
'loteTramite' => $loteTramite, 'titulos' => $titulo,
'lotesTramites' => $lotesTramites,
'tramite' => $tramite, 'tramite' => $tramite,
'agendamentos' => $agendamentos, 'agendamentos' => $agendamentos,
] ]
...@@ -63,13 +62,13 @@ class TituloController extends Controller ...@@ -63,13 +62,13 @@ class TituloController extends Controller
} }
} }
} else { } else {
return view('cpfValidoSemTitulo')->with(['cpf' => $this->request->cpf]); return view('cpfValidoSemTitulo')->with(['cpf' => $this->request->cpf, 'nome' => $tramite->nome]);
} }
} }
} }
} }
} }
} }
} else { } else {
return view('cpfInvalido')->with(['cpf' => $this->request->cpf]); return view('cpfInvalido')->with(['cpf' => $this->request->cpf]);
......
...@@ -8,10 +8,10 @@ class LoteTramite extends Model ...@@ -8,10 +8,10 @@ class LoteTramite extends Model
{ {
protected $table = 'sige.lotes_tramites'; protected $table = 'sige.lotes_tramites';
// public function tramites() public function tramite()
// { {
// return $this->hasMany(Tramite::class, 'id', 'tramite_id'); return $this->belongsTo(Tramite::class, 'id');
// } }
// public function secUser(){ // public function secUser(){
// return $this->belongsTo(SecUser::class); // return $this->belongsTo(SecUser::class);
......
...@@ -10,7 +10,7 @@ class PessoaLote extends Model ...@@ -10,7 +10,7 @@ class PessoaLote extends Model
public function pessoa() public function pessoa()
{ {
return $this->belongsTo(Pessoa::class); return $this->belongsTo(Pessoa::class, 'pessoa_id', 'id');
} }
public function lote() public function lote()
......
...@@ -10,26 +10,17 @@ ...@@ -10,26 +10,17 @@
rel="stylesheet"> rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
{{-- <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)
<h1>DADOS DO ATENDIMENTO</h1> <h1>DADOS DO ATENDIMENTO</h1>
<h2>{{ $lote->proprietario }}</h1> <h2>{{ $lote->proprietario }}</h1>
<h3>CPF: {{ $documentoPessoa->cpf }} </h1> <h3>CPF: {{ $documentoPessoa->cpf }} </h1>
<h3>NÚMERO DO ATENDIMENTO: {{ $agendamentos->id }} </h1> <h3>NÚMERO DO ATENDIMENTO: {{ $agendamentos->id }} </h1>
<h3>DATA DO AGENDAMENTO: {{ $agendamentos->data }} </h1> <h3>DATA DO AGENDAMENTO: {{ date('d/m/Y', strtotime($agendamentos->data)) }} </h1>
@endforeach @endforeach
{{-- @endforeach --}} @endforeach --}}
</div> </div>
<!-- <h1></h1> --> <!-- <h1></h1> -->
<div class="card card-outline card-success"> <div class="card card-outline card-success">
...@@ -43,6 +34,7 @@ ...@@ -43,6 +34,7 @@
<tr> <tr>
<th>MUNICÍPIO</th> <th>MUNICÍPIO</th>
<th>PROPRIETÁRIO</th> <th>PROPRIETÁRIO</th>
<th>LOTE</th>
<th>CPF</th> <th>CPF</th>
<th>STATUS</th> <th>STATUS</th>
{{-- <th>DATA</th> --}} {{-- <th>DATA</th> --}}
...@@ -51,26 +43,24 @@ ...@@ -51,26 +43,24 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{-- @foreach ($documentosPessoa as $documentoPessoa) --}} @foreach ($pessoasLote as $pessoaLote)
@foreach ($lotes as $lote)
@foreach ($titulos as $titulo)
@if ($agendamentos)
<tr> <tr>
<td>{{ $lote->municipio->nome }}</td> <td>{{ $pessoaLote->lote->municipio->nome }}</td>
<td>{{ $lote->proprietario }}</td> <td>{{ $pessoaLote->pessoa->nome }}</td>
<td>{{ $pessoaLote->lote->numero }}</td>
<td>{{ $documentoPessoa->cpf }}</td> <td>{{ $documentoPessoa->cpf }}</td>
<td>{{ $tramite->nome }}</td> <td>{{ $tramite->nome }}</td>
{{-- <td>{{ $agendamentos->data }}</td> --}} <td><a
{{-- <td>{{ $agendamentos->id }}</td> --}} href="{{ route('titulos.show', $pessoaLote->lote->id) }}"
<td> class="badge bg-green">DETALHES</a></td>
<a href="{{ route('titulos.show', $lote->id) }}"
class="badge bg-green">DETALHES</a>
</td>
</tr> </tr>
@endif
@endforeach
{{-- @endforeach --}}
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
...@@ -83,7 +73,6 @@ ...@@ -83,7 +73,6 @@
<strong>Date : </strong> <strong>Date : </strong>
<input class="date form-control" type="text" id="datepicker" name="data"> <input class="date form-control" type="text" id="datepicker" name="data">
<button type="submit" class="btn btn-success">AGENDAR</button> <button type="submit" class="btn btn-success">AGENDAR</button>
</div> </div>
</div> </div>
</form> </form>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<h4 class="titulo2">DETENTOR: <strong> {{ $lotes->proprietario }}</strong></h4> <h4 class="titulo2">DETENTOR: <strong> {{ $lotes->proprietario }}</strong></h4>
<h4 class="titulo2">IMÓVEL: <strong>{{ $lotes->nome }}</strong></h4> <h4 class="titulo2">IMÓVEL: <strong>{{ $lotes->nome }}</strong></h4>
<h4 class="titulo2">CPF: <strong>{{ $lotes->cpf }}</strong></h4> <h4 class="titulo2">CPF: <strong>{{ $lotes->cpf }}</strong></h4>
<h4 class="titulo2">LOTE: <strong>{{ $lotes->numero }}</strong></h4>
<div class="row"> <div class="row">
<div class="col-sm-6" style="text-align:center;font-size:23px;"> <div class="col-sm-6" style="text-align:center;font-size:23px;">
{{-- <h4 class="titulo2">Data: <strong>02/02/2020</strong></h4> --}} {{-- <h4 class="titulo2">Data: <strong>02/02/2020</strong></h4> --}}
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<img class="logoidace" src="{{ asset('img/logo-idace.png') }}" > <img class="logoidace" src="{{ asset('img/logo-idace.png') }}" >
<h1 class="titulo">Nenhum dado encontrato o CPF: {{ $cpf }}</h1> <h1 class="titulo">Nenhum dado encontrado o CPF: {{ $cpf }}</h1>
<h4 class="titulo2">Caso tenha alguma dúvida, entre em contato através do telefone: 85 0000-0000</h4> <h4 class="titulo2">Caso tenha alguma dúvida, entre em contato através do telefone: 85 0000-0000</h4>
<!-- general form elements --> <!-- general form elements -->
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
<img class="logoidace" src="{{ asset('img/logo-idace.png') }}" > <img class="logoidace" src="{{ asset('img/logo-idace.png') }}" >
<h1 class="titulo">Nenhum Título encontrato o CPF: {{ $cpf }}</h1> <h1 class="titulo">Nenhum Título pronto para entrega para o CPF: {{ $cpf }}</h1>
<h1 class="titulo">Status do Título encontrado: {{ $nome }}</h1>
<h4 class="titulo2">Caso tenha alguma dúvida, entre em contato através do telefone: 85 0000-0000</h4> <h4 class="titulo2">Caso tenha alguma dúvida, entre em contato através do telefone: 85 0000-0000</h4>
<!-- general form elements --> <!-- general form elements -->
......
...@@ -33,7 +33,7 @@ Route::get('/home', 'HomeController@index')->name('home'); ...@@ -33,7 +33,7 @@ Route::get('/home', 'HomeController@index')->name('home');
Route::get('/', function () { Route::get('/', function () {
return view('pesquisaCpf'); return view('pesquisaCpf');
}); })->name('pesquisaCpf');
// Route::get('/', function () { // Route::get('/', function () {
// return view('teste'); // return view('teste');
......
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