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
62990eb1
"resources/views/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "91af7454505cab149eb5ffca395209c1b68f984f"
Commit
62990eb1
authored
Mar 25, 2022
by
alissonalbuquerque
Browse files
add tratamento de listagem e delete de pad
parent
6a80f1d5
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/Dimensao/EnsinoController.php
View file @
62990eb1
...
@@ -22,19 +22,19 @@ class EnsinoController extends Controller
...
@@ -22,19 +22,19 @@ class EnsinoController extends Controller
*/
*/
public
function
index
()
{
public
function
index
()
{
$user
=
Auth
::
user
();
$user
=
Auth
::
user
();
$cursos
=
(
new
CursoQuery
())
->
getQuery
()
->
get
();
$cursos
=
(
new
CursoQuery
())
->
getQuery
()
->
get
();
$niveis
=
EnsinoAula
::
listNivel
();
$niveis
=
EnsinoAula
::
listNivel
();
$modalidades
=
EnsinoAula
::
listModalidade
();
$modalidades
=
EnsinoAula
::
listModalidade
();
$ensinoAula
=
EnsinoAula
::
all
();
$ensinoAula
s
=
EnsinoAula
::
all
();
return
view
(
'pad.dimensao.ensino'
,
[
return
view
(
'pad.dimensao.ensino'
,
[
'pad_id'
=>
1
,
'pad_id'
=>
1
,
'cursos'
=>
$cursos
,
'cursos'
=>
$cursos
,
'niveis'
=>
$niveis
,
'niveis'
=>
$niveis
,
'ensinoAulas'
=>
$ensinoAulas
,
'modalidades'
=>
$modalidades
,
'modalidades'
=>
$modalidades
,
'index_menu'
=>
self
::
MENU_PAD
,
'index_menu'
=>
self
::
MENU_PAD
,
'ensinoAula'
=>
$ensinoAula
,
]);
]);
}
}
}
}
app/Http/Controllers/Tabelas/Ensino/EnsinoAulaController.php
View file @
62990eb1
...
@@ -21,7 +21,9 @@ class EnsinoAulaController extends Controller
...
@@ -21,7 +21,9 @@ class EnsinoAulaController extends Controller
return
redirect
()
->
route
(
'dimensao_ensino'
);
return
redirect
()
->
route
(
'dimensao_ensino'
);
}
}
public
function
store
(){
public
function
delete
(
$id
){
$model
=
EnsinoAula
::
find
(
$id
);
$model
->
delete
();
return
redirect
()
->
route
(
'dimensao_ensino'
);
}
}
}
}
app/Models/Tabelas/Ensino/EnsinoAula.php
View file @
62990eb1
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
namespace
App\Models\Tabelas\Ensino
;
namespace
App\Models\Tabelas\Ensino
;
use
App\Models\Curso
;
use
App\Models\Disciplina
;
use
App\Queries\PlanejamentoQuery
;
use
App\Queries\PlanejamentoQuery
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
...
@@ -101,6 +103,26 @@ class EnsinoAula extends Model
...
@@ -101,6 +103,26 @@ class EnsinoAula extends Model
return
$this
->
belongsTo
(
Curso
::
class
);
return
$this
->
belongsTo
(
Curso
::
class
);
}
}
// /**
// * Get Disciplina with diciplina.id = ensino_aulas.displina_id
// *
// * @return Disciplina
// */
// public function disciplina()
// {
// return $this->belongsTo(Disciplina::class);
// }
/**
* Get Disciplina with diciplina.id = ensino_aulas.displina_id
*
* @return Disciplina
*/
public
function
disciplina
()
{
return
$this
->
belongsTo
(
Disciplina
::
class
,
'componente_curricular'
);
}
/**
/**
* @return array
* @return array
*/
*/
...
...
resources/views/pad/dimensao/ensino.blade.php
View file @
62990eb1
...
@@ -52,40 +52,33 @@
...
@@ -52,40 +52,33 @@
</
tr
>
</
tr
>
</
thead
>
</
thead
>
<
tbody
>
<
tbody
>
@
foreach
(
$ensinoAula
as
$ensino
)
@
foreach
(
$ensinoAula
s
as
$ensino
Aula
)
<
tr
>
<
tr
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
cod_atividade
}}
{{
$ensinoAula
->
cod_atividade
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
componente_curricular
}}
{{
$ensinoAula
->
disciplina
->
name
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
nivel
}}
{{
$ensinoAula
->
curso
->
name
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
modalidade
}}
{{
$ensinoAula
::
listNivel
(
$ensinoAula
->
nivel
)
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
ch_semanal
}}
{{
$ensinoAula
::
listModalidade
(
$ensinoAula
->
modalidade
)
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
ch_total
}}
{{
$ensinoAula
->
ch_semanal
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
td
class
=
"text-center"
>
{{
$ensino
->
pad_id
}}
{{
$ensinoAula
->
ch_total
}}
</
th
>
</
td
>
<
th
class
=
"text-center"
>
<
button
name
=
"del0"
class
=
'btn btn-danger glyphicon glyphicon-remove row-remove'
>
<
td
class
=
"text-center"
>
<
span
aria
-
hidden
=
"true"
>
@
include
(
'components.buttons.btn-delete'
,
[
'route'
=>
route
(
'ensino_aula_delete'
,
[
'id'
=>
$ensinoAula
->
id
])]);
<
svg
xmlns
=
"http://www.w3.org/2000/svg"
width
=
"16"
height
=
"16"
</
td
>
fill
=
"currentColor"
class
=
"bi bi-trash-fill"
viewBox
=
"0 0 16 16"
>
<
path
d
=
"M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 1 0z"
/>
</
svg
>
</
span
>
</
button
>
</
th
>
</
tr
>
</
tr
>
@
endforeach
@
endforeach
</
tbody
>
</
tbody
>
...
...
routes/web.php
View file @
62990eb1
...
@@ -73,6 +73,7 @@ Route::get('/pad/dimensao/pesquisa', [PesquisaController::class, 'index'])->name
...
@@ -73,6 +73,7 @@ Route::get('/pad/dimensao/pesquisa', [PesquisaController::class, 'index'])->name
Route
::
get
(
'/pad/dimensao/extensao'
,
[
ExtensaoController
::
class
,
'index'
])
->
name
(
'dimensao_extensao'
);
Route
::
get
(
'/pad/dimensao/extensao'
,
[
ExtensaoController
::
class
,
'index'
])
->
name
(
'dimensao_extensao'
);
Route
::
post
(
'/pad/dimensao/ensino/aula/create'
,
[
EnsinoAulaController
::
class
,
'create'
])
->
name
(
'ensino_aula_create'
);
Route
::
post
(
'/pad/dimensao/ensino/aula/create'
,
[
EnsinoAulaController
::
class
,
'create'
])
->
name
(
'ensino_aula_create'
);
Route
::
delete
(
'/pad/dimensao/ensino/aula/delete/{id}'
,
[
EnsinoAulaController
::
class
,
'delete'
])
->
name
(
'ensino_aula_delete'
);
/** json */
/** json */
Route
::
get
(
'/disciplina/{curso_id}'
,
[
DisciplinaController
::
class
,
'getDisciplinaByCurso'
])
->
name
(
'get_disciplina_by_curso'
);
Route
::
get
(
'/disciplina/{curso_id}'
,
[
DisciplinaController
::
class
,
'getDisciplinaByCurso'
])
->
name
(
'get_disciplina_by_curso'
);
\ No newline at end of file
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