penilaian reviewer seleksi internal

parent 739816cc
...@@ -117,13 +117,16 @@ class JenisPenilaianMonevController extends Controller ...@@ -117,13 +117,16 @@ class JenisPenilaianMonevController extends Controller
for($i=0; $i<count($request->nama); $i++) for($i=0; $i<count($request->nama); $i++)
{ {
$uuid = Uuid::generate(); $uuid = decrypt($request->jenis_penilaian_monev_id[$i]);
$data['jenis_penilaian_monev_id'] = $uuid; $data['jenis_penilaian_monev_id'] = $uuid;
$data['jenis_id'] = $id; $data['jenis_id'] = $id;
$data['nama'] = $request->nama[$i]; $data['nama'] = $request->nama[$i];
$data['bobot'] = $request->bobot[$i]; $data['bobot'] = 1;
JenisPenilaianMonev::create($data); JenisPenilaianMonev::updateOrCreate([
'jenis_penilaian_monev_id' => $uuid
],
$data);
} }
Alert::success('Data berhasil disimpan.')->persistent('Ok'); Alert::success('Data berhasil disimpan.')->persistent('Ok');
......
...@@ -21,7 +21,10 @@ use Illuminate\Support\Carbon; ...@@ -21,7 +21,10 @@ use Illuminate\Support\Carbon;
use App\Models\ReviewerProposal; use App\Models\ReviewerProposal;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\DaftarProposalBelmawa; use App\Models\DaftarProposalBelmawa;
use App\Models\JenisMonev;
use App\Models\MonevInternal;
use App\Models\ReviewerProposalDetil; use App\Models\ReviewerProposalDetil;
use Illuminate\Support\Facades\Log;
class DaftarSeleksiController extends Controller class DaftarSeleksiController extends Controller
{ {
...@@ -158,7 +161,7 @@ class DaftarSeleksiController extends Controller ...@@ -158,7 +161,7 @@ class DaftarSeleksiController extends Controller
if($status_administrasi != 0) if($status_administrasi != 0)
{ {
if($status_nilai > 0) if($status_nilai == 0)
{ {
if($urut == '1') if($urut == '1')
$aksi = '<h4>'.$nilai_1.'</h4>'; $aksi = '<h4>'.$nilai_1.'</h4>';
...@@ -241,7 +244,7 @@ class DaftarSeleksiController extends Controller ...@@ -241,7 +244,7 @@ class DaftarSeleksiController extends Controller
$urut = DB::select("select ambil_data_reviewer_proposal('".$this->rBiodata->noidentitas."', '".decrypt($id)."', '1')")[0]->ambil_data_reviewer_proposal; $urut = DB::select("select ambil_data_reviewer_proposal('".$this->rBiodata->noidentitas."', '".decrypt($id)."', '1')")[0]->ambil_data_reviewer_proposal;
$title = 'Penilaian Proposal Seleksi Internal'; $title = 'Penilaian Proposal Seleksi Internal';
$proposal = DaftarProposal::where('proposal_id', decrypt($id))->first(); $proposal = DaftarProposal::query()->with('proposalUrl')->where('proposal_id', decrypt($id))->first();
$reviewer_proposal = ReviewerProposal::with('rReviewerProposalDetil')->where('proposal_id', decrypt($id))->where('urut', $urut)->first(); $reviewer_proposal = ReviewerProposal::with('rReviewerProposalDetil')->where('proposal_id', decrypt($id))->where('urut', $urut)->first();
$komponen = JenisPenilaianMonev::where('jenis_id', $proposal->jenis_id)->get(); $komponen = JenisPenilaianMonev::where('jenis_id', $proposal->jenis_id)->get();
...@@ -276,7 +279,6 @@ class DaftarSeleksiController extends Controller ...@@ -276,7 +279,6 @@ class DaftarSeleksiController extends Controller
{ {
try { try {
$urut = DB::select("select ambil_data_reviewer_proposal('".$this->rBiodata->noidentitas."', '".decrypt($id)."', '1')")[0]->ambil_data_reviewer_proposal; $urut = DB::select("select ambil_data_reviewer_proposal('".$this->rBiodata->noidentitas."', '".decrypt($id)."', '1')")[0]->ambil_data_reviewer_proposal;
$delete = ReviewerProposal::where('proposal_id', Crypt::decrypt($id))->where('urut', $urut)->update(['status_administrasi'=>$status]); $delete = ReviewerProposal::where('proposal_id', Crypt::decrypt($id))->where('urut', $urut)->update(['status_administrasi'=>$status]);
if ($delete) { if ($delete) {
...@@ -284,6 +286,8 @@ class DaftarSeleksiController extends Controller ...@@ -284,6 +286,8 @@ class DaftarSeleksiController extends Controller
{ {
$status = 'success'; $status = 'success';
$message = "Proposal Seleksi Internal Lolos Administrasi."; $message = "Proposal Seleksi Internal Lolos Administrasi.";
$this->createMonevInternal(Crypt::decrypt($id));
} }
elseif($status == '2') elseif($status == '2')
{ {
...@@ -308,4 +312,32 @@ class DaftarSeleksiController extends Controller ...@@ -308,4 +312,32 @@ class DaftarSeleksiController extends Controller
]); ]);
} }
} }
private function createMonevInternal($proposalId)
{
Log::debug('createMonevInternal');
$reviewerProposal = ReviewerProposal::where('proposal_id', $proposalId)->whereIn('urut', [1, 2]);
$count = $reviewerProposal->where('status_administrasi', 1)->count();
$monevInternal = MonevInternal::query()->where('proposal_id', $proposalId)->get();
Log::debug($count);
Log::debug($monevInternal->count());
if($count == 2){
for ($i = 3; $i < 5; $i++) {
$jenis = JenisMonev::query()->where('urut', $i)->first();
$monevInternal->where('jenis_monev_id', $jenis->jenis_monev_id);
if($monevInternal->count() == 0){
Log::debug('create monev');
MonevInternal::query()->create([
'proposal_id' => $proposalId,
'jenis_monev_id' => $jenis->jenis_monev_id,
'created_user' => 'SYSTEM',
]);
}
}
}
}
} }
...@@ -9,6 +9,7 @@ class DaftarProposal extends Model ...@@ -9,6 +9,7 @@ class DaftarProposal extends Model
protected $table = 'daftar_proposal'; protected $table = 'daftar_proposal';
protected $primaryKey = 'proposal_id'; protected $primaryKey = 'proposal_id';
public $incrementing = false; public $incrementing = false;
protected $keyType = 'string';
protected $fillable = [ protected $fillable = [
'proposal_id', 'jenis_id', 'kode', 'jenis_pkm', 'judul', 'status', 'status_hapus', 'status_administrasi_1', 'status_administrasi_2', 'reviewer_id_1', 'reviewer_id_2', 'status_final', 'nidn_reviewer_id_1', 'nidn_reviewer_id_2', 'upload_dokumen', 'date_upload', 'date_approval', 'identitas_ketua', 'identitas_dospem', 'periode' 'proposal_id', 'jenis_id', 'kode', 'jenis_pkm', 'judul', 'status', 'status_hapus', 'status_administrasi_1', 'status_administrasi_2', 'reviewer_id_1', 'reviewer_id_2', 'status_final', 'nidn_reviewer_id_1', 'nidn_reviewer_id_2', 'upload_dokumen', 'date_upload', 'date_approval', 'identitas_ketua', 'identitas_dospem', 'periode'
...@@ -18,4 +19,9 @@ class DaftarProposal extends Model ...@@ -18,4 +19,9 @@ class DaftarProposal extends Model
{ {
return $this->hasMany(\App\Models\KelompokDetail::class, 'kelompok_id', 'kelompok_id'); return $this->hasMany(\App\Models\KelompokDetail::class, 'kelompok_id', 'kelompok_id');
} }
public function proposalUrl()
{
return $this->hasMany(ProposalUrl::class, 'proposal_id', 'proposal_id');
}
} }
<?php
namespace App\Models;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ProposalUrl extends Model
{
use HasFactory;
use UuidTrait;
protected $table = 'proposal_url';
protected $primaryKey = 'id';
public $incrementing = false;
protected $keyType = 'string';
protected $fillable = [
'id',
'url',
'nama',
'deskripsi',
'proposal_id',
'created_at',
'updated_at',
];
}
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
<thead> <thead>
<tr> <tr>
<th scope="col" width="75%">Komponen</th> <th scope="col" width="75%">Komponen</th>
<th scope="col" width="10%">Bobot</th>
<th scope="col" width="15%">Aksi</th> <th scope="col" width="15%">Aksi</th>
</tr> </tr>
</thead> </thead>
...@@ -67,12 +66,10 @@ ...@@ -67,12 +66,10 @@
@foreach ($jenis_penilaian_monev as $key => $val) @foreach ($jenis_penilaian_monev as $key => $val)
<tr> <tr>
<td> <td>
<input type="hidden" class="form-control" name="jenis_penilaian_monev_id[]" required value="{{ encrypt($val->jenis_penilaian_monev_id) }}">
<input type="text" class="form-control" name="nama[]" required value="{{ $val->nama }}"> <input type="text" class="form-control" name="nama[]" required value="{{ $val->nama }}">
</td> </td>
<td> <td>
<input class="form-control input-mask reqBobot" data-inputmask="'mask': '9', 'repeat': 3, 'greedy' : false" name="bobot[]" maxlength="3" value="{{ $val->bobot }}">
</td>
<td>
<a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a> <a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a>
</td> </td>
</tr> </tr>
...@@ -83,27 +80,11 @@ ...@@ -83,27 +80,11 @@
<input type="text" class="form-control" name="nama[]" required> <input type="text" class="form-control" name="nama[]" required>
</td> </td>
<td> <td>
<input class="form-control input-mask reqBobot" data-inputmask="'mask': '9', 'repeat': 3, 'greedy' : false" name="bobot[]" maxlength="3">
</td>
<td>
<a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a> <a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a>
</td> </td>
</tr> </tr>
@endif @endif
</tbody> </tbody>
<tfoot>
<tr>
<td style="text-align: right">
<label>TOTAL BOBOT <span class="badge bg-info">(total bobot harus 100)</span></label>
</td>
<td>
<input class="form-control reqBobotTotal" readonly>
</td>
<td>
</td>
</tr>
</tfoot>
</table> </table>
</div> </div>
...@@ -162,33 +143,7 @@ ...@@ -162,33 +143,7 @@
function submitForm() function submitForm()
{ {
var sum = hitung(); $('#btnSubmit').click();
if(sum != '100')
{
Swal.fire({
title: "Gagal",
text: "Total Bobot harus 100",
icon: "error",
confirmButtonColor: "#556ee6"
});
}
else
{
$('#btnSubmit').click();
}
}
function hitung()
{
var sum = 0;
$(".reqBobot").each(function(){
sum += +$(this).val();
});
$(".reqBobotTotal").val(sum);
return sum;
} }
</script> </script>
@endsection @endsection
...@@ -11,12 +11,10 @@ ...@@ -11,12 +11,10 @@
validate: !0 validate: !0
}); });
</script> </script>
<input type="hidden" class="form-control" name="jenis_penilaian_monev_id[]" required value="{{ encrypt(Uuid::generate()) }}">
<input type="text" class="form-control" name="nama[]" required> <input type="text" class="form-control" name="nama[]" required>
</td> </td>
<td> <td>
<input class="form-control input-mask reqBobot" data-inputmask="'mask': '9', 'repeat': 3, 'greedy' : false" name="bobot[]" maxlength="3">
</td>
<td>
<a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a> <a onclick="$(this).parent().parent().remove();" class="btn btn-danger btn-sm btn-delete">Delete</a>
</td> </td>
</tr> </tr>
...@@ -57,15 +57,26 @@ ...@@ -57,15 +57,26 @@
@endif @endif
</div> </div>
</div> </div>
<div class="row mb-3" class="dropzone">
<label for="kode" class="col-sm-2 col-form-label">Tautan</label>
<div class="col-sm-10">
<ul>
@foreach ($proposal->proposalUrl as $item)
<li>
<a class="btn btn-link" href="{{ $item->url }}">{{ $item->url_name }}</a>
<p>{{ $item->deskripsi }}</p>
</li>
@endforeach
</ul>
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<label for="kode" class="col-sm-2 col-form-label">Komponen Penilaian : </label> <label for="kode" class="col-sm-2 col-form-label">Komponen Penilaian : </label>
<div class="col-sm-10"> <div class="col-sm-10">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr style="text-align: center"> <tr style="text-align: center">
<th style="width: 70%">Komponen</th> <th>Komponen</th>
<th style="width: 10%">Bobot</th>
<th style="width: 10%">Skor</th>
<th style="width: 10%">Nilai</th> <th style="width: 10%">Nilai</th>
</tr> </tr>
</thead> </thead>
...@@ -87,18 +98,14 @@ ...@@ -87,18 +98,14 @@
<input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}"> <input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}">
<span>{{ $val->nama }}</span> <span>{{ $val->nama }}</span>
</td> </td>
<td><span id="varBobot-{{ $val->jenis_penilaian_monev_id }}">{{ $val->bobot }}</span></td>
<td> <td>
<select name="skor[]" class="hitung_skor" data-id="{{ $val->jenis_penilaian_monev_id }}"> <select name="skor[]" class="hitung_skor" data-id="{{ $val->jenis_penilaian_monev_id }}">
<option value="1" @if($skor == '1') selected="selected" @endif>1</option> <option value="1" @if($skor == '1') selected="selected" @endif>1</option>
<option value="2" @if($skor == '2') selected="selected" @endif>2</option> <option value="2" @if($skor == '2') selected="selected" @endif>2</option>
<option value="3" @if($skor == '3') selected="selected" @endif>3</option> <option value="3" @if($skor == '3') selected="selected" @endif>3</option>
<option value="5" @if($skor == '5') selected="selected" @endif>5</option> <option value="5" @if($skor == '5') selected="selected" @endif>5</option>
<option value="6" @if($skor == '6') selected="selected" @endif>6</option>
<option value="7" @if($skor == '7') selected="selected" @endif>7</option>
</select> </select>
</td> </td>
<td><span id='varNilai-{{ $val->jenis_penilaian_monev_id }}' class="clsNilai">{{ $nilai }}</span></td>
</tr> </tr>
@php @php
$total += $nilai; $total += $nilai;
......
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