Commit 6c0dbf84 by Alfiro Pratama

Perintilan View

parent 934975c3
......@@ -191,14 +191,15 @@ class DaftarProposalController extends Controller
if($record->reviewerProposal1) {
if($record->reviewerProposal1->revisi_nilai != 1) {
$revisi1 = '
<br>
<button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal1->reviewer_proposal_id).'\')">Revisi</button>
<div align="center">
<button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal1->reviewer_proposal_id).'\')">Revisi</button>
</div>
';
}
else{
$revisi1 = '
<br>
on review
<p style="font-style: italic; text-align: center">On review</p>
';
}
}
......@@ -216,18 +217,20 @@ class DaftarProposalController extends Controller
</td>';
$revisi1 = '';
$revisi2 = '';
if($record->reviewerProposal2){
if($record->reviewerProposal2->revisi_nilai != 1) {
$revisi2 = '
<br>
<button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal2->reviewer_proposal_id).'\')">Revisi</button>
<div align="center">
<button class="btn btn-warning btn-sm" onclick="revisi(\''.encrypt($record->reviewerProposal2->reviewer_proposal_id).'\')">Revisi</button>
</div>
';
}
else{
$revisi2 = '
<br>
on review
<p style="font-style: italic; text-align: center">On review</p>
';
}
}
......@@ -265,26 +268,28 @@ class DaftarProposalController extends Controller
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')
{
$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
{
$aksi = '<td class="table-action">
<a href="#!" 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 align="center">
<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>';
}
$pendanaan = '
<td>
Usulan Dana: '.$record->usulan_dana.'
Usulan Dana: Rp'.number_format($record->usulan_dana, 0, ",", ",").'
<br>
<br>
Diberikan: '.$record->pendanaan.'
Diberikan: Rp'.number_format($record->pendanaan, 0, ",", ",").'
</td>
';
......@@ -755,7 +760,13 @@ class DaftarProposalController extends Controller
$status = $request->status;
$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)
......@@ -795,8 +806,8 @@ class DaftarProposalController extends Controller
}
$data = DaftarProposal::with('rKelompokDetil')
->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();
->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();
$result = [];
$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
'kemajuan_date',
'akhir_file',
'akhir_date',
'produk_url',
'produk_date',
];
public function rProposal()
......@@ -62,5 +64,9 @@ class MonevInternal extends Model
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;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Traits\UuidTrait;
use Illuminate\Database\Eloquent\Model;
class Proposal extends Model
......@@ -110,6 +109,11 @@ class Proposal extends Model
return $this->hasOne(ReviewerProposal::class, 'proposal_id', 'proposal_id');
}
public function rBuktiAnggaran()
{
return $this->hasMany(BuktiAnggaran::class, 'proposal_id', 'proposal_id');
}
public function rBelmawa()
{
return $this->hasOne(SeleksiBelmawa::class, 'proposal_id', 'proposal_id');
......
......@@ -30,7 +30,7 @@
<div class="bg-primary">
<div class="text-primary text-center p-4">
<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">
<img src="{{ asset('theme/images/logo-login.png') }}" height="66" alt="logo">
</a>
......@@ -68,7 +68,7 @@
</div>
<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>
......
......@@ -110,10 +110,10 @@
@endif
</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')
<a onclick="setuju('{{ encrypt($item->proposal_id) }}', 'row-{{ $token }}')" class="btn btn-success btn-sm"><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 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 form-control"><i class="fas fa-times"></i> Tolak</a>
@endif
</td>
</tr>
......@@ -266,6 +266,12 @@ function setuju(id, rowId){
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
if (isValidYouTubeUrl(videoUrl)) {
$.magnificPopup.open({
......
......@@ -248,71 +248,79 @@
@if (count($proposal) > 0)
<script>
$(document).ready(function() {
// Event handler untuk tombol "Lihat Video" dengan ID preview-video
$('#preview-video').on('click', function() {
var videoUrl = $(this).attr('data-video');
// console.log(videoUrl);
// Event handler untuk tombol "Lihat Video" dengan ID preview-video
$('#preview-video').on('click', function() {
var videoUrl = $(this).attr('data-video');
// console.log(videoUrl);
if (videoUrl) {
// Buka video dalam Magnific Popup
if (videoUrl.includes('youtu.be')) {
// Konversi ke format youtube.com/watch?v=xxxxx
videoUrl = videoUrl.replace('youtu.be/', 'youtube.com/watch?v=');
}
if (videoUrl) {
// Buka video dalam Magnific Popup
if (videoUrl.includes('youtu.be')) {
// Konversi ke format youtube.com/watch?v=xxxxx
videoUrl = videoUrl.replace('youtu.be/', 'youtube.com/watch?v=');
}
// Buka video dalam Magnific Popup jika valid, buka di tab baru jika tidak
if (isValidYouTubeUrl(videoUrl)) {
$.magnificPopup.open({
items: {
src: videoUrl
},
type: 'iframe',
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<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');
// Menghapus parameter query dari URL
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
if (isValidYouTubeUrl(videoUrl)) {
$.magnificPopup.open({
items: {
src: videoUrl
},
type: 'iframe',
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<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
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc + '&autoplay=1'); // Tambahkan autoplay=1 ke URL video
}
},
close: function() {
// Tampilkan kembali modal lama setelah Magnific Popup ditutup
$('#{{ 'lihat'.$item->proposal_id }}').modal('show');
// Mulai autoplay video setelah Magnific Popup dibuka
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc + '&autoplay=1'); // Tambahkan autoplay=1 ke URL video
}
},
close: function() {
// Tampilkan kembali modal lama setelah Magnific Popup ditutup
$('#{{ 'lihat'.$item->proposal_id }}').modal('show');
// Hentikan autoplay video saat Magnific Popup ditutup
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
iframe.attr('src', videoSrc.replace('&autoplay=1', '')); // Hapus autoplay=1 dari URL video
}
// Hentikan autoplay video saat Magnific Popup ditutup
var iframe = this.content.find('iframe');
if (iframe.length > 0) {
var videoSrc = iframe.attr('src');
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);
}
});
function isValidYouTubeUrl(url) {
// Lakukan validasi sederhana menggunakan ekspresi reguler
return /^(http(s)?:\/\/)?((w){3}.)?youtu(be|.be)?(\.com)?\/.+/gm.test(url);
});
} else {
// Buka video di tab baru jika tidak valid
window.open(videoUrl, '_blank');
}
} else {
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
{{-- <script>
......
......@@ -81,9 +81,9 @@
<br>
<div class="table-responsive">
<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>
<th id</th>
<th> id</th>
<th width='5%'>Kode Kelompok</th>
<th width='15%'>Jenis PMW</th>
<th width='20%'>Judul Proposal</th>
......
......@@ -75,7 +75,7 @@
<br>
<div class="table-responsive">
<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>
<th>id</th>
<th>Kode Kelompok</th>
......
......@@ -109,6 +109,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
//monev-ii -> 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
Route::resource('luaran', LuaranMahasiswa::class);
......@@ -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-reviewer-approval', [DaftarProposalController::class, 'approval'])->name('seleksi-internal.approval');
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_new'])->name('cetak-daftar-proposal-new');
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::post('seleksi-internal/buka-penilaian', [DaftarProposalController::class, 'bukaPenilaian'])->name('seleksi-internal.buka-penilaian');
// 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