<?php 
if($xls==1){
  header('Content-type: application/word');
  $filename = 'Register_Mediasi_diluar_Pengadilan.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 = 'Register_Mediasi_diluar_Pengadilan.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:1700;text-align:center;" >
  <div class="title">BUKU REGISTER MEDIASI DI LUAR PENGADILAN</div>
  <div class="title"><?php echo $this->session->userdata('namaPN');?></div>
  <div class="subtitle">Bulan : <?php echo $bulan_name;?> Tahun : <?php echo $tahun;?></div>
</div>
<br>
<table class="reg_mediasi" width="1700" border="1" cellspacing="0" cellpadding="4">
  <tr>
    <td width="20" valign="top"><p>No Urut</p></td>
    <td width="150" valign="top"><ol>
      <li>No Perkara</li>
      <li>Tanggal Pendaftaran </li>
      <li>Jenis Perkara</li>
    </ol>
    <p>&nbsp;</p></td>
    <td width="220" valign="top"><p>Identitas Para Pihak</p></td>
    <td width="200" valign="top"><ol>
      <li>Nama Mediator</li>
      <li>Sertifikat/Tidak Bersertifikat</li>
      <li>Lembaga Penerbit Sertifikat</li>
      <li>Nomor dan Tanggal Sertifikat</li>
      (Jika ada mediator)
    </ol>
    </td>
    <td width="270" valign="top"><ol>
      <li>Tanggal Kesepakatan Perdamaian </li>
      <li>Isi Kesepakatan Perdamaian</li>
    </ol></td>
    <td width="160" valign="top"><ol>
      <li>Tanggal Penetapan Majelis Hakim</li>
      <li>Majelis Hakim</li>
      <li>Panitera Pengganti </li>
    </ol></td>
    <td width="160" valign="top"><ol>
      <li>Tanggal Penetapan Hari Sidang</li>
      <li>Tanggal Sidang</li>
      <li>Alasan Tunda</li>
    </ol></td>
    <td width="280" valign="top"><ol>
      <li>Tanggal    Akta Perdamaian</li>
      <li>Isi    Akta Perdamaian</li>
    </ol></td>
  </tr>  
  <tr>
    <td width="50" valign="top"><p align="center">1</p></td>
    <td width="166" valign="top"><p align="center">2</p></td>
    <td width="86" valign="top"><p align="center">3</p></td>
    <td width="139" valign="top"><p align="center">4</p></td>
    <td width="153" valign="top"><p align="center">5</p></td>
    <td width="132" valign="top"><p align="center">6</p></td>
    <td width="126" valign="top"><p align="center">7</p></td>
    <td width="208" valign="top"><p align="center">8</p></td>
  </tr>
  <?php 
    if(!empty($data_reg_mediasi)){
        $i=1;
        foreach ($data_reg_mediasi->result() as $row) {
          echo "<tr>
                <td valign='top' align='center'>".$i."</td>
                <td valign='top'>1. ".$row->nomor_perkara."<br>2. ".$row->tanggal_pendaftaran."<br>3. ".$row->jenis_perkara."</td>
                <td valign='top'><strong>Penggugat:</strong><br>".$row->data_pihak1;
                if(!empty($row->pengacara_pihak1)){
                  echo "<br><strong>Pengacara Penggugat :</strong><br>".$row->pengacara_pihak1;
                }
                echo "<br><strong>Tergugat :</strong><br>".$row->data_pihak2;
                if(!empty($row->pengacara_pihak2)){
                  echo "<br><strong>Pengacara Tergugat :</strong><br>".$row->pengacara_pihak2;
                }
                echo "</td>
                <td valign='top'>".$row->mediator."</td>
                <td valign='top'>1. ".$row->tgl_kesepakatan."<br>2. ".$row->isi_kesepakatan."</td>
                <td valign='top'>1.".$row->tgl_penetapan_majelis."<br>2. Majelis Hakim : <br>".$row->majelis_hakim."<br>3. ".$row->panitera_pengganti."</td>
                <td valign='top'>1. ".$row->tgl_penetapan_sidang."<br>2. Tgl. Sidang :<br>".$row->sidang."</td>                
                <td valign='top'>1. ".$row->tgl_akta_perdamaian."<br>2. ".$row->isi_akta_perdamaian."</td>
              ";
        $i++;
        }
    }
  ?>
  </tr>
</table>

</div>
