Commit 3734f95c by Novan Bagus Setiawan

cetak monev internal

parent 43916083
......@@ -422,4 +422,98 @@ class MonevProposalController extends Controller
return Excel::download(new DaftarProposalMonevExport($jenis, $status, $tahun), 'seleksi_monev_export.xlsx');
}
public function cetak_daftar_monev_internal_new(Request $request)
{
$id = $request->id;
$reqId = Crypt::decrypt($id);
$jenis = $request->jenis;
$status = $request->status;
$tahun= $request->tahun;
ini_set('memory_limit', '-1');
$statement = " STATUS_HAPUS = '0' AND JENIS_MONEV_ID = '".$reqId."' ";
if($jenis != "0")
{
$statement .= " AND jenis_id = '".$jenis."'";
}
if($status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $status - 1;
$statement .= " AND STATUS_FINAL = '".$status."'";
}
if($tahun != "0")
{
$statement .= " AND PERIODE = '".$tahun."'";
}
$data = DaftarProposalMonev::with('rKelompokDetil')
->select("*")
->selectRaw(" round((ambil_jumlah_penilaian_monev(reviewer_monev_id_1, '".$reqId."') + ambil_jumlah_penilaian_monev(reviewer_monev_id_2, '".$reqId."')) / 2, 2) as rata ")->whereRaw($statement)->get();
$result = [];
$x =0;
$dospem = '';
foreach ($data as $key => $value) {
// $dospem = "(".str_replace("###",") ",$value->identitas_dospem);
$data_dospem = explode('###', $value->identitas_dospem);
$data_ketua = explode('###', $value->identitas_ketua);
$dospem = "(".$data_dospem[0].") ".$data_dospem[1];
$url = "https://statik.unesa.ac.id/simpkm/monev/".$value->periode."/".$value->upload_dokumen;
if($value->status_final == '1')
$status_final = "Lolos";
elseif($value->status_final == '2')
$status_final = "Tidak Lolos";
else
$status_final = "Menunggu Persetujuan";
$urut = 1;
$det = array();
$no = 0;
foreach ($value->rKelompokDetil as $keys => $detil) {
if($detil->status_ketua == '1')
{
$keanggotaan = "Ketua";
}
else
{
$keanggotaan = "Anggota ".$urut;
$urut++;
}
$det[$no]['fak'] = $detil->fakultas;
$det[$no]['nama'] = $detil->nama;
$det[$no]['nim']= $detil->nim;
$det[$no]['keanggotaan'] = $keanggotaan;
$no++;
}
$result[$x]['rowspan'] = count($value->rKelompokDetil);
$result[$x]['kode'] = $value->kode;
$result[$x]['jenis'] = $value->jenis_pkm;
$result[$x]['detil'] = $det;
$result[$x]['judul'] = $value->judul;
$result[$x]['dospem'] = $dospem;
$result[$x]['link'] = $url;
$result[$x]['status'] = $status_final;
$result[$x]['rata'] = $value->rata;
$result[$x]['email_dospem'] = end($data_dospem);
$result[$x]['email_ketua'] = end($data_ketua);
$x++;
}
$datas['list_proposal'] = $result;
$datas['jenis_monev'] = 'Seleksi Internal';
return view('backend.operator.daftar_proposal.monev_excel_new', $datas);
}
}
......@@ -295,7 +295,7 @@
var status = $("#reqStatus").val();
var tahun = $("#reqTahun").val();
window.open('{{url("/operator/cetak-daftar-monev-internal/")}}?id='+id+'&jenis='+jenis+'&tahun='+tahun+'&status='+status+'&_token='+_token, '_blank');
window.open('{{url("/operator/cetak-daftar-monev-internal-new/")}}?id='+id+'&jenis='+jenis+'&tahun='+tahun+'&status='+status+'&_token='+_token, '_blank');
};
</script>
......
@php
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-Disposition: attachment; filename=daftar-proposal-monev-internal.xls"); //File name extension was wrong
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
@endphp
<table border="1">
<thead>
<tr>
<td style="border: 1px solid #000000;"><strong>No</strong></td>
<td style="border: 1px solid #000000;"><strong>Kode Kelompok</strong></td>
<td style="border: 1px solid #000000;"><strong>Jenis PKM</strong></td>
<td style="border: 1px solid #000000;"><strong>Fak.</strong></td>
<td style="border: 1px solid #000000;"><strong>Nama</strong></td>
<td style="border: 1px solid #000000;"><strong>NIM</strong></td>
<td style="border: 1px solid #000000;"><strong>Ketua/Anggota</strong></td>
<td style="border: 1px solid #000000;"><strong>Email Ketua</strong></td>
<td style="border: 1px solid #000000;"><strong>Judul Proposal</strong></td>
<td style="border: 1px solid #000000;"><strong>Dosen Pembimbing</strong></td>
<td style="border: 1px solid #000000;"><strong>Email Dosen Pembimbing</strong></td>
<td style="border: 1px solid #000000;"><strong>Link Proposal</strong></td>
<td style="border: 1px solid #000000;"><strong>Status {{ $jenis_monev }}</strong></td>
<td style="border: 1px solid #000000;"><strong>Nilai Akhir</strong></td>
</tr>
</thead>
<tbody>
@php
$no = 1;
$tempKode = '';
@endphp
@foreach ($list_proposal as $proposal)
{{-- @if($tempKode != $proposal['kode']) --}}
<tr>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $no++ }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['kode'] }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['jenis'] }}</th>
@foreach ($proposal['detil'] as $res => $val)
@if($res == 0)
<th style="border: 1px solid #000000;">{{ $val['fak'] }}</th>
<th style="border: 1px solid #000000;">{{ $val['nama'] }}</th>
<th style="border: 1px solid #000000;">{{ $val['nim'] }}</th>
<th style="border: 1px solid #000000;">{{ $val['keanggotaan'] }}</th>
@endif
@endforeach
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['email_ketua'] }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['judul'] }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['dospem'] }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['email_dospem'] }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">
@if(!isset($proposal['link']))
<a href="{{ $proposal['link'] }}" target="_blank">Link</a></th>
@endif
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['status'] }}</th>
<th rowspan="{{ $proposal['rowspan'] }}" style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['rata'] }}</th>
</tr>
{{-- @else --}}
@foreach ($proposal['detil'] as $res => $val)
@if($res != 0)
<tr valign="top">
<th style="border: 1px solid #000000;">{{ $val['fak'] }}</th>
<th style="border: 1px solid #000000;">{{ $val['nama'] }}</th>
<th style="border: 1px solid #000000;">{{ $val['nim'] }}</th>
<th style="border: 1px solid #000000;">{{ $val['keanggotaan'] }}</th>
</tr>
@endif
@endforeach
{{-- @endif --}}
@php
// $tempKode = $proposal['kode'];
@endphp
@endforeach
</tbody>
</table>
......@@ -199,6 +199,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route::get('/monev-internal-reviewer-approval/{id}/{status}', [MonevProposalController::class, 'approval'])->name('monev-internal.approval');
Route::get('getMonevProposal', [MonevProposalController::class, 'getData'])->name('getMonevProposal');
Route::get('cetak-daftar-monev-internal', [MonevProposalController::class, 'cetak_daftar_monev_internal'])->name('cetak-daftar-monev-internal');
Route::get('cetak-daftar-monev-internal-new', [MonevProposalController::class, 'cetak_daftar_monev_internal_new'])->name('cetak-daftar-monev-internal-new');
Route::resource('user', UserController::class);
Route::post('/user/remove-role', [UserController::class, 'removeRole'])->name('remove-role');
......
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