Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- view : -->
- <label>Cek Data Industri</label>
- <table class="table table-bordered table-hover" id="tableFormPersetujuan">
- <thead>
- <tr>
- <th>Nama Industri</th>
- <th>Alamat Industri</th>
- <th>Telephon</th>
- <th>Direktur</th>
- <th>Nomor Surat</th>
- <th>Periode</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <!-- /.row -->
- </section>
- <!-- /.content -->
- </div>
- <script>
- $(function () {
- $('#tableFormIndustri').DataTable({
- 'ajax': {
- 'url' : '<?php echo base_url()?>index.php/admin/showDataIndustri2',
- 'type' : 'POST'
- }
- });
- $('#tableFormPersetujuan').DataTable({
- 'ajax': {
- 'url' : '<?php echo base_url()?>index.php/admin/showFormIndustri'
- }
- });
- <!-- controller : -->
- <?php
- public function showFormIndustri()
- {
- $result = $this->auth_model->model_formindustri();
- $dataformindustri = [];
- $dataformindustri['dataform'] = [];
- /*
- foreach($result as $index => $value) {
- $dataformindustri['dataform'][$index] = array (
- $value->m_industri['nama_industri'],
- $value->m_industri['alamat_industri'],
- $value->m_industri['telepon_industri'],
- $value->m_industri['direktur'],
- $value->formulirpersetujuan['nomor_surat'],
- $value->formulirpersetujuan['periode']
- );
- };
- */
- $dataformindustri['dataform']=array();
- foreach($result as $value) {
- $dataformindustri['dataform'][]=$row;//coba print_r disini
- }
- echo json_encode($dataformindustri);
- }
- ?>
- <!--- model : --->
- <?php
- public function model_formindustri()
- {
- $this->db->select('*');
- $this->db->from('formulir_persetujuan');
- $this->db->join('m_industri', 'm_industri.kode_industri = formulir_persetujuan.kode_industri');
- $query = $this->db->get();
- $result = $query->result_array();
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment