Commit c69be37f by Farendi Giotivano R.P

tambah download excel mintanya yg ketua aj

parent 88925cae
......@@ -715,4 +715,89 @@ class DaftarProposalController extends Controller
return view('backend.operator.daftar_proposal.excel_new', $datas);
}
public function cetak_daftar_proposal_ketua(Request $request)
{
$jenis = $request->jenis;
$status = $request->status;
$tahun = $request->tahun;
ini_set('memory_limit', '-1');
$statement = " STATUS_HAPUS = '0' ";
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 = 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();
$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/proposal/" . $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.excel_ketuaaja', $datas);
}
}
@php
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-Disposition: attachment; filename=daftar-proposal-seleksi-internal-ketua.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 style="vertical-align: top; border: 1px solid #000000;">{{ $no++ }}</th>
<th style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['kode'] }}</th>
<th 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 style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['email_ketua'] }}</th>
<th style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['judul'] }}</th>
<th style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['dospem'] }}</th>
<th style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['email_dospem'] }}</th>
<th style="vertical-align: top; border: 1px solid #000000;"><a href="{{ $proposal['link'] }}" target="_blank">Link</a></th>
<th style="vertical-align: top; border: 1px solid #000000;">{{ $proposal['status'] }}</th>
<th 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>
......@@ -23,7 +23,8 @@
</div>
<div class="col-md-4">
<div class="float-end d-none d-md-block">
<button onclick="cetak()" class="btn btn-primary waves-effect waves-light"> <i class="fas fa-file-excel"></i> Unduh</button>
<button onclick="cetak_ketua()" class="btn btn-primary waves-effect waves-light"> <i class="fas fa-file-excel"></i> Unduh Ketua</button>
<button onclick="cetak()" class="btn btn-primary waves-effect waves-light"> <i class="fas fa-file-excel"></i> Unduh Anggota</button>
</div>
</div>
</div>
......@@ -331,5 +332,14 @@
window.open('{{url("/operator/cetak-daftar-proposal-new/")}}?jenis='+jenis+'&tahun='+tahun+'&status='+status+'&_token='+_token, '_blank');
};
function cetak_ketua() {
var _token = $('input[name="_token"]').val();
var jenis = $("#reqJenisPkm").val();
var status = $("#reqStatus").val();
var tahun = $("#reqTahun").val();
window.open('{{url("/operator/cetak-daftar-proposal-ketua/")}}?jenis='+jenis+'&tahun='+tahun+'&status='+status+'&_token='+_token, '_blank');
};
</script>
@endsection
......@@ -78,6 +78,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route::get('/kelompok-new/{id}', [MahasiswaKelompok::class, 'newkelompok'])->name('kelompok.createnew');
Route::post('/kelompok-kirim', [MahasiswaKelompok::class, 'kirim'])->name('kelompok.kirim');
Route::post('/kelompok-hapus', [MahasiswaKelompok::class, 'hapus'])->name('kelompok.hapus');
Route::post('/anggota-hapus', [MahasiswaKelompok::class, 'hapusanggota'])->name('anggota.hapus');
Route::resource('anggota', AnggotaController::class);
......@@ -180,6 +181,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
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-ketua', [DaftarProposalController::class, 'cetak_daftar_proposal_ketua'])->name('cetak-daftar-proposal-ketua');
// SELEKSI BELMAWA
Route::get('seleksi-belmawa', [DaftarProposalController::class, 'index_belmawa'])->name('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