fix pendaftaran, penilaian seleksi internal

parent aee5f874
......@@ -49,7 +49,7 @@ class LoginController extends Controller
try {
$clientbiodata = new Client();
$apiRequestbiodata = $clientbiodata->request('GET', 'https://sso.unesa.ac.id/userid/'.'ranum.18066@mhs.unesa.ac.id');
$apiRequestbiodata = $clientbiodata->request('GET', 'https://sso.unesa.ac.id/userid/'.'chumairo.18008@mhs.unesa.ac.id');
$aksessso = json_decode($apiRequestbiodata->getBody()->getContents());
} catch (\Exception $apiRequestbiodata) {
$gagal_login = 'Data Tidak Ditemukan';
......
......@@ -198,6 +198,7 @@ class KelompokController extends Controller
$kelompok = Kelompok::query()->find($kel['kelompok_id']);
$kelompok->status = 1;
$kelompok->kirim = 1;
$kelompok->save();
......
......@@ -31,7 +31,7 @@ class MonevController extends Controller
->where('nama','Monev Internal '.$id)->first();
$title = 'Monev Internal '.$id;
$proposal = MonevInternal::with(['rProposal', 'rJenisMonev'])
$proposal = MonevInternal::with(['rProposal', 'rJenisMonev', 'rNilaiMonevAll'])
->whereHas('rProposal', function ($query) use($nim){
$query->whereHas('rKelompok', function ($query) use($nim){
$query->whereHas('rAnggota', function ($query) use($nim){
......
......@@ -138,7 +138,7 @@ class ProposalController extends Controller
$file_nama = $periode->nama.'_'.$uuid.'.'.$proposal['file']->getClientOriginalExtension();
Storage::disk('local')->put('simpmw/proposal/'.$periode->nama.'/'.$file_nama, file_get_contents($proposal['file']->getRealPath()));
Storage::disk('static')->put('simpmw/proposal/'.$periode->nama.'/'.$file_nama, file_get_contents($proposal['file']->getRealPath()));
$kel = Proposal::create([
'proposal_id' => $uuid,
......
......@@ -27,6 +27,9 @@ use App\Models\DaftarProposalBelmawa;
use App\Models\ReviewerProposalDetil;
use App\Exports\DaftarProposalMonevExport;
use App\Exports\DaftarProposalBelmawaExport;
use App\Models\JenisMonev;
use App\Models\MonevInternal;
use Illuminate\Support\Facades\Log;
class DaftarProposalController extends Controller
{
......@@ -522,6 +525,8 @@ class DaftarProposalController extends Controller
{
$status = 'success';
$message = "Proposal Seleksi Internal Lolos.";
$this->createMonevInternal(Crypt::decrypt($id));
}
elseif($status == '2')
{
......@@ -547,6 +552,30 @@ class DaftarProposalController extends Controller
}
}
private function createMonevInternal($proposalId)
{
$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();
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',
]);
}
}
}
}
public function approval_belmawa($id, $status)
{
try {
......
......@@ -286,8 +286,6 @@ class DaftarSeleksiController extends Controller
{
$status = 'success';
$message = "Proposal Seleksi Internal Lolos Administrasi.";
$this->createMonevInternal(Crypt::decrypt($id));
}
elseif($status == '2')
{
......@@ -312,28 +310,4 @@ class DaftarSeleksiController extends Controller
]);
}
}
private function createMonevInternal($proposalId)
{
$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();
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',
]);
}
}
}
}
}
......@@ -54,7 +54,12 @@ class MonevInternal extends Model
public function rNilaiMonev()
{
return $this->hasOne(VDaftarMonev::class, 'proposal_id', 'proposal_id')->with(['rReviewerBio1', 'rReviewerBio2']);
return $this->hasOne(VDaftarMonev::class, 'proposal_id', 'proposal_id')->where('jenis_monev_id', $this->jenis_monev_id)->with(['rReviewerBio1', 'rReviewerBio2']);
}
public function rNilaiMonevAll()
{
return $this->hasMany(VDaftarMonev::class, 'proposal_id', 'proposal_id')->with(['rReviewerBio1', 'rReviewerBio2']);
}
}
......
......@@ -127,6 +127,9 @@
</td>
</tr>
<tr>
@php
$nilaiMonev = $item->rNilaiMonev->where('jenis_monev_id', $idmonev);
@endphp
<th>Nilai</th>
<td>
<h4 class="card-title mb-4">Reviewer 1 - {{ $item->rNilaiMonev->rReviewerBio1 ? $item->rNilaiMonev->rReviewerBio1->nama : '' }}</h4>
......
......@@ -64,6 +64,7 @@
<th>Judul Proposal</th>
<th width="10%">Catatan Harian (Logbook)</th>
<th width="10%">Laporan Kemajuan</th>
<th width="8%">Laporan Akhir</th>
<th width="10%">Luaran</th>
<th>Aksi</th>
</tr>
......@@ -80,16 +81,23 @@
<td>{{ $item->rProposal->judul }}</td>
<td>
@if(is_null($item->logbook_file))
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->id.'__logbook__II')) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Upload</a>
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->proposal_id.'__logbook__III')) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Upload</a>
@else
<a href="https://statik.unesa.ac.id/simpmw/monev/II/logbook/{{ $item->logbook_file }}" target="_blank" title="Logbook" class="btn btn-info btn-sm waves-effect waves-light"> <i class="fas fa-search"></i> Lihat</a>
<a href="https://statik.unesa.ac.id/simpmw/monev/III/logbook/{{ $item->logbook_file }}" target="_blank" title="Logbook" class="btn btn-info btn-sm waves-effect waves-light"> <i class="fas fa-search"></i> Lihat</a>
@endif
</td>
<td>
@if(is_null($item->kemajuan_file))
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->id.'__kemajuan__II')) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Upload</a>
@if(is_null($item->laporan_kemajuan_file))
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->proposal_id.'__kemajuan__III')) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Upload</a>
@else
<a href="https://statik.unesa.ac.id/simpmw/monev/II/kemajuan/{{ $item->kemajuan_file }}" target="_blank" title="Laporan Kemajuan" class="btn btn-info btn-sm waves-effect waves-light"> <i class="fas fa-search"></i> Lihat</a>
<a href="https://statik.unesa.ac.id/simpmw/monev/III/kemajuan/{{ $item->kemajuan_file }}" target="_blank" title="Laporan Kemajuan" class="btn btn-info btn-sm waves-effect waves-light"> <i class="fas fa-search"></i> Lihat</a>
@endif
</td>
<td>
@if(is_null($item->laporan_akhir_file))
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->proposal_id.'__akhir__III')) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Upload</a>
@else
<a href="https://statik.unesa.ac.id/simpmw/monev/III/akhir/{{ $item->akhir_file }}" target="_blank" title="Laporan Akhir" class="btn btn-info btn-sm waves-effect waves-light"> <i class="fas fa-search"></i> Lihat</a>
@endif
</td>
<td>
......@@ -97,7 +105,7 @@
</td>
<td align="center">
<button data-bs-toggle="modal" data-bs-target="{{ '#lihat'.$item->id }}" class="btn btn-success btn-sm"> <i class="fas fa-search"></i> Hasil Penilaian</button>
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->id.'__proposal__II')) }}" type="button" class="btn btn-danger btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Revisi</a>
<a href="{{ URL::to('mahasiswa/monev-revisi/'.encrypt($item->id.'__proposal__III')) }}" type="button" class="btn btn-danger btn-sm waves-effect waves-light"> <i class="fas fa-file-upload"></i> Revisi</a>
<div id="{{ 'lihat'.$item->id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true">
......@@ -166,7 +174,7 @@
</table>
@else
<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong>Informasi!</strong> Monev Internal II dilaksanakan pada : <strong>Tanggal {{ Carbon\Carbon::parse($jadwal->tanggal_mulai)->isoFormat('D MMMM Y'); }}</strong> sampai dengan <strong>Tanggal {{ Carbon\Carbon::parse($jadwal->tanggal_selesai)->isoFormat('D MMMM Y'); }}.</strong>
<strong>Informasi!</strong> Monev Internal III dilaksanakan pada : <strong>Tanggal {{ Carbon\Carbon::parse($jadwal->tanggal_mulai)->isoFormat('D MMMM Y'); }}</strong> sampai dengan <strong>Tanggal {{ Carbon\Carbon::parse($jadwal->tanggal_selesai)->isoFormat('D MMMM Y'); }}.</strong>
</div>
@endif
......
......@@ -83,7 +83,6 @@
<option value="3" @if($skor == '3') selected="selected" @endif>3</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>
</td>
{{-- <td><span id='varNilai-{{ $val->jenis_penilaian_monev_id }}' class="clsNilai">{{ $nilai }}</span></td> --}}
......
......@@ -96,14 +96,16 @@
<tr class="table-light">
<td>
<input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}">
<span>{{ $val->nama }} {{ $val->bobot }}</span>
<span>{{ $val->nama }}</span>
</td>
<td>
<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="2" @if($skor == '2') selected="selected" @endif>2</option>
<option value="3" @if($skor == '3') selected="selected" @endif>3</option>
<option value="4" @if($skor == '4') selected="selected" @endif>4</option>
<option value="5" @if($skor == '5') selected="selected" @endif>5</option>
<option value="6" @if($skor == '6') selected="selected" @endif>6</option>
</select>
</td>
</tr>
......
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