• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cannot display province name & some other

#1
[eluser]zacksyah[/eluser]
I cannot display province_name, regency_name, sub-district_name, village_name, sample_name & some other.
This is my code
Controllrer
Code:
<?php

class Bps extends CI_Controller {
    //put your code here

    function __construct(){
        parent::__construct();
        $this->load->library('pagination');
        $this->load->database();
        $this->load->model('bpsmodel');
    }
    
    function tampil($offset=0){
        $limit = 10;
        $uri_segment = 3;
        
        $config['base_url']=site_url('bps/tampil');
                $config['total_rows']=$this->bpsmodel->countdata('ukm');
                $config['per_page']=$limit;
                $config['uri_segment']=$uri_segment;
                $config['full_tag_open'] = '';
                $config['full_tag_close'] = '';
                $this->pagination->initialize($config);
                $data['pagination']=$this->pagination->create_links();
                
                $data['title'] = 'Test pagination';
                $data['detail'] = $this->bpsmodel->get('ukm', $config['per_page'], $this->uri->segment(3));
                $this->load->view('bpsview', $data);
    }
    
    
}

?>

Model
Code:
<?php

class Bpsmodel extends CI_Model{
    //put your code here
    
    function __construct(){
        parent::__construct();      
                
        }
        var $table = 'ukm';
        
    function countdata($table){
                           $this->db->SELECT('province_name', 'regency_name', 'sub-district_name', 'village_name','NBS','NSBS','NUS','sample_type','name','address','RT','RW','zip_code','phone','EXT','FAX','EMAIL','HOMEPAGE','activity','category_code','lable','business_name');
                           $this->db->FROM('$table');
                           $this->db->JOIN('village','ukm.village_id = desa.village_id');
                           $this->db->JOIN('sub-district','village.sub-district_id= sub-district.sub-district_id');
                           $this->db->JOIN('regency','sub-district.regency_id = regency.regency_id');
                           $this->db->JOIN('province','regency.province_id = province.province_id');
                           $this->db->JOIN('kbli','ukm.kbli_code = kbli.kbli_code');
                           $this->db->JOIN('category','kbli.category_code = category.category_code');
                           $res = $this->db->get();
                           return $res->num_rows();
    }
    
    function get($table,$limit,$offset)
    {
        $this->db->from($table)->limit($limit)->offset($offset);
        return $this->db->get()->result();
        $query = $this->db->get($limit,$offset);
    }
}

?>

View
Code:
<center>
<h3>Tabel data Usaha Kecil dan Menengah<h3>

</table>
<table border=1 >
<tr>
<td>No businessman</td>
<td>province</td>
<td>regency</td>
<td>sub-district</td>
<td>Village</td>
<td>NBS</td>
<td>NSBS</td>
<td>NUS</td>
<td>NUP</td>
<td>Sample Type</td>
<td>Name</td>
<td>Address</td>
<td>RT</td>
<td>RW</td>
<td>Zip code</td>
<td>Phone</td>
<td>Ext</td>
<td>Fax</td>
<td>Email</td>
<td>Homepage</td>
<td>Activity</td>
<td>Category Name</td>
<td>lable</td>
<td>business_name</td>
</tr>
&lt;?php foreach($detail as $row) : ?&gt;
<tr>
<td>&lt;?php echo $row->id_pengusaha; ?&gt;</td>
<td>&lt;?php echo $row->province_id; ?&gt;</td>
<td>&lt;?php echo $row->regency_id; ?&gt;</td>
<td>&lt;?php echo $row->sub-district_idn; ?&gt;</td>
<td>&lt;?php echo $row->village_id; ?&gt;</td>
<td>&lt;?php echo $row->NBS; ?&gt;</td>
<td>&lt;?php echo $row->NSBS; ?&gt;</td>
<td>&lt;?php echo $row->NUS; ?&gt;</td>
<td>&lt;?php echo $row->NUP; ?&gt;</td>
<td>&lt;?php echo $row->sample_type; ?&gt;</td>
<td>&lt;?php echo $row->Name; ?&gt;</td>
<td>&lt;?php echo $row->Address; ?&gt;</td>
<td>&lt;?php echo $row->RT; ?&gt;</td>
<td>&lt;?php echo $row->RW; ?&gt;</td>
<td>&lt;?php echo $row->zip_code; ?&gt;</td>
<td>&lt;?php echo $row->phone; ?&gt;</td>
<td>&lt;?php echo $row->EXT; ?&gt;</td>
<td>&lt;?php echo $row->FAX; ?&gt;</td>
<td>&lt;?php echo $row->EMAIL; ?&gt;</td>
<td>&lt;?php echo $row->HOMEPAGE; ?&gt;</td>
<td>&lt;?php echo $row->activity; ?&gt;</td>
<td>&lt;?php echo $row->category_code; ?&gt;</td>
<td>&lt;?php echo $row->kbli_code; ?&gt;</td>
<td>&lt;?php echo $row->business_name; ?&gt;</td>


</td>
</tr>
&lt;?php endforeach; ?&gt;
&lt;?php echo $this->pagination->create_links(); ?&gt;
</table>
whether there is something wrong in my view & model file?
please help thanks b4


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.