Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.7 kB
3
Indexable
Never
/** FORM MODAL TAMBAH BBP */
<div class="modal fade" id="modal_add" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Tambah Bahan Penolong</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <?= form_open('Hpp/add_sub_bbp'); ?>
                <div class="col-lg-12">
                    <div class="row">

                        <div class="form-group col-lg-4">
                            <label for="no_konsep">Pilih NO Konsep</label>
                            <select class="form-control dropdown" name="no_konsep[]" id="no_konsep" onchange="change_konsep(this.value)">
                                <option value="">Select Data</option>
                                <?php

                                $jsarray = "var dthpp = new Array();\n";
                                foreach ($data_konsep as $roww) {
                                    echo '<option value="' . $roww['no_konsep'] . '">' . $roww['no_konsep'] . '</option>';

                                    $jsarray .= "dthpp['" . $roww['no_konsep'] . "'] = 
                                        {
                                        id_hpp:'" . addslashes($roww['id_hpp']) . "',
                                        no_konsep:'" . addslashes($roww['no_konsep']) . "',
                                        tanggal:'" . addslashes($roww['tanggal']) . "',
                                        dibuat:'" . addslashes($roww['dibuat']) . "'  };\n";
                                }
                                ?>

                            </select>
                        </div>
                        <div class="form-group col-lg-4">
                            <label for="tanggal">Tanggal</label>
                            <input type="text" name="tanggal" class="form-control" id="tanggal" readonly>
                        </div>
                        <div class="form-group col-lg-4">
                            <label for="dibuat">Dibuat</label>
                            <input type="text" name="dibuat[]" class="form-control" id="dibuat" readonly>
                        </div>
                    </div>
                    <hr>
                    <table class="table table-bordered" id="tableLoop">
                        <thead>
                            <tr>
                                <th>No</th>
                                <th>Nama BBP</th>
                                <th>Harga BBP</th>
                                <th>Satuan BBP</th>
                                <th>Pemakaian BBP</th>

                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $no = 1;
                            foreach ($data_bbp as $u) :
                            ?>
                                <tr>
                                    <input type="text" name="id_bbp[]" id="id_bbp" class="form-control" value="<?= $u['id_bbp']; ?>" />
                                    <td><?= $no++; ?></td>
                                    <td><input type="text" name="nama_bbp[]" id="nama_bbp" class="form-control" value="<?= $u['nama_bbp']; ?>" readonly></td>
                                    <td><input type="text" name="harga_bbp[]" id="harga_bbp" class="form-control" value="<?= $u['harga_bbp']; ?>" readonly></td>
                                    <td><input type="text" name="satuan_bbp[]" id="satuan_bbp" class="form-control" value="<?= $u['satuan_bbp']; ?>" readonly></td>
                                    <td><input type="text" name="jmlh_pakai[]" id="jmlh_pakai" class="form-control" value="<?= $roww['jmlh_hpp']; ?>"></td>

                                </tr>
                            <?php
                            endforeach;
                            ?>

                        </tbody>
                    </table>

                    <div class="modal-footer justify-content-between">
                        <button type="submit" class="btn btn-primary btn-block">Tambah</button>
                    </div>
                    <?= form_close(); ?>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
        <!-- /.modal -->
    </div>