Skip to main content

Aplikasi Raport SD Kurikulum 2013

<?php

$path  = $_SERVER['DOCUMENT_ROOT'];
    $path1 = "/raport/assets/mpdf60/mpdf.php";
    include ($path.$path1);
ob_start();

?>
<?php
$link = mysqli_connect("localhost", "root", "", "raport");
$id_raport = $_GET['id_raport'];
$id_raport_siswa = $_GET['id_raport_siswa'];
$kelas = '1';
$semester = '2';
?>

<style>
td {
    padding: 3px 5px 3px 5px;
    border-right: 1px solid #666666;
    border-bottom: 1px solid #666666;
}

.head td {
    font-weight: bold;
    font-size: 12px;
    background: #b7f0ff;
}

table .main tbody tr td {
    font-size: 12px;
}

table, table .main {
    width: 100%;
    border-top: 1px solid #666;
    border-left: 1px solid #666;
    border-collapse: collapse;
    background: #fff;
}

h1 {
    font-size:20px;
}
</style>

<?php
    $query_siswa = "SELECT * FROM data_siswa WHERE id_raport = '$id_raport' AND id_raport_siswa = '$id_raport_siswa'";
    $query_raport = "SELECT * FROM data_raport WHERE id_raport = '$id_raport'";
    $result_siswa = mysqli_query($link, $query_siswa);
    $result_raport = mysqli_query($link, $query_raport);
    $row_siswa=mysqli_fetch_row($result_siswa);
    $row_raport=mysqli_fetch_row($result_raport);
    mysqli_report(MYSQLI_REPORT_ERROR);
  
    $nama_panggilan_siswa = $row_siswa[6];
?>
      
<table class='main' repeat_header="1" cellspacing="0" width="100%" style="width:100%">
<tbody>
<tr><td>Nama Peserta Didik</td><td>:</td><td><?=$row_siswa[3];?></td><td>Kelas</td><td>:</td><td>4</td></tr>
<tr><td>Nomor Induk</td><td>:</td><td><?=$row_siswa[4]; ?>/<?=$row_siswa[5]; ?></td><td>Semester</td><td>:</td><td>Ganjil</td></tr>
<tr><td>Nama Sekolah</td><td>:</td><td><?=$row_raport[2];?></td><td>Semester</td><td>:</td><td>I (Ganjil)</td></tr>
<tr><td valign="top">Alamat Sekolah</td><td valign="top">:</td><td valign="top"><?=$row_raport[4];?></td><td valign="top">Tahun Pelajaran</td><td valign="top">:</td><td valign="top">2016/2017</td></tr>
</tbody>
</table>

<h3>A. KOMPETENSI SIKAP</h3>
<table class='main' repeat_header="1" cellspacing="0" width="100%" style="width:100%">
    <thead>
        <tr class="head">
    <td width ='5%'>No.</td><td>Aspek</td><td>Deskripsi</td>
        </tr>
    </thead>
    <tbody>
    <?php
    $query_sikap = "SELECT * FROM kompetensi_inti WHERE ki = 'KI-1' OR ki = 'KI-2' AND kelas = '$kelas' AND semester = '$semester' GROUP BY mata_pelajaran";
  
    $result_sikap = mysqli_query($link, $query_sikap);
    mysqli_report(MYSQLI_REPORT_ERROR);
    $i=1;
    while ($row_sikap=mysqli_fetch_row($result_sikap))
    {      
        echo "<tr><td>$i</td><td>$row_sikap[5]</td><td valign='top'>";
            $query_1 = "SELECT * FROM kompetensi_inti WHERE mata_pelajaran = '$row_sikap[5]' AND kelas = '$kelas' AND semester = '$semester'";
            $result_1 = mysqli_query($link, $query_1);
                while ($row_1=mysqli_fetch_row($result_1))
                {
                echo $nama_panggilan_siswa . ' dalam ' .$row_1[7];
                }
        echo "</td></tr>";
    $i++;  
    }
  
    ?>
  
    </tbody>
</table>

<h3>B. KOMPETENSI PENGETAHUAN DAN KETERAMPILAN</h3>
<table class='main' repeat_header="1" cellspacing="0" width="100%" style="width:100%">
    <thead>
        <tr class="head">
    <td width ='5%'>No.</td><td>Mata Pelajaran</td><td>Nilai</td><td>Predikat</td><td>Deskripsi</td><td>Nilai</td><td>Predikat</td><td>Deskripsi</td>
        </tr>
    </thead>
    <tbody>
  
    <?php
        $query_ki = "SELECT * FROM kompetensi_inti WHERE ki = 'KI-3' OR ki = 'KI-4' AND kelas = '$kelas' GROUP BY mata_pelajaran ";
        $result_ki = mysqli_query($link, $query_ki);
        mysqli_report(MYSQLI_REPORT_ERROR);
        $iki=1;
        while ($row_ki=mysqli_fetch_row($result_ki))
        {
                echo "<tr><td>$iki</td><td>$row_ki[5]</td>
                <td>1</td>
                <td>2</td>
                    <td valign='top'>";
                    $query_ki3 = "SELECT * FROM kompetensi_inti WHERE ki = 'KI-3' AND mata_pelajaran='$row_ki[5]' AND kelas = '$kelas'";
                    $result_ki3 = mysqli_query($link, $query_ki3);
                    mysqli_report(MYSQLI_REPORT_ERROR);
                    while ($row_ki3=mysqli_fetch_row($result_ki3))
                    {
                        echo $nama_panggilan_siswa . ' dalam ' . $row_ki3[7];
  
                    }
                    echo "</td>
                <td>4</td>
                <td>3</td>
                    <td valign='top'>";
                    $query_ki4 = "SELECT * FROM kompetensi_inti WHERE ki = 'KI-4' AND mata_pelajaran='$row_ki[5]' AND kelas = '$kelas'";
                    $result_ki4 = mysqli_query($link, $query_ki4);
                    mysqli_report(MYSQLI_REPORT_ERROR);
                    while ($row_ki4=mysqli_fetch_row($result_ki4))
                    {
                        echo $nama_panggilan_siswa . ' dalam '.$row_ki4[7];
                    }
                    echo "</td>
                </tr>";
        $iki++;      
        }
    ?>
      
    </tbody>
    </table>
  
<h3>C. EKSTRAKURIKULER</h3>
<h3>D. TINGGI DAN BERAT BADAN</h3>
<h3>E. KONDISI KESEHATAN</h3>
<h3>F. PRESTASI</h3>
<h3>G. KETIDAKHADIRAN</h3>
<h3>H. SARAN-SARAN</h3>


<?php
$content = ob_get_clean();

$header = '<table cellpadding=0 cellspacing=0 style="border:none;">
           <tr><td style="border:none;" align="left"><img src="images/logo_kab_bantul.jpg" width="5%"></td>
           <td width="95%" style="border:none;"><h2><center>RAPOR DAN PROFIL PESERTA DIDIK</center></h2></td></tr></table>';

$footer = '<table cellpadding=0 cellspacing=0 style="border:none;">
           <tr><td style="margin-right:-5px;border:none;" align="left">
           Dicetak: '.date("Y-m-d H:i").'</td>
           <td style="margin-right:-5px;border:none;" align="right">
           Halaman: {PAGENO} / {nb}</td></tr></table>';          

try {
    $mpdf=new mPDF('utf-8', "F4", 9 ,'Arial', 8, 8, 20, 5, 5, 4);
    $mpdf->SetTitle("Raport Kurikulum 2013");
    $mpdf->setHTMLHeader($header);
    $mpdf->setHTMLFooter($footer);
    $stylesheet = file_get_contents('css/style_1.css');
    $mpdf->WriteHTML($stylesheet,1);
    $mpdf->WriteHTML($content);
    $mpdf->Output("raport.pdf","I");
} catch(Exception $e) {
    echo $e;
    exit;
}
?>

Comments

Popular posts from this blog

FPDF dengan CodeIgniter

Cetak Surat Keputusan Controller: <?php //File in controller named surat_keputusan.php defined('BASEPATH') OR exit('No direct script access allowed'); class Cetak_surat_keputusan extends CI_Controller { public function __construct()     {         parent::__construct();         $this->load->helper('url');         $this->load->database();                $this->db->select();         $this->db->from('surat.config_sk');                $query = $this->db->get();                 return $query->result();             } public function index() {      ...

Preview PDF di Modal Bootstrap dengan Ajax

//preview pdf in line function preview_surat_keputusan(no) { $('#form')[0].reset(); $('.form-group').removeClass('has-error'); $('.help-block').empty(); $.ajax({ url : "<?php echo site_url('surat_keputusan/ajax_preview/')?>/" + no, type: "GET", dataType: "JSON",     success: function(data)     {     //paramater yang akan ditampilkan di modal         $('[name="no"]').val(data.no);         $('[name="ns"]').val(data.ns);         $('[name="thts"]').val(data.thts);         $('[name="pdf"]').val("http://localhost/dosdm/document/sm/pdf/"+data.thts+"-SK-"+data.ns+".pdf");         var link_base =  "http://localhost/dosdm/document/sm/pdf/"+data.thts+"-SK-"+data.ns+".pdf" ;             $('#pdf_view').attr('src', link_base);      ...

Hack File .xlsb

For first you must create a backup copy of your Workbook!!! Then you have to rename the XLSB file with ZIP extension. Test.XLSB => Test.ZIP             Opening your ZIP file using a compression software (e.g. WinRar) I can see the content of the file, structured in folders Inside the folder xl you can find a binary file named vbaProject.bin. Extract it on your desktop and edit it using a text editor. In my case I used Notepad++. Using the Find function of your editor, you must search the text DPB And replace the DPB string with DPx Then save the vbaProject.bin and replace this file inside the .ZIP File, renaming then .ZIP file in XLSB. Reopening the XLSB file using Excel, you will get an error message: you have to answer Yes to this error message. Then  Save , Close and Reopen your XLSB file. Now, if you go to VBA Editor (ALT + F11), you ca...