PHP代码Igniter无法在模态引导程序中显示数据

时间:2018-02-26 23:14:28

标签: javascript php arrays bootstrap-modal

我正在使用codeigniter franmework。我尝试将数据显示为模态。但我的数据有问题。它们不会出现在模态中。我按照互联网上的教程,但它不起作用。这是我的按钮点击代码,用于显示数据:

libthing.so.1

这是我的模态代码

<a href="javascript:;"
data-id="<?php echo $row->id ?>"
data-kode="<?php echo $row->kode ?>"
data-subkode="<?php echo $row->subkode ?>"
data-nama_kegiatan="<?php echo $row->nama_kegiatan ?>"
data-toggle="modal" data-target="#edit-data">
<button  data-target="#ubah-data" data-toggle="modal" class="btn btn-info">Ubah</button>
</a>

这是获取数据的脚本

<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="edit-data" class="modal fade">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
            <h4 class="modal-title">Ubah Data</h4>
        </div>
        <form class="form-horizontal" action="<?php echo base_url('dashboard/rka2/ubah')?>" method="post" enctype="multipart/form-data" role="form">
            <div class="modal-body">
                <div class="form-group">
                    <label class="col-lg-2 col-sm-2 control-label">Kode</label>
                    <div class="col-lg-10">
                        <input type="hidden" id="id" name="id">
                        <input type="text" class="form-control" id="kode" name="kode">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 col-sm-2 control-label">Subkode</label>
                    <div class="col-lg-10">
                        <input type="text" class="form-control" id="subkode" name="subkode">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 col-sm-2 control-label">Nama Kegiatan</label>
                    <div class="col-lg-10">
                        <input type="text" class="form-control" id="nama_kegiatan" name="nama_kegiatan">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-info" type="submit"> Simpan&nbsp;</button>
                <button type="button" class="btn btn-warning" data-dismiss="modal"> Batal</button>
            </div>
        </form>
     </div>
</div>

0 个答案:

没有答案