Commit da6b6a26 authored by victorMendes18's avatar victorMendes18
Browse files

finalizando aprovar

parent 00de41e3
...@@ -35,7 +35,7 @@ class AvaliadorController extends Controller ...@@ -35,7 +35,7 @@ class AvaliadorController extends Controller
'professor_id' => ['required', 'integer'], 'professor_id' => ['required', 'integer'],
'atividade_type' => ['required', 'integer'], 'atividade_type' => ['required', 'integer'],
'descricao' => ['nullable', 'string'], 'descricao' => ['nullable', 'string'],
'hora_reajuste' => ['nullable', 'double'], 'hora_reajuste' => ['nullable', 'integer'],
], ],
[ [
'required' => 'O campo de :attribute é obrigatório', 'required' => 'O campo de :attribute é obrigatório',
...@@ -56,15 +56,10 @@ class AvaliadorController extends Controller ...@@ -56,15 +56,10 @@ class AvaliadorController extends Controller
$avaliacao->status = $req->status; $avaliacao->status = $req->status;
$avaliacao->avaliador_id = $user->id; $avaliacao->avaliador_id = $user->id;
$avaliacao->descricao = $req->descricao ? $req->descricao : NULL; $avaliacao->descricao = $req->descricao ? $req->descricao : NULL;
$avaliacao->hora_reajuste = $req->hora_reajuste; $avaliacao->horas_reajuste = $req->hora_reajuste;
if ($avaliacao->save()) { if ($avaliacao->save()) {
return redirect()->back();
dd($avaliacao);
//return view('pad.avaliacao.dimensao.ensino', [
// 'index_menu' => MenuItemsAvaliador::PADs,
// 'user_pad_id' => 1
//]);
} }
} }
} }
......
...@@ -11,7 +11,7 @@ class Avaliacao extends Model ...@@ -11,7 +11,7 @@ class Avaliacao extends Model
protected $table = 'avaliacao'; protected $table = 'avaliacao';
protected $fillable = ['tarefa_id', 'avaliador_id', 'type', 'status', 'descricao', 'ch_semanal']; protected $fillable = ['tarefa_id', 'avaliador_id', 'type', 'status', 'descricao', 'ch_semanal', 'hora_reajuste'];
public function tarefa() { public function tarefa() {
......
...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; ...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
class AddFeedbackAvaliacaoCampos extends Migration class AddColumnHorasReajusteInTableAvaliacao extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -14,7 +14,7 @@ class AddFeedbackAvaliacaoCampos extends Migration ...@@ -14,7 +14,7 @@ class AddFeedbackAvaliacaoCampos extends Migration
public function up() public function up()
{ {
Schema::table('avaliacao', function (Blueprint $table) { Schema::table('avaliacao', function (Blueprint $table) {
$table->double('horas_reajuste')->nullable(true); $table->integer('horas_reajuste')->nullable(true);
}); });
} }
......
...@@ -31,18 +31,21 @@ ...@@ -31,18 +31,21 @@
<span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br> <span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br>
<div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end"> <div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end">
<button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick="setaDadosModalAvaliacao($tarefa['id'], $professor['id'], 6, )"> <button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" style="height: 38px;" onclick='setaDadosModalAvaliacao("{{$tarefa["id"]}}", "{{$professor["id"]}}", "6", "{{$tarefa["tipo_atividade"]}}")'>
Reprovar Reprovar
</button> </button>
<span>&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;</span>
@include('components.buttons.btn-aprovar', [
'route' => route('avaliador_avaliar'),
'class' => 'ml-2',
'content' => 'Aprovar',
'id' => '',
])
<form action="{{route('avaliador_avaliar')}}" method="POST">
@csrf
@method("PUT")
<input type="hidden" name="tarefa_id" id="tarefa_id_aprovar" value="{{$tarefa["id"]}}">
<input type="hidden" name="professor_id" id="professor_id_aprovar" value="{{$professor["id"]}}">
<input type="hidden" name="status" id="status_aprovar" value='7'>
<input type="hidden" name="atividade_type" id="atividade_type_aprovar" value="{{$tarefa["tipo_atividade"]}}">
<input type="submit" class="btn btn-primary" value="Aprovar">
</form>
</div> </div>
</div> </div>
</div><br> </div><br>
...@@ -66,17 +69,21 @@ ...@@ -66,17 +69,21 @@
<span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br> <span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br>
<div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end"> <div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end">
<button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick="setaDadosModalAvaliacao('a', 'b')"> <button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick='setaDadosModalAvaliacao("{{$tarefa["id"]}}", "{{$professor["id"]}}", "6", "{{$tarefa["tipo_atividade"]}}")'>
Reprovar Reprovar
</button> </button>
<span>&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;</span>
@include('components.buttons.btn-aprovar', [
'route' => route('avaliador_avaliar'), <form action="{{route('avaliador_avaliar')}}" method="POST">
'class' => 'ml-2', @csrf
'content' => 'Aprovar', @method("PUT")
'id' => '', <input type="hidden" name="tarefa_id" id="tarefa_id_aprovar" value="{{$tarefa["id"]}}">
]) <input type="hidden" name="professor_id" id="professor_id_aprovar" value="{{$professor["id"]}}">
<input type="hidden" name="status" id="status_aprovar" value='7'>
<input type="hidden" name="atividade_type" id="atividade_type_aprovar" value="{{$tarefa["tipo_atividade"]}}">
<input type="submit" class="btn btn-primary" value="Aprovar">
</form>
</div> </div>
</div> </div>
...@@ -101,17 +108,21 @@ ...@@ -101,17 +108,21 @@
<span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br> <span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br>
<div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end"> <div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end">
<button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick="setaDadosModalAvaliacao('a', 'b')"> <button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick='setaDadosModalAvaliacao("{{$tarefa["id"]}}", "{{$professor["id"]}}", "6", "{{$tarefa["tipo_atividade"]}}")'>
Reprovar Reprovar
</button> </button>
<span>&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;</span>
@include('components.buttons.btn-aprovar', [
'route' => route('avaliador_avaliar'), <form action="{{route('avaliador_avaliar')}}" method="POST">
'class' => 'ml-2', @csrf
'content' => 'Aprovar', @method("PUT")
'id' => '', <input type="hidden" name="tarefa_id" id="tarefa_id_aprovar" value="{{$tarefa["id"]}}">
]) <input type="hidden" name="professor_id" id="professor_id_aprovar" value="{{$professor["id"]}}">
<input type="hidden" name="status" id="status_aprovar" value='7'>
<input type="hidden" name="atividade_type" id="atividade_type_aprovar" value="{{$tarefa["tipo_atividade"]}}">
<input type="submit" class="btn btn-primary" value="Aprovar">
</form>
</div> </div>
</div> </div>
...@@ -136,17 +147,21 @@ ...@@ -136,17 +147,21 @@
<span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br> <span class="fw-bold ">CH. Semanal: </span><span class="card-text">{{isset($tarefa["ch_semanal"])?$tarefa["ch_semanal"]:"--"}}</span><br>
<div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end"> <div style="width: 100%; " class="btns-avaliar mt-5 d-flex justify-content-end">
<button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick="setaDadosModalAvaliacao('a', 'b')"> <button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#modal_avaliacao" onclick='setaDadosModalAvaliacao("{{$tarefa["id"]}}", "{{$professor["id"]}}", "6", "{{$tarefa["tipo_atividade"]}}")'>
Reprovar Reprovar
</button> </button>
<span>&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;</span>
@include('components.buttons.btn-aprovar', [
'route' => route('avaliador_avaliar'), <form action="{{route('avaliador_avaliar')}}" method="POST">
'class' => 'ml-2', @csrf
'content' => 'Aprovar', @method("PUT")
'id' => '', <input type="hidden" name="tarefa_id" id="tarefa_id_aprovar" value="{{$tarefa["id"]}}">
]) <input type="hidden" name="professor_id" id="professor_id_aprovar" value="{{$professor["id"]}}">
<input type="hidden" name="status" id="status_aprovar" value='7'>
<input type="hidden" name="atividade_type" id="atividade_type_aprovar" value="{{$tarefa["tipo_atividade"]}}">
<input type="submit" class="btn btn-primary" value="Aprovar">
</form>
</div> </div>
</div> </div>
...@@ -164,7 +179,9 @@ ...@@ -164,7 +179,9 @@
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<form action="#" method="POST"> <form action="{{route('avaliador_avaliar')}}" method="POST">
@csrf
@method("PUT")
<input type="hidden" name="tarefa_id" id="tarefa_id"> <input type="hidden" name="tarefa_id" id="tarefa_id">
<input type="hidden" name="professor_id" id="professor_id"> <input type="hidden" name="professor_id" id="professor_id">
<input type="hidden" name="status" id="status"> <input type="hidden" name="status" id="status">
...@@ -180,7 +197,7 @@ ...@@ -180,7 +197,7 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-outline-danger">Reprovar</button> <input type="submit" class="btn btn-outline-danger" value="Reprovar">
</div> </div>
</form> </form>
</div> </div>
...@@ -190,9 +207,10 @@ ...@@ -190,9 +207,10 @@
@endsection @endsection
<script> <script>
function setaDadosModalAvaliacao(a, b){ function setaDadosModalAvaliacao(tarefa_id, professor_id, status, atividade_type){
document.getElementById('a').value = a; document.getElementById('tarefa_id').value = tarefa_id;
document.getElementById('b').value = b; document.getElementById('professor_id').value = professor_id;
document.getElementById('status').value = status;
document.getElementById('atividade_type').value = atividade_type;
} }
</script> </script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment