Commit 36c5d3c5 authored by Marcos Albano's avatar Marcos Albano 💬

Tela de listagem de titulos

parent 46cef058
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class DocumentoPessoaController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class FormaObtencaoController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
......@@ -2,14 +2,27 @@
namespace App\Http\Controllers;
use App\Models\DocumentoPessoa;
use App\Models\Lote;
use App\Models\Municipio;
use App\Models\Tramite;
use App\Models\SecUser;
use App\Models\SituacaoJuridica;
class ManyToOneController extends Controller
{
public function manyToOne()
{
//$pessoas = PessoaLote::where('lote_id', 384549)->with('lote')->get();
//dd($pessoas);
//echo "{$pessoas}";
// $lotes = Lote::where('modificado_por_id', 79)->with('secUser')->get();
// dd($lotes);
// $lotesTramites = LoteTramite::where('criado_por_id', 527)->with('secUser')->get();
// dd($lotesTramites);
// $tramites = Tramite::where('modificado_por_id', 79)->with('secUser')->get();
// dd($tramites);
$documentosPessoa = DocumentoPessoa::where('cpf', '005.272.793-90')->with('naturalidade')->get();
dd($documentosPessoa);
}
}
......@@ -2,18 +2,43 @@
namespace App\Http\Controllers;
use App\Models\Etapa;
use App\Models\Pendencia;
use App\Models\SecUser;
use App\Models\Setor;
use App\Models\Pessoa;
class OneToManyController extends Controller
{
public function oneToMany()
{
$pessoas = Pessoa::where('id', 56263)->with('documentoPessoa')->get();
foreach ($pessoas as $pessoa) {
$pessoasLote = $pessoa->pessoaLote('pessoaLote')->get();
foreach ($pessoasLote as $pessoaLote) {
$lotes = $pessoaLote->lote('lote')->get();
foreach ($lotes as $lote) {
$titulos = $lote->titulos('titulos')->get();
foreach($titulos as $titulo){
if(isset($titulo)){
echo "Pessoa: " . "{$pessoa->nome}<hr>";
echo "Lote: " . "{$lote->numero}<hr>";
echo "Titulo: " . "{$titulo->numero_titulo}<hr>";
echo "Condiçao da pessoa no imovel: " . "{$pessoaLote->condicao_pessoa_imovel_rural}<hr>";
}
}
}
}
}
//$titulo = Titulo::where('lote_id', 410053)->with('lotes')->get();
// $tiposLeis = TipoLei::where('id', 10)->with('titulos')->get();
// dd($tiposLeis);
// $gleba = Gleba::where('id', 37)->with('titulos')->get();
// dd($gleba);
$secUsers = SecUser::where('id', 79)->with('lotes')->get();
dd($secUsers);
// $secUsers = SecUser::where('id', 79)->with('tramites')->get();
// dd($secUsers);
// $pendencias = Pendencia::where('etapa_id', 1)->with('processos')->limit(1)->get();
// dd($pendencias);
......
......@@ -2,24 +2,52 @@
namespace App\Http\Controllers;
use App\Models\DocumentoPessoa;
use App\Models\Lote;
use App\Models\Pessoa;
use App\Models\Titulo;
use Illuminate\Http\Request;
use App\Models\PessoaLote;
class OneToOneController extends Controller
{
public function oneToOne()
{
/* RELACIONAMENTO PESSOA/DOCUMENTO_PESSOA */
$pessoas = Pessoa::where('id', 74516)->with('documentoPessoa')->get();
foreach($pessoas as $pessoa){
echo "Pessoa: " . "{$pessoa->nome}<hr>";
$documentosPessoa = $pessoa->documentoPessoa()
->get();
foreach($documentosPessoa as $documentoPessoa){
echo "DocumentoPessoa: " . "{$documentoPessoa->cpf}<hr>";
// /* RELACIONAMENTO PESSOA/DOCUMENTO_PESSOA */
// $pessoasLote = PessoaLote::where('pessoa_id', 74516)->with('pessoa')->get();
// //dd($pessoasLote);
// foreach ($pessoasLote as $pessoaLote) {
// echo "Pessoa: " . "{$pessoaLote->lote_id}<hr>";
// $pessoas = $pessoaLote->pessoa('pessoa')->get();
// foreach ($pessoas as $pessoa) {
// echo "Pessoa: " . "{$pessoa->nome}<hr>";
// $documentosPessoa = $pessoa->documentoPessoa('documentoPessoa')->get();
// foreach ($documentosPessoa as $documentoPessoa) {
// echo "Documento Pessoa: " . "{$documentoPessoa->cpf}<hr>";
// }
// }
// }
$pessoas = Pessoa::where('id', 56263)->with('documentoPessoa')->get();
foreach ($pessoas as $pessoa) {
//echo "Pessoa: " . "{$pessoa->nome}<hr>";
$pessoasLote = $pessoa->pessoaLote('pessoaLote')->get();
foreach ($pessoasLote as $pessoaLote) {
//echo "Condiçao da pessoa no imovel: " . "{$pessoaLote->condicao_pessoa_imovel_rural}<hr>";
$titulos = $pessoaLote->titulos('titulos')->get();
foreach ($titulos as $titulo) {
echo "Título: " . "{$titulo->numero_titulo}<hr>";
}
// }
// echo "Pessoa: " . "{$pessoa->nome}<hr>";
// echo "Condiçao da pessoa no imovel: " . "{$pessoaLote->condicao_pessoa_imovel_rural}<hr>";
// }
}
}
}
......
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PendenciaController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PessoaController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PessoaLoteController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PolymorphicController extends Controller
{
public function polymorphic()
{
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ProcessoController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SecUSerController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* 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 $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
<?php
namespace App\Http\Controllers\Admin;
namespace App\Http\Controllers;
use App\Models\DocumentoPessoa;
use App\Models\Lote;
use App\Models\PessoaLote;
use App\Models\Titulo;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class TesteController extends Controller
{
public function teste(){
return "Teste Controller";
protected $request;
//Injeção de dependência
public function __construct(Request $request, Titulo $titulo)
{
$this->request = $request;
$this->repository = $titulo;
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$documentosPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->get();
foreach ($documentosPessoa as $documentoPessoa) {
//echo "Documento/Pessoa: " . "{$documentoPessoa}<hr>";
$pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->get();
foreach ($pessoasLote as $pessoaLote) {
//echo "Pessoa/Pessoa_Lote: " . "{$pessoaLote}<hr>";
$lotes = Lote::where('id', $pessoaLote->lote_id)->get();
foreach ($lotes as $lote) {
//echo "Lote: " . "{$lote}<hr>";
$titulos = Titulo::where('lote_id', $lote->id)->get();
foreach ($titulos as $titulo) {
echo "<hr>Título: {$titulo->numero_titulo}" . " | Proprietário: {$lote->proprietario}" .
" | CPF: {$documentoPessoa->cpf}" . " | Lote: {$lote->numero}" . " | Cancelado?: {$titulo->flag_cancelamento}";
}
}
}
//return view('admin.pages.titulos.teste', ['titulos' => $titulos]);
}
}
/**
* 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)
{
return $request->name;
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* 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)
{
//
}
}
......@@ -3,11 +3,13 @@
namespace App\Http\Controllers;
use App\Http\Requests\StoreUpdateTituloRequest;
use App\Models\DocumentoPessoa;
use App\Models\Lote;
use App\Models\LoteTramite;
use App\Models\PessoaLote;
use App\Models\Titulo;
use App\Models\Tramite;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use function GuzzleHttp\Promise\all;
class TituloController extends Controller
{
......@@ -26,12 +28,81 @@ class TituloController extends Controller
*/
public function index()
{
$titulos = Titulo::paginate();
return view('admin.pages.titulos.index', [
'titulos' => $titulos
]);
$documentosPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->get();
foreach ($documentosPessoa as $documentoPessoa) {
$pessoasLotes = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote')->get();
foreach ($pessoasLotes as $pessoaLote) {
$lotes = Lote::where('id', $pessoaLote->lote_id)->with('lotesTramites', 'municipio')->get();
foreach ($lotes as $lote) {
$lotesTramites = LoteTramite::where('lote_id', $lote->id)->get();
foreach ($lotesTramites as $loteTramite) {
$tramites = Tramite::where('id', $loteTramite->tramite_id)->with('setor')->where('documento_tipo', 'TITULO DO IMOVEL')
->where('id', 67)
->get();
foreach ($tramites as $tramite) {
$titulos = Titulo::where('lote_id', $lote->id)->where('flag_cancelamento', '<>', 'S')->get();
foreach ($titulos as $titulo) {
// 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>";
//echo "Titulo: " . "{$titulo}<hr>";
}
}
}
}
}
return view(
'admin.pages.titulos.index',
[
'titulos' => $titulos,
'lotes' => $lotes,
'documentosPessoa' => $documentosPessoa,
'loteTramite' => $loteTramite,
'tramite' => $tramite,
'pessoasLotes' => $pessoasLotes,
]
);
}
}
//------------------FUNCIONANDO----------------------------------
// $documentosPessoa = DocumentoPessoa::where('cpf', $this->request->cpf)->with('pessoa')->get();
// foreach ($documentosPessoa as $documentoPessoa) {
// //echo "Documento/Pessoa: " . "{$documentoPessoa}<hr>";
// $pessoasLote = PessoaLote::where('pessoa_id', $documentoPessoa->pessoa_id)->with('lote')->get();
// foreach ($pessoasLote as $pessoaLote) {
// //echo "Pessoa/Pessoa_Lote: " . "{$pessoaLote}<hr>";
// $lotes = Lote::where('id', $pessoaLote->lote_id)->with('lotesTramites', 'municipio')->get();
// foreach ($lotes as $lote) {
// $lotesTramites = LoteTramite::where('lote_id', $lote->id)->with('tramites')->get();
// // echo "LOte/Tramite: " . "{$lotesTramites}<hr>";
// foreach ($lotesTramites as $loteTramite) {
// $tramites = Tramite::where('id', $loteTramite->tramite_id)->where('documento_tipo', 'TITULO DO IMOVEL')
// ->where('id', 67)
// ->get();
// foreach ($tramites as $tramite) {
// $titulos = Titulo::where('lote_id', $lote->id)->where('flag_cancelamento', '<>', 'S')->get();
// echo "Titulo: " . "{$titulos}<hr>";
// foreach ($titulos as $titulo) {
// 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>";
// //echo "Tramite: " . "{$tramites}<hr>";
// return view('admin.pages.titulos.index',
// [
// 'titulos' => $titulos,
// 'lotes' => $lotes,
// 'documentosPessoa' => $documentosPessoa,
// 'lotesTramites' => $lotesTramites,
// 'tramites' => $tramites,
// ]);
// }
// }
// }
// }
// }
// }
/**
* Show the form for creating a new resource.
......@@ -49,12 +120,17 @@ class TituloController extends Controller
* @param App\Http\Requests\StoreUpdateTituloRequest $request
* @return \Illuminate\Http\Response
*/
public function store(StoreUpdateTituloRequest $request)
{
$data = $request->all();
$this->repository->create($data);
return redirect()->route('titulos.index');
// public function store(StoreUpdateTituloRequest $request)
// {
// $data = $request->all();
// $this->repository->create($data);
// return redirect()->route('titulos.index');
// }
public function store(Request $request)
{
return $request->name;
}
/**
......@@ -65,11 +141,12 @@ class TituloController extends Controller
*/
public function show($id)
{
if(!$titulo = Titulo::find($id))
if (!$titulo = Titulo::find($id)) {
return redirect()->back();
}
return view('admin.pages.titulos.show', [
'titulos' => $titulo
'titulos' => $titulo,
]);
}
......@@ -81,8 +158,10 @@ class TituloController extends Controller
*/
public function edit($id)
{
if(!$titulo = $this->repository->find($id))
if (!$titulo = $this->repository->find($id)) {
return redirect()->back();
}
//dd($titulo);
// return view('admin.pages.titulos.edit', [
// 'titulos' => $titulo
......@@ -99,8 +178,9 @@ class TituloController extends Controller
*/
public function update(StoreUpdateTituloRequest $request, $id)
{
if(!$titulo = $this->repository->find($id))
if (!$titulo = $this->repository->find($id)) {
return redirect()->back();
}
$titulo->update($request->all());
return redirect()->route('titulos.index');
......@@ -114,8 +194,10 @@ class TituloController extends Controller
*/
public function destroy($id)
{
if(!$titulo = $this->repository->find($id))
if (!$titulo = $this->repository->find($id)) {
return redirect()->back();
}
$titulo->delete();
return redirect()->route('titulos.index');
......@@ -125,10 +207,10 @@ class TituloController extends Controller
{
$filters = $request->except('_token');
$titulo = $this->repository->search($request->filter);
$titulos = $this->repository->search($request->filter);
return view('admin.pages.titulos.index', [
'titulos' => $titulo,
'titulos' => $titulos,
'filters' => $filters,
]);
......
......@@ -24,14 +24,14 @@ class StoreUpdateTituloRequest extends FormRequest
public function rules()
{
return [
'numero_titulo' => 'required',
'cpf' => 'required',
];
}
public function messages()
{
return [
'numero_titulo.required' => 'Número Título é obrigatório!',
'cpf.required' => 'Número Título é obrigatório!',
];
}
}
......@@ -8,6 +8,15 @@ class DocumentoPessoa extends Model
{
protected $table = 'regularizacaofundiaria.documentos_pessoa';
public function naturalidade()
{
return $this->belongsTo(Municipio::class);
}
public function pessoa()
{
return $this->belongsTo(Pessoa::class, 'id');
}
}
......@@ -8,10 +8,10 @@ class Etapa extends Model
{
protected $table = 'sige.etapas';
public function setores()
{
return $this->hasMany(Setor::class, 'id', 'setor_id');
}
// public function setores()
// {
// return $this->hasMany(Setor::class, 'id', 'setor_id');
// }
public function pendencias()
{
......
......@@ -7,7 +7,11 @@ use Illuminate\Database\Eloquent\Model;
class Gleba extends Model
{
protected $table = 'sige.glebas';
protected $fillable = ['id'];
public function titulos()
{
return $this->hasMany(Titulo::class, 'gleba_id', 'id');
}
public function search($filter = null)
{
......
......@@ -7,16 +7,20 @@ use Illuminate\Database\Eloquent\Model;
class Lote extends Model
{
protected $table = 'sige.lotes';
// protected $fillable = ['id', 'area', 'ativo', 'criado_por_id', 'dhc', 'dhm', 'modificado_por_id',
// 'municipio_id', 'nome', 'numero', 'perimetro', 'proprietario', 'situacao_juridica_id',
// 'titulo', 'sncr', 'cpf', 'protocolo', 'is_aprovado', 'data_termino_periodo_de_uso',
// 'status_estrutura', 'status_pessoa', 'status_uso', 'comunidade', 'localidade', 'projeto_especial',
// 'cnpj', 'status_titulo', 'migrado_para_access', 'cod_imo_rur'];
// public function secUser(){
// return $this->belongsTo(SecUser::class);
protected $fillable = ['id', 'area', 'ativo', 'criado_por_id', 'dhc', 'dhm', 'modificado_por_id',
'municipio_id', 'nome', 'numero', 'perimetro', 'proprietario', 'situacao_juridica_id',
'titulo', 'sncr', 'cpf', 'protocolo', 'is_aprovado', 'data_termino_periodo_de_uso',
'status_estrutura', 'status_pessoa', 'status_uso', 'comunidade', 'localidade', 'projeto_especial',
'cnpj', 'status_titulo', 'migrado_para_access', 'cod_imo_rur'];
// public function titulos(){
// return $this->hasMany(Titulo::class, 'lote_id', 'id');
// }
public function secUser(){
return $this->belongsTo(SecUser::class);
}
public function municipio()
{
return $this->belongsTo(Municipio::class);
......
......@@ -8,8 +8,14 @@ class LoteTramite extends Model
{
protected $table = 'sige.lotes_tramites';
public function tramites()
{
return $this->hasMany(Tramite::class, 'id', 'tramite_id');
}
// public function tramites()
// {
// return $this->hasMany(Tramite::class, 'id', 'tramite_id');
// }
// public function secUser(){
// return $this->belongsTo(SecUser::class);
// }
}
......@@ -27,6 +27,4 @@ class Municipio extends Model
// return $this->hasMany(Lote::class, 'municipio_id', 'id');
}
}
......@@ -15,6 +15,7 @@ class PessoaLote extends Model
public function lote()
{
return $this->belongsTo(Lote::class);
return $this->belongsTo(Lote::class, 'lote_id', 'id');
}
}
......@@ -13,8 +13,10 @@ class SecUser extends Model
return $this->hasMany(Lote::class, 'criado_por_id', 'id', 'modificado_por_id');
}
public function secUser()
public function lotesTramites()
{
return $this->hasMany(SecUser::class);
return $this->hasMany(LoteTramite::class, 'criado_por_id', 'id', 'modificado_por_id');
}
}
......@@ -13,4 +13,9 @@ class Setor extends Model
return $this->hasMany(Tramite::class, 'id');
}
public function etapas()
{
return $this->hasMany(Etapa::class, 'id');
}
}
......@@ -8,13 +8,6 @@ class SituacaoJuridica extends Model
{
protected $table = 'sige.situacoes_juridicas';
// public function lote()
// {
// return $this->belongsTo(Lote::class);
// //CASO FOSSE VINCULAR COM SITUAÇÃO JURÍDICA (ESSE id SERIA O id DA TABELA sige.situacoes_juridicas) - AULA 9
// // return $this->hasMany(Lote::class, 'municipio_id', 'id');
// }
public function lotes()
{
//lote_id: na tabela Processos, id: na tabela Lotes
......
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class TipoLei extends Model
{
protected $table = 'sige.tiposleis';
public function titulos()
{
return $this->hasMany(Titulo::class, 'tipo_lei_id', 'id');
}
}
......@@ -25,12 +25,12 @@ class Titulo extends Model
// public function lotes()
// {
// return $this->belongsTo(Titulo::class);
// return $this->belongsTo(Lote::class, 'lote_id', 'id');
// }
// public function gleba()
// {
// return $this->hasOne(Gleba::class,'id');
// }
public function gleba()
{
return $this->belongsTo(Gleba::class, 'id');
}
}
......@@ -13,10 +13,14 @@ class Tramite extends Model
return $this->belongsTo(Setor::class, 'id');
}
public function lotesTramites()
{
return $this->hasMany(LoteTramite::class, 'tramite_id', 'id');
}
public function setores()
{
return $this->hasMany(Setor::class, 'id');
}
}
......@@ -15,6 +15,7 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@stack('styles')
</head>
<body>
......@@ -68,8 +69,90 @@
</div>
</div>
</nav>
<div class="container">
@yield('content')
</div>
@stack('scripts')
</body>
</html>
{{-- <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>@yield('title') - Idace</title>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@stack('styles')
</head>
<body>
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left Side Of Navbar -->
<ul class="navbar-nav mr-auto">
</ul>
<!-- Right Side Of Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Authentication Links -->
@guest
<li class="nav-item">
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
</li>
@if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
@endif
@else
<li class="nav-item dropdown">
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ __('Logout') }}
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</div>
</li>
@endguest
</ul>
</div>
</div>
</nav>
<div class="container">
@yield('content')
</div>
</body>
</html> --}}
\ No newline at end of file
......@@ -2,7 +2,6 @@
<div class="card card-outline card-success">
<div class="card-header">
<h3 class="card-title">Agendamentos <a href="{{ route('agendamentos.index') }}">
<<< /a>
</h3>
</div>
{{-- {{ $agendamento->data }} --}}
......
......@@ -3,23 +3,24 @@
@section('title', 'Pesquisa de Agendamentos')
@section('content_header')
{{-- <a href="{{ route('agendamentos.create') }}" class="btn btn-success">Agendar</a> --}}
{{-- <a href="{{ route('agendamentos.create') }}" class="btn btn-success">Agendar</a>
--}}
@endsection
{{-- @extends('admin.layouts.app')
@section('title', 'Pesquisa de Agendamentos')
--}}
@section('content')
<div class="card card-outline card-success">
<div class="card card-outline card-success">
<div class="card-body">
<form action="{{ route('agendamentos.search') }}" class="form form-inline" method="POST">
@csrf
<input type="text" name="filter" placeholder="Filtrar:" class="form-control" value="{{ $filters['filter'] ?? '' }}">
<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="card card-outline card-success">
<div class="card-header">
<h3 class="card-title"><b>Listagem dos Agendamentos</b></h3>
......@@ -49,8 +50,10 @@
<td>{{ $agendamento->data }}</td>
<td>
<a href="{{ route('agendamentos.edit', $agendamento->id) }}" class="badge bg-green">Editar</a>
<a href="{{ route('agendamentos.show', $agendamento->id) }}" class="badge bg-green">Detalhes</a>
<a href="{{ route('agendamentos.edit', $agendamento->id) }}"
class="badge bg-green">Editar</a>
<a href="{{ route('agendamentos.show', $agendamento->id) }}"
class="badge bg-green">Detalhes</a>
</td>
</tr>
......@@ -112,6 +115,3 @@
{!! $agendamentos->links() !!}
@endsection
\ No newline at end of file
{{-- @extends('admin.layouts.app') --}}
@extends('adminlte::page')
@section('title', "Detalhes {$agendamentos->data}")
@section('content_header')
{{-- <a href="{{ route('agendamentos.create') }}" class="btn btn-primary">Agendar</a> --}}
@endsection
@section('content')
......
@include('admin.includes.alerts')
@csrf
<div class="form-group">
<input type="text" name="id" class="form-control" placeholder="Id:" value="{{ $titulos->id ?? old('id')}}">
</div>
<div class="form-group">
<input type="text" name="numero_titulo" class="form-control" placeholder="Número Título:" value="{{ $titulos->numero_titulo ?? old('numero_titulo')}}">
</div>
<button class="btn btn-success" type="submit">Enviar</button>
\ No newline at end of file
@extends('adminlte::page')
@section('title', 'Cadastrar Titulo')
@section('content')
<h1>Cadastrar Título</h1>
<form action="{{ route('titulos.store') }}" method="post" enctype="multipart/form-data" class="form">
@include('admin.pages.titulos._partials.form')
</form>
@endsection
\ No newline at end of file
@extends('adminlte::page')
@section('title', "Editar Titulo do dia {$titulo->data}")
@section('content')
<h1>Editar Titulo {{ $titulo->data }}</h1>
<form action="{{ route('titulos.update', $titulo->id) }}" method="post">
@method('PUT')
@include('admin.pages.titulos._partials.form')
</form>
@endsection
@extends('adminlte::page')
@section('title', 'Pesquisa de Titulos')
@section('content_header')
@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>
{{-- @if (isset($filters))
<p><strong>Resultados para: </strong>{{ $filters }}</p>
@endif --}}
</div>
</div>
<div class="card card-outline card-success">
<div class="card-header">
<h3 class="card-title"><b>Listagem dos Títulos</b></h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<table class="table table-striped">
<thead>
<tr>
<th>NÚMERO TÍTULO</th>
<th>DHC</th>
<th>DHM</th>
<th>LOTE_ID</th>
<th>GLEBA_ID</th>
<th>ANO TITULO</th>
<th width="100">AÇÕES</th>
</tr>
</thead>
<tbody>
@foreach ($titulos as $titulo)
<tr>
<td>{{ $titulo->numero_titulo }}</td>
<td>{{ $titulo->dhc }}</td>
<td>{{ $titulo->dhm }}</td>
<td>{{ $titulo->lote_id }}</td>
<td>{{ $titulo->gleba_id }}</td>
<td>{{ $titulo->ano_titulo }}</td>
<td>
<a href="{{ route('titulos.edit', $titulo->id) }}" class="badge bg-green">Editar</a>
<a href="{{ route('titulos.show', $titulo->id) }}" class="badge bg-green">Detalhes</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer">
{!! $titulos->appends($filters)->links() !!}
</div>
</div>
@endsection
\ No newline at end of file
@extends('adminlte::page')
@section('title', "Detalhes do Título {$titulos->numero_titulo}")
@section('content_header')
@section('content')
<div class="card card-outline card-success">
<div class="card-header">
<h3 class="card-title"><b>Detalhes dos Títulos</b><a href="{{ route('titulos.index') }}"> <<</a></h3>
</div>
<div class="card-body">
<ul>
<li><strong>NÚMERO TÍTULO: </strong> {{ $titulos->numero_titulo }}</li>
<li><strong>DHC: </strong> {{ $titulos->dhc }}</li>
<li><strong>DHM: </strong> {{ $titulos->dhm }}</li>
<li><strong>Lote_id: </strong> {{ $titulos->lote_id }}</li>
<li><strong>Gleba_id: </strong> {{ $titulos->gleba_id }}</li>
<li><strong>Ano Titulo: </strong> {{ $titulos->ano_titulo }}</li>
</ul>
</div>
<div class="card-footer">
The footer of the card
</div>
</div>
@endsection
@include('admin.includes.alerts')
@section('content')
<div class="card card-outline card-success">
<div class="card-header">
<h3 class="card-title">Títulos <a href="{{ route('titulos.index') }}">
</h3>
</div>
{{-- {{ $agendamento->data }} --}}
<!-- /.card-header -->
<div class="card-body">
@include('admin.includes.alerts')
@csrf
<div class="form-group">
<input type="text" name="numero_titulo" class="form-control" placeholder="Título:"
value="{{ $titulo->numero_titulo ?? old('numero_titulo') }}">
</div>
<div class="form-group">
<input type="text" name="dhc" class="form-control" placeholder="DHC:"
value="{{ $titulo->dhc ?? old('dhc') }}">
</div>
<div class="form-group">
<input type="text" name="dhm" class="form-control" placeholder="DHM:"
value="{{ $titulo->dhm ?? old('dhm') }}">
</div>
<div class="form-group">
<input type="text" name="lote_id" class="form-control" placeholder="LOTE_ID:"
value="{{ $titulo->lote_id ?? old('lote_id') }}">
</div>
<div class="form-group">
<input type="text" name="gleba_id" class="form-control" placeholder="GLEBA_ID:"
value="{{ $titulo->gleba_id ?? old('gleba_id') }}">
</div>
<div class="form-group">
<input type="text" name="ano_titulo" class="form-control" placeholder="ANO TITULO:"
value="{{ $titulo->ano_titulo ?? old('ano_titulo') }}">
</div>
<button class="btn btn-success" type="submit">Enviar</button>
</div>
<!-- /.card-body -->
<div class="card-footer">
The footer of the card
</div>
<!-- /.card-footer -->
</div>
<!-- /.card -->
{{-- @include('admin.includes.alerts')
@csrf
<div class="form-group">
<input type="text" name="id" class="form-control" placeholder="Id:" value="{{ $titulos->id ?? old('id')}}">
<input type="text" name="numero_titulo" class="form-control" placeholder="Numero Título:"
value="{{ $titulos->numero_titulo ?? old('numero_titulo') }}">
</div>
<div class="form-group">
<input type="text" name="numero_titulo" class="form-control" placeholder="Número Título:" value="{{ $titulos->numero_titulo ?? old('numero_titulo')}}">
<input type="text" name="dhc" class="form-control" placeholder="DHC:" value="{{ $titulos->dhc ?? old('dhc') }}">
</div>
<button class="btn btn-success" type="submit">Enviar</button>
\ No newline at end of file
<div class="form-group">
<input type="text" name="dhm" class="form-control" placeholder="DHM:" value="{{ $titulos->dhm ?? old('dhm') }}">
</div>
<div class="form-group">
<input type="text" name="lote_id" class="form-control" placeholder="lote_id:"
value="{{ $titulos->lote_id ?? old('lote_id') }}">
</div>
<div class="form-group">
<input type="text" name="gleba_id" class="form-control" placeholder="gleba_id:"
value="{{ $titulos->gleba_id ?? old('gleba_id') }}">
</div>
<div class="form-group">
<input type="text" name="ano_titulo" class="form-control" placeholder="ano_titulo:"
value="{{ $titulos->ano_titulo ?? old('ano_titulo') }}">
</div>
<button class="btn btn-success" type="submit">Enviar</button> --}}
......@@ -3,23 +3,18 @@
@section('title', 'Pesquisa de Titulos')
@section('content_header')
@endsection
@section('content')
<div class="card card-outline card-success">
{{-- <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'] ?? '' }}">
<input type="text" name="filter" placeholder="Filtrar:" class="form-control"
value="{{ $filters['filter'] ?? '' }}">
<button type="submit" class="btn btn-info">Pesquisar</button>
</form>
{{-- @if (isset($filters))
<p><strong>Resultados para: </strong>{{ $filters }}</p>
@endif --}}
</div>
</div>
</div> --}}
<div class="card card-outline card-success">
<div class="card-header">
......@@ -27,42 +22,42 @@
</div>
<!-- /.card-header -->
<div class="card-body">
<table class="table table-striped">
<table class="table table-striped" >
<thead>
<tr>
<tr >
<th>MUNICÍPIO</th>
<th>PROPRIETÁRIO</th>
<th>NÚMERO TÍTULO</th>
<th>DHC</th>
<th>DHM</th>
<th>LOTE_ID</th>
<th>GLEBA_ID</th>
<th>ANO TITULO</th>
<th>CPF</th>
<th>TRAMITE</th>
<th>LOCALIZAÇÃO</th>
<th width="100">AÇÕES</th>
</tr>
</thead>
<tbody>
@foreach ($documentosPessoa as $documentoPessoa)
@foreach ($lotes as $lote)
@foreach ($titulos as $titulo)
<tr>
<tr align="center">
<td>{{ $lote->municipio->nome }}</td>
<td>{{ $lote->proprietario }}</td>
<td>{{ $titulo->numero_titulo }}</td>
<td>{{ $titulo->dhc }}</td>
<td>{{ $titulo->dhm }}</td>
<td>{{ $titulo->lote_id }}</td>
<td>{{ $titulo->gleba_id }}</td>
<td>{{ $titulo->ano_titulo }}</td>
<td>{{ $documentoPessoa->cpf }}</td>
<td>{{ $tramite->nome }}</td>
<td>{{ $loteTramite->localizacao_nova }}</td>
<td>
<a href="{{ route('titulos.edit', $titulo->id) }}" class="badge bg-green">Editar</a>
<a href="{{ route('titulos.show', $titulo->id) }}" class="badge bg-green">Detalhes</a>
<a href="{{ route('titulos.show', $titulo->id) }}"
class="badge bg-green">Detalhes</a>
</td>
</tr>
@endforeach
@endforeach
@endforeach
</tbody>
</table>
</div>
<div class="card-footer">
{!! $titulos->appends($filters)->links() !!}
{{-- {!! $titulos->appends($filters)->links() !!} --}}
</div>
</div>
@endsection
\ No newline at end of file
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
<!-- Styles -->
<style>
html,
body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-weight: 200;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.top-right {
position: absolute;
right: 10px;
top: 18px;
}
.content {
text-align: center;
}
.title {
font-size: 84px;
}
.links>a {
color: #636b6f;
padding: 0 25px;
font-size: 13px;
font-weight: 600;
letter-spacing: .1rem;
text-decoration: none;
text-transform: uppercase;
}
.m-b-md {
margin-bottom: 30px;
}
</style>
</head>
<body>
</body>
</html>
......@@ -4,25 +4,32 @@
@section('content')
<form action="" method="post" enctype="multipart/form-data" class="form">
<form class="form">
<div class="row">
<!-- left column -->
<div class="col-md-3">
</div>
<div class="col-md-6 tela">
<img class="logoidace" src="{{ asset('vendor/adminlte/dist/img/logo-idace.png') }}">
<h1 class="titulo">Agendamento de entrega de Títulos</h1>
<h4 class="titulo2">Preecha com cpf Válido</h4>
<form role="form">
<form action="{{ route('titulos.store') }}" class="form form-inline" method="GET">
<input type="text" class="form-control label_cpf" data-mask="000.000.000-00" name="cpf"
placeholder="000.000.000-00">
<button type="submit" class="btn btn-block btn-primary btn_pesquisa">Pesquisar</button>
</form>
{{-- <form role="form">
<div class="card-body">
<div class="form-group ">
<!-- <label for="exampleInputEmail1">CPF</label> -->
<input type="email" class="form-control label_cpf" data-mask="000.000.000-00"
id="exampleInputEmail1" placeholder="000.000.000-00">
<button type="button" class="btn btn-block btn-primary btn_pesquisa">Pesquisar</button>
<button type="button " class="btn btn-block btn-primary btn_pesquisa">Pesquisar</button>
</div>
</div>
</form>
</form> --}}
</div>
<div class="col-md-3">
</div>
......
......@@ -7,6 +7,22 @@
<title>Minha View</title>
</head>
<body>
{{ $teste }}
<div class="row">
<img class="logoidace" src="{{ asset('vendor/adminlte/dist/img/logo-idace.png') }}">
<h1 class="titulo">Agendamento de entrega de Títulos</h1>
<h4 class="titulo2">Preecha com cpf Válido</h4>
<form action="{{ route('titulos.store') }}" class="form form-inline" method="GET">
<input type="text" class="form-control label_cpf" data-mask="000.000.000-00" name="cpf"
placeholder="000.000.000-00">
<button type="submit" class="btn btn-block btn-primary btn_pesquisa">Pesquisar</button>
</form>
</div>
</body>
</html>
......@@ -3,6 +3,7 @@
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
Route::get('polymorphics', 'PolymorphicController@polymorphic');
Route::get('many-to-many', 'ManyToManyController@manyToMany');
Route::get('many-to-one', 'ManyToOneController@manyToOne');
Route::get('one-to-many', 'OneToManyController@oneToMany');
......@@ -19,17 +20,27 @@ Route::any('municipios/search', 'MunicipioController@search')->name('municipios.
Route::resource('glebas', 'GlebaController')->middleware('auth');
Route::any('glebas/search', 'GlebaController@search')->name('glebas.search')->middleware('auth');//->middleware('auth');
Route::resource('teste', 'TesteController');
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
// Route::get('/', function () {
// return view('pesquisaCpf');
// });
Route::get('/', function () {
return view('pesquisaCpf');
return view('teste');
});
Route::get('/cpfinvalido', function () {
return view('cpfInvalido');
});
})->name('cpfinvalido');
/* Route::put('titulos/{id}', 'TituloController@destroy')->name('titulos.destroy'); //Editar um registro - put
......
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