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
af8d2093
Commit
af8d2093
authored
Jun 16, 2023
by
PedroLopesUPE
Browse files
Modificações do UserPadController
parent
15b69545
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/UserPadController.php
View file @
af8d2093
...
@@ -3,12 +3,14 @@
...
@@ -3,12 +3,14 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Models\Pad
;
use
App\Models\Pad
;
use
App\Models\Curso
;
use
App\Models\User
;
use
App\Models\User
;
use
App\Models\UserPad
;
use
App\Models\UserPad
;
use
App\Models\Util\Status
;
use
App\Models\Util\Status
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Response
;
use
Illuminate\Support\Facades\Response
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Support\Facades\Validator
;
use
PDF
;
class
UserPadController
extends
Controller
class
UserPadController
extends
Controller
{
{
...
@@ -76,4 +78,15 @@ class UserPadController extends Controller
...
@@ -76,4 +78,15 @@ class UserPadController extends Controller
return
Response
::
json
([
'errors'
=>
$validator
->
errors
(),
'status'
=>
400
]);
return
Response
::
json
([
'errors'
=>
$validator
->
errors
(),
'status'
=>
400
]);
}
}
public
function
generatePDF
(
$user_pad_id
)
{
$model
=
UserPad
::
whereId
(
$user_pad_id
)
->
first
();
dd
(
$model
->
ensinoAulas
,
$model
,
empty
(
$model
));
// return view('pad.teacher.report_pdf', ['cursos' => $data]);
dd
(
$user_pad_id
);
view
()
->
share
(
$user_pad_id
);
$pdf
=
PDF
::
loadView
(
''
,
compact
(
'pad'
));
return
$pdf
->
download
(
"Relatório PAD (
{
toDateTimeString({{now()->format('d-m-Y')}})
}
)"
);
}
}
}
app/Models/UserPad.php
View file @
af8d2093
...
@@ -110,4 +110,11 @@ class UserPad extends Model
...
@@ -110,4 +110,11 @@ class UserPad extends Model
return
$totalHoras
;
return
$totalHoras
;
}
}
/*
* @RELATIONS (relações entre tarefas)
*/
public
function
ensinoAulas
()
{
return
$this
->
hasMany
(
EnsinoAula
::
class
,
'user_pad_id'
,
'id'
);
}
}
}
resources/views/pad/teacher/report_pdf.blade.php
0 → 100644
View file @
af8d2093
@
extends
(
'layouts.main'
)
<
body
>
<
header
style
=
"display: flex; direction: rtl"
>
</
header
>
<
div
style
=
"display: flex; flex-direction: column; align-items: center;"
>
<
div
>
<
h3
style
=
"font-size: 30px;"
>
Cursos
</
h3
>
</
div
>
<
div
>
<
table
style
=
"border-radius: 10px; background-color: #F2F2F2;
min-width: 600px; box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25); min-height: 50px; "
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Campus
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$cursos
as
$curso
)
<
tr
>
<
td
style
=
"border-top: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
name
}}
</
td
>
<
td
style
=
"border-top: 1px solid #000; border-left: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
campus
}}
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
<
div
>
<
h3
style
=
"font-size: 30px;"
>
Cursos
</
h3
>
</
div
>
<
div
>
<
table
style
=
"border-radius: 10px; background-color: #F2F2F2;
min-width: 600px; box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25); min-height: 50px; "
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Campus
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$cursos
as
$curso
)
<
tr
>
<
td
style
=
"border-top: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
name
}}
</
td
>
<
td
style
=
"border-top: 1px solid #000; border-left: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
campus
}}
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
<
div
>
<
h3
style
=
"font-size: 30px;"
>
Cursos
</
h3
>
</
div
>
<
div
>
<
table
style
=
"border-radius: 10px; background-color: #F2F2F2;
min-width: 600px; box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25); min-height: 50px; "
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Campus
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$cursos
as
$curso
)
<
tr
>
<
td
style
=
"border-top: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
name
}}
</
td
>
<
td
style
=
"border-top: 1px solid #000; border-left: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
campus
}}
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
<
div
>
<
h3
style
=
"font-size: 30px;"
>
Cursos
</
h3
>
</
div
>
<
div
>
<
table
style
=
"border-radius: 10px; background-color: #F2F2F2;
min-width: 600px; box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.25); min-height: 50px; "
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Campus
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$cursos
as
$curso
)
<
tr
>
<
td
style
=
"border-top: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
name
}}
</
td
>
<
td
style
=
"border-top: 1px solid #000; border-left: 1px solid #000; border-bottom: 1px solid #000; vertical-align: middle"
>
{{
$curso
->
campus
}}
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
</
div
>
<
footer
style
=
"padding-top: 0.75rem; margin-top: 0.75rem; text-align: center; border-top: 1px"
>
Copyright
&
copy
;
2022.
Universidade
de
Pernambuco
-
Todos
os
direitos
reservados
</
footer
>
</
body
>
resources/views/pad/teacher/view.blade.php
View file @
af8d2093
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<
div
class
=
"text-center"
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$ensinoTotalHoras
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$ensinoTotalHoras
}}
</
span
>
</
h4
>
</
div
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('dimensao_ensino', ['user_pad_id' =>
$user_pad_id
]) }}"
class
=
"btn-pad-dimensao"
></
a
>
<
a
class
=
"stretched-link
btn-pad-dimensao
"
href
=
"{{ route('dimensao_ensino', ['user_pad_id' =>
$user_pad_id
]) }}"
></
a
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
<
div
class
=
"text-center"
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$pesquisaTotalHoras
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$pesquisaTotalHoras
}}
</
span
>
</
h4
>
</
div
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('dimensao_pesquisa', ['user_pad_id' =>
$user_pad_id
]) }}"
class
=
"btn-pad-dimensao"
></
a
>
<
a
class
=
"stretched-link
btn-pad-dimensao
"
href
=
"{{ route('dimensao_pesquisa', ['user_pad_id' =>
$user_pad_id
]) }}"
></
a
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
<
div
class
=
"text-center"
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$extensaoTotalHoras
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$extensaoTotalHoras
}}
</
span
>
</
h4
>
</
div
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('dimensao_extensao', ['user_pad_id' =>
$user_pad_id
]) }}"
class
=
"btn-pad-dimensao"
></
a
>
<
a
class
=
"stretched-link
btn-pad-dimensao
"
href
=
"{{ route('dimensao_extensao', ['user_pad_id' =>
$user_pad_id
]) }}"
></
a
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
<
div
class
=
"text-center"
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$gestaoTotalHoras
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$gestaoTotalHoras
}}
</
span
>
</
h4
>
</
div
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('dimensao_gestao', ['user_pad_id' =>
$user_pad_id
]) }}"
class
=
"btn-pad-dimensao"
></
a
>
<
a
class
=
"stretched-link
btn-pad-dimensao
"
href
=
"{{ route('dimensao_gestao', ['user_pad_id' =>
$user_pad_id
]) }}"
></
a
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
<
div
class
=
"text-center"
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge"
style
=
"color: #32415c;background-color: #fd9d0d"
>
Horas
:
{{
$ensinoTotalHoras
+
$gestaoTotalHoras
+
$pesquisaTotalHoras
+
$extensaoTotalHoras
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge"
style
=
"color: #32415c;background-color: #fd9d0d"
>
Horas
:
{{
$ensinoTotalHoras
+
$gestaoTotalHoras
+
$pesquisaTotalHoras
+
$extensaoTotalHoras
}}
</
span
>
</
h4
>
</
div
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('
cursos_print'
) }}"
></
a
>
<
a
class
=
"stretched-link
btn-pdf-download
"
href
=
"{{ route('
user-pad_pdf', ['user_pad_id' =>
$user_pad_id
]
) }}"
></
a
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
routes/professor_pad.php
View file @
af8d2093
...
@@ -10,4 +10,5 @@ Route::prefix('/user-pad')->group(function() {
...
@@ -10,4 +10,5 @@ Route::prefix('/user-pad')->group(function() {
Route
::
post
(
'/update/{id}'
,
[
UserPadController
::
class
,
'actionUpdate'
])
->
name
(
'user-pad_update'
);
Route
::
post
(
'/update/{id}'
,
[
UserPadController
::
class
,
'actionUpdate'
])
->
name
(
'user-pad_update'
);
Route
::
delete
(
'/delete/{id}'
,
[
UserPadController
::
class
,
'actionDelete'
])
->
name
(
'user-pad_delete'
);
Route
::
delete
(
'/delete/{id}'
,
[
UserPadController
::
class
,
'actionDelete'
])
->
name
(
'user-pad_delete'
);
Route
::
post
(
'/validate'
,
[
UserPadController
::
class
,
'ajaxValidation'
])
->
name
(
'user-pad_ajax_validation'
);
Route
::
post
(
'/validate'
,
[
UserPadController
::
class
,
'ajaxValidation'
])
->
name
(
'user-pad_ajax_validation'
);
Route
::
get
(
'/pdf/{user_pad_id}'
,
[
UserPadController
::
class
,
'generatePDF'
])
->
name
(
'user-pad_pdf'
);
});
});
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