<?php
 
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=LAPORAN_HARIAN_MEDIUM_DRAWING.xls");
?>
<table border="1" cellpadding="2">
  	<tr>
    	<th colspan="2" rowspan="6"></th>
        <th colspan="18" rowspan="4"> LAPORAN HARIAN MEDIUM DRAWING</th>
        <th colspan="1">CHECKED</th>
        <th rowspan="6" colspan="2"></th>
        <tr>
            <th rowspan="4"></th>
            <tr>
                <tr>
                    <tr>
                        <th colspan="12" rowspan="1" align="left" >NO. DOKUMEN</th>
                        <th colspan="6" rowspan="1" align="left">HALAMAN</th>                       
                    </tr>
                </tr>        
            </tr>
            <tr>              
                        <th colspan="12" rowspan="1" align="left" >TGL.EFEKTIF</th>
                        <th colspan="6" rowspan="1" align="left">REVISI</th>
                        <th rowspan="1">FOREMAN</th>                                
            </tr>
        </tr>

  
        <tr>
            <th colspan="2" rowspan="2">TANGGAL</th>
            <th colspan="2" rowspan="2">NO. MESIN</th>
            <th colspan="3" rowspan="2">SHIF</th>
            <th colspan="2" rowspan="2">OPERATOR</th>
            <th colspan="2" rowspan="2">JAM CHECKED</th>
            <th colspan="10" rowspan="1">KONDISI ANEALING</th>
            <th colspan="2" rowspan="2">CONDUCTOR (0.985-1.005mm)</th>
        </tr>  
       <tr>
            <th colspan="2" rowspan="1">SETTING</th>
            <th colspan="2" rowspan="1">VOLTASI</th>
            <th colspan="2" rowspan="1">ARUS</th>
            <th colspan="2" rowspan="1">PRE HEATING</th>
            <th colspan="2" rowspan="1">AIR PENDINGIN</th>
  
        </tr>    
        <tr>
            <th colspan="2" rowspan="3"> </th>
            <th colspan="2" rowspan="3"> </th>
            <th colspan="3" rowspan="1">SHIF PAGI</th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
        </tr>  
        <tr>

            <th colspan="3" rowspan="1">SHIF SORE</th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
        </tr>  
        <tr>
 
            <th colspan="3" rowspan="1">SHIF MALAM</th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
            <th colspan="2" rowspan="1"> </th>
        </tr>  
        <tr>
			<th colspan="23"> </th>
  
        </tr>    

        <tr>
            <th colspan="2" rowspan="2">OPERATOR </th>
            <th colspan="2" rowspan="2">NO </th>
            <th colspan="4" rowspan="2">LOT NO SUPPLY</th>
            <th colspan="2" rowspan="2">BERAT (kg) </th>
            <th colspan="4" rowspan="2">LOT NO OUTPUT MDD </th>
            <th colspan="2" rowspan="2">JUMLAH PRODUKSI (JUMLAH PACK) </th>
            <th colspan="2" rowspan="2">COUNTER TIAP PACK (meter) </th>
            <th colspan="2" rowspan="2">SUPPLIER MATERIAL CU </th>
            <th colspan="3" rowspan="2">KETERANGAN </th>
  
        </tr>  
        <tr>
        </tr>
 
    

      <?php
   $no = 1;  
    $this->db = $this->load->database('pasi', TRUE);
    $userid = $this->session->userdata('DX_user_id');
    $query = $this->db->query("SELECT * FROM tblx_rptrdd_detail where userid like '$userid'");
    foreach ($query->result() as $row)
    {
        echo "<tr>";
        echo "<td colspan=\"2\">".$row->operator."</td>";
        echo "<td colspan=\"2\">".$no."</td>";
        echo "<td colspan=\"4\">".$row->nolotin."</td>";
        echo "<td colspan=\"2\">".$row->qtyin."</td>";
        echo "<td colspan=\"4\">".$row->nolotout."</td>";
        echo "<td colspan=\"2\">".$row->qtyout."</td>";
        echo "<td colspan=\"2\">".$row->kind."</td>";
        echo "<td colspan=\"2\">".$row->kind."</td>";
        echo "<td colspan=\"3\">".$row->kind."</td>";
 //       echo "<td>".$row->kodesatuan."</td>";
 //       echo "<td>".$row->jumlahsatuan."</td>";
 //       echo "<td>".$row->noproduksi."</td>";
 //       echo "<td>".$row->tglproduksi."</td>";
 //       echo "<td>".$row->jumlahproduksi."</td>";
 //       echo "<td>".$row->satuanproduksi."</td>";
 //       echo "<td>".$row->sisabahan."</td>";
 //       echo "<td>".$row->satuanbahan."</td>";
 //       echo "<td>".$row->kodefg."</td>";
 //       echo "<td>".$row->namafg."</td>";
 //       echo "<td>".$row->jumlahfg."</td>";
 //       echo "<td>".$row->satuanfg."</td>";
 //       echo "<td>".$row->nodokkeluar."</td>";
 //       echo "<td>".$row->tgldokkeluar."</td>";
 //       echo "<td>".$row->sisafg."</td>";
            $no++;

    }

   






      ?>

<tr>

    <th colspan="2" rowspan="1">REVISI </th>
    <th colspan="6" rowspan="1">TANGGAL EFEKTIF</th>
    <th colspan="15" rowspan="1">BAGIAN YANG BERUBAH </th>
 
</tr>

<tr>

    <th colspan="2" rowspan="1">0 </th>
    <th colspan="6" rowspan="1">21-DESEMBER 1988 </th>
    <th colspan="15" rowspan="1">TIDAK ADA PERUBAHAN </th>
 
</tr>

<tr>

    <th colspan="2" rowspan="1">2 </th>
    <th colspan="6" rowspan="1">31-JULI-2003 </th>
    <th colspan="15" rowspan="1">PERUBAHAN DIAMETER CONDUCTOR </th>
 
</tr>
<tr>

    <th colspan="2" rowspan="1">3 </th>
    <th colspan="6" rowspan="1">1-JUNI-2011 </th>
    <th colspan="15" rowspan="1">PENAMBAHAN KOLOM SUPPLIER MATERIAL CU DAN JUMLAH COUNTER SERTA MENGHILANGKAN KOLOM DIA.ROLL </th>
 
</tr>
</table>     