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
submeta
Commits
22127580
Commit
22127580
authored
Nov 02, 2021
by
Guilherme Silva
Browse files
Alteração da tela listagem de relatórios
parent
7d244145
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/ArquivoController.php
View file @
22127580
...
...
@@ -6,6 +6,7 @@ use App\Arquivo;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Http\Request
;
use
mysql_xdevapi
\
Exception
;
use
Carbon\Carbon
;
class
ArquivoController
extends
Controller
{
...
...
@@ -97,7 +98,9 @@ class ArquivoController extends Controller
public
function
listar
(
$id
){
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
return
view
(
'planosTrabalho.listar'
)
->
with
([
'arquivos'
=>
$arquivos
]);
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
$hoje
->
toDateString
();
return
view
(
'planosTrabalho.listar'
)
->
with
([
'arquivos'
=>
$arquivos
,
'hoje'
=>
$hoje
]);
}
public
function
anexarRelatorio
(
Request
$request
){
...
...
resources/views/planosTrabalho/listar.blade.php
View file @
22127580
...
...
@@ -7,39 +7,51 @@
<
div
class
=
"row justify-content-center titulo-menu mb-0"
>
<
h4
>
Planos
de
Trabalho
</
h4
>
</
div
>
<
div
class
=
"card-body"
>
<
div
class
=
"card-body"
style
=
"width: 75% !important;margin: auto;"
>
<
table
class
=
"table table-bordered table-hover"
style
=
"display: block; overflow-x: visible; white-space: nowrap; border-radius:10px; margin-bottom:0px"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
style
=
"width:200px;"
>
Plano
de
Trabalho
</
th
>
<
th
scope
=
"col"
style
=
"width:200px;"
>
Projeto
</
th
>
<
th
scope
=
"col"
style
=
"width:200px;"
>
Discente
</
th
>
<
th
scope
=
"col"
style
=
"width:200px;"
>
Data
</
th
>
<
th
scope
=
"col"
style
=
"width:200px;"
>
Relatório
Parcial
</
th
>
<
th
scope
=
"col"
style
=
"width:200px;"
>
Relatório
Final
</
th
>
<
th
scope
=
"col"
style
=
"width:200px; text-align: center;"
>
Título
</
th
>
<
th
scope
=
"col"
style
=
"width:200px; text-align: center;"
>
Discente
</
th
>
<
th
scope
=
"col"
style
=
"width:200px; text-align: center;"
>
Relatório
Parcial
</
th
>
<
th
scope
=
"col"
style
=
"width:200px; text-align: center;"
>
Relatório
Final
</
th
>
</
tr
>
</
thead
>
@
foreach
(
$arquivos
as
$arquivo
)
<
tbody
>
<
td
>
{{
$arquivo
->
trabalho
->
titulo
}}
</
td
>
<
td
>
{{
$arquivo
->
titulo
}}
</
td
>
<
td
>
{{
$arquivo
->
participante
->
user
->
name
}}
</
td
>
<
td
>
{{
$arquivo
->
data
}}
</
td
>
<
td
>
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalRelatorioParcial{{
$arquivo->id
}}"
>
Visualizar
</
button
>
</
td
>
<
td
>
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalRelatorioFinal{{
$arquivo->id
}}"
>
Visualizar
</
button
>
<
td
style
=
"text-align: center;"
>
{{
$arquivo
->
titulo
}}
</
td
>
<
td
style
=
"text-align: center;"
>
{{
$arquivo
->
participante
->
user
->
name
}}
{{
$arquivo
->
trabalho
->
evento
->
nome
}}
</
td
>
<
td
style
=
"text-align: center;"
>
@
if
((
Auth
::
user
()
->
proponentes
!=
null
)
&&
(
$arquivo
->
relatorioParcial
==
null
)
&&
(
$arquivo
->
trabalho
->
evento
->
dt_inicioRelatorioParcial
<=
$hoje
)
&&
(
$hoje
<=
$arquivo
->
trabalho
->
evento
->
dt_fimRelatorioParcial
))
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalRelatorioParcial{{
$arquivo->id
}}"
>
Enviar
</
button
>
@
else
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalRelatorioParcial{{
$arquivo->id
}}"
>
Visualizar
</
button
>
@
endif
</
td
>
<
td
style
=
"text-align: center;"
>
@
if
((
Auth
::
user
()
->
proponentes
!=
null
)
&&
(
$arquivo
->
relatorioFinal
==
null
)
&&
(
$arquivo
->
trabalho
->
evento
->
dt_inicioRelatorioFinal
<=
$hoje
)
&&
(
$hoje
<=
$arquivo
->
trabalho
->
evento
->
dt_fimRelatorioFinal
))
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalRelatorioFinal{{
$arquivo->id
}}"
>
Enviar
</
button
>
@
else
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalRelatorioFinal{{
$arquivo->id
}}"
>
Visualizar
</
button
>
@
endif
</
td
>
<!--
Modal
Relatorio
Parcial
-->
...
...
@@ -52,6 +64,21 @@
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"col-12"
>
<
div
class
=
"row"
>
<
div
class
=
"col-6"
>
<
label
for
=
"dt_inicioRelatorioParcial"
class
=
"col-form-label"
>
{{
__
(
'Início do Relatório Parcial:'
)
}}
</
label
>
<
input
id
=
"dt_inicioRelatorioParcial"
type
=
"date"
class
=
"form-control"
name
=
"dt_inicioRelatorioParcial"
value
=
"
{
{$arquivo->trabalho->evento->dt_inicioRelatorioParcial}
}
"
required
autocomplete
=
"dt_inicioRelatorioParcial"
disabled
autofocus
>
</
div
>
<
div
class
=
"col-6"
>
<
label
for
=
"dt_fimRelatorioParcial"
class
=
"col-form-label"
>
{{
__
(
'Fim do Relatório Parcial:'
)
}}
</
label
>
<
input
id
=
"dt_fimRelatorioParcial"
type
=
"date"
class
=
"form-control"
name
=
"dt_fimRelatorioParcial"
value
=
"
{
{$arquivo->trabalho->evento->dt_fimRelatorioParcial}
}
"
required
autocomplete
=
"dt_fimRelatorioParcial"
disabled
autofocus
>
</
div
>
</
div
>
</
div
>
<
br
>
<
form
id
=
"formRelatParcial"
method
=
"post"
action
=
"
{
{route('planos.anexar.relatorio')}
}
"
enctype
=
"multipart/form-data"
>
@
csrf
<
input
type
=
"hidden"
value
=
"{{
$arquivo->id
}}"
name
=
"arqId"
>
...
...
@@ -69,7 +96,8 @@
</
div
>
<
br
>
@
if
(
Auth
::
user
()
->
proponentes
!=
null
)
@
if
((
Auth
::
user
()
->
proponentes
!=
null
)
&&
(
$arquivo
->
trabalho
->
evento
->
dt_inicioRelatorioParcial
<=
$hoje
)
&&
(
$hoje
<=
$arquivo
->
trabalho
->
evento
->
dt_fimRelatorioParcial
))
<
input
type
=
"file"
class
=
"input-group-text"
value
=
""
name
=
"relatorioParcial"
accept
=
".pdf"
placeholder
=
"Relatorio Parcial"
id
=
"relatorioParcial
{
{$arquivo->id}
}
"
required
/>
@
error
(
'relatorioParcial'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:block"
>
...
...
@@ -81,7 +109,8 @@
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
Cancelar
</
button
>
@
if
(
Auth
::
user
()
->
proponentes
!=
null
)
@
if
((
Auth
::
user
()
->
proponentes
!=
null
)
&&
(
$arquivo
->
trabalho
->
evento
->
dt_inicioRelatorioParcial
<=
$hoje
)
&&
(
$hoje
<=
$arquivo
->
trabalho
->
evento
->
dt_fimRelatorioParcial
))
<
button
type
=
"submit"
class
=
"btn btn-success"
>
Salvar
</
button
>
@
endif
</
div
>
...
...
@@ -101,6 +130,21 @@
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"col-12"
>
<
div
class
=
"row"
>
<
div
class
=
"col-6"
>
<
label
for
=
"dt_inicioRelatorioFinal"
class
=
"col-form-label"
>
{{
__
(
'Início do Relatório Final:'
)
}}
</
label
>
<
input
id
=
"dt_inicioRelatorioFinal"
type
=
"date"
class
=
"form-control"
name
=
"dt_inicioRelatorioFinal"
value
=
"
{
{$arquivo->trabalho->evento->dt_inicioRelatorioFinal}
}
"
required
autocomplete
=
"dt_inicioRelatorioFinal"
disabled
autofocus
>
</
div
>
<
div
class
=
"col-6"
>
<
label
for
=
"dt_fimRelatorioFinal"
class
=
"col-form-label"
>
{{
__
(
'Fim do Relatório Final:'
)
}}
</
label
>
<
input
id
=
"dt_fimRelatorioFinal"
type
=
"date"
class
=
"form-control"
name
=
"dt_fimRelatorioFinal"
value
=
"
{
{$arquivo->trabalho->evento->dt_fimRelatorioFinal}
}
"
required
autocomplete
=
"dt_fimRelatorioFinal"
disabled
autofocus
>
</
div
>
</
div
>
</
div
>
<
br
>
<
form
id
=
"formRelatFinal"
method
=
"post"
action
=
"
{
{route('planos.anexar.relatorio')}
}
"
enctype
=
"multipart/form-data"
>
@
csrf
<
input
type
=
"hidden"
value
=
"{{
$arquivo->id
}}"
name
=
"arqId"
>
...
...
@@ -117,7 +161,8 @@
@
endif
</
div
>
<
br
>
@
if
(
Auth
::
user
()
->
proponentes
!=
null
)
@
if
((
Auth
::
user
()
->
proponentes
!=
null
)
&&
(
$arquivo
->
trabalho
->
evento
->
dt_inicioRelatorioFinal
<=
$hoje
)
&&
(
$hoje
<=
$arquivo
->
trabalho
->
evento
->
dt_fimRelatorioFinal
))
<
input
type
=
"file"
class
=
"input-group-text"
value
=
""
name
=
"relatorioFinal"
accept
=
".pdf"
placeholder
=
"Relatorio Final"
id
=
"relatorioFinal
{
{$arquivo->id}
}
"
required
/>
@
error
(
'relatorioFinal'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:block"
>
...
...
@@ -129,7 +174,8 @@
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
Cancelar
</
button
>
@
if
(
Auth
::
user
()
->
proponentes
!=
null
)
@
if
((
Auth
::
user
()
->
proponentes
!=
null
)
&&
(
$arquivo
->
trabalho
->
evento
->
dt_inicioRelatorioFinal
<=
$hoje
)
&&
(
$hoje
<=
$arquivo
->
trabalho
->
evento
->
dt_fimRelatorioFinal
))
<
button
type
=
"submit"
class
=
"btn btn-success"
>
Salvar
</
button
>
@
endif
</
div
>
...
...
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