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

Mostrando todos os lotes

parent 61fc7105
......@@ -31,31 +31,30 @@ class TituloController extends Controller
{
$documentoPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->first();
if ($documentoPessoa) {
$pessoas = Pessoa::where('id', $documentoPessoa->pessoa_id)->get();
foreach ($pessoas as $pessoa) {
$pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote')->get();
$pessoa = Pessoa::where('id', $documentoPessoa->pessoa_id)->with('pessoaLote', 'documentoPessoa')->first();
if ($pessoa) {
$pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote', 'pessoa')->get();
foreach ($pessoasLote as $pessoaLote) {
$lotes = Lote::where('id', $pessoaLote->lote_id)
->with('lotesTramites', 'municipio')
->get();
$lotes = Lote::where('id', $pessoaLote->lote->id)->with('municipio', 'pessoaLote', 'lotesTramites')->get();
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();
foreach ($lotesTramites as $lotTramite) {
$tramites = Tramite::where('id', $lotTramite->tramite_id)->get();
foreach ($tramites as $tramite) {
if ($tramite->nome === "ARQUIVO PRONTO PARA ENTREGA") {
$titulos = Titulo::where('lote_id', $lote->id)->where('flag_cancelamento', '<>', 'S')->get();
if ($tramite->id === 67) {
$titulos = Titulo::where('lote_id', $pessoaLote->lote_id)->where('flag_cancelamento', '<>', 'S')->get();
foreach ($titulos as $titulo) {
$agendamentos = Agendamento::get()->last();
if ($agendamentos) {
return view(
'admin.pages.titulos.index',
[
'titulos' => $titulos,
'pessoasLote' => $pessoasLote,
'lotes' => $lotes,
'documentoPessoa' => $documentoPessoa,
'loteTramite' => $loteTramite,
'titulos' => $titulo,
'lotesTramites' => $lotesTramites,
'tramite' => $tramite,
'agendamentos' => $agendamentos,
]
......@@ -63,13 +62,13 @@ class TituloController extends Controller
}
}
} else {
return view('cpfValidoSemTitulo')->with(['cpf' => $this->request->cpf]);
return view('cpfValidoSemTitulo')->with(['cpf' => $this->request->cpf, 'nome' => $tramite->nome]);
}
}
}
}
}
}
} else {
return view('cpfInvalido')->with(['cpf' => $this->request->cpf]);
......
......@@ -8,10 +8,10 @@ class LoteTramite extends Model
{
protected $table = 'sige.lotes_tramites';
// public function tramites()
// {
// return $this->hasMany(Tramite::class, 'id', 'tramite_id');
// }
public function tramite()
{
return $this->belongsTo(Tramite::class, 'id');
}
// public function secUser(){
// return $this->belongsTo(SecUser::class);
......
......@@ -10,7 +10,7 @@ class PessoaLote extends Model
public function pessoa()
{
return $this->belongsTo(Pessoa::class);
return $this->belongsTo(Pessoa::class, 'pessoa_id', 'id');
}
public function lote()
......
......@@ -10,26 +10,17 @@
rel="stylesheet">
<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>
{{-- <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">
{{-- @foreach ($documentosPessoa as $documentoPessoa) --}}
{{-- @foreach ($documentosPessoa as $documentoPessoa)
@foreach ($lotes as $lote)
<h1>DADOS DO ATENDIMENTO</h1>
<h2>{{ $lote->proprietario }}</h1>
<h3>CPF: {{ $documentoPessoa->cpf }} </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 --}}
</div>
<!-- <h1></h1> -->
<div class="card card-outline card-success">
......@@ -43,6 +34,7 @@
<tr>
<th>MUNICÍPIO</th>
<th>PROPRIETÁRIO</th>
<th>LOTE</th>
<th>CPF</th>
<th>STATUS</th>
{{-- <th>DATA</th> --}}
......@@ -51,26 +43,24 @@
</tr>
</thead>
<tbody>
{{-- @foreach ($documentosPessoa as $documentoPessoa) --}}
@foreach ($lotes as $lote)
@foreach ($titulos as $titulo)
@if ($agendamentos)
<tr>
<td>{{ $lote->municipio->nome }}</td>
<td>{{ $lote->proprietario }}</td>
<td>{{ $documentoPessoa->cpf }}</td>
<td>{{ $tramite->nome }}</td>
{{-- <td>{{ $agendamentos->data }}</td> --}}
{{-- <td>{{ $agendamentos->id }}</td> --}}
<td>
<a href="{{ route('titulos.show', $lote->id) }}"
class="badge bg-green">DETALHES</a>
</td>
</tr>
@endif
@endforeach
{{-- @endforeach --}}
@foreach ($pessoasLote as $pessoaLote)
<tr>
<td>{{ $pessoaLote->lote->municipio->nome }}</td>
<td>{{ $pessoaLote->pessoa->nome }}</td>
<td>{{ $pessoaLote->lote->numero }}</td>
<td>{{ $documentoPessoa->cpf }}</td>
<td>{{ $tramite->nome }}</td>
<td><a
href="{{ route('titulos.show', $pessoaLote->lote->id) }}"
class="badge bg-green">DETALHES</a></td>
</tr>
@endforeach
</tbody>
</table>
......@@ -83,7 +73,6 @@
<strong>Date : </strong>
<input class="date form-control" type="text" id="datepicker" name="data">
<button type="submit" class="btn btn-success">AGENDAR</button>
</div>
</div>
</form>
......
......@@ -17,6 +17,7 @@
<h4 class="titulo2">DETENTOR: <strong> {{ $lotes->proprietario }}</strong></h4>
<h4 class="titulo2">IMÓVEL: <strong>{{ $lotes->nome }}</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="col-sm-6" style="text-align:center;font-size:23px;">
{{-- <h4 class="titulo2">Data: <strong>02/02/2020</strong></h4> --}}
......
......@@ -16,7 +16,7 @@
<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>
<!-- general form elements -->
......
......@@ -15,8 +15,9 @@
<div class="col-md-6 tela_cpf_invalido">
<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>
<!-- general form elements -->
......
......@@ -33,7 +33,7 @@ Route::get('/home', 'HomeController@index')->name('home');
Route::get('/', function () {
return view('pesquisaCpf');
});
})->name('pesquisaCpf');
// Route::get('/', function () {
// 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