<small>
<?php
 $caseid = $this->uri->segment('3');
 $mr     = $this->uri->segment('4');
?>
<table class="table table-striped">
    <tr>
        <td>Pilih Keterangan</td>
        <td>
            <select name="keterangan" id="keterangan" onchange="checkKeterangan()" class="form-control teanganData">
                <option value="">Pilih Keterangan</option>
                <option value="Sehat">Surat Keterangan Sehat</option>
                <option value="Sakit">Surat Keterangan Sakit</option>
            </select>
        </td>
    </tr>
</table>
<form action="<?= base_url('Sks/Simpansurat/'.$caseid.'/'.$mr); ?>" method="post">
<table class="table table-striped" id="formsks"  style="display:none;">
<input type="hidden" class="form-control" name="pilihan" value="Sakit" disabled>
    <tr>
        <td>Terhitung</td>
        <td  style="width: 50%;"><input type="date" class="form-control" name="daritgl" value=""></td>
        <td>SD</td>
        <td  style="width: 50%;">
            <input type="date" class="form-control" name="sampaitgl" value="">
        <input type="hidden" class="form-control" name="pengirim" value="<?= $user['nama']; ?>">
        </td>
    </tr>
    <tr>
        <td>
            <button type="submit" class="btn btn-success">Save</button>
        </td>
    </tr>
</table>
</form>
<form action="<?= base_url('Sks/Simpansurat/'.$caseid.'/'.$mr); ?>" method="post">
<table class="table table-striped" id="formsehat"  style="display:none;">
<input type="hidden" class="form-control" name="pilihan" value="Sehat" disabled>
    <tr>
        <td>Dipergunakan Untuk</td>
        <td style="width: 100%;">
        <select name="pilihan" class="form-control teanganData">
                <option value="">-- Pilih --</option>
                <option value="Melamar Pekerjaan">Melamar Pekerjaan</option>
                <option value="Menikah">Menikah</option>
        </select>
        <input type="hidden" class="form-control" name="pengirim" value="<?= $user['nama']; ?>">
        </td>
    </tr>
    <tr>
        <td>Keterangan</td>
        <td style="width: 100%;">
        <select name="pilihketerangan" class="form-control teanganData">
                <option value="Sehat">Sehat</option>
                <option value="Sakit">Sakit</option>
        </select>
        </td>
    </tr>
    <tr>
        <td>
            <button type="submit" class="btn btn-success">Save</button>
        </td>
    </tr>
</table>
</form>
</small>
<?php
$qdata = $this->db->query("select e.case_id,c.Description as nama,e.keterangan,e.daritgl,e.sampaitgl
from Cases c join erm_surat e on c.[Case ID] = e.case_id where e.case_id='$caseid'")->result_array();
?>
<tabel id="example1"  class="table">
    <tr>
    <td>caseid</td>
    <td>nama</td>
    <td>keterangan</td>
    <td>daritgl</td>
    <td>sampaitgl</td>
     </tr>
     <?php foreach($qdata as $d) : ?>
    <tr>
        <td><?= $d['case_id']; ?></td>
        <td><?= $d['nama']; ?></td>
        <td><?= $d['keterangan']; ?></td>
        <td><?= $d['daritgl']; ?></td>
        <td><?= $d['sampaitgl']; ?></td>
    </tr>
    <?php endforeach; ?>
</tabel>

    