Exemplo n.º 1
0
 public function cetak()
 {
     $cek = $this->session->userdata('logged_in');
     $level = $this->session->userdata('level');
     if (!empty($cek) && $level == 'mahasiswa') {
         $nim = $this->session->userdata('username');
         $q = $this->db->query("SELECT * FROM wisuda as a \n\t\t\t\t\t\t\t\t\tJOIN mahasiswa as b\n\t\t\t\t\t\t\t\t\tON a.nim=b.nim\n\t\t\t\t\t\t\t\t\tWHERE a.nim='{$nim}' ");
         $r = $q->num_rows();
         if ($r > 0) {
             foreach ($q->result() as $dt) {
                 $tgl_daftar = $this->model_global->tgl_indo($dt->tgl_daftar);
                 $thak = $dt->th_akademik;
                 $nama = $dt->nama_mhs;
                 if ($dt->sex == 'L') {
                     $sex = 'Laki-laki';
                 } else {
                     $sex = 'Perempuan';
                 }
                 $prodi = $dt->kd_prodi . '-' . $this->model_data->nama_jurusan($dt->kd_prodi);
                 $tmpt_lhr = $dt->tempat_lahir;
                 $tgl_lhr = $this->model_global->tgl_indo($dt->tanggal_lahir);
                 $alamat = $dt->alamat;
                 $tgl_sidang = $this->model_global->tgl_indo($dt->tgl_sidang);
                 $skripsi = $dt->judul_skripsi;
                 $ipk = $dt->ipk;
             }
             $pdf = new reportProduct();
             $pdf->setKriteria("cetak_laporan");
             $pdf->setNama("CETAK LAPORAN");
             $pdf->AliasNbPages();
             $pdf->AddPage("P", "A4");
             //foreach($data->result() as $t){
             $A4[0] = 210;
             $A4[1] = 297;
             $Q[0] = 216;
             $Q[1] = 279;
             $pdf->SetTitle('Laporan Aplikasi');
             $pdf->SetCreator('Programmer IT with fpdf');
             $h = 10;
             $pdf->SetFont('Times', 'B', 16);
             $pdf->image(base_url() . 'assets/img/logo-black.png', 95, 5, 20, 20);
             $pdf->Ln(15);
             $pdf->Cell(190, 8, $this->config->item('nama_pendek'), 0, 1, 'C');
             $pdf->SetFont('Times', 'B', 14);
             $pdf->Cell(190, 5, $this->config->item('nama_instansi'), 0, 1, 'C');
             $pdf->SetFont('Times', '', 10);
             $pdf->Cell(190, 5, 'Alamat : ' . $this->config->item('alamat_instansi'), 0, 1, 'C');
             $pdf->Ln(10);
             //Column widths
             $pdf->SetFont('courier', 'B', 16);
             $pdf->Cell(190, 5, 'FORMULIR PENDAFTARAN WISUDA', 0, 1, 'C');
             $pdf->Cell(190, 5, $thak, 0, 1, 'C');
             $pdf->Ln(10);
             $pdf->SetFillColor(204, 204, 204);
             $pdf->SetTextColor(0);
             $fill = true;
             $h = 10;
             $wl = 50;
             $wr = 140;
             $pdf->SetFont('courier', '', 14);
             $pdf->Cell($wl, $h, 'Tanggal :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $tgl_daftar, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'NIM :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $nim, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'Nama Lengkap :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $nama, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'jenis Kelamin :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $sex, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'Tempat Lahir :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $tmpt_lhr, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'Tanggal Lahir :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $tgl_lhr, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'Alamat :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $alamat, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'Program Studi :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $prodi, 'TR', 1, 'L');
             $pdf->Cell($wl, $h, 'Tanggal Sidang :', 'LTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $tgl_sidang, 'TR', 1, 'L');
             $pdf->Cell(190, $h, 'Judul Skripsi :', 'LTR', 1, 'C', $fill);
             $fill = false;
             $pdf->MultiCell(190, 7, $skripsi, 'LTR', 1, 'L', $fill);
             $fill = true;
             $pdf->Cell($wl, $h, 'IPK :', 'LBTR', 0, 'R', $fill);
             $pdf->Cell($wr, $h, $ipk, 'BTR', 1, 'L');
             $h = 7;
             $pdf->Ln(10);
             $pdf->SetX(100);
             $pdf->Cell(80, $h, 'Serang, ' . $this->model_global->tgl_indo(date('Y-m-d')), 0, 1, 'C');
             $pdf->SetX(100);
             $pdf->Cell(80, $h, 'Mahasiswa yang bersangkutan,', 0, 1, 'C');
             $pdf->Ln(20);
             $pdf->SetX(100);
             $pdf->Cell(80, $h, $nama, 0, 1, 'C');
             $pdf->footer();
             //}
             //}
             $pdf->Output('Pendaftaran_Wisuda_' . $nim . '.pdf', 'D');
         } else {
             $this->session->set_flashdata('result_info', '<center>Tidak Ada Data</center>');
             redirect('site_mahasiswa/wisuda');
             //echo "Maaf Tidak ada data";
         }
     } else {
         redirect('login', 'refresh');
     }
 }
Exemplo n.º 2
0
 public function print_khs()
 {
     $cek = $this->session->userdata('logged_in');
     $level = $this->session->userdata('level');
     if (!empty($cek) && $level == 'mahasiswa') {
         $th_ak = $this->session->userdata('th_ak');
         $smt = $this->session->userdata('smt');
         $nim = $this->session->userdata('username');
         $q = $this->db->query("SELECT * FROM krs WHERE th_akademik='{$th_ak}' AND semester='{$smt}' AND nim='{$nim}' ");
         $r = $q->num_rows();
         if ($r > 0) {
             $nama = $this->model_data->cari_nama_mhs($nim);
             $kd_prodi = $this->model_data->cari_kd_prodi_mhs($nim);
             $prodi = $this->model_data->nama_jurusan($kd_prodi);
             $data_prodi = $this->model_data->cari_nama_ka_prodi($kd_prodi);
             $nama_ka_prodi = $data_prodi['nama'];
             $nik_ka_prodi = $data_prodi['nik'];
             $semester = $this->model_data->cari_smt_krs($th_ak, $smt, $nim);
             $ip = $this->model_data->cari_ipk($semester, $nim);
             $pdf = new reportProduct();
             $pdf->setKriteria("cetak_laporan");
             $pdf->setNama("CETAK LAPORAN");
             $pdf->AliasNbPages();
             $pdf->AddPage("P", "A4");
             //foreach($data->result() as $t){
             $A4[0] = 210;
             $A4[1] = 297;
             $Q[0] = 216;
             $Q[1] = 279;
             $pdf->SetTitle('Laporan Aplikasi');
             $pdf->SetCreator('Programmer IT with fpdf');
             $h = 10;
             $pdf->SetFont('Times', 'B', 16);
             $pdf->image(base_url() . 'assets/img/logo-black.png', 95, 5, 20, 20);
             $pdf->Ln(15);
             $pdf->Cell(190, 8, $this->config->item('nama_pendek'), 0, 1, 'C');
             $pdf->SetFont('Times', 'B', 14);
             $pdf->Cell(190, 5, $this->config->item('nama_instansi'), 0, 1, 'C');
             $pdf->SetFont('Times', '', 10);
             $pdf->Cell(190, 5, 'Alamat : ' . $this->config->item('alamat_instansi'), 0, 1, 'C');
             $pdf->Ln(7);
             //Column widths
             $pdf->SetFont('courier', 'B', 14);
             $pdf->Cell(198, 4, 'KARTU HASIL STUDI (KHS) MAHASISWA', 0, 1, 'C');
             $pdf->Ln(5);
             $h = 6;
             $pdf->SetFont('courier', '', 12);
             $pdf->Cell(30, $h, 'NIM', 0, 0, 'L');
             $pdf->Cell(50, $h, ': ' . $nim, 0, 0, 'L');
             $pdf->SetX(120);
             $pdf->Cell(35, $h, 'Tahun Akademik ', 0, 0, 'L');
             $pdf->Cell(50, $h, ': ' . $th_ak, 0, 1, 'L');
             $pdf->Cell(30, $h, 'Nama', 0, 0, 'L');
             $pdf->Cell(50, $h, ': ' . strtoupper($nama), 0, 0, 'L');
             $pdf->SetX(120);
             $pdf->Cell(35, $h, 'Semester ', 0, 0, 'L');
             $pdf->Cell(50, $h, ': ' . strtoupper($smt) . '/' . $semester, 0, 1, 'L');
             $pdf->Cell(30, $h, 'PRODI', 0, 0, 'L');
             $pdf->Cell(50, $h, ': S1 - ' . $prodi, 0, 0, 'L');
             $pdf->SetX(120);
             $pdf->Cell(35, $h, 'IP ', 0, 0, 'L');
             $pdf->Cell(50, $h, ': ' . $ip, 0, 1, 'L');
             $w = array(10, 20, 85, 10, 20, 20, 20);
             //Header
             $pdf->SetFont('courier', 'B', 10);
             $pdf->SetFillColor(204, 204, 204);
             $pdf->SetTextColor(0);
             $fill = true;
             $h = 8;
             $pdf->Cell($w[0], $h, 'No.', 'TB', 0, 'C', $fill);
             $pdf->Cell($w[1], $h, 'Kode', 'TB', 0, 'C', $fill);
             $pdf->Cell($w[2], $h, 'Mata Kuliah', 'TB', 0, 'C', $fill);
             $pdf->Cell($w[3], $h, 'SKS', 'TB', 0, 'C', $fill);
             $pdf->Cell($w[4], $h, 'N.Huruf', 'TB', 0, 'C', $fill);
             $pdf->Cell($w[5], $h, 'N.Angka', 'TB', 0, 'C', $fill);
             $pdf->Cell($w[6], $h, 'N.Bobot', 'TB', 0, 'C', $fill);
             $pdf->Ln();
             //data
             //$pdf->SetFillColor(224,235,255);
             $h = 7;
             $pdf->SetFont('courier', '', 9);
             $pdf->SetFillColor(204, 204, 204);
             $pdf->SetTextColor(0);
             $fill = false;
             $no = 1;
             $jmlsks = 0;
             $jmlnilai = 0;
             foreach ($q->result() as $row) {
                 $sks = $row->sks;
                 $angka = $this->model_data->cari_nilai_angka($row->nilai_akhir);
                 $akhir = $angka * $sks;
                 $pdf->Cell($w[0], $h, $no, 0, 0, 'C', $fill);
                 $pdf->Cell($w[1], $h, $row->kd_mk, 0, 0, 'C', $fill);
                 $pdf->Cell($w[2], $h, $row->nama_mk, 0, 0, 'L', $fill);
                 $pdf->Cell($w[3], $h, $row->sks, 0, 0, 'C', $fill);
                 $pdf->Cell($w[4], $h, $row->nilai_akhir, 0, 0, 'C', $fill);
                 $pdf->Cell($w[5], $h, $angka, 0, 0, 'C', $fill);
                 $pdf->Cell($w[6], $h, $akhir, 0, 0, 'C', $fill);
                 $pdf->Ln();
                 //$fill = !$fill;
                 $jmlsks = $jmlsks + $row->sks;
                 $jmlnilai = $jmlnilai + $akhir;
                 $no++;
             }
             //$ip = $jmlnilai/$jmlsks;
             // Closing line
             $pdf->Cell(array_sum($w), 0, '', 'T');
             $pdf->Ln();
             $pdf->SetFillColor(204, 204, 204);
             $pdf->SetTextColor(0);
             $fill = true;
             $h = 6;
             $pdf->SetFont('courier', 'B', 9);
             $pdf->Cell(115, $h, 'J U M L A H :', 'T', 0, 'C', $fill);
             $pdf->Cell(10, $h, $jmlsks, 'T', 0, 'C', $fill);
             $pdf->Cell(40, $h, '', 'T', 0, 'C', $fill);
             $pdf->Cell(20, $h, $jmlnilai, 'T', 0, 'C', $fill);
             $pdf->Ln();
             $pdf->Cell(115, $h, 'Indeks Prestasi (IP) :', 'TB', 0, 'C', $fill);
             $pdf->Cell(10, $h, '', 'TB', 0, 'C', $fill);
             $pdf->Cell(40, $h, number_format($ip, 2), 'TB', 0, 'C', $fill);
             $pdf->Cell(20, $h, '', 'TB', 0, 'C', $fill);
             $pdf->Ln(10);
             $h = 5;
             $pdf->SetFont('courier', '', 12);
             $pdf->Cell(50, $h, 'Menyetujui', 0, 0, 'C');
             $pdf->SetX(110);
             $pdf->Cell(100, $h, 'Serang, ' . $this->model_global->tgl_indo(date('Y-m-d')), 0, 1, 'C');
             $pdf->Cell(50, $h, 'Ketua Program Studi,', 0, 0, 'C');
             $pdf->SetX(110);
             $pdf->Cell(100, $h, 'Mahasiswa', 0, 1, 'C');
             $pdf->Ln(20);
             $pdf->Cell(50, $h, $nama_ka_prodi, 0, 0, 'C');
             $pdf->SetX(110);
             $pdf->Cell(100, $h, $nama, 0, 1, 'C');
             $pdf->Cell(50, $h, 'NIK : ' . $nik_ka_prodi, 0, 0, 'C');
             $pdf->SetX(110);
             $pdf->Cell(100, $h, 'NIM :' . $nim, 0, 1, 'C');
             $pdf->Ln(5);
             $h = 4;
             $pdf->SetFont('courier', 'B', 8);
             $pdf->Cell(100, $h, 'Catatan :', 0, 1, 'L');
             $pdf->SetFont('courier', '', 8);
             $pdf->MultiCell(0, $h, 'Jumlah maksimum SKS yang dapat diambil pada semester berikutnya berdasarkan indeks prestasi (IP) adalah sebagai berikut :');
             $pdf->Ln();
             $pdf->Cell(20, $h, '3.00 - 4.00', 0, 0, 'L');
             $pdf->Cell(50, $h, '= 24 SKS', 0, 0, 'L');
             $pdf->Ln();
             $pdf->Cell(20, $h, '2.50 - 2.99', 0, 0, 'L');
             $pdf->Cell(50, $h, '= 22 SKS', 0, 0, 'L');
             $pdf->Ln();
             $pdf->Cell(20, $h, '2.00 - 2.49', 0, 0, 'L');
             $pdf->Cell(50, $h, '= 20 SKS', 0, 0, 'L');
             $pdf->Ln();
             $pdf->Cell(20, $h, '1.50 - 1.99', 0, 0, 'L');
             $pdf->Cell(50, $h, '= 16 SKS', 0, 0, 'L');
             $pdf->Ln();
             $pdf->Cell(20, $h, '1.00 - 1.49', 0, 0, 'L');
             $pdf->Cell(50, $h, '= 14 SKS', 0, 0, 'L');
             $pdf->Ln();
             $pdf->Cell(20, $h, '0.00 - 0.99', 0, 0, 'L');
             $pdf->Cell(50, $h, '= 12 SKS', 0, 0, 'L');
             $pdf->footer();
             //}
             //}
             $pdf->Output('KHS_' . $th_ak . '_' . $smt . '_' . $nim . '.pdf', 'D');
         } else {
             $this->session->set_flashdata('result_info', '<center>Tidak Ada Data</center>');
             redirect('khs');
             //echo "Maaf Tidak ada data";
         }
     } else {
         redirect('login', 'refresh');
     }
 }