<?php 
if($xls==1){
  header('Content-type: application/word');
  $filename = 'Cetak_Perkara_Lalulintas.xls';
  header('Content-Disposition: attachment; filename='.$filename);

  $data = '<html xmlns:x="urn:schemas-microsoft-com:office:excel">
          <head>
              <!--[if gte mso 9]>
              <xml>
                  <x:ExcelWorkbook>
                      <x:ExcelWorksheets>
                          <x:ExcelWorksheet>
                              <x:Name>Sheet 1</x:Name>
                              <x:WorksheetOptions>
                                  <x:Print>
                                      <x:ValidPrinterInfo/>
                                  </x:Print>
                              </x:WorksheetOptions>
                          </x:ExcelWorksheet>
                      </x:ExcelWorksheets>
                  </x:ExcelWorkbook>
              </xml>
              <![endif]-->
          </head>' ; 
}else if($xls==2){
  header('Content-type: application/word');
  $filename = 'Cetak_Perkara_Lalulintas.doc';
  header('Content-Disposition: attachment; filename='.$filename);

  $data = '<html xmlns:x="urn:schemas-microsoft-com:office:excel">
          <head>
              <!--[if gte mso 9]>
              <xml>
                  <x:ExcelWorkbook>
                      <x:ExcelWorksheets>
                          <x:ExcelWorksheet>
                              <x:Name>Sheet 1</x:Name>
                              <x:WorksheetOptions>
                                  <x:Print>
                                      <x:ValidPrinterInfo/>
                                  </x:Print>
                              </x:WorksheetOptions>
                          </x:ExcelWorksheet>
                      </x:ExcelWorksheets>
                  </x:ExcelWorkbook>
              </xml>
              <![endif]-->
          </head>' ; 

}
?>
<style type='text/css'>
  table td {word-wrap:break-word;white-space: pre-line;}  
</style>

<div id="reg_med" >
<div style="width:100%;text-align:left;" >
  <tr><td><b><h3><?php echo $NamaPN; ?></h3></b></td></tr>
</div>
<table class="reg_mediasi" width="100%" border="1" cellspacing="0" cellpadding="4">
  <tr height="30" valign="center">
    <td><div align="center"><b>NO</b></div></td>
    <td><div align="center"><b>NOMOR REGISTER TILANG</b></div></td>
    <td><div align="center"><b>TANGGAL PENINDAKAN</b></div></td>
    <td><div align="center"><b>FORM TILANG</b></div></td>
    <td><div align="center"><b>NOMOR PEMBAYARAN</b></div></td>
    <td><div align="center"><b>KODE SATKER PENINDAK</b></div></td>
    <td><div align="center"><b>DESKRIPSI PENINDAK</b></div></td>
    <td><div align="center"><b>NAMA</b></div></td>
    <td><div align="center"><b>ALAMAT</b></div></td>
    <td><div align="center"><b>PASAL</b></div></td>
    <td><div align="center"><b>BARANG BUKTI</b></div></td>
    <td><div align="center"><b>JENIS KENDARAAN</b></div></td>
    <td><div align="center"><b>TANDA NOMOR KENDARAAN BERMOTOR</b></div></td>
    <td><div align="center"><b>UANG TITIPAN</b></div></td>
    <td><div align="center"><b>KODE SATKER PN</b></div></td>
    <td><div align="center"><b>NOMOR PERKARA</b></div></td>
    <td><div align="center"><b>NAMA HAKIM</b></div></td>
    <td><div align="center"><b>NAMA PANITERA</b></div></td>
    <td><div align="center"><b>KODE SATKER KEJAKSAAN</b></div></td>
    <td><div align="center"><b>TANGGAL SIDANG</b></div></td>
    <td><div align="center"><b>HADIR/VERSTEK</b></div></td>
    <td><div align="center"><b>DENDA</b></div></td>
    <td><div align="center"><b>BIAYA PERKARA</b></div></td>
    <td><div align="center"><b>SUBSIDER</b></div></td>
    <td><div align="center"><b>TANGGAL BAYAR</b></div></td>
    <td><div align="center"><b>SISA TITIPAN</b></div></td>
  </tr>
  <?php
  if(!empty($queryLalulintas)){
    $a=0;
    foreach ($queryLalulintas->result() as $row) {$a++;
      echo "<tr>";
        echo "<td valign='middle'>".$a."</td>";
        echo "<td valign='middle' align='left'>".$row->NomorTilang."</td>";
        echo "<td valign='middle' align='center'>".$row->TanggalPenindakan."</td>";
        echo "<td valign='middle' align='center'>".$row->JenisTilang."</td>";
        echo "<td valign='middle'>&nbsp;".$row->NomorPembayaran."</td>";
        echo "<td valign='middle' align='center'>".$row->KodeSatkerPolri."</td>";
        echo "<td valign='middle'>".$row->DeskripsiPolri."</td>";
        echo "<td valign='middle'>".$row->NamaPelanggar."</td>";
        echo "<td valign='middle'>".$row->AlamatPelanggar."</td>";
        echo "<td valign='middle'>".$row->PasalPelanggaran."</td>";
        echo "<td valign='middle'>".$row->BuktiTilang."</td>";
        echo "<td valign='middle'>".$row->JenisKendaraan."</td>";
        echo "<td valign='middle'>".$row->NomorPolisi."</td>";
        echo "<td valign='middle'>".$row->UangTitipan."</td>";
        echo "<td valign='middle' align='center'>".$row->KodeSatkerPN."</td>";
        echo "<td valign='middle'>".$row->NomorPerkara."</td>";
        echo "<td valign='middle'>".$row->NamaHakim."</td>";
        echo "<td valign='middle'>".$row->NamaPanitera."</td>";
        echo "<td valign='middle' align='center'>".$row->KodeSatkerKejaksaan."</td>";
        echo "<td valign='middle' align='center'>".$row->TanggalSidang."</td>";
        echo "<td valign='middle' align='center'>".$row->StatusKehadiran."</td>";
        echo "<td valign='middle'>".$row->DendaTilang."</td>";
        echo "<td valign='middle'>".$row->BiayaPerkara."</td>";
        echo "<td valign='middle'>".$row->SubsiderKurungan."</td>";
        echo "<td valign='middle'></td>";
        echo "<td valign='middle'></td>";
       echo "</tr>";
    }
   
  }
  ?>
</table>
</div>
