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
4b6417cd
Commit
4b6417cd
authored
May 22, 2024
by
alissonalbuquerque
Browse files
update view from avaliator and teacher
parent
5e7a3582
Changes
10
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/DashboardController.php
View file @
4b6417cd
...
@@ -44,7 +44,7 @@ class DashboardController extends Controller
...
@@ -44,7 +44,7 @@ class DashboardController extends Controller
$userPads
=
$userPads
=
AvaliadorPad
::
where
(
'user_id'
,
'='
,
$user
->
id
)
AvaliadorPad
::
where
(
'user_id'
,
'='
,
$user
->
id
)
->
join
(
'pad'
,
'avaliador_pad.pad_id'
,
'='
,
'pad.id'
)
->
join
(
'pad'
,
'avaliador_pad.pad_id'
,
'='
,
'pad.id'
)
->
where
(
'pad.status'
,
'='
,
Status
::
A
TIVO
)
->
where
In
(
'pad.status'
,
[
Status
::
ATIVO
,
Status
::
A
RQUIVADO
]
)
->
get
();
->
get
();
return
view
(
'dashboard'
,
[
'userPads'
=>
$userPads
,
'menu'
=>
Menu
::
HOME
]);
return
view
(
'dashboard'
,
[
'userPads'
=>
$userPads
,
'menu'
=>
Menu
::
HOME
]);
...
...
app/Http/Controllers/PadController.php
View file @
4b6417cd
...
@@ -213,6 +213,8 @@ class PadController extends Controller
...
@@ -213,6 +213,8 @@ class PadController extends Controller
$avaliatorsPads
=
$pad
->
avaliadorPads
;
$avaliatorsPads
=
$pad
->
avaliadorPads
;
$status
=
Constants
::
listStatus
();
$status
=
Constants
::
listStatus
();
//Se a página atual for 1 remova o previous
//Se a página atual for 1 remova o previous
//Se a página atual for lastPage remova o next
//Se a página atual for lastPage remova o next
//Se houver um page="" no query selecionar a opção de professor por padrão [list]
//Se houver um page="" no query selecionar a opção de professor por padrão [list]
...
@@ -298,50 +300,68 @@ class PadController extends Controller
...
@@ -298,50 +300,68 @@ class PadController extends Controller
$user
=
Auth
::
user
();
$user
=
Auth
::
user
();
$pad
=
Pad
::
find
(
$id
);
$pad
=
Pad
::
find
(
$id
);
$index_menu
=
MenuItemsAvaliador
::
HOME
;
$index_menu
=
MenuItemsAvaliador
::
HOME
;
$professores
=
User
::
join
(
'user_pad'
,
'user_pad.user_id'
,
'='
,
'users.id'
)
[
$user_id
,
$campus_id
,
$pad_id
,
$status_active
]
=
[
$user
->
id
,
$user
->
campus_id
,
$pad
->
id
,
PAD
::
STATUS_ATIVO
];
$professores
=
User
::
join
(
'user_pad'
,
'user_pad.user_id'
,
'='
,
'users.id'
)
->
join
(
'pad'
,
'user_pad.pad_id'
,
'='
,
'pad.id'
)
->
join
(
'pad'
,
'user_pad.pad_id'
,
'='
,
'pad.id'
)
->
where
(
function
(
$query
)
use
(
$user
,
$id
)
{
->
where
(
function
(
$query
)
use
(
$user_id
,
$campus_id
,
$pad_id
,
$status_active
)
$query
->
where
(
'pad.status'
,
'='
,
Status
::
ATIVO
);
{
$query
->
where
(
'users.campus_id'
,
'='
,
$user
->
campus_id
);
$query
->
where
(
'pad.status'
,
'='
,
$status_active
);
$query
->
where
(
'users.id'
,
'!='
,
$user
->
id
);
$query
->
where
(
'users.campus_id'
,
'='
,
$campus_id
);
$query
->
where
(
'pad.id'
,
'='
,
$id
);
$query
->
where
(
'users.id'
,
'!='
,
$user_id
);
$query
->
where
(
'pad.id'
,
'='
,
$pad_id
);
})
})
->
select
(
'users.id'
,
'users.name'
)
->
select
(
'users.id'
,
'users.name'
,
'users.email'
)
->
orderBy
(
'name'
)
->
orderBy
(
'users.name'
)
->
limit
(
10
)
->
get
();
->
get
();
//Informando se o PAD foi enviado ou não
// $professores = User::join('user_pad', 'user_pad.user_id', '=', 'users.id')
$avaliador_pad
=
AvaliadorPad
::
where
(
function
(
$query
)
use
(
$pad
,
$user
)
{
// ->join('pad', 'user_pad.pad_id', '=', 'pad.id')
$query
->
where
(
'user_id'
,
'='
,
$user
->
id
);
// ->where(function ($query) use ($user, $id) {
$query
->
where
(
'pad_id'
,
'='
,
$pad
->
id
);
// $query->where('pad.status', '=', Status::ATIVO);
})
->
first
();
// $query->where('users.campus_id', '=', $user->campus_id);
// $query->where('users.id', '!=', $user->id);
// $query->where('pad.id', '=', $id);
foreach
(
$professores
as
$professor
){
// })
$professor
->
status
=
"Pendente"
;
// ->select('users.id', 'users.name')
$userPad
=
$professor
->
userPads
()
->
where
(
'pad_id'
,
'='
,
$pad
->
id
)
->
first
();
// ->orderBy('name')
// ->limit(10)
$avaliacoes
=
$this
->
get_avaliacoes
(
$userPad
,
$avaliador_pad
);
// ->get();
//
$avaliacoes_ensino
=
!
empty
(
$avaliacoes
[
'ensino'
])
?
$avaliacoes
[
'ensino'
]
:
null
;
// //Informando se o PAD foi enviado ou não
$avaliacoes_pesquisa
=
!
empty
(
$avaliacoes
[
'pesquisa'
])
?
$avaliacoes
[
'pesquisa'
]
:
null
;
// $avaliador_pad = AvaliadorPad::where(function ($query) use ($pad, $user) {
$avaliacoes_extensao
=
!
empty
(
$avaliacoes
[
'extensao'
])
?
$avaliacoes
[
'extensao'
]
:
null
;
// $query->where('user_id', '=', $user->id);
$avaliacoes_gestao
=
!
empty
(
$avaliacoes
[
'gestao'
])
?
$avaliacoes
[
'gestao'
]
:
null
;
// $query->where('pad_id', '=', $pad->id);
// })->first();
//
$avaliacoes_ensino_all
=
$avaliacoes_ensino
?
$avaliacoes_ensino
->
all
()
:
null
;
//
$avaliacoes_pesquisa_all
=
$avaliacoes_pesquisa
?
$avaliacoes_pesquisa
->
all
()
:
null
;
// foreach ($professores as $professor){
$avaliacoes_extensao_all
=
$avaliacoes_extensao
?
$avaliacoes_extensao
->
all
()
:
null
;
// $professor->status = "Pendente";
$avaliacoes_gestao_all
=
$avaliacoes_gestao
?
$avaliacoes_gestao
->
all
()
:
null
;
// $userPad = $professor->userPads()->where('pad_id', '=', $pad->id)->first();
//
// $avaliacoes = $this->get_avaliacoes($userPad, $avaliador_pad);
if
(
$avaliacoes_ensino_all
||
$avaliacoes_pesquisa_all
||
$avaliacoes_extensao_all
||
$avaliacoes_gestao_all
)
{
//
$professor
->
status
=
"Enviado"
;
// $avaliacoes_ensino = !empty($avaliacoes['ensino']) ? $avaliacoes['ensino'] : null;
}
// $avaliacoes_pesquisa = !empty($avaliacoes['pesquisa']) ? $avaliacoes['pesquisa'] : null;
// $avaliacoes_extensao = !empty($avaliacoes['extensao']) ? $avaliacoes['extensao'] : null;
$professor
->
ch
=
$this
->
get_carga_horaria_total
(
$avaliacoes
);
// $avaliacoes_gestao = !empty($avaliacoes['gestao']) ? $avaliacoes['gestao'] : null;
$professor
->
ch_corrigida
=
$this
->
get_carga_horaria_corrigida
(
$avaliacoes_ensino
,
$avaliacoes_pesquisa
,
$avaliacoes_extensao
,
$avaliacoes_gestao
);
//
}
//
// $avaliacoes_ensino_all = $avaliacoes_ensino? $avaliacoes_ensino->all() : null;
// $avaliacoes_pesquisa_all = $avaliacoes_pesquisa? $avaliacoes_pesquisa->all() : null;
// $avaliacoes_extensao_all = $avaliacoes_extensao? $avaliacoes_extensao->all() : null;
// $avaliacoes_gestao_all = $avaliacoes_gestao? $avaliacoes_gestao->all() : null;
//
//
// if($avaliacoes_ensino_all || $avaliacoes_pesquisa_all || $avaliacoes_extensao_all || $avaliacoes_gestao_all) {
// $professor->status = "Enviado";
// }
//
// $professor->ch = $this->get_carga_horaria_total($avaliacoes);
// $professor->ch_corrigida = $this->get_carga_horaria_corrigida($avaliacoes_ensino, $avaliacoes_pesquisa, $avaliacoes_extensao, $avaliacoes_gestao);
// }
return
view
(
"pad.avaliacao.professores"
,
compact
(
'professores'
,
'pad'
,
'index_menu'
));
return
view
(
"pad.avaliacao.professores"
,
compact
(
'professores'
,
'pad'
,
'index_menu'
));
}
}
...
...
app/Models/Pad.php
View file @
4b6417cd
...
@@ -12,6 +12,18 @@ class Pad extends Model
...
@@ -12,6 +12,18 @@ class Pad extends Model
{
{
use
HasFactory
;
use
HasFactory
;
const
STATUS_ATIVO
=
1
;
const
STATUS_INATIVO
=
2
;
const
STATUS_ARQUIVADO
=
3
;
const
STATUS_EM_AVALIACAO
=
4
;
const
STATUS_PENDENTE
=
3
;
const
ARQUIVADO
=
4
;
const
FINALIZADO
=
5
;
const
REPROVADO
=
6
;
const
APROVADO
=
7
;
const
EM_REVISAO
=
8
;
/** @var string */
/** @var string */
protected
$table
=
'pad'
;
protected
$table
=
'pad'
;
...
...
app/Models/Tabelas/Constants.php
View file @
4b6417cd
...
@@ -29,6 +29,7 @@ class Constants {
...
@@ -29,6 +29,7 @@ class Constants {
const
STATUS_ATIVO
=
1
;
const
STATUS_ATIVO
=
1
;
const
STATUS_INATIVO
=
2
;
const
STATUS_INATIVO
=
2
;
const
STATUS_ARQUIVADO
=
3
;
const
STATUS_ARQUIVADO
=
3
;
const
STATUS_EM_AVALIACAO
=
4
;
const
DIMENSAO_ENSINO
=
1
;
const
DIMENSAO_ENSINO
=
1
;
const
DIMENSAO_PESQUISA
=
2
;
const
DIMENSAO_PESQUISA
=
2
;
...
@@ -132,6 +133,7 @@ class Constants {
...
@@ -132,6 +133,7 @@ class Constants {
self
::
STATUS_ATIVO
=>
'Ativo'
,
self
::
STATUS_ATIVO
=>
'Ativo'
,
self
::
STATUS_INATIVO
=>
'Inativo'
,
self
::
STATUS_INATIVO
=>
'Inativo'
,
self
::
STATUS_ARQUIVADO
=>
'Arquivado'
,
self
::
STATUS_ARQUIVADO
=>
'Arquivado'
,
self
::
STATUS_EM_AVALIACAO
=>
'Periodo de Avaliação'
];
];
return
$value
!==
null
?
$values
[
$value
]
:
$values
;
return
$value
!==
null
?
$values
[
$value
]
:
$values
;
...
...
app/Models/Util/Status.php
View file @
4b6417cd
...
@@ -21,7 +21,7 @@ class Status
...
@@ -21,7 +21,7 @@ class Status
self
::
ATIVO
=>
'Ativo'
,
self
::
ATIVO
=>
'Ativo'
,
self
::
INATIVO
=>
'Inativo'
,
self
::
INATIVO
=>
'Inativo'
,
self
::
PENDENTE
=>
'Pendente'
,
self
::
PENDENTE
=>
'Pendente'
,
self
::
ARQUIVADO
=>
'
Arquivad
o'
,
self
::
ARQUIVADO
=>
'
Em Avaliaçã
o'
,
self
::
FINALIZADO
=>
'Finalizado'
,
self
::
FINALIZADO
=>
'Finalizado'
,
self
::
REPROVADO
=>
'Reprovado'
,
self
::
REPROVADO
=>
'Reprovado'
,
self
::
APROVADO
=>
'Aprovado'
,
self
::
APROVADO
=>
'Aprovado'
,
...
...
app/Search/TeacherAvaliatorSearch.php
0 → 100644
View file @
4b6417cd
<?php
use
Illuminate\Database\Eloquent\Model
;
namespace
App\Search
;
use
App\Models\Campus
;
use
App\Models\User
;
class
TeacherAvaliatorSearch
extends
Model
{
/** @var string */
public
$name
;
/** @var string */
public
$email
;
/** @var integer */
public
$user_id
;
/** @var integer */
public
$campus_id
;
/** @var integer */
public
$pad_id
;
/** @var integer */
public
$pad_status
;
/** @var integer */
public
$paginate
;
/** @var array */
public
$_attributes
=
[
'name'
,
'email'
,
'user_id'
,
'pad_id'
,
'campus_id'
,
'pad_status'
,
'paginate'
];
/** @return void */
public
function
load
(
$params
=
[])
{
foreach
(
$this
->
_attributes
as
$_attribute
)
{
if
(
isset
(
$this
->
$_attribute
))
{
$this
->
$_attribute
=
$this
->
$_attribute
;
}
else
if
(
isset
(
$params
[
$_attribute
]))
{
$this
->
$_attribute
=
$params
[
$_attribute
];
}
else
{
$this
->
$_attribute
=
null
;
}
}
}
/** @return Illuminate\Database\Eloquent\Collection */
public
function
search
(
$params
=
[])
{
/** @var Illuminate\Database\Eloquent\Builder */
$query
=
User
::
where
([]);
$query
->
join
(
'user_pad'
,
'user_pad.user_id'
,
'='
,
'users.id'
)
->
join
(
'pad'
,
'user_pad.pad_id'
,
'='
,
'pad.id'
);
$this
->
load
(
$params
);
if
(
$this
->
name
)
{
$name
=
$this
->
name
;
$query
->
where
(
'users.name'
,
"like"
,
"%
{
$name
}
%"
);
}
if
(
$this
->
email
)
{
$email
=
$this
->
email
;
$query
->
where
(
'users.email'
,
"like"
,
"%
{
$email
}
%"
);
}
if
(
$this
->
user_id
)
{
$user_id
=
$this
->
user_id
;
$query
->
where
(
"users.id"
,
'!='
,
"
{
$user_id
}
"
);
}
if
(
$this
->
pad_id
)
{
$pad_id
=
$this
->
pad_id
;
$query
->
where
(
"pad.id"
,
'='
,
"
{
$pad_id
}
"
);
}
if
(
$this
->
campus_id
)
{
$campus_id
=
$this
->
campus_id
;
$query
->
where
(
"users.campus_id"
,
'='
,
"
{
$campus_id
}
"
);
}
if
(
$this
->
pad_status
)
{
$pad_status
=
$this
->
pad_status
;
$query
->
where
(
"pad.status"
,
'='
,
"
{
$pad_status
}
"
);
}
return
$this
->
paginate
?
$query
->
get
()
->
paginate
(
$this
->
paginate
)
:
$query
->
get
();
}
/** @return Illuminate\Database\Eloquent\Relations\BelongsTo */
public
function
user
()
{
return
$this
->
belongsTo
(
User
::
class
);
}
/** @return Illuminate\Database\Eloquent\Relations\BelongsTo */
public
function
pad
()
{
return
$this
->
belongsTo
(
Pad
::
class
);
}
/** @return Illuminate\Database\Eloquent\Relations\BelongsTo */
public
function
campus
()
{
return
$this
->
belongsTo
(
Campus
::
class
);
}
}
resources/views/layouts/user-dashboard/dashboard_teacher.blade.php
View file @
4b6417cd
@
php
@
php
use
App\Models\Util\Status
;
use
App\Models\Util\Status
;
use
App\Models\Pad
;
@
endphp
@
endphp
<
div
class
=
"tab-pane active"
id
=
"home"
role
=
"tabpanel"
aria
-
labelledby
=
"home-tab"
>
<
div
class
=
"tab-pane active"
id
=
"home"
role
=
"tabpanel"
aria
-
labelledby
=
"home-tab"
>
...
@@ -31,6 +32,23 @@
...
@@ -31,6 +32,23 @@
</
div
>
</
div
>
@
endif
@
endif
@
if
(
$userPad
->
pad
->
status
===
Pad
::
STATUS_EM_AVALIACAO
)
<
div
class
=
"card mx-2 bg-secondary"
style
=
"width: 12rem;"
>
<
div
class
=
"card-body"
>
<
div
class
=
"text-end"
>
<
span
class
=
"badge bg-primary"
>
{{
$userPad
->
pad
->
statusAsString
()
}}
</
span
>
</
div
>
<
h1
class
=
"text-center"
>
<
i
class
=
"bi bi-book-half"
></
i
>
</
h1
>
<
h5
class
=
"text-center"
>
PDA
:
{{
$userPad
->
pad
->
nome
}}
</
h4
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
totalHoras
()
}}
</
span
>
</
h4
>
</
div
>
{{
--
<
a
class
=
"stretched-link"
href
=
"{{ route('pad_view', ['id' =>
$userPad->id
]) }}"
></
a
>
--
}}
</
div
>
</
div
>
@
endif
@
endforeach
@
endforeach
</
div
>
</
div
>
</
div
>
</
div
>
resources/views/pad/avaliacao/professores.blade.php
View file @
4b6417cd
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<
thead
class
=
"thead-dark"
>
<
thead
class
=
"thead-dark"
>
<
tr
>
<
tr
>
<
th
scope
=
"col"
>
Professor
</
th
>
<
th
scope
=
"col"
>
Professor
</
th
>
<
th
scope
=
"col"
>
E
-
mail
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
<
th
scope
=
"col"
>
CH
</
th
>
<
th
scope
=
"col"
>
CH
</
th
>
<
th
scope
=
"col"
>
CH
Corrigida
</
th
>
<
th
scope
=
"col"
>
CH
Corrigida
</
th
>
...
@@ -34,6 +35,7 @@
...
@@ -34,6 +35,7 @@
@
foreach
(
$professores
as
$professor
)
@
foreach
(
$professores
as
$professor
)
<
tr
>
<
tr
>
<
td
>
{{
$professor
->
name
}}
</
td
>
<
td
>
{{
$professor
->
name
}}
</
td
>
<
td
>
{{
$professor
->
email
}}
</
td
>
@
if
(
$professor
->
status
===
'Pendente'
)
@
if
(
$professor
->
status
===
'Pendente'
)
<
td
style
=
"color:red;"
>
{{
$professor
->
status
}}
</
td
>
<
td
style
=
"color:red;"
>
{{
$professor
->
status
}}
</
td
>
@
else
@
else
...
...
resources/views/pad/avaliacao/search/_teachers_search.blade.php
0 → 100644
View file @
4b6417cd
<?php
/**
* @var $model App\Models\UserSearch
*/
?>
<form
action=
"{{ route('user_index') }}"
method=
"get"
>
<div
class=
"row"
>
<div
class=
"mb-3 col-6"
>
<div
class=
"form-group"
>
<label
class=
"form-label"
for=
"name"
>
Nome
</label>
<input
type=
"text"
name=
"name"
id=
"name"
class=
"form-control"
placeholder=
"Nome"
value=
"{{ $model->name }}"
>
</div>
</div>
<div
class=
"mb-3 col-6"
>
<div
class=
"form-group"
>
<label
class=
"form-label"
for=
"email"
>
E-Mail
</label>
<input
type=
"email"
name=
"email"
id=
"email"
class=
"form-control"
placeholder=
"E-Mail"
value=
"{{ $model->email }}"
>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"mb-3 col-6"
>
<div
class=
"form-group"
>
<label
class=
"form-label"
for=
"campus_id"
>
Status
</label>
<select
class=
"form-control"
name=
"campus_id"
id=
"campus_id"
>
@if($model->campus_id)
<option
value=
"{{$model->campus_id}}"
selected
>
{{$model->campus}}
</option>
@endif
</select>
</div>
</div>
</div>
<button
type=
"submit"
class=
"btn btn-primary"
>
Buscar
</button>
</form>
routes/web.php
View file @
4b6417cd
...
@@ -38,7 +38,9 @@ require __DIR__ . '/avaliador_pad.php';
...
@@ -38,7 +38,9 @@ require __DIR__ . '/avaliador_pad.php';
require
__DIR__
.
'/professor_pad.php'
;
require
__DIR__
.
'/professor_pad.php'
;
require
__DIR__
.
'/unidade.php'
;
require
__DIR__
.
'/unidade.php'
;
require
__DIR__
.
'/campus.php'
;
require
__DIR__
.
'/campus.php'
;
require
__DIR__
.
'/curso.php'
;
require
__DIR__
.
'/curso.php'
;
require
__DIR__
.
'/anexo.php'
;
require
__DIR__
.
'/anexo.php'
;
...
...
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