[eluser]Atrhick[/eluser]
Can someone help me please I have no idea why the data is not being passed to my view. thak you in advance.
Model
Code:
Class Dashboard_model extends CI_Model
{
function employees()
{
$this -> db -> select('id, employees_name, store_name, manager_name, email, hire_date, status, last_signin');
$this -> db -> from('employees');
$query = $this -> db -> get();
if($query)
{
return $query->result();
$employees_list_data= array();
foreach($result->result() as $employees_list_results)
{
$employees_list_data[] = $employees_list_results;
}
}return $employees_list_data;
}
}
Controller
Code:
function employees()
{
if($this->session->userdata('logged_in'))
{
$employees_list_data['employees_list_data'] = $this->Dashboard_model->employees();
$this->view_data['employees_list_data'] = $this->Dashboard_model->employees();
$this->load->view('dashboard_view', $this->view_data);
}
}
View
Code:
<?php foreach($employees_list_data as $employees_list_show_results): ?>
<?php foreach($employees_list_data as $employees_list_show_results): ?>
<?php { ?>
<tr class="odd gradeX">
<td><?php $employees_list_show_results['employees_name']?></td>
<td><?php $employees_list_show_results['store_name']?></td>
<td>test_name</td>
<td class="center"> 90% - Pass</td>
<td class="center">
<?php $employees_list_show_results['manager_name']?></td>
</tr>
<?php } ?>
<?php endforeach; ?>