I have three view files in views folder and i want to show category table and product table by click in link button using ajax call...
input.php
display both table data
<div class="wrapper">
<div class="container">
<div class="jumbotron">
<h1>View Two Records By Click Event</h1>
</div>
<div id="show-catg">
<?php $this->load->view('show'); ?>
</div>
<div id="show-prd">
<?php $this->load->view('show_pro'); ?>
</div>
but i want to show this using click event.. like
<a href="" class="show_catg">Categories</a>
<a href="" class="show_prd">Product</a>
$('.show_catg').click(function(){
url:,
data:,
});
$('.show_prd').click(function(){
url:
data:
});
this is may controller class function
public function index(){
$data= $this->Model_data->getAll_categories();
$data1 = $this->Model_data->getAll_product();
$Dataa = array('categories' => $data,"products"=>$data1);
$this->load->view('input',$Dataa);
}
Model_data class
function getAll_categories(){
$this->db->select('*');
$this->db->from('categories');
$this->db->limit(50);
$this->db->order_by('Catg_ID','ASC');
$query = $this->db->get();
return $query->result();
}
public function getAll_product(){
$this->db->select('*');
$this->db->from('product');
$this->db->limit(50);
$this->db->order_by('Prod_ID','ASC');
$query = $this->db->get();
return $query->result();
}