Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
7f6044f3
Commit
7f6044f3
authored
2 years ago
by
Abraão Barbosa
Browse files
Options
Download
Email Patches
Plain Diff
add controller, seed and model from Avaliação and Avaliador
parent
23b24ea2
main
anexoB
avaliacao_de_tarefas
dev-gabriel-avaliador
dev-joao-pdf_generator
dump
feat_task_time
feat_template_calendar
fix_calendar_loading
fix_user_pad
text_fix
No related merge requests found
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
app/Http/Controllers/AvaliadorController.php
+226
-0
app/Http/Controllers/AvaliadorController.php
app/Http/Controllers/PadController.php
+1
-1
app/Http/Controllers/PadController.php
app/Models/Avaliacao.php
+24
-0
app/Models/Avaliacao.php
app/Models/AvaliadorPad.php
+28
-0
app/Models/AvaliadorPad.php
app/Models/UserPad.php
+0
-1
app/Models/UserPad.php
app/Models/Util/PadTables.php
+5
-0
app/Models/Util/PadTables.php
app/Queries/AvaliadorPadQuery.php
+43
-0
app/Queries/AvaliadorPadQuery.php
database/migrations/2022_07_15_003939_create_evaluator_pad_table.php
+35
-0
...grations/2022_07_15_003939_create_evaluator_pad_table.php
database/migrations/2022_07_17_193918_create_avaliacao_table.php
+37
-0
...e/migrations/2022_07_17_193918_create_avaliacao_table.php
database/seeders/AvaliacaoSeeder.php
+18
-0
database/seeders/AvaliacaoSeeder.php
database/seeders/CampusSeeder.php
+0
-1
database/seeders/CampusSeeder.php
database/seeders/DatabaseSeeder.php
+2
-0
database/seeders/DatabaseSeeder.php
database/seeders/EvaluatorSeeder.php
+26
-0
database/seeders/EvaluatorSeeder.php
database/seeders/PadSeeder.php
+16
-0
database/seeders/PadSeeder.php
resources/views/layouts/user-navigation/navigation_coordinator.blade.php
+1
-1
.../layouts/user-navigation/navigation_coordinator.blade.php
resources/views/pad/avaliacao/create.blade.php
+58
-0
resources/views/pad/avaliacao/create.blade.php
resources/views/pad/avaliacao/index.blade.php
+56
-0
resources/views/pad/avaliacao/index.blade.php
resources/views/pad/avaliacao/update.blade.php
+57
-0
resources/views/pad/avaliacao/update.blade.php
routes/web.php
+10
-0
routes/web.php
with
643 additions
and
4 deletions
+643
-4
app/Http/Controllers/AvaliadorController.php
0 → 100644
View file @
7f6044f3
<?php
namespace
App\Http\Controllers
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
App\Models\PAD
;
use
App\Models\Tabelas\Constants
;
use
App\Models\User
;
use
App\Models\UserPad
;
use
App\Models\Util\MenuItemsAdmin
;
use
App\Models\AvaliadorPad
;
use
Exception
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Validation\Rule
;
class
AvaliadorController
extends
Controller
{
/**
* Show last PAD.
*
* @return \Illuminate\View\View
*/
public
function
index
()
{
AvaliadorPad
return
view
(
'pad.avaliacao.index'
,
[
'index_menu'
=>
2
]);
if
(
Auth
::
user
()
->
isTypeAdmin
())
{
$pads
=
Pad
::
all
();
$index_menu
=
MenuItemsAdmin
::
PADS
;
return
view
(
'pad.admin.index'
,
[
'index_menu'
=>
$index_menu
,
'pads'
=>
$pads
]);
}
if
(
Auth
::
user
()
->
isTypeTeacher
())
{
$index_menu
=
1
;
$userPads
=
UserPad
::
find
()
->
whereUser
(
Auth
::
user
()
->
id
)
->
get
();
return
view
(
'pad.avaliacao.index'
,
[
'index_menu'
=>
$index_menu
,
'userPads'
=>
$userPads
]);
}
}
/**
* @param integer $id
* @return \Illuminate\Http\Response
*/
public
function
view
(
$id
)
{
$index_menu
=
1
;
return
view
(
'pad.teacher.view'
,
[
'id'
=>
$id
,
'index_menu'
=>
$index_menu
]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public
function
create
()
{
$status
=
[
Constants
::
STATUS_ATIVO
=>
Constants
::
listStatus
(
Constants
::
STATUS_ATIVO
)
];
return
view
(
'pad.admin.create'
,
[
'status'
=>
$status
]);
}
/**
* Store a newly created resource in storage.
* @param \Illuminate\Http\Request $request
*/
public
function
store
(
Request
$request
)
{
$validated
=
$request
->
validate
([
'nome'
=>
[
'required'
,
'string'
,
'min:6'
,
'max:255'
],
'status'
=>
[
'required'
,
'integer'
],
'data_inicio'
=>
[
'required'
,
'date'
,
'before_or_equal:data_fim'
],
'data_fim'
=>
[
'required'
,
'date'
,
'after_or_equal:data_inicio'
],
],
[
'required'
=>
'O campo de :attribute é obrigatório'
,
'nome.min'
=>
'O campo de :attribute deve ter no mínimo 6 letras'
,
'nome.max'
=>
'O campo de :attribute deve ter no máximo 255 letras'
,
'data_inicio.before_or_equal'
=>
'A :attribute deve ser uma data anterior ou igual a data de fim'
,
'data_fim.after_or_equal'
=>
'A :attribute deve ser uma data posterior ou igual a data de início'
,
]);
if
(
$validated
)
{
$model
=
new
Pad
(
$request
->
all
());
if
(
$model
->
save
())
{
$users
=
User
::
find
()
->
whereType
(
User
::
TYPE_TEACHER
)
->
get
();
foreach
(
$users
as
$user
)
{
$modelUserPad
=
new
UserPad
();
$modelUserPad
->
user_id
=
$user
->
id
;
$modelUserPad
->
pad_id
=
$model
->
id
;
$modelUserPad
->
save
();
}
return
redirect
()
->
route
(
'pad_index'
)
->
with
(
'success'
,
'PAD cadastrado com sucesso!'
);
}
else
{
return
redirect
()
->
route
(
'pad_index'
)
->
with
(
'success'
,
'Erro ao cadastrar o PAD!'
);
}
}
}
public
function
anexo
()
{
return
view
(
'pad.anexo'
,
[
'index_menu'
=>
1
]);
}
// /**
// * Store a newly created resource in storage.
// *
// * @param \Illuminate\Http\Request $request
// * @return \Illuminate\Http\Response
// */
// public function store(Request $request)
// {
// $rules = [
// 'first_name' => 'required|string|min:3|max:255',
// 'city_name' => 'required|string|min:3|max:255',
// 'email' => 'required|string|email|max:255'
// ];
// $validator = Validator::make($request->all(),$rules);
// if ($validator->fails()) {
// return redirect('insert')
// ->withInput()
// ->withErrors($validator);
// }
// else{
// $data = $request->input();
// try{
// $student = new StudInsert;
// $student->first_name = $data['first_name'];
// $student->last_name = $data['last_name'];
// $student->city_name = $data['city_name'];
// $student->email = $data['email'];
// $student->save();
// return redirect('insert')->with('status',"Insert successfully");
// }
// catch(Exception $e){
// return redirect('insert')->with('failed',"operation failed");
// }
// }
// return redirect('/dashboard');
// }
/**
* Show the form for editing the specified resource.
*
* @param integer $id
* @return \Illuminate\Http\Response
*/
public
function
edit
(
$id
)
{
$pad
=
PAD
::
find
(
$id
);
$status
=
Constants
::
listStatus
();
return
view
(
'pad.admin.edit'
,
[
'pad'
=>
$pad
,
'status'
=>
$status
]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param integer $id
* @return \Illuminate\Http\Response
*/
public
function
update
(
Request
$request
,
$id
)
{
$validated
=
$request
->
validate
([
'nome'
=>
[
'required'
,
'string'
,
'min:6'
,
'max:255'
],
'status'
=>
[
'required'
,
'integer'
],
'data_inicio'
=>
[
'required'
,
'date'
,
'before_or_equal:data_fim'
],
'data_fim'
=>
[
'required'
,
'date'
,
'after_or_equal:data_inicio'
],
],
[
'required'
=>
'O campo de :attribute é obrigatório'
,
'nome.min'
=>
'O campo de :attribute deve ter no mínimo 6 letras'
,
'nome.max'
=>
'O campo de :attribute deve ter no máximo 255 letras'
,
'data_inicio.before_or_equal'
=>
'A :attribute deve ser uma data anterior ou igual a data de fim'
,
'data_fim.after_or_equal'
=>
'A :attribute deve ser uma data posterior ou igual a data de início'
,
]);
if
(
$validated
)
{
$model
=
Pad
::
find
(
$id
);
$model
->
fill
(
$request
->
all
());
if
(
$model
->
save
())
{
return
redirect
()
->
route
(
'pad_index'
)
->
with
(
'success'
,
'PAD atualizado com sucesso!'
);
}
else
{
return
redirect
()
->
route
(
'pad_index'
)
->
with
(
'success'
,
'Erro ao atualizar o PAD!'
);
}
}
}
public
function
delete
(
$id
)
{
$model
=
Pad
::
find
(
$id
);
if
(
$model
->
delete
())
{
return
redirect
()
->
route
(
'pad_index'
)
->
with
(
'success'
,
'PAD removido com sucesso!'
);
}
else
{
return
redirect
()
->
route
(
'pad_index'
)
->
with
(
'fail'
,
'Não foi possível remover o PAD!'
);
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
$id
)
{
$model
=
PAD
::
find
(
$id
);
$model
->
delete
();
return
redirect
(
'/pad/index'
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/Http/Controllers/PadController.php
View file @
7f6044f3
...
...
@@ -84,7 +84,7 @@ class PadController extends Controller
if
(
$validated
)
{
$model
=
new
Pad
(
$request
->
all
());
if
(
$model
->
save
())
{
$users
=
User
::
find
()
->
whereType
(
User
::
TYPE_TEACHER
)
->
get
();
...
...
This diff is collapsed.
Click to expand it.
app/Models/Avaliacao.php
0 → 100644
View file @
7f6044f3
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
class
Avaliacao
extends
Model
{
use
HasFactory
;
protected
$table
=
'avaliador_pad'
;
protected
$fillable
=
[
'id'
,
'ch_semanal'
,
'status'
,
'descricao'
,
'tarefa_id'
,
'avaliador_id'
];
public
function
tarefa
()
{
//return $this->belongsTo(PAD::class);
}
public
function
avaliadorPad
()
{
return
$this
->
belongsTo
(
AvaliadorPad
::
class
);
}
}
This diff is collapsed.
Click to expand it.
app/Models/AvaliadorPad.php
0 → 100644
View file @
7f6044f3
<?php
namespace
App\Models
;
use
App\Queries\UserPadQuery
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
class
AvaliadorPad
extends
Model
{
use
HasFactory
;
protected
$table
=
'avaliador_pad'
;
protected
$fillable
=
[
'id'
,
'dimensao'
,
'user_id'
,
'pad_id'
];
public
function
Avaliador
()
{
return
$this
->
belongsTo
(
User
::
class
);
}
public
function
pad
()
{
return
$this
->
belongsTo
(
PAD
::
class
);
}
public
static
function
find
()
{
return
new
UserPadQuery
(
get_called_class
());
}
}
This diff is collapsed.
Click to expand it.
app/Models/UserPad.php
View file @
7f6044f3
...
...
@@ -25,5 +25,4 @@ class UserPad extends Model
public
static
function
find
()
{
return
new
UserPadQuery
(
get_called_class
());
}
}
This diff is collapsed.
Click to expand it.
app/Models/Util/PadTables.php
View file @
7f6044f3
...
...
@@ -4,6 +4,11 @@ namespace App\Models\Util;
class
PadTables
{
const
TYPE_ENSINO
=
0
;
const
TYPE_EXTENSAO
=
1
;
const
TYPE_PESQUISA
=
2
;
const
TYPE_GESTAO
=
3
;
public
static
function
tablesEnsino
()
{
return
[
[
'id'
=>
'ensino_aulas'
,
'name'
=>
'ENSINO (AULAS EM COMPONENTES CURRICULARES)'
],
...
...
This diff is collapsed.
Click to expand it.
app/Queries/AvaliadorPadQuery.php
0 → 100644
View file @
7f6044f3
<?php
namespace
App\Queries
;
use
App\Models\AvaliadorPad
;
class
AvaliadorPadQuery
{
private
$query
;
public
function
__construct
()
{
$this
->
query
=
AvaliadorPad
::
where
([]);
}
/**
* @param integer $id
* @return AvaliadorPadQuery|Builder
*/
public
function
whereId
(
$id
,
$expression
=
'='
)
{
$this
->
query
=
$this
->
query
->
where
(
'id'
,
$expression
,
$id
);
return
$this
->
query
;
}
/**
* @param integer $user_id
* @return AvaliadorPadQuery|Builder
*/
public
function
whereUser
(
$user_id
,
$expression
=
'='
)
{
$this
->
query
=
$this
->
query
->
where
(
'user_id'
,
$expression
,
$user_id
);
return
$this
->
query
;
}
/**
* @return Builder
*/
public
function
getQuery
()
{
return
$this
->
query
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
database/migrations/2022_07_15_003939_create_evaluator_pad_table.php
0 → 100644
View file @
7f6044f3
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateEvaluatorPadTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'avaliador_pad'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
tinyInteger
(
'dimensao'
)
->
notNull
();
$table
->
foreignId
(
'user_id'
)
->
notNull
();
$table
->
foreignId
(
'pad_id'
)
->
notNull
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'avaliador_pad'
);
}
}
This diff is collapsed.
Click to expand it.
database/migrations/2022_07_17_193918_create_avaliacao_table.php
0 → 100644
View file @
7f6044f3
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateAvaliacaoTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'avaliacao'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
integer
(
'ch_semanal'
)
->
notNull
();
$table
->
integer
(
'status'
)
->
notNull
();
$table
->
string
(
'descricao'
)
->
notNull
();
$table
->
integer
(
'tarefa_id'
)
->
notNull
();
$table
->
foreignId
(
'avaliador_id'
)
->
notNull
();
$table
->
timestamps
();
$table
->
softDeletes
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'avaliacao'
);
}
}
This diff is collapsed.
Click to expand it.
database/seeders/AvaliacaoSeeder.php
0 → 100644
View file @
7f6044f3
<?php
namespace
Database\Seeders
;
use
Illuminate\Database\Seeder
;
class
AvaliacaoSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
//
}
}
This diff is collapsed.
Click to expand it.
database/seeders/CampusSeeder.php
View file @
7f6044f3
...
...
@@ -29,6 +29,5 @@ class CampusSeeder extends Seeder
]);
}
}
}
}
This diff is collapsed.
Click to expand it.
database/seeders/DatabaseSeeder.php
View file @
7f6044f3
...
...
@@ -23,6 +23,8 @@ class DatabaseSeeder extends Seeder
PlanejamentoSeeder
::
class
,
PadSeeder
::
class
,
DisciplinaSeeder
::
class
,
EvaluatorSeeder
::
class
,
]);
}
}
This diff is collapsed.
Click to expand it.
database/seeders/EvaluatorSeeder.php
0 → 100644
View file @
7f6044f3
<?php
namespace
Database\Seeders
;
use
Illuminate\Database\Seeder
;
use
App\Models\AvaliadorPad
;
use
App\Models\Util\PadTables
;
class
EvaluatorSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
AvaliadorPad
::
create
([
'id'
=>
1
,
'dimensao'
=>
PadTables
::
TYPE_ENSINO
,
'user_id'
=>
8
,
'pad_id'
=>
1
]
);
}
}
This diff is collapsed.
Click to expand it.
database/seeders/PadSeeder.php
View file @
7f6044f3
...
...
@@ -4,6 +4,7 @@ namespace Database\Seeders;
use
App\Models\PAD
;
use
App\Models\User
;
use
Illuminate\Database\Seeder
;
class
PadSeeder
extends
Seeder
...
...
@@ -15,5 +16,20 @@ class PadSeeder extends Seeder
*/
public
function
run
()
{
PAD
::
create
([
'id'
=>
1
,
'nome'
=>
"2022.1"
,
'data_inicio'
=>
"2022-02-01"
,
'data_fim'
=>
"2022-06-01"
,
'status'
=>
0
]);
PAD
::
create
([
'id'
=>
2
,
'nome'
=>
"2022.2"
,
'data_inicio'
=>
"2022-07-01"
,
'data_fim'
=>
"2022-12-01"
,
'status'
=>
1
]);
}
}
This diff is collapsed.
Click to expand it.
resources/views/layouts/user-navigation/navigation_coordinator.blade.php
View file @
7f6044f3
...
...
@@ -15,7 +15,7 @@
</li>
<li
class=
"nav-item"
>
<a
class=
"custom-nav-link {{ ((!empty($index_menu) ? $index_menu : 0) == 1? "
active
"
:
"")
}}"
id=
"pad-tab"
href=
"{{ route('
pad
_index') }}"
<a
class=
"custom-nav-link {{ ((!empty($index_menu) ? $index_menu : 0) == 1? "
active
"
:
"")
}}"
id=
"pad-tab"
href=
"{{ route('
avaliador
_index') }}"
aria-controls=
"pad"
aria-selected=
"false"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
fill=
"currentColor"
class=
"bi bi-book-half"
viewBox=
"0 0 16 16"
>
...
...
This diff is collapsed.
Click to expand it.
resources/views/pad/avaliacao/create.blade.php
0 → 100644
View file @
7f6044f3
@
extends
(
'layouts.main'
)
@
section
(
'title'
,
'Campus'
)
@
section
(
'header'
)
@
include
(
'layouts.header'
,
[
'user'
=>
Auth
::
user
(),
])
@
endsection
@
section
(
'nav'
)
@
include
(
'layouts.navigation'
,
[
'index_menu'
=>
$index_menu
,
])
@
endsection
@
section
(
'body'
)
<
div
class
=
"content mx-auto"
>
<
h1
class
=
"titulo pt-4 pb-4 mb-3 border-bottom"
>
CADASTRO
CAMPUS
</
h1
>
<
p
class
=
"pb-4 mb-3 text-center text-muted align-items-center"
>
Insira
os
dados
correspondentes
nos
campos
exibidos
abaixo
</
p
>
<!--
Formulario
-->
<
form
action
=
"{{ route('campus_store') }}"
method
=
"post"
>
@
csrf
@
method
(
'POST'
)
<
div
class
=
"form-group"
>
<
label
for
=
"inputNameCampus"
>
Nome
do
Campus
</
label
>
<
input
type
=
"text"
name
=
"name"
class
=
"form-control"
id
=
"inputNameCampus"
placeholder
=
"Insira o nome do Campus"
value
=
"{{ old('name') }}"
>
@
error
(
'name'
)
<
span
class
=
"text-danger"
>
{{
$message
}}
</
span
>
@
enderror
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"selectCampus"
>
Campus
</
label
>
<
select
class
=
"custom-select"
name
=
"unidade_id"
id
=
"unidade_id"
>
<
option
value
=
""
disabled
selected
hidden
>
selecione
...
</
option
>
@
foreach
(
$unidades
as
$unidade
)
<
option
value
=
"{{
$unidade->id
}}"
{{
old
(
'unidade_id'
)
==
$unidade
->
id
?
'selected'
:
''
}}
>
{{
$unidade
->
name
}}
</
option
>
@
endforeach
</
select
>
@
error
(
'unidade_id'
)
<
span
class
=
"text-danger"
>
{{
$message
}}
</
span
>
@
enderror
</
div
>
<
div
class
=
"d-flex justify-content-between"
>
@
include
(
'components.buttons.btn-cancel'
,
[
'route'
=>
route
(
'campus_index'
),
])
@
include
(
'components.buttons.btn-save'
,
[
'content'
=>
'Cadastrar'
,
'btn_class'
=>
'btn btn-outline-success'
,
'i_class'
=>
''
,
])
</
div
>
</
form
>
</
div
>
@
endsection
\ No newline at end of file
This diff is collapsed.
Click to expand it.
resources/views/pad/avaliacao/index.blade.php
0 → 100644
View file @
7f6044f3
@
extends
(
'layouts.main'
)
@
section
(
'title'
,
'Campus'
)
@
section
(
'header'
)
@
include
(
'layouts.header'
,
[
'user'
=>
Auth
::
user
(),
])
@
endsection
@
section
(
'nav'
)
@
include
(
'layouts.navigation'
,
[
'index_menu'
=>
$index_menu
,
])
@
endsection
@
section
(
'body'
)
@
include
(
'components.alerts'
)
<
div
class
=
"d-flex justify-content-between align-items-center border-bottom"
>
<
h2
class
=
""
>
PADs
</
h2
>
@
include
(
'components.buttons.btn-create'
,
[
'route'
=>
route
(
'campus_create'
),
'class'
=>
''
,
'content'
=>
'Novo Campus'
,
'id'
=>
''
,
])
</
div
>
<!--
Tabela
-->
<
div
class
=
"table-responsive mt-5"
>
<
table
class
=
"table table-hover table-striped"
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Unidade
</
th
>
<
th
scope
=
"col"
>
Ações
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{{
--
@
foreach
(
$campus
as
$camp
)
<
tr
>
<
td
>
{{
$camp
->
name
}}
</
td
>
<
td
>
{{
$camp
->
unidade
}}
</
td
>
<
td
>
@
include
(
'components.buttons.btn-edit'
,
[
'btn_class'
=>
'btn btn-warning'
,
'route'
=>
route
(
'campus_edit'
,
[
'id'
=>
$camp
->
id
]),
])
@
include
(
'components.buttons.btn-soft-delete'
,
[
'modal_id'
=>
$camp
->
id
,
'route'
=>
route
(
'campus_delete'
,
[
'id'
=>
$camp
->
id
])
])
</
td
>
</
tr
>
@
endforeach
--
}}
</
tbody
>
</
table
>
</
div
>
@
endsection
This diff is collapsed.
Click to expand it.
resources/views/pad/avaliacao/update.blade.php
0 → 100644
View file @
7f6044f3
@
extends
(
'layouts.main'
)
@
section
(
'title'
,
'Campus'
)
@
section
(
'header'
)
@
include
(
'layouts.header'
,
[
'user'
=>
Auth
::
user
(),
])
@
endsection
@
section
(
'nav'
)
@
include
(
'layouts.navigation'
,
[
'index_menu'
=>
$index_menu
,
])
@
endsection
@
section
(
'body'
)
<
div
class
=
"content mx-auto"
>
<
h1
class
=
"titulo pt-4 pb-4 mb-3 border-bottom"
>
Atualizar
CAMPUS
</
h1
>
<
p
class
=
"pb-4 mb-3 text-center text-muted align-items-center"
>
Insira
os
dados
correspondentes
nos
campos
exibidos
abaixo
</
p
>
<!--
Formulario
-->
<
form
action
=
"{{ route('campus_update',
$campus->id
) }}"
method
=
"post"
>
@
csrf
@
method
(
'POST'
)
<
div
class
=
"form-group"
>
<
label
for
=
"inputNameCampus"
>
Nome
do
Campus
</
label
>
<
input
type
=
"text"
name
=
"name"
class
=
"form-control"
id
=
"inputNameCampus"
placeholder
=
"Insira o nome do Campus"
value
=
"{{
$campus->name
}}{{ old('name') }}"
>
@
error
(
'name'
)
<
span
class
=
"text-danger"
>
{{
$message
}}
</
span
>
@
enderror
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"selectCampus"
>
Campus
</
label
>
<
select
class
=
"custom-select"
name
=
"unidade_id"
id
=
"unidade_id"
>
<
option
value
=
""
disabled
selected
hidden
>
selecione
...
</
option
>
@
foreach
(
$unidades
as
$unidade
)
<
option
value
=
"{{
$unidade->id
}}"
{{
$campus
->
unidade
->
id
==
$unidade
->
id
?
'selected'
:
''
}}
>
{{
$unidade
->
name
}}
</
option
>
@
endforeach
</
select
>
@
error
(
'unidade_id'
)
<
span
class
=
"text-danger"
>
{{
$message
}}
</
span
>
@
enderror
</
div
>
<
div
class
=
"d-flex justify-content-between"
>
@
include
(
'components.buttons.btn-cancel'
,
[
'route'
=>
route
(
'campus_index'
),
])
@
include
(
'components.buttons.btn-save'
,
[
'content'
=>
'Atualizar'
,
'btn_class'
=>
'btn btn-outline-success'
,
'i_class'
=>
''
,
])
</
div
>
</
form
>
</
div
>
@
endsection
\ No newline at end of file
This diff is collapsed.
Click to expand it.
routes/web.php
View file @
7f6044f3
...
...
@@ -15,6 +15,7 @@ use App\Http\Controllers\UserController;
use
App\Http\Controllers\CoordenadorController
;
use
App\Http\Controllers\ProfessorController
;
use
App\Http\Controllers\DiretorController
;
use
App\Http\Controllers\AvaliadorController
;
use
App\Models\Disciplina
;
use
Illuminate\Support\Facades\Route
;
...
...
@@ -122,6 +123,15 @@ Route::prefix('/professor')->group(function () {
Route
::
delete
(
'/delete/{id}'
,
[
ProfessorController
::
class
,
'destroy'
])
->
name
(
'professor_delete'
);
});
Route
::
prefix
(
'/avaliador'
)
->
group
(
function
()
{
Route
::
get
(
'/index'
,
[
AvaliadorController
::
class
,
'index'
])
->
name
(
'avaliador_index'
);
Route
::
get
(
'/create'
,
[
AvaliadorController
::
class
,
'create'
])
->
name
(
'avaliador_create'
);
Route
::
post
(
'/store'
,
[
AvaliadorController
::
class
,
'store'
])
->
name
(
'avaliador_store'
);
Route
::
get
(
'/edit/{id}'
,
[
AvaliadorController
::
class
,
'edit'
])
->
name
(
'avaliador_edit'
);
Route
::
post
(
'/update/{id}'
,
[
AvaliadorController
::
class
,
'update'
])
->
name
(
'avaliador_update'
);
Route
::
delete
(
'/delete/{id}'
,
[
AvaliadorController
::
class
,
'destroy'
])
->
name
(
'avaliador_delete'
);
});
// return json
Route
::
get
(
'/listar/unidade'
,
[
UnidadeController
::
class
,
'getAll'
])
->
name
(
'listar_unidades'
);
Route
::
get
(
'/list/campus/{unidade_id}'
,
[
CampusController
::
class
,
'findByUnidade'
])
->
name
(
'list_campus_by_unidade'
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help