Commit 6c0dbf84 by Alfiro Pratama

Perintilan View

parent 934975c3
...@@ -191,14 +191,15 @@ class DaftarProposalController extends Controller ...@@ -191,14 +191,15 @@ class DaftarProposalController extends Controller
if($record->reviewerProposal1) { if($record->reviewerProposal1) {
if($record->reviewerProposal1->revisi_nilai != 1) { if($record->reviewerProposal1->revisi_nilai != 1) {
$revisi1 = ' $revisi1 = '
<br> <div align="center">
<button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal1->reviewer_proposal_id).'\')">Revisi</button> <button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal1->reviewer_proposal_id).'\')">Revisi</button>
</div>
'; ';
} }
else{ else{
$revisi1 = ' $revisi1 = '
<br> <br>
on review <p style="font-style: italic; text-align: center">On review</p>
'; ';
} }
} }
...@@ -216,18 +217,20 @@ class DaftarProposalController extends Controller ...@@ -216,18 +217,20 @@ class DaftarProposalController extends Controller
</td>'; </td>';
$revisi1 = ''; $revisi1 = '';
$revisi2 = ''; $revisi2 = '';
if($record->reviewerProposal2){ if($record->reviewerProposal2){
if($record->reviewerProposal2->revisi_nilai != 1) { if($record->reviewerProposal2->revisi_nilai != 1) {
$revisi2 = ' $revisi2 = '
<br> <div align="center">
<button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal2->reviewer_proposal_id).'\')">Revisi</button> <button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal2->reviewer_proposal_id).'\')">Revisi</button>
</div>
'; ';
} }
else{ else{
$revisi2 = ' $revisi2 = '
<br> <br>
on review <p style="font-style: italic; text-align: center">On review</p>
'; ';
} }
} }
...@@ -265,26 +268,28 @@ class DaftarProposalController extends Controller ...@@ -265,26 +268,28 @@ class DaftarProposalController extends Controller
if($status_final == '1') if($status_final == '1')
{ {
$aksi = '<span class="badge bg-success">Lolos</span>'; $aksi = '<div align="center"><span class="badge bg-success" style="font-size: 12pt;">Lolos</span></div>';
} }
elseif($status_final == '2') elseif($status_final == '2')
{ {
$aksi = '<span class="badge bg-danger">Tidak Lolos</span>'; $aksi = '<div align="center"><span class="badge bg-danger style="font-size: 12pt;"">Tidak Lolos</span></div>';
} }
else else
{ {
$aksi = '<td class="table-action"> $aksi = '<td class="table-action">
<a href="#!" class="btn btn-icon-sm btn-success" onclick="'.$lolos.'"><i class="fas fa-check"></i></a> <div align="center">
<a href="#!" class="btn btn-icon-sm btn-danger" onclick="'.$tidak_lolos.'"><i class="fas fa-ban"></i></a> <a href="#!" style="margin-right: 3px;" class="btn btn-icon-sm btn-success" onclick="'.$lolos.'"><i class="fas fa-check"></i></a>
<a href="#!" class="btn btn-icon-sm btn-danger" onclick="'.$tidak_lolos.'"><i class="fas fa-ban"></i></a>
</div>
</td>'; </td>';
} }
$pendanaan = ' $pendanaan = '
<td> <td>
Usulan Dana: '.$record->usulan_dana.' Usulan Dana: Rp'.number_format($record->usulan_dana, 0, ",", ",").'
<br> <br>
<br> <br>
Diberikan: '.$record->pendanaan.' Diberikan: Rp'.number_format($record->pendanaan, 0, ",", ",").'
</td> </td>
'; ';
...@@ -755,7 +760,13 @@ class DaftarProposalController extends Controller ...@@ -755,7 +760,13 @@ class DaftarProposalController extends Controller
$status = $request->status; $status = $request->status;
$tahun= $request->tahun; $tahun= $request->tahun;
return Excel::download(new DaftarProposalExport($jenis, $status, $tahun), 'seleksi_export.xlsx'); // dd($jenis, $tahun, $status);
return Excel::download(new DaftarProposalExport($jenis, $status, $tahun), 'daftar_seleksi_internal_'.$tahun.'-export_pmw.xlsx');
// $daftarProposalExport = new DaftarProposalExport($jenis, $status, $tahun);
// $data = $daftarProposalExport->view(); // Mendapatkan koleksi data
// return $data;
} }
public function cetak_daftar_belmawa(Request $request) public function cetak_daftar_belmawa(Request $request)
...@@ -795,8 +806,8 @@ class DaftarProposalController extends Controller ...@@ -795,8 +806,8 @@ class DaftarProposalController extends Controller
} }
$data = DaftarProposal::with('rKelompokDetil') $data = DaftarProposal::with('rKelompokDetil')
->select("*") ->select("*")
->selectRaw(" round((ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_1) + ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_2 )) / 2, 2) as rata ")->whereRaw($statement)->get(); ->selectRaw(" round((ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_1) + ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_2 )) / 2, 2) as rata ")->whereRaw($statement)->get();
$result = []; $result = [];
$x =0; $x =0;
......
<?php
namespace App\Models;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Carbon\Carbon;
class BuktiAnggaran extends Model
{
use HasFactory, SoftDeletes, UuidTrait;
protected $table = 'bukti_anggaran';
protected $primaryKey = 'id';
public $incrementing = false;
protected $keyType = 'string';
protected $fillable = [
'proposal_id',
'monev_id',
'nama_kegiatan',
'nama_barang',
'kuantitas',
'jenis_satuan',
'harga_satuan',
'total_harga_per',
'total_harga_seluruh',
'nota_file',
'created_user',
'updated_user',
'deleted_user',
];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
// Jika ada relasi, tambahkan disini
public function rProposal()
{
return $this->belongsTo(Proposal::class, 'proposal_id', 'proposal_id');
}
public function rMonev()
{
return $this->belongsTo(MonevInternal::class, 'monev_id', 'id');
}
}
...@@ -35,6 +35,8 @@ class MonevInternal extends Model ...@@ -35,6 +35,8 @@ class MonevInternal extends Model
'kemajuan_date', 'kemajuan_date',
'akhir_file', 'akhir_file',
'akhir_date', 'akhir_date',
'produk_url',
'produk_date',
]; ];
public function rProposal() public function rProposal()
...@@ -62,5 +64,9 @@ class MonevInternal extends Model ...@@ -62,5 +64,9 @@ class MonevInternal extends Model
return $this->hasMany(VDaftarMonev::class, 'proposal_id', 'proposal_id')->with(['rReviewerBio1', 'rReviewerBio2']); return $this->hasMany(VDaftarMonev::class, 'proposal_id', 'proposal_id')->with(['rReviewerBio1', 'rReviewerBio2']);
} }
public function rBuktiAnggaran()
{
return $this->hasMany(BuktiAnggaran::class, 'id', 'monev_id');
}
} }
...@@ -4,7 +4,6 @@ namespace App\Models; ...@@ -4,7 +4,6 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Traits\UuidTrait; use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class Proposal extends Model class Proposal extends Model
...@@ -110,6 +109,11 @@ class Proposal extends Model ...@@ -110,6 +109,11 @@ class Proposal extends Model
return $this->hasOne(ReviewerProposal::class, 'proposal_id', 'proposal_id'); return $this->hasOne(ReviewerProposal::class, 'proposal_id', 'proposal_id');
} }
public function rBuktiAnggaran()
{
return $this->hasMany(BuktiAnggaran::class, 'proposal_id', 'proposal_id');
}
public function rBelmawa() public function rBelmawa()
{ {
return $this->hasOne(SeleksiBelmawa::class, 'proposal_id', 'proposal_id'); return $this->hasOne(SeleksiBelmawa::class, 'proposal_id', 'proposal_id');
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="bg-primary"> <div class="bg-primary">
<div class="text-primary text-center p-4"> <div class="text-primary text-center p-4">
<h5 class="text-white font-size-20">LOGIN</h5> <h5 class="text-white font-size-20">LOGIN</h5>
<p class="text-white-50">Sistem Informasi PMW.</p> <p class="text-white-50">Sistem Informasi PMW</p>
<a href="{{ url('/') }}" class="logo logo-admin"> <a href="{{ url('/') }}" class="logo logo-admin">
<img src="{{ asset('theme/images/logo-login.png') }}" height="66" alt="logo"> <img src="{{ asset('theme/images/logo-login.png') }}" height="66" alt="logo">
</a> </a>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</div> </div>
<div class="mt-5 text-center"> <div class="mt-5 text-center">
<p class="mb-0">© <script>document.write(new Date().getFullYear())</script> SIM PMW. Crafted with <i class="mdi mdi-heart text-danger"></i> by PPTI</p> <p class="mb-0">© <script>document.write(new Date().getFullYear())</script> SIM PMW. Crafted with <i class="mdi mdi-heart text-danger"></i> by PPTI UNESA</p>
</div> </div>
......
...@@ -110,10 +110,10 @@ ...@@ -110,10 +110,10 @@
@endif @endif
</td> </td>
<td> <td>
<a data-toggle="tooltip" data-id="{{ $item->proposal_id }}" data-original-title="Lihat" class="btn btn-info btn-sm lihatDet"><i class="far fa-eye"></i> Lihat</a> <a data-toggle="tooltip" data-id="{{ $item->proposal_id }}" data-original-title="Lihat" class="btn btn-info btn-sm form-control mb-2 lihatDet"><i class="far fa-eye"></i> Lihat</a>
@if($item->status == '0') @if($item->status == '0')
<a onclick="setuju('{{ encrypt($item->proposal_id) }}', 'row-{{ $token }}')" class="btn btn-success btn-sm"><i class="fas fa-check"></i> Setuju</a> <a onclick="setuju('{{ encrypt($item->proposal_id) }}', 'row-{{ $token }}')" class="btn btn-success btn-sm form-control mb-2"><i class="fas fa-check"></i> Setuju</a>
<a href="" id="revPro" data-toggle="modal" data-target='#practice_modal' data-id="{{ encrypt($item->proposal_id) }}" class="btn btn-danger btn-sm"><i class="fas fa-times"></i> Tolak</a> <a href="" id="revPro" data-toggle="modal" data-target='#practice_modal' data-id="{{ encrypt($item->proposal_id) }}" class="btn btn-danger btn-sm form-control"><i class="fas fa-times"></i> Tolak</a>
@endif @endif
</td> </td>
</tr> </tr>
...@@ -266,6 +266,12 @@ function setuju(id, rowId){ ...@@ -266,6 +266,12 @@ function setuju(id, rowId){
videoUrl = videoUrl.replace('youtu.be/', 'youtube.com/watch?v='); videoUrl = videoUrl.replace('youtu.be/', 'youtube.com/watch?v=');
} }
if (videoUrl.includes('youtu.be')) {
videoUrl = videoUrl.split('?')[0];
} else if (videoUrl.includes('youtube.com/watch?v=')) {
videoUrl = videoUrl.split('&')[0];
}
// Buka video dalam Magnific Popup jika valid, buka di tab baru jika tidak // Buka video dalam Magnific Popup jika valid, buka di tab baru jika tidak
if (isValidYouTubeUrl(videoUrl)) { if (isValidYouTubeUrl(videoUrl)) {
$.magnificPopup.open({ $.magnificPopup.open({
......
...@@ -248,71 +248,79 @@ ...@@ -248,71 +248,79 @@
@if (count($proposal) > 0) @if (count($proposal) > 0)
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Event handler untuk tombol "Lihat Video" dengan ID preview-video // Event handler untuk tombol "Lihat Video" dengan ID preview-video
$('#preview-video').on('click', function() { $('#preview-video').on('click', function() {
var videoUrl = $(this).attr('data-video'); var videoUrl = $(this).attr('data-video');
// console.log(videoUrl); // console.log(videoUrl);
if (videoUrl) { if (videoUrl) {
// Buka video dalam Magnific Popup // Buka video dalam Magnific Popup
if (videoUrl.includes('youtu.be')) { if (videoUrl.includes('youtu.be')) {
// Konversi ke format youtube.com/watch?v=xxxxx // Konversi ke format youtube.com/watch?v=xxxxx
videoUrl = videoUrl.replace('youtu.be/', 'youtube.com/watch?v='); videoUrl = videoUrl.replace('youtu.be/', 'youtube.com/watch?v=');
} }
// Buka video dalam Magnific Popup jika valid, buka di tab baru jika tidak // Menghapus parameter query dari URL
if (isValidYouTubeUrl(videoUrl)) { if (videoUrl.includes('youtu.be')) {
$.magnificPopup.open({ videoUrl = videoUrl.split('?')[0];
items: { } else if (videoUrl.includes('youtube.com/watch?v=')) {
src: videoUrl videoUrl = videoUrl.split('&')[0];
}, }
type: 'iframe',
iframe: { // Buka video dalam Magnific Popup jika valid, buka di tab baru jika tidak
markup: '<div class="mfp-iframe-scaler">'+ if (isValidYouTubeUrl(videoUrl)) {
'<div class="mfp-close"></div>'+ $.magnificPopup.open({
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen allow="autoplay"></iframe>'+ items: {
'</div>' src: videoUrl
}, },
callbacks: { type: 'iframe',
open: function() { iframe: {
// Sembunyikan modal lama saat Magnific Popup dibuka markup: '<div class="mfp-iframe-scaler">'+
$('#{{ 'lihat'.$item->proposal_id }}').modal('hide'); '<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen allow="autoplay"></iframe>'+
'</div>'
},
callbacks: {
open: function() {
// Sembunyikan modal lama saat Magnific Popup dibuka
$('#{{ 'lihat'.$item->proposal_id }}').modal('hide');
// Mulai autoplay video setelah Magnific Popup dibuka // Mulai autoplay video setelah Magnific Popup dibuka
var iframe = this.content.find('iframe'); var iframe = this.content.find('iframe');
if (iframe.length > 0) { if (iframe.length > 0) {
var videoSrc = iframe.attr('src'); var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc + '&autoplay=1'); // Tambahkan autoplay=1 ke URL video iframe.attr('src', videoSrc + '&autoplay=1'); // Tambahkan autoplay=1 ke URL video
} }
}, },
close: function() { close: function() {
// Tampilkan kembali modal lama setelah Magnific Popup ditutup // Tampilkan kembali modal lama setelah Magnific Popup ditutup
$('#{{ 'lihat'.$item->proposal_id }}').modal('show'); $('#{{ 'lihat'.$item->proposal_id }}').modal('show');
// Hentikan autoplay video saat Magnific Popup ditutup // Hentikan autoplay video saat Magnific Popup ditutup
var iframe = this.content.find('iframe'); var iframe = this.content.find('iframe');
if (iframe.length > 0) { if (iframe.length > 0) {
var videoSrc = iframe.attr('src'); var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc.replace('&autoplay=1', '')); // Hapus autoplay=1 dari URL video iframe.attr('src', videoSrc.replace('&autoplay=1', '')); // Hapus autoplay=1 dari URL video
}
} }
} }
});
} else {
// Tampilkan pesan kesalahan jika URL video tidak valid
window.open(videoUrl, '_blank');
} }
} else { });
console.error('URL video tidak valid:', videoUrl); } else {
} // Buka video di tab baru jika tidak valid
}); window.open(videoUrl, '_blank');
function isValidYouTubeUrl(url) { }
// Lakukan validasi sederhana menggunakan ekspresi reguler } else {
return /^(http(s)?:\/\/)?((w){3}.)?youtu(be|.be)?(\.com)?\/.+/gm.test(url); console.error('URL video tidak valid:', videoUrl);
} }
}); });
</script> function isValidYouTubeUrl(url) {
// Lakukan validasi sederhana menggunakan ekspresi reguler
return /^(http(s)?:\/\/)?((w){3}\.)?youtu(be|\.be)?(\.com)?\/.+/gm.test(url);
}
});
</script>
@endif @endif
{{-- <script> {{-- <script>
......
...@@ -81,9 +81,9 @@ ...@@ -81,9 +81,9 @@
<br> <br>
<div class="table-responsive"> <div class="table-responsive">
<table id="example" class="table table-bordered dt-responsive wrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;"> <table id="example" class="table table-bordered dt-responsive wrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead> <thead style="text-align: center; vertical-align: middle">
<tr> <tr>
<th id</th> <th> id</th>
<th width='5%'>Kode Kelompok</th> <th width='5%'>Kode Kelompok</th>
<th width='15%'>Jenis PMW</th> <th width='15%'>Jenis PMW</th>
<th width='20%'>Judul Proposal</th> <th width='20%'>Judul Proposal</th>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<br> <br>
<div class="table-responsive"> <div class="table-responsive">
<table id="example" class="table table-bordered dt-responsive wrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;"> <table id="example" class="table table-bordered dt-responsive wrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead> <thead align="center" valign="middle">
<tr> <tr>
<th>id</th> <th>id</th>
<th>Kode Kelompok</th> <th>Kode Kelompok</th>
......
...@@ -109,6 +109,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () { ...@@ -109,6 +109,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
//monev-ii -> anggaran //monev-ii -> anggaran
Route::get('/monev/II/anggaran/{id}', [MonevMahasiswa::class, 'buktiAnggaran'])->name('monev-anggaran'); Route::get('/monev/II/anggaran/{id}', [MonevMahasiswa::class, 'buktiAnggaran'])->name('monev-anggaran');
Route::post('/monev/II/anggaran/store', [MonevMahasiswa::class, 'storeAnggaran'])->name('monev-anggaran-store');
//luaran //luaran
Route::resource('luaran', LuaranMahasiswa::class); Route::resource('luaran', LuaranMahasiswa::class);
...@@ -182,8 +183,8 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () { ...@@ -182,8 +183,8 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route::post('seleksi-internal-proposal-jenis', [DaftarProposalController::class, 'change_jenis'])->name('seleksi-internal-proposal-jenis'); Route::post('seleksi-internal-proposal-jenis', [DaftarProposalController::class, 'change_jenis'])->name('seleksi-internal-proposal-jenis');
Route::post('seleksi-internal-reviewer-approval', [DaftarProposalController::class, 'approval'])->name('seleksi-internal.approval'); Route::post('seleksi-internal-reviewer-approval', [DaftarProposalController::class, 'approval'])->name('seleksi-internal.approval');
Route::get('getDaftarProposal', [DaftarProposalController::class, 'getData'])->name('getDaftarProposal'); Route::get('getDaftarProposal', [DaftarProposalController::class, 'getData'])->name('getDaftarProposal');
Route::get('cetak-daftar-proposal', [DaftarProposalController::class, 'cetak_daftar_proposal'])->name('cetak-daftar-proposal'); Route::get('cetak-daftar-proposal-new', [DaftarProposalController::class, 'cetak_daftar_proposal'])->name('cetak-daftar-proposal');
Route::get('cetak-daftar-proposal-new', [DaftarProposalController::class, 'cetak_daftar_proposal_new'])->name('cetak-daftar-proposal-new'); // Route::get('cetak-daftar-proposal-new', [DaftarProposalController::class, 'cetak_daftar_proposal_new'])->name('cetak-daftar-proposal-new');
Route::post('seleksi-internal/buka-penilaian', [DaftarProposalController::class, 'bukaPenilaian'])->name('seleksi-internal.buka-penilaian'); Route::post('seleksi-internal/buka-penilaian', [DaftarProposalController::class, 'bukaPenilaian'])->name('seleksi-internal.buka-penilaian');
// SELEKSI BELMAWA // SELEKSI BELMAWA
......
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