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

Pagina de resultado da pesquisa

parent 0778bc46
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\DocumentoPessoa;
use App\Repositories\Contracts\AgendamentoRepositoryInterface; use App\Repositories\Contracts\AgendamentoRepositoryInterface;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator as FacadesValidator; use Illuminate\Support\Facades\Validator as FacadesValidator;
class AgendamentoController extends Controller class AgendamentoController extends Controller
{ {
private $route = 'agendamentos'; private $route = 'agendamentos';
...@@ -29,7 +29,7 @@ class AgendamentoController extends Controller ...@@ -29,7 +29,7 @@ class AgendamentoController extends Controller
$columnList = ['id' => '#', 'municipio' => trans('agendamento.municipio'), 'detentor' => trans('agendamento.name'), $columnList = ['id' => '#', 'municipio' => trans('agendamento.municipio'), 'detentor' => trans('agendamento.name'),
'cpf' => trans('agendamento.cpf'), 'titulo' => trans('agendamento.titulo'), 'nome_mae' => trans('agendamento.nome_mae'), 'cpf' => trans('agendamento.cpf'), 'titulo' => trans('agendamento.titulo'), 'nome_mae' => trans('agendamento.nome_mae'),
'data' => trans('agendamento.data'), 'hora' => trans('agendamento.hora'), 'escritorio' => trans('agendamento.escritorio')]; 'data' => trans('agendamento.data'), 'hora' => trans('agendamento.hora'), 'escritorio' => trans('agendamento.escritorio')];
$page = trans('agendamento.agendamento_list'); $page = trans('agendamento.agendamento_list');
$search = ""; $search = "";
...@@ -61,7 +61,7 @@ class AgendamentoController extends Controller ...@@ -61,7 +61,7 @@ class AgendamentoController extends Controller
$routeName = $this->route; $routeName = $this->route;
$page = trans('agendamento.agendamento_list'); $page = trans('agendamento.agendamento_list');
$page_create = trans('agendamento.agendamento'); $page_create = trans('agendamento.agendamento');
$breadcrumb = [ $breadcrumb = [
(object) ['url' => route('home'), 'title' => trans('agendamento.home')], (object) ['url' => route('home'), 'title' => trans('agendamento.home')],
(object) ['url' => route($routeName . '.index'), 'title' => trans('agendamento.list', ['page' => $page])], (object) ['url' => route($routeName . '.index'), 'title' => trans('agendamento.list', ['page' => $page])],
...@@ -176,7 +176,7 @@ class AgendamentoController extends Controller ...@@ -176,7 +176,7 @@ class AgendamentoController extends Controller
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
$data = $request->all(); $data = $request->all();
if (!$data['password']) { if (!$data['password']) {
unset($data['password']); unset($data['password']);
} }
...@@ -223,21 +223,28 @@ class AgendamentoController extends Controller ...@@ -223,21 +223,28 @@ class AgendamentoController extends Controller
return redirect()->route($routeName . '.index'); return redirect()->route($routeName . '.index');
} }
// public function agendamentoTitulo() public function pesquisaAgendamento(Request $request)
// { {
// $routeName = $this->route; $columnList = ['id' => '#', 'municipio' => trans('agendamento.municipio'), 'detentor' => trans('agendamento.name'),
// $page = trans('agendamento.agendamento_list'); 'cpf' => trans('agendamento.cpf'), 'titulo' => trans('agendamento.titulo'), 'nome_mae' => trans('agendamento.nome_mae'),
// $page_create = trans('agendamento.agendamento'); 'data' => trans('agendamento.data'), 'hora' => trans('agendamento.hora'), 'escritorio' => trans('agendamento.escritorio')];
// $breadcrumb = [ $page = trans('agendamento.agendamento_list');
// (object) ['url' => route('home'), 'title' => trans('agendamento.home')], $data = $request->all();
// (object) ['url' => route($routeName . '.index'), 'title' => trans('agendamento.list', ['page' => $page])],
// (object) ['url' => '', 'title' => trans('agendamento.create_crud', ['page' => $page_create])], $routeName = $this->route;
// ]; $list = $this->model->paginate($this->paginate);
$breadcrumb = [
(object) ['url' => route('home'), 'title' => trans('agendamento.home')],
(object) ['url' => '', 'title' => trans('agendamento.list', ['page' => $page])],
];
// return view('admin.' . $routeName . '.agendamentoTitulo', ['page' => $page, 'page_create' => $page_create, 'routeName' => $routeName, 'breadcrumb' => $breadcrumb]);
// } return view('admin.' . $routeName . '.resultadoPesquisa', ['page' => $page, 'columnList' => $columnList,'routeName' => $routeName,
'list' => $list, 'breadcrumb' => $breadcrumb]);
}
} }
...@@ -3,11 +3,10 @@ ...@@ -3,11 +3,10 @@
namespace App\Http\Controllers\Admin; namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\DocumentoPessoa; use App\Models\Lote;
use App\Repositories\Contracts\UserRepositoryInterface; use App\Repositories\Contracts\UserRepositoryInterface;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Validator;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator as FacadesValidator; use Illuminate\Support\Facades\Validator as FacadesValidator;
...@@ -100,7 +99,7 @@ class UserController extends Controller ...@@ -100,7 +99,7 @@ class UserController extends Controller
'data_nascimento' => 'required', 'data_nascimento' => 'required',
]); ]);
$documentosPessoa = DocumentoPessoa::where('cpf', $data['cpf'])->first(); $documentosPessoa = Lote::where('cpf', $data['cpf'])->first();
if ($documentosPessoa) { if ($documentosPessoa) {
$this->model->create($data); $this->model->create($data);
session()->flash('msg', trans('agendamento.record_added_successfully')); session()->flash('msg', trans('agendamento.record_added_successfully'));
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
@breadcrumb(['page'=>$page,'items'=>$breadcrumb ?? []]) @breadcrumb(['page'=>$page,'items'=>$breadcrumb ?? []])
@endbreadcrumb @endbreadcrumb
@form(['action'=>route('pesquisaTitulo'), 'method'=>'POST']) @form(['action'=>route('resultadoPesquisa'), 'method'=>'POST'])
@csrf @csrf
<h4> <h4>
<p class="text-center"><b>Pesquisa de Títulos</b></p> <p class="text-center"><b>Pesquisa de Títulos</b></p>
</h4> </h4>
{{-- <h3 class="titulo">Pesquisa de Títulos</h3> --}} {{-- <h3 class="titulo">Pesquisa de Títulos</h3> --}}
<div class="row"> <div class="row">
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control label_cpf" data-mask="000.000.000-00" name="cpf" <input type="text" class="form-control label_cpf" data-mask="000.000.000-00" name="cpf"
placeholder="000.000.000-00"> placeholder="000.000.000-00">
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
</div> </div>
</div> </div>
@endform @endform
@endpage @endpage
@endsection @endsection
@extends('layouts.app')
@section('content')
@page(['col'=>12, 'page'=>__('agendamento.list', ['page'=>$page])])
@alert(['msg' => session('msg'), 'status' => session('status')])
@endalert
@breadcrumb(['page'=>$page,'items'=>$breadcrumb ?? []])
@endbreadcrumb
@table(['columnList'=>$columnList, 'list'=>$list, 'routeName'=>$routeName])
@endtable
<table class="table table-striped">
<tbody>
<tr>
<td>1</td>
<td>IPUEIRAS</td>
<td>MARIA PEREIRA DE MELO BORGES</td>
<td>716.375.323-34</td>
<td>113839</td>
<td>ALZIRA PEREIRA CARREIRO</td>
<td>25/01/2021</td>
<td>SEDE DO IDACE</td>
</tr>
</tbody>
</table>
@endpage
@endsection
...@@ -133,4 +133,26 @@ Route::any('/pesquisaTitulo', function () { ...@@ -133,4 +133,26 @@ Route::any('/pesquisaTitulo', function () {
return view('admin.' . $routeName . '.pesquisaTitulo', ['page' => $page, 'page_create' => $page_create, 'routeName' => $routeName, 'breadcrumb' => $breadcrumb]); return view('admin.' . $routeName . '.pesquisaTitulo', ['page' => $page, 'page_create' => $page_create, 'routeName' => $routeName, 'breadcrumb' => $breadcrumb]);
})->name('pesquisaTitulo'); })->name('pesquisaTitulo');
Route::any('/resultadoPesquisa', function () {
$columnList = ['id' => '#', 'municipio' => trans('agendamento.municipio'), 'detentor' => trans('agendamento.name'),
'cpf' => trans('agendamento.cpf'), 'titulo' => trans('agendamento.titulo'), 'nome_mae' => trans('agendamento.nome_mae'),
'data' => trans('agendamento.data'), 'hora' => trans('agendamento.hora'), 'escritorio' => trans('agendamento.escritorio')];
$routeName = 'agendamentos';
$page = trans('agendamento.agendamento_list');
$page_create = trans('agendamento.agendamento');
$list = [];
$breadcrumb = [
(object) ['url' => route('home'), 'title' => trans('agendamento.home')],
(object) ['url' => route($routeName . '.index'), 'title' => trans('agendamento.list', ['page' => $page])],
(object) ['url' => '', 'title' => trans('agendamento.create_crud', ['page' => $page_create])],
];
return view('admin.' . $routeName . '.resultadoPesquisa', ['page' => $page, 'columnList' => $columnList, 'list' => $list,
'page_create' => $page_create, 'routeName' => $routeName, 'breadcrumb' => $breadcrumb]);
})->name('resultadoPesquisa');
//->middleware('auth') //->middleware('auth')
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