<form action="" method="post">
        <table class="table table-striped" style="width: 100%;">
            <tr>
                <td align="center"><b>Catatan Awal Kehamilan</b></td>
                <td><a href="#" data-toggle="modal" data-target="#ModalCatatankehamilan<?= $pasien['Case ID']; ?>" class="btn btn-success"><i class="fa fa-plus"></i></a> 
                    -  <a href="<?= base_url('CatatanKehamilan/ViewCatatanawal/'.$pasien['PatientCode']); ?>" class="btn btn-success"><i class="fa fa-eye"></i></a>
                </td>
            </tr>
            <tr>
                <td align="center"><b>Catatan Kehamilan</b></td>
                <td><a href="#" data-toggle="modal" data-target="#Modalkehamilan<?= $pasien['Case ID']; ?>" class="btn btn-success"><i class="fa fa-plus"></i></a>
                -  <a href="<?= base_url('CatatanKehamilan/ViewCatatanhamil/'.$pasien['PatientCode']); ?>" class="btn btn-success"><i class="fa fa-eye"></i></a>
            </td>
            </tr>
            <tr>
                <td align="center"><b>Catatan KB</b></td>
                <td><a href="#" data-toggle="modal" data-target="#ModalKb" class="btn btn-success"><i class="fa fa-plus"></i></a>
                -  <a href="<?= base_url('CatatanKehamilan/ViewCatatanKb/'.$pasien['PatientCode']); ?>" class="btn btn-success"><i class="fa fa-eye"></i></a>
            </td>
            </tr>
        </table>
    </form>

 <!-- Modal Catatan Awal Kehamilan -->
<div class="modal fade" id="ModalCatatankehamilan<?= $pasien['Case ID']; ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-scrollable" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
          <form action="<?= base_url('CatatanKehamilan/ProsesPencatatan'); ?>" method="post">
            <table class="table table-striped" style="width: 100%;">
            <tr>
                <td align="center" colspan="2"><h3>Catatan Awal Kehamilan</h3></td>
            </tr>
            <tr>
                <td><b>Kehamilan Saat ini</b></td>
            </tr>
            <tr>
                <td>Hari Pertama Haid Terakhir (HPHT)</td>
                <td>
                    <input type="hidden" class="form-control" name="caseID" value="<?= $pasien['Case ID']; ?>">
                    <input type="date" class="form-control" name="hpht" value="" require>
                </td>
            </tr>
            <tr>
            <tr>
                <td>Hari Taksiran Persalinan (HTP)</td>
                <td><input type="date" class="form-control" name="htp" value=""></td>
            </tr>
            <tr>
                <td>Golongan Darah</td>
                <td>
                    <select name="GolonganDarah" id="" class="form-control" value="">
                        <option value="">--Pilih Golongan Darah--</option>
                        <?php foreach($Golongan as $d) : ?>
                        <option value="<?= $d['idGolongan']; ?>"><?= $d['Golongandarah']; ?></option>
                        <?php endforeach; ?>
                    </select>
            </td>
            </tr>
            <tr>
                <td>Penggunaan Kontrasepsi Sebelum Hamil</td>
                <td>
                <select name="kontrasepsi" id="" class="form-control" value="">
                        <option value="">--Pilih Kontrasepsi --</option>
                        <option value=""></option>
                        <?php foreach($kontrasepsi as $d) : ?>
                        <option value="<?= $d['idkontrasepsi']; ?>"><?= $d['namakontrasepsi']; ?></option>
                        <?php endforeach; ?>
                </select>
                </td>
            </tr>
            <tr>
                <td>Riwayat Penyakit yang Diderita Ibu</td>
                <td><input type="text" name="penyakitygdiderita" class="form-control" placeholder="Riwayat Penyakit" require></td>
            </tr>
            <tr>
                <td>Riwayat Alergi</td>
                <td><input type="text" name="riwayatalergi" class="form-control" value="" placeholder="Riwayat Alergi"></td>
            </tr>
            <tr>
                <td>Status Imunisasi Tetanus (T) Terakhir</td>
                <td><input type="text" name="statusimunisasi" class="form-control" value="" placeholder="Status Imunisasi Tetanus"></td>
            </tr>
            <tr>
                <td>G</td>
                <td><input type="text" name="g" class="form-control" value="" placeholder="G"></td>
            </tr>
            <tr>
                <td>P</td>
                <td><input type="text" name="p" class="form-control" placeholder="P"></td>
            </tr>
            <tr>
                <td>A</td>
                <td><input type="text" name="a" class="form-control" placeholder="A"></td>
            </tr>
            <tr>
                <td>TB</td>
                <td><input type="text" name="tb" class="form-control" placeholder="cm"></td>
            </tr>
            </tr>
            </table>
            <table class="table table-striped" style="width: 100%;">
            <tr>
                <th>Hari Pertama Haid Terakhir</th>
                <th>Hari Taksiran Persalinan</th>
                <th>Golongan Darah</th>
                <th>Penggunaan Kontrasepsi Sebelum Hamil</th>
                <th>Riwayat Penyakit</th>
                <th>Alergi</th>
                <th>Status imunisasi</th>
                <th>G/P/A/TB</th>
            </tr>
            <?php 
                $CaseID = $pasien['Case ID'];
                $qdata = $this->db->query("Select * from erm_catatanawalkehamilan where caseID = '$CaseID'")->result_array();   
                foreach($qdata as $dp) :         
            ?>
            <tr>
                <td><?= $dp['hpht']; ?></td>
                <td><?= $dp['htp']; ?></td>
                <td><?= $dp['GolonganDarah']; ?></td>
                <td><?= $dp['kontrasepsi']; ?></td>
                <td><?= $dp['penyakitygdiderita']; ?></td>
                <td><?= $dp['riwayatalergi']; ?></td>
                <td><?= $dp['statusimunisasi']; ?></td>
                <td><?= $dp['g'].','.$dp['p'].','.$dp['a'].','.$dp['tb']; ?></td>
            </tr>
            <?php endforeach; ?>
            </table>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-success">Save</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
            </div>
        </div>
       </form>
    </div>
</div>
<!-- End of ModalCatatan Awal Kehamilan  -->

 <!-- Modal Catatan Kehamilan -->
 <div class="modal fade" id="Modalkehamilan<?= $pasien['Case ID']; ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-scrollable" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
            <form action="<?= base_url('CatatanKehamilan/Prosescatatankehamilan'); ?>" method="post">
            <table class="table table-striped" style="width: 100%;">
                <tr>
                    <td colspan="6">Obstetri Trimester 1<hr></td>
                </tr>
                <tr>
                    <td>Gs</td>
                    <td>
                        <input type="radio" name="Gs" id="Gs1" value="Ada" checked=""> Ada
                    </td>
                    <td><input type="radio" name="Gs" id="Gs2" value="Tidak" checked=""> Tidak</td>

                    <td><input type="radio" name="in1" id="in1" value="Intrauterine" checked=""> Intrauterine</td>
                    <td><input type="radio" name="in1" id="in2" value="Ekstratuterine" checked=""> Ekstratuterine</td>
                </tr>
                <tr>
                    <td>FE</td>
                    <td><input type="radio" name="Fe" id="fe1" value="Ada" checked=""> Ada</td>
                    <td><input type="radio" name="Fe" id="fe2" value="Tidak" checked=""> Tidak</td>

                    <td><input type="radio" name="Tu" id="tu1" value="Tunggal" checked=""> Tunggal</td>
                    <td><input type="radio" name="Tu" id="tu2" value="Ganda" checked=""> Ganda</td>
                </tr>
                <tr>
                    <td>YS</td>
                    <td><input type="radio" name="Ys" id="ys1" value="Ada" checked=""> Ada</td>
                    <td><input type="radio" name="Ys" id="ys2" value="Tidak" checked=""> Tidak</td>
                </tr>
                <tr>
                    <td>FHR</td>
                    <td><input type="radio" name="Fhr" id="fhr1" value="Ada" checked=""> Ada</td>
                    <td><input type="radio" name="Fhr" id="fhr2" value="Tidak" checked=""> Tidak</td>
                </tr>
                <tr>
                    <td>CRL</td>
                    <td colspan="2"><input type="text" name="Crl" class="form-control" placeholder="mm" value=""></td>
                </tr>
                <tr>
                    <td>NT</td>
                    <td colspan="2"><input type="text" name="Nt" class="form-control" placeholder="mm" value=""></td>
                </tr>
                <tr>
                    <td>Frekuensi</td>
                    <td><input type="text" name="frekuensi" class="form-control" placeholder="dpm" value=""></td>
                    <td><input type="text" name="minggu" class="form-control" placeholder="Minggu" value=""></td>
                </tr>
                <tr>
                    <td>Kesimpulan</td>
                    <td colspan="2">
                        <textarea class="form-control" name="kesimpulan"></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="6">Obstetri Trimester 2/3<hr></td>
                </tr>
                <tr>
                    <td><img src="<?= base_url('aset/img/1.png'); ?>" height="200"></td>
                    <td><img src="<?= base_url('aset/img/2.png'); ?>" height="200"></td>
                    <td><img src="<?= base_url('aset/img/3.png'); ?>" height="200"></td>
                </tr>
                <tr>
                    <td>BPD</td>
                    <td colspan="2"><input type="text" name="Bpd" class="form-control" placeholder="mm" value=""></td>
                </tr>
                <tr>
                    <td>HC</td>
                    <td><input type="text" name="Hc" class="form-control" placeholder="mm" value=""></td>
                    <td><input type="text" name="tbj" class="form-control" placeholder="TBJ (gram)" value=""></td>
                </tr>
                <tr>
                    <td>AC</td>
                    <td colspan="2"><input type="text" name="Ac" class="form-control" placeholder="mm" value=""></td>
                    <td><input type="text" name="Uk" class="form-control" placeholder="UK (Minggu)" value=""></td>
                </tr>
                <tr>
                    <td>FL</td>
                    <td colspan="2"><input type="text" name="Fl" class="form-control" placeholder="mm" value=""></td>
                    <td><input type="text" name="Tp" class="form-control" placeholder="TP" value=""></td>
                </tr>
                <tr>
                    <td>Plasenta</td>
                    <td><input type="radio" name="fudus" id="fu1" value="Fudus" checked=""> Fudus</td>
                    <td><input type="radio" name="fudus" id="fu2" value="Corpus Anterior" checked=""> Corpus Anterior</td>
                    <td><input type="radio" name="fudus" id="fu3" value="Corpus Posterior" checked=""> Corpus Posterior</td>
                    <td>----------</td>
                    <td><input type="radio" name="oui" id="oui1" value="Tidak Menutupi" checked=""> Tidak Menutupi</td>
                    <td><input type="radio" name="oui" id="oui2" value="Menutupi Oui" > Menutupi Oui</td>
                </tr>
                <tr>
                    <td>ICA</td>
                    <td><input type="radio" name="ica" id="ica1" value="Cukup" checked=""> Cukup</td>
                    <td><input type="radio" name="ica" id="ica1" value="Sedikit" checked=""> Sedikit</td>
                    <td colspan="3"><input type="radio" name="ica" id="ica1" value="Banyak" checked=""> Banyak</td>
                </tr>
                <tr>
                    <td>FHR</td>
                    <td colspan="4"><input type="text" name="fhr1" class="form-control" placeholder="dpm" value=""></td>
                </tr>
                <tr>
                <td>Gerak Janin</td>
                    <td><input type="radio" name="gerakjannin" id="gerak1" value="Aktif" checked=""> Aktif</td>
                    <td><input type="radio" name="gerakjannin" id="gerak2" value="Kurang"> Kurang</td>
                </tr>
                <tr>
                    <td>Jenis Kelamin</td>
                    <td><input type="radio" name="jenis" id="jk1" value="Laki - Laki" checked=""> Laki-Laki</td>
                    <td><input type="radio" name="jenis" id="jk2" value="Perempuan" checked=""> Perempuan</td>
                </tr>
                <tr>
                    <td>Kesimpulan</td>
                    <td colspan="2">
                        <textarea class="form-control" name="kesimpulan2"></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="6">Ginekologi<hr></td>
                </tr>
                <tr>
                    <td>Uterus</td>
                    <td><input type="radio" name="Af" id="aft1" value="AF"> AF</td>
                    <td><input type="radio" name="Af" id="aft2" value="RF"> RF</td>
                    <td>-----------</td>
                    <td><input type="radio" name="Membesar" id="mbt1" value="Membesar" checked=""> Membesar</td>
                    <td><input type="radio" name="Membesar" id="mbt2" value="Tidak Membesar"> Tidak Membesar</td>
                </tr>
                <tr>
                    <td>Ukuran</td>
                    <td><input type="text" name="m1" class="form-control" placeholder="mm" value=""></td>
                    <td>X</td>
                    <td><input type="text" name="m2" class="form-control" placeholder="" value=""></td>
                    <td>X</td>
                    <td><input type="text" name="m3" class="form-control" placeholder="" value=""></td>
                </tr>
                <tr>
                    <td>Ovarium Kanan</td>
                    <td><input type="text" name="ovakanan" class="form-control" placeholder="Ovarium Kanan" value=""></td>
                </tr>
                <tr>
                    <td>Ovarium Kiri</td>
                    <td><input type="text" name="ovakiri" class="form-control" placeholder="Ovarium Kiri" value=""></td>
                </tr>
                <tr>
                    <td>Massa</td>
                    <td><input type="text" name="massa" class="form-control" placeholder="Massa" value=""></td>
                </tr>
                <tr>
                    <td>Kesimpulan</td>
                    <td>
                        <input type="text" name="kesimpulan3" class="form-control" placeholder="Kesimpulan" value="">
                        <input type="hidden" class="form-control" name="CaseID" value="<?= $pasien['Case ID']; ?>">
                    </td>
                </tr>
            </table>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-success">Save</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
            </div>
        </form>
        </div>
    </div>
</div>
<!-- End of ModalCatatan Kehamilan  -->

 <!-- Modal Catatan KB -->
 <div class="modal fade" id="ModalKb" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-scrollable" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
            <form action="<?= base_url('CatatanKehamilan/prosescatatankb'); ?>" method="post">
            <table class="table table-striped" style="width: 100%;">
                <tr>
                    <td colspan="2"><h3>Riwayat Haid</h3></td>
                </tr>
                <tr>
                    <td>Menarche</td>
                    <td><input type="date" name="menerche" class="form-control" placeholder="Menarche"></td>
                </tr>
                <tr>
                    <td>Lamanya</td>
                    <td><input type="text" name="lamanya" class="form-control" placeholder="Lamanya Hari"></td>
                </tr>
                <tr>
                    <td>Banyaknya</td>
                    <td><select name="banyaknya" class="form-control" id="">
                        <option value="">-- Pilih Banyaknya --</option>
                        <option value="Banyak">Banyak</option>
                        <option value="Sedikit">Sedikit</option>
                        <option value="Sedang">Sedang</option>
                    </select>
                    </td>
                </tr>
                <tr>
                    <td>Dysmenore</td>
                    <td>
                        <select name="dysmenore" id="" class="form-control">
                            <option value="">pilih</option>
                            <option value="Ya">Ya</option>
                            <option value="Tidak">Tidak</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Haid Trakhir</td>
                    <td><input type="date" name="haid_terakhir" class="form-control" placeholder="dd/mm/yyy" ></td>
                </tr>
                <tr>
                    <td colspan="2"><h3>Riwayat Penyakit  Keluarga</h3></td>
                </tr>
                <tr>
                    <td>Jantung</td>
                    <td>
                        <select name="Jantung" id="" class="form-control">
                            <option value="">pilih</option>
                            <option value="Ya">Ya</option>
                            <option value="Tidak">Tidak</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Paru-Paru</td>
                    <td>
                        <select name="Paru" id="" class="form-control">
                            <option value="">pilih</option>
                            <option value="Ya">Ya</option>
                            <option value="Tidak">Tidak</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Hipertensi</td>
                    <td>
                        <select name="Hipertensi" id="" class="form-control">
                            <option value="">pilih</option>
                            <option value="Ya">Ya</option>
                            <option value="Tidak">Tidak</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Diabetes Militus</td>
                    <td>
                        <select name="Diabet" id="" class="form-control">
                            <option value="">pilih</option>
                            <option value="Ya">Ya</option>
                            <option value="Tidak">Tidak</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>PMS</td>
                    <td>
                        <select name="Pms" id="" class="form-control">
                            <option value="">pilih</option>
                            <option value="Ya">Ya</option>
                            <option value="Tidak">Tidak</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><h3>Riwayat KB</h3></td>
                </tr>
                <tr>
                    <td>KB yang Pernah Diikuti</td>
                    <td>
                    <select id="metode_kb" name="metode_kb" class="form-control" required>
                        <option value="">-- Pilih --</option>
                        <option value="Pil">Pil</option>
                        <option value="Suntik">Suntik</option>
                        <option value="IUD">IUD</option>
                        <option value="Kondom">Kondom</option>
                        <option value="Implan">Implan</option>
                        <option value="Tidak Ada">Tidak Ada</option>
                     </select>
                    </td>
                </tr>
                <tr>
                    <td>Lamanya</td>
                    <td><input type="text" name="lamanya1" class="form-control" placeholder="Tahun"></td>
                </tr>
                <tr>
                    <td>Keluhan</td>
                    <td><textarea class="form-control" name="keluhan" placeholder="Keluhan"></textarea></td>
                </tr>
                <tr>
                    <td>KB Pilihan Saat Ini</td>
                    <td>
                    <select id="metode_kb" name="kbpilihan" class="form-control" required>
                        <option value="">-- Pilih --</option>
                        <option value="Pil">Pil</option>
                        <option value="Suntik">Suntik</option>
                        <option value="IUD">IUD</option>
                        <option value="Kondom">Kondom</option>
                        <option value="Implan">Implan</option>
                        <option value="Tidak Ada">Tidak Ada</option>
                     </select>
                    </td>
                </tr>
            </table>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-success">Save</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
            </div>
                </form>
        </div>
    </div>
</div>
<!-- End of ModalCatatan KB  -->