<?php 
if($xls==1){
  header('Content-type: application/excel');
  $filename = 'Register_Mediator.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_Mediator.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:1400;text-align:center;" >
  <div class="title">REGISTER MEDIATOR</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="1400px" border="1" cellspacing="0" cellpadding="4">
  <tr>
    <td width="30" valign="top"><p align="center">No.</p></td>
    <td width="130px" valign="top"><p align="center">Foto</p></td>
    <td width="220" valign="top"><ol>
      <li>Nama</li>
      <li>Identitas</li>
      <li>Pendidikan</li>
    </ol></td>
    <td width="139" valign="top"><ol>
      <li>Tanggal dan Nomor Sertifikat</li>
      <li>Lembaga Sertifikasi</li>
    </ol></td>
    <td width="120" valign="top"><p align="center">Tanggal dan Nomor SK KPN/KPA</p></td>
    <td width="144" valign="top"><p align="center">Profesi </p></td>
    <td width="200" valign="top"><p align="center">Keahlian/Pengalaman </p></td>
    <td width="185" valign="top"><p align="center">Keterangan </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' align='center'><img width=140 height=180 src=".base_url()."resources/file/foto/".$row->foto."></td>
                <td valign='top'>1. ".$row->nama."<br>2. ".$row->tempat_lahir.", ".$row->tanggal_lahir."<br>- ".$row->alamat."<br>3. ".$row->pendidikan."</td>
                <td valign='top'>1.".$row->tgl_sertifikat.", ".is_empty($row->nomor_sertifkat)."<br>2. ".is_empty($row->lembaga_sertifikasi)."</td>
                <td valign='top'>".is_empty($row->tgl_sk_ketua).",<br>".is_empty($row->nomor_sk_ketua)."</td>
                <td valign='top'>".is_empty($row->profesi)."</td>
                <td valign='top'>".is_empty($row->keahlian)."</td>
                <td valign='top'>".is_empty($row->keterangan)."</td>
                ";
          $i++;
        }
      }
  ?>
  </tr>
</table>

</div>
