<!-- Modal RACIK-->
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
    <form action="<?= base_url('Obat/prosesRacikanoheader/' . $this->uri->segment(3) .'/'. $this->uri->segment(4)); ?>" method="post">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">MODAL FORM OBAT RACIKAN</h5>
      </div>
      
        <div class="modal-body">
            <input type="text" hidden name="DokterPengirim" value="<?= $user['IdAlias'];?>">
            <table class="table table-striped table-hover">             
                <tr>
                    <th>Racikan</th>
                    <td>
                        <table>
                            <tr>
                                <th> Deskripsi </th>
                                <th>&nbsp;&nbsp;</th>
                                <th> Jumlah </th>
                                <th>&nbsp;&nbsp;</th>
                                <th> Satuan </th>
                                <th></th>
                            </tr>
                            <tr>
                                <td>
                                    <select name="Obat[]" required class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" required placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport" onclick="ShowHideDiv(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport" style="display: none;margin-top:5px">
                            <tr>
                                <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport2" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport2" onclick="ShowHideDiv2(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport2" style="display: none;margin-top:5px">
                            <tr>
                            <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport3" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport3" onclick="ShowHideDiv3(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport3" style="display: none;margin-top:5px">
                            <tr>
                            <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport4" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport4" onclick="ShowHideDiv4(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport4" style="display: none;margin-top:5px">
                            <tr>
                            <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport5" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport5" onclick="ShowHideDiv5(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport5" style="display: none;margin-top:5px">
                            <tr>
                            <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport6" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport6" onclick="ShowHideDiv6(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport6" style="display: none;margin-top:5px">
                            <tr>
                            <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="chkPassport7" style="cursor: pointer;">
                                        <input type="checkbox" id="chkPassport7" onclick="ShowHideDiv7(this)" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                        <table id="dvPassport7" style="display: none;margin-top:5px">
                            <tr>
                            <td>
                                    <select name="Obat[]" class="teanganData" data-live-search="true">
                                        <option value=""></option>
                                        <?php
                                            foreach($obatmodal as $ob):
                                                ?>
                                                <option value="<?= $ob['PharmacyCode'];?>"><?= $ob['Description'];?> (<?= $ob['PharmacyUnit'];?>)</option>
                                                <?php 
                                            endforeach;
                                        ?>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <input type="text" placeholder="" name="Jumlah[]" style="width:100%" class="form-control" >
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    <select name="" disabled class="form-control">
                                        <option value=""></option>
                                    </select>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>
                                    &nbsp;&nbsp;
                                    <label for="" style="cursor: pointer;">
                                        <input type="checkbox" id="" onclick="" name="cek[]" value="1" />
                                        Tambah
                                    </label>
                                </td>
                            </tr>
                        </table>

                    </td>
                </tr>
            </table>
            

        </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary btn-sm">Simpan</button>
      </div>
      
    </div>
    </form>
  </div>
</div>

<script type="text/javascript">
    function ShowHideDiv(chkPassport) {
        var dvPassport = document.getElementById("dvPassport");
        dvPassport.style.display = chkPassport.checked ? "block" : "none";
    }
    function ShowHideDiv2(chkPassport2) {
        var dvPassport2 = document.getElementById("dvPassport2");
        dvPassport2.style.display = chkPassport2.checked ? "block" : "none";
    }
    function ShowHideDiv3(chkPassport3) {
        var dvPassport3 = document.getElementById("dvPassport3");
        dvPassport3.style.display = chkPassport3.checked ? "block" : "none";
    }
    function ShowHideDiv4(chkPassport4) {
        var dvPassport4 = document.getElementById("dvPassport4");
        dvPassport4.style.display = chkPassport4.checked ? "block" : "none";
    }
    function ShowHideDiv5(chkPassport5) {
        var dvPassport5 = document.getElementById("dvPassport5");
        dvPassport5.style.display = chkPassport5.checked ? "block" : "none";
    }
    function ShowHideDiv6(chkPassport6) {
        var dvPassport6 = document.getElementById("dvPassport6");
        dvPassport6.style.display = chkPassport6.checked ? "block" : "none";
    }   
    function ShowHideDiv7(chkPassport7) {
        var dvPassport7 = document.getElementById("dvPassport7");
        dvPassport7.style.display = chkPassport7.checked ? "block" : "none";
    }   
</script>