Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
fca6f5bf
Commit
fca6f5bf
authored
Mar 24, 2022
by
alissonalbuquerque
Browse files
add atualizacoes de rotas, e controllers
parent
e1adcee1
Changes
10
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/Dimensao/EnsinoController.php
View file @
fca6f5bf
...
...
@@ -3,17 +3,30 @@
namespace
App\Http\Controllers\Dimensao
;
use
App\Http\Controllers\Controller
;
use
App\Models\Curso
;
use
App\Queries\CursoQuery
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
class
EnsinoController
extends
Controller
{
const
MENU_HOME
=
1
;
const
MENU_PAD
=
2
;
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public
function
index
()
{
return
view
(
'pad.dimensao.ensino'
);
$user
=
Auth
::
user
();
$cursos
=
(
new
CursoQuery
())
->
getQuery
()
->
get
();
return
view
(
'pad.dimensao.ensino'
,
[
'index_menu'
=>
self
::
MENU_PAD
,
'cursos'
=>
$cursos
,
]);
}
}
app/Http/Controllers/PADController.php
View file @
fca6f5bf
...
...
@@ -20,7 +20,7 @@ class PADController extends Controller
*/
public
function
index
()
{
$PADs
=
PAD
::
where
(
'
professo
r_id'
,
'='
,
Auth
::
user
()
->
id
);
$PADs
=
PAD
::
where
(
'
use
r_id'
,
'='
,
Auth
::
user
()
->
id
);
return
view
(
'pad.index'
,
[
"PADs"
=>
$PADs
,
'index_menu'
=>
1
]);
}
...
...
app/Queries/CursoQuery.php
0 → 100644
View file @
fca6f5bf
<?php
namespace
App\Queries
;
use
App\Models\Curso
;
class
CursoQuery
extends
Query
{
public
function
__construct
(
$init
=
[])
{
$this
->
query
=
Curso
::
where
([]);
}
public
function
whereCampusId
(
int
$campus_id
,
string
$expression
=
'='
)
{
$this
->
query
=
$this
->
query
->
where
(
'campus_id'
,
$expression
,
$campus_id
);
return
$this
->
query
;
}
}
app/Queries/Query.php
View file @
fca6f5bf
...
...
@@ -8,6 +8,6 @@ class Query {
public
function
getQuery
(){
return
$this
->
query
;
}
}
database/migrations/2022_03_20_233337_create_p_a_d_s_table.php
View file @
fca6f5bf
...
...
@@ -13,25 +13,21 @@ class CreatePADSTable extends Migration
*/
public
function
up
()
{
Schema
::
create
(
'
PAD
s'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'
pad
s'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
// $table->integer('ano')->default(false);
// $table->integer('semestre')->default(false);
// $table->integer('carga_horaria')->default(false);
// $table->string('categoria', 20)->default(false);
// $table->boolean('afastamento_total')->default(false);
// $table->boolean('afastamento_parcial')->default(false);
// $table->boolean('exerce_funcao_admin')->default(false);
// $table->boolean('exerce_funcao_sindical')->default(false);
// $table->string('licenca_de_acor_legais', 50)->default(null);
// $table->string('outras_observacoes', 200)->nullable(true);
$table
->
foreignId
(
'user_id'
);
$table
->
timestamps
();
$table
->
integer
(
'ano'
);
$table
->
integer
(
'semestre'
);
$table
->
integer
(
'carga_horaria'
);
$table
->
string
(
'categoria'
,
20
);
$table
->
boolean
(
'afastamento_total'
)
->
default
(
false
);
$table
->
boolean
(
'afastamento_parcial'
)
->
default
(
false
);
$table
->
boolean
(
'exerce_funcao_admin'
)
->
default
(
false
);
$table
->
boolean
(
'exerce_funcao_sindical'
)
->
default
(
false
);
$table
->
string
(
'licenca_de_acor_legais'
,
50
)
->
default
(
null
);
$table
->
string
(
'outras_observacoes'
,
200
)
->
nullable
(
true
);
$table
->
unsignedBigInteger
(
'professor_id'
);
$table
->
foreign
(
'professor_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
$table
->
unsignedBigInteger
(
'curso_id'
);
$table
->
foreign
(
'curso_id'
)
->
references
(
'id'
)
->
on
(
'cursos'
);
});
}
...
...
@@ -42,6 +38,6 @@ class CreatePADSTable extends Migration
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'
PAD
s'
);
Schema
::
dropIfExists
(
'
pad
s'
);
}
}
database/seeders/DatabaseSeeder.php
View file @
fca6f5bf
...
...
@@ -22,6 +22,7 @@ class DatabaseSeeder extends Seeder
CursoSeeder
::
class
,
UserSeeder
::
class
,
PlanejamentoSeeder
::
class
,
PADSeeder
::
class
]);
}
}
database/seeders/PADSeeder.php
0 → 100644
View file @
fca6f5bf
<?php
namespace
Database\Seeders
;
use
App\Models\PAD
;
use
App\Models\User
;
use
Illuminate\Database\Seeder
;
class
PADSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
$users
=
User
::
where
(
'type'
,
'='
,
User
::
TYPE_TEACHER
)
->
get
();
foreach
(
$users
as
$user
)
{
PAD
::
create
([
'user_id'
=>
$user
->
id
,
]);
}
}
}
resources/views/pad/dimensao/ensino.blade.php
View file @
fca6f5bf
...
...
@@ -56,19 +56,18 @@
<
tr
id
=
'addr0'
data
-
id
=
"0"
class
=
"hidden"
>
<
td
data
-
name
=
"codigoAtividade"
>
<
input
type
=
"text"
name
=
'codigoAtividade0'
placeholder
=
'CÓDIGO ATIVIDADE'
class
=
"form-control"
/>
class
=
"form-control"
/>
</
td
>
<
td
data
-
name
=
"componentecurricular"
>
<
input
type
=
"text"
name
=
'componentecurricular0'
placeholder
=
'COMPONENTE CURRICULAR'
class
=
"form-control"
/>
</
td
>
<
td
data
-
name
=
"selcurso"
>
<
select
class
=
"custom-select mr-sm-2"
id
=
"inlineCursoSelect"
aria
-
label
=
"Default select example"
>
<
select
class
=
"custom-select mr-sm-2"
name
=
"curso_id"
id
=
"curso_id"
aria
-
label
=
"Default select example"
>
<
option
selected
>
Selecionar
Curso
</
option
>
<
option
value
=
"1"
>
Um
</
option
>
<
option
value
=
"
2"
>
Dois
</
option
>
<
option
value
=
"3"
>
Três
</
option
>
@
foreach
(
$cursos
as
$curso
)
<
option
value
=
"
{{
$curso->id
}}"
>
{{
$curso
->
name
}}
</
option
>
@
endforeach
</
select
>
</
td
>
<
td
data
-
name
=
"selnivel"
>
...
...
resources/views/pad/index.blade.php
View file @
fca6f5bf
...
...
@@ -24,25 +24,25 @@
</
div
>
<
div
class
=
"btn-toolbar"
role
=
"toolbar"
aria
-
label
=
"Toolbar with button groups"
>
<
div
class
=
"btn-group mr-2"
role
=
"group"
aria
-
label
=
"First group"
>
<
a
href
=
""
class
=
"btn-pad-dimensao"
>
<
a
href
=
"
{{ route('dimensao_ensino') }}
"
class
=
"btn-pad-dimensao"
>
<
i
class
=
"bi bi-mortarboard-fill"
></
i
>
<
h2
>
ENSINO
</
h2
>
</
a
>
</
div
>
<
div
class
=
"btn-group"
role
=
"group"
aria
-
label
=
"Third group"
>
<
a
href
=
""
class
=
"btn-pad-dimensao"
>
<
a
href
=
"
{{ route('dimensao_pesquisa') }}
"
class
=
"btn-pad-dimensao"
>
<
i
class
=
"bi bi-search"
></
i
>
<
h2
>
PESQUISA
</
h2
>
</
a
>
</
div
>
<
div
class
=
"btn-group mr-2"
role
=
"group"
aria
-
label
=
"Second group"
>
<
a
href
=
""
class
=
"btn-pad-dimensao"
>
<
a
href
=
"
{{ route('dimensao_extensao') }}
"
class
=
"btn-pad-dimensao"
>
<
i
class
=
"bi bi-person-plus-fill"
></
i
>
<
h2
>
EXTENSÃO
</
h2
>
</
a
>
</
div
>
<
div
class
=
"btn-group"
role
=
"group"
aria
-
label
=
"Third group"
>
<
a
href
=
""
class
=
"btn-pad-dimensao"
>
<
a
href
=
"
{{ route('dimensao_gestao') }}
"
class
=
"btn-pad-dimensao"
>
<
i
class
=
"bi bi-people-fill"
></
i
>
<
h2
>
GESTÃO
</
h2
>
</
a
>
...
...
routes/web.php
View file @
fca6f5bf
...
...
@@ -64,7 +64,7 @@ Route::post('/curso/store', [CursoController::class, 'store'])->name('curso_stor
Route
::
get
(
'/listar/unidade'
,
[
UnidadeController
::
class
,
'getAll'
])
->
name
(
'listar_unidades'
);
Route
::
get
(
'/list/campus/{unidade_id}'
,
[
CampusController
::
class
,
'findByUnidade'
])
->
name
(
'list_campus_by_unidade'
);
Route
::
get
(
'/dimensao/gestao'
,
[
GestaoController
::
class
,
'index'
])
->
name
(
'dimensao_gestao'
);
Route
::
get
(
'/dimensao/ensino'
,
[
EnsinoController
::
class
,
'index'
])
->
name
(
'dimensao_ensino'
);
Route
::
get
(
'/dimensao/pesquisa'
,
[
PesquisaController
::
class
,
'index'
])
->
name
(
'dimensao_pesquisa'
);
Route
::
get
(
'/dimensao/extensao'
,
[
ExtensaoController
::
class
,
'index'
])
->
name
(
'dimensao_extensao'
);
Route
::
get
(
'/
pad/
dimensao/gestao'
,
[
GestaoController
::
class
,
'index'
])
->
name
(
'dimensao_gestao'
);
Route
::
get
(
'/
pad/
dimensao/ensino'
,
[
EnsinoController
::
class
,
'index'
])
->
name
(
'dimensao_ensino'
);
Route
::
get
(
'/
pad/
dimensao/pesquisa'
,
[
PesquisaController
::
class
,
'index'
])
->
name
(
'dimensao_pesquisa'
);
Route
::
get
(
'/
pad/
dimensao/extensao'
,
[
ExtensaoController
::
class
,
'index'
])
->
name
(
'dimensao_extensao'
);
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