runQuery($query); $idKKKetua = -1; $currentKK = ''; while ($aRow = $db->dbFetch($result)) { $idKKKetua = $aRow['idKK']; $currentKK = $aRow['namaKK']; } $query = "SELECT * FROM tbdosen WHERE iddosen = '".$_SESSION['login-dosen']['id']."'"; $result = $db->runQuery($query); $namaDosen = ''; $nipDosen = ''; while ($aRow = $db->dbFetch($result)) { $namaDosen = $aRow['nmLengkap']; $nipDosen = $aRow['nip']; } /* * Paging */ $sLimit = ''; if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { $sLimit = 'LIMIT '.intval($_GET['iDisplayStart']).', '. intval($_GET['iDisplayLength']); } /* * Ordering */ //$sOrder = 'ORDER BY tp.tgl_upload DESC, tp.judul ASC'; $sOrder = 'ORDER BY t.tgl_upload DESC, t.judul ASC'; /* * Filtering */ $sWhere = ''; if (isset($_GET['sSearch']) && $_GET['sSearch'] != '') { $sWhere = 'WHERE ('; for ($i = 0; $i < count($aColumns); ++$i) { if (isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == 'true') { $sWhere .= ''.$aColumns[$i]." LIKE '%".$_GET['sSearch']."%' OR "; } } $sWhere = substr_replace($sWhere, '', -3); $sWhere .= ')'; } /* Individual column filtering */ for ($i = 0; $i < count($aColumns); ++$i) { if (isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == 'true' && $_GET['sSearch_'.$i] != '') { if ($sWhere == '') { $sWhere = 'WHERE '; } else { $sWhere .= ' AND '; } $sWhere .= ''.$aColumns[$i]." LIKE '%".$_GET['sSearch_'.$i]."%' "; } } $where2 = ''; if ($sWhere != '') { $where2 = " AND tp.idProdi='$idprodi' "; } else { $where2 = " WHERE tp.idProdi='$idprodi' "; } /* * SQL queries * Get data to display */ $sqlKK = 'SELECT * FROM tb_kelompok_keahlian'; $db->runQuery($sqlKK); $dataKK = []; while ($kk = $db->dbFetch()) { $idKK = $kk['idKK']; $namaKK = $kk['namaKK']; $warnaLabel = $kk['warnaLabel']; $dataKK[$idKK] = ['nama' => $namaKK, 'label' => $warnaLabel]; } $whereJenis = ''; if (isset($_GET['jenis'])) { $jenis = $_GET['jenis']; if ($jenis != 'Semua') { switch ($jenis) { case 'Belum Disetujui': $whereJenis = ' AND found = 0 '; break; case 'Sudah Disetujui': $whereJenis = ' AND found > 0 '; break; } } } $whereTanggal = ''; $periodeText = "SEMUA TANGGAL"; if (isset($_GET['show'])) { $showTanggal = $_GET['show']; if ($showTanggal == '1') { $tanggalAwal = date('Y-m-d', strtotime($_GET['startDate'])); $tanggalAkhir = date('Y-m-d', strtotime($_GET['endDate'])); $tanggalAwalDMY = date('d-m-Y', strtotime($_GET['startDate'])); $tanggalAkhirDMY = date('d-m-Y', strtotime($_GET['endDate'])); $whereTanggal = " AND tgl_kep >= '$tanggalAwal' AND tgl_kep <= '$tanggalAkhir'"; $periodeText = "$tanggalAwalDMY s/d $tanggalAkhirDMY"; } } $sQuery0 = " SELECT * FROM (SELECT tp.*, tm.nmLengkap as nm_mhs, tgl_kep, (SELECT COUNT(id) as found FROM tbrekaphasil WHERE idpraoutline = tp.id), wkt_kep FROM $sTable $sWhere $where2 ) t WHERE kelompokKeahlian = '$idKKKetua' $whereJenis $whereTanggal $sOrder "; $db->runQuery($sQuery0); $iFilteredTotal = $db->dbRows(); $result = $db->runQuery($sQuery0.$sLimit); /* Total data set length */ $sQuery2 = " SELECT COUNT(tp.id) as total FROM $sTable $sWhere $where2 GROUP BY tp.id "; //echo $sQuery2; $db->runQuery($sQuery2); $aResultTotal = $db->dbFetch(); $iTotal = $aResultTotal['total']; /*$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() ); $aResultTotal = mysql_fetch_array($rResultTotal); $iTotal = $aResultTotal[0];*/ /* * Output */ $output = [ 'sEcho' => intval($_GET['sEcho']), 'iTotalRecords' => $iTotal, 'iTotalDisplayRecords' => $iFilteredTotal, 'aaData' => [], ]; $listData = []; while ($aRow = $db->dbFetch($result)) { $row = []; $statusPraoutline = ''; if ($aRow['status_usulan'] == 0) { $statusPraoutline = 'Belum Diterima'; } elseif ($aRow['status_usulan'] == 1) { $statusPraoutline = 'Judul Diterima'; } elseif ($aRow['status_usulan'] == 2) { $statusPraoutline = 'Judul Ditolak'; } elseif ($aRow['status_usulan'] == 3) { $statusPraoutline = 'Judul Gugur'; } $tglKep = ''; if($aRow['tgl_kep'] != null){ $tglKep = tanggalIndo($aRow['tgl_kep'], 'j F Y'). ' '.$aRow['wkt_kep']; } array_push($listData, [ 'statusPraoutline' => $statusPraoutline, 'nama' => $aRow['nm_mhs'], 'nim' => $aRow['nim'], 'judul' => $aRow['judul'], 'sem' => $aRow['thn_ajaran'].' - '.$aRow['semester'], 'upload' => tanggalIndo($aRow['tgl_upload'], 'j F Y, H:i'), 'keputusan' => $tglKep, ]); } $titleDokumen = "LAPORAN KINERJA KELOMPOK KEAHLIAN $currentKK JURUSAN INFORMATIKA FAK. TEKNIK Periode: $periodeText"; $mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8', 'format' => 'A4', 'margin_header' => 0, 'margin_top' => 10, 'margin_bottom' => 3, 'margin_left' => 10, 'margin_right' => 10, 'margin_footer' => 0], ['defaultPageNumStyle' => '1']); $html = ' '.$titleDokumen.'
LAPORAN KINERJA KELOMPOK KEAHLIAN
'.$currentKK.'
JURUSAN INFORMATIKA FAK. TEKNIK
Periode: '.$periodeText.'

'; if(sizeof($listData) == 0){ $html .= ''; } for ($i = 0; $i < sizeof($listData); ++$i) { $dataProp = $listData[$i]; $no = $i + 1; $html .= ' '; } $html .= '
No Mahasiswa Judul Usulan Status Tahun Ajaran Tanggal Upload Tanggal Keputusan
Tidak ada data.
'.$no.' '.$dataProp['nama'].' / '.$dataProp['nim'].' '.$dataProp['judul'].' '.$dataProp['statusPraoutline'].' '.$dataProp['sem'].' '.$dataProp['upload'].' '.$dataProp['keputusan'].'
Pontianak, '.tanggalIndo(date('Y-m-d'), 'j F Y').'
Ketua KK '.$currentKK.'





'.$namaDosen.'
NIP. '.$nipDosen.'
'; $mpdf->shrink_tables_to_fit = 0; $mpdf->WriteHTML($html); $namafile = $titleDokumen.'-'.time(); $mpdf->Output($namafile, 'I');