Guest User

Untitled

a guest
Dec 22nd, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. view :
  2. <label>Cek Data Industri</label>
  3. <table class="table table-bordered table-hover" id="tableFormPersetujuan">
  4. <thead>
  5. <tr>
  6. <th>Nama Industri</th>
  7. <th>Alamat Industri</th>
  8. <th>Telephon</th>
  9. <th>Direktur</th>
  10. <th>Nomor Surat</th>
  11. <th>Periode</th>
  12. </tr>
  13. </thead>
  14. </table>
  15. </div>
  16.  
  17.  
  18.  
  19.  
  20. </div>
  21.  
  22. <!-- /.row -->
  23. </section>
  24. <!-- /.content -->
  25. </div>
  26. <script>
  27. $(function () {
  28.  
  29. $('#tableFormIndustri').DataTable({
  30. 'ajax': {
  31. 'url' : '<?php echo base_url()?>index.php/admin/showDataIndustri2',
  32. 'type' : 'POST'
  33. }
  34. });
  35. $('#tableFormPersetujuan').DataTable({
  36. 'ajax': {
  37. 'url' : '<?php echo base_url()?>index.php/admin/showFormIndustri'
  38. }
  39. });
  40.  
  41. controller :
  42. public function showFormIndustri()
  43. {
  44. $result = $this->auth_model->model_formindustri();
  45. $dataformindustri = [];
  46. $dataformindustri['dataform'] = [];
  47.  
  48. foreach($result as $index => $value) {
  49. $dataformindustri['dataform'][$index] = array (
  50. $value->m_industri['nama_industri'],
  51. $value->m_industri['alamat_industri'],
  52. $value->m_industri['telepon_industri'],
  53. $value->m_industri['direktur'],
  54. $value->formulirpersetujuan['nomor_surat'],
  55. $value->formulirpersetujuan['periode']
  56.  
  57.  
  58. );
  59. };
  60.  
  61. echo json_encode($dataformindustri);
  62. }
  63.  
  64. model :
  65. public function model_formindustri()
  66. {
  67. $this->db->select('*');
  68. $this->db->from('formulir_persetujuan');
  69. $this->db->join('m_industri', 'm_industri.kode_industri = formulir_persetujuan.kode_industri');
  70. $query = $this->db->get();
  71. $result = $query->result_array();
  72. return $result;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment