SHOW:
|
|
- or go back to the newest paste.
| 1 | - | view : |
| 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 : |
| 41 | + | <!-- controller : --> |
| 42 | <?php | |
| 43 | public function showFormIndustri() | |
| 44 | {
| |
| 45 | $result = $this->auth_model->model_formindustri(); | |
| 46 | $dataformindustri = []; | |
| 47 | $dataformindustri['dataform'] = []; | |
| 48 | /* | |
| 49 | foreach($result as $index => $value) {
| |
| 50 | $dataformindustri['dataform'][$index] = array ( | |
| 51 | $value->m_industri['nama_industri'], | |
| 52 | $value->m_industri['alamat_industri'], | |
| 53 | $value->m_industri['telepon_industri'], | |
| 54 | $value->m_industri['direktur'], | |
| 55 | $value->formulirpersetujuan['nomor_surat'], | |
| 56 | $value->formulirpersetujuan['periode'] | |
| 57 | ||
| 58 | ||
| 59 | ); | |
| 60 | }; | |
| 61 | */ | |
| 62 | $dataformindustri['dataform']=array(); | |
| 63 | foreach($result as $value) {
| |
| 64 | - | model : |
| 64 | + | $dataformindustri['dataform'][]=$row;//coba print_r disini |
| 65 | } | |
| 66 | ||
| 67 | echo json_encode($dataformindustri); | |
| 68 | } | |
| 69 | ?> | |
| 70 | <!--- model : ---> | |
| 71 | <?php | |
| 72 | public function model_formindustri() | |
| 73 | {
| |
| 74 | $this->db->select('*');
| |
| 75 | $this->db->from('formulir_persetujuan');
| |
| 76 | $this->db->join('m_industri', 'm_industri.kode_industri = formulir_persetujuan.kode_industri');
| |
| 77 | $query = $this->db->get(); | |
| 78 | $result = $query->result_array(); | |
| 79 | return $result; | |
| 80 | } |