Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
agendamento
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marcos Albano
agendamento
Commits
b7364abe
Commit
b7364abe
authored
Aug 19, 2020
by
Marcos Albano
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mais relacionamentos
parent
2d22eb9b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
140 additions
and
81 deletions
+140
-81
OneToManyController.php
app/Http/Controllers/OneToManyController.php
+51
-13
OneToOneController.php
app/Http/Controllers/OneToOneController.php
+5
-7
DocumentoPessoa.php
app/Models/DocumentoPessoa.php
+1
-1
FormaObtencao.php
app/Models/FormaObtencao.php
+15
-0
Lote.php
app/Models/Lote.php
+10
-0
LoteTramite.php
app/Models/LoteTramite.php
+15
-0
Tramite.php
app/Models/Tramite.php
+11
-0
adminlte.php
config/adminlte.php
+0
-3
pesquisaCpf.blade.php
resources/views/pesquisaCpf.blade.php
+24
-49
web.php
routes/web.php
+8
-8
No files found.
app/Http/Controllers/OneToManyController.php
View file @
b7364abe
...
...
@@ -3,12 +3,51 @@
namespace
App\Http\Controllers
;
use
App\Models\Lote
;
use
App\Models\SituacaoJuridica
;
use
App\Models\LoteTramite
;
use
App\Models\Tramite
;
class
OneToManyController
extends
Controller
{
public
function
oneToMany
()
{
/* RELACIONAMENTO LOTE/LOTE_TRAMITE */
$lotesTramites
=
LoteTramite
::
where
(
'lote_id'
,
410251
)
->
with
(
'tramites'
)
->
get
();
foreach
(
$lotesTramites
as
$loteTramite
){
$tramites
=
$loteTramite
->
tramites
()
->
get
();
foreach
(
$tramites
as
$tramite
){
echo
"lote_Tramite:
{
$loteTramite
->
tramite_id
}
<hr>"
;
echo
"Nome Tramite:
{
$tramite
->
nome
}
<hr>"
;
}
}
/* RELACIONAMENTO LOTE/LOTE_TRAMITE */
// $lotes = Lote::where('id', 410251)->with('lotesTramites')->get();
// foreach ($lotes as $lote) {
// echo "Municipio: {$lote->municipio_id}<hr>";
// echo "Lote: {$lote->numero}<br>";
// $lotesTramites = $lote->lotesTramites()->get();
// foreach ($lotesTramites as $loteTramite) {
// echo "Lote_Tramite: {$loteTramite->tramite_id}<hr>";
// }
// }
/* RELACIONAMENTO LOTE/FORMA_DE_OBTENCAO */
// $lotes = Lote::where('id', 410777)->with('formasObtencao')->get();
// foreach($lotes as $lote){
// echo "Municipio: {$lote->municipio_id}<hr>";
// echo "Lote: {$lote->numero}<br>";
// $formasObtencao = $lote->formasObtencao()->get();
// foreach($formasObtencao as $formaObtencao){
// echo "Forma_Obtenção: {$formaObtencao->descricao_forma_de_obtencao}<hr>";
// }
// }
/* RELACIONAMENTO MUNICIPIO/LOTE */
// //$municipios = Municipio::where('id', 2304277)->get()->first();
// //$municipio = Municipio::where('nome', "ERERÊ")->orderBy('nome', 'asc')->with('lotes')->get();
...
...
@@ -35,19 +74,18 @@ class OneToManyController extends Controller
// }
/* RELACIONAMENTO LOTE/SITUACAO_JURIDICA */
$lotes
=
Lote
::
where
(
'municipio_id'
,
2304707
)
->
with
(
'situacaoJuridica'
)
->
get
();
foreach
(
$lotes
as
$lote
)
{
//dd($lote);
echo
"Número do Lote: "
.
"
{
$lote
->
numero
}
<hr>"
;
$situacoesJuridicas
=
$lote
->
situacaoJuridica
()
->
where
(
'id'
,
99
)
->
get
();
foreach
(
$situacoesJuridicas
as
$situacaoJuridica
)
{
echo
"Situação Jurídica: "
.
"
{
$situacaoJuridica
->
nome
}
<hr>"
;
}
}
// $lotes = Lote::where('municipio_id', 2304707)->with('situacaoJuridica')->get();
// foreach ($lotes as $lote) {
// //dd($lote);
// echo "Número do Lote: " . "{$lote->numero}<hr>";
// $situacoesJuridicas = $lote->situacaoJuridica()
// ->where('id', 99)
// ->get();
// foreach ($situacoesJuridicas as $situacaoJuridica) {
// echo "Situação Jurídica: " . "{$situacaoJuridica->nome}<hr>";
// }
// }
/* RELACIONAMENTO LOTE/PESSOA_LOTE */
// $lotes = Lote::where('municipio_id', 2304608)->with('pessoaLote')->get();
// foreach ($lotes as $lote) {
...
...
app/Http/Controllers/OneToOneController.php
View file @
b7364abe
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
use
App\Models\DocumentoPessoa
;
use
App\Models\Lote
;
use
App\Models\Pessoa
;
use
App\Models\Titulo
;
...
...
@@ -12,16 +13,13 @@ class OneToOneController extends Controller
public
function
oneToOne
()
{
/* RELACIONAMENTO PESSOA/DOCUMENTO_PESSOA */
$pessoas
=
Pessoa
::
where
(
'atividade_principal'
,
'Outras'
)
->
with
(
'documentoPessoa'
)
->
get
();
$pessoas
=
Pessoa
::
where
(
'id'
,
74516
)
->
with
(
'documentoPessoa'
)
->
get
();
foreach
(
$pessoas
as
$pessoa
){
echo
"Pessoa: "
.
"
{
$pessoa
->
nome
}
<hr>"
;
$documentosPessoa
=
$pessoa
->
documentoPessoa
()
->
where
(
'naturalidade_id'
,
2313104
)
->
get
();
$documentosPessoa
=
$pessoa
->
documentoPessoa
()
->
get
();
foreach
(
$documentosPessoa
as
$documentoPessoa
){
echo
"
{
$documentoPessoa
}
"
;
echo
"
DocumentoPessoa: "
.
"
{
$documentoPessoa
->
cpf
}
<hr>
"
;
}
}
}
...
...
app/Models/DocumentoPessoa.php
View file @
b7364abe
...
...
@@ -9,5 +9,5 @@ class DocumentoPessoa extends Model
protected
$table
=
'regularizacaofundiaria.documentos_pessoa'
;
}
app/Models/FormaObtencao.php
0 → 100644
View file @
b7364abe
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
FormaObtencao
extends
Model
{
protected
$table
=
'regularizacaofundiaria.forma_obtecao'
;
public
function
lote
()
{
return
$this
->
belongsTo
(
Lote
::
class
);
}
}
app/Models/Lote.php
View file @
b7364abe
...
...
@@ -46,4 +46,14 @@ class Lote extends Model
return
$this
->
hasMany
(
PessoaLote
::
class
,
'lote_id'
,
'id'
);
}
public
function
formasObtencao
()
{
return
$this
->
hasMany
(
FormaObtencao
::
class
,
'lote_id'
,
'id'
);
}
public
function
lotesTramites
()
{
return
$this
->
hasMany
(
LoteTramite
::
class
,
'lote_id'
,
'id'
);
}
}
app/Models/LoteTramite.php
0 → 100644
View file @
b7364abe
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
LoteTramite
extends
Model
{
protected
$table
=
'sige.lotes_tramites'
;
public
function
tramites
()
{
return
$this
->
hasMany
(
Tramite
::
class
,
'id'
,
'tramite_id'
);
}
}
app/Models/Tramite.php
0 → 100644
View file @
b7364abe
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
Tramite
extends
Model
{
protected
$table
=
'sige.tramites'
;
}
config/adminlte.php
View file @
b7364abe
...
...
@@ -47,11 +47,8 @@ return [
'logo'
=>
'<b>Agendamento IDACE</b>'
,
'logo_img'
=>
'vendor/adminlte/dist/img/logoidace.png'
,
<<<<<<<
HEAD
'logo_img_class'
=>
'brand-image img-circle elevation-3'
,
=======
'logo_img_class'
=>
'brand-image elevation-3'
,
>>>>>>>
b175a848d4af3a2e44c5089de935401b6cf267b0
'logo_img_xl'
=>
null
,
'logo_img_xl_class'
=>
'brand-image-xs'
,
'logo_img_alt'
=>
'IDACE'
,
...
...
resources/views/pesquisaCpf.blade.php
View file @
b7364abe
@
extends
(
'adminlte::page'
)
@
section
(
'title'
,
'Pesquisar CPF'
)
@
section
(
'content'
)
<
form
action
=
""
method
=
"post"
enctype
=
"multipart/form-data"
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
>
<!--
general
form
elements
-->
<!--
/.
card
-
header
-->
<!--
form
start
-->
<
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
>
</
div
>
</
div
>
<!--
/.
card
-
body
-->
@
section
(
'content'
)
</
form
>
<
form
action
=
""
method
=
"post"
enctype
=
"multipart/form-data"
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"
>
<
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
>
</
div
>
</
div
>
</
form
>
</
div
>
<
div
class
=
"col-md-3"
>
</
div
>
<!--
/.
card
-->
<!--/.
col
(
left
)
-->
<!--
right
column
-->
<!--/.
col
(
right
)
-->
<
div
class
=
"col-md-3"
>
</
div
>
</
div
>
</
form
>
</
form
>
@
endsection
\ No newline at end of file
@
endsection
routes/web.php
View file @
b7364abe
...
...
@@ -23,6 +23,14 @@ Auth::routes();
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
Route
::
get
(
'/'
,
function
()
{
return
view
(
'pesquisaCpf'
);
});
Route
::
get
(
'/cpfinvalido'
,
function
()
{
return
view
(
'cpfInvalido'
);
});
/* Route::put('titulos/{id}', 'TituloController@destroy')->name('titulos.destroy'); //Editar um registro - put
Route::put('titulos/{id}', 'TituloController@update')->name('titulos.update'); //Editar um registro - put
...
...
@@ -40,12 +48,4 @@ Route::post('titulos', 'TituloController@store')->name('titulos.store'); //Cadas
// })->name('login');
Route
::
get
(
'/'
,
function
()
{
return
view
(
'pesquisaCpf'
);
});
Route
::
get
(
'/cpfinvalido'
,
function
()
{
return
view
(
'cpfInvalido'
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment