Welcome Guest, Not a member yet? Register   Sign In
Undefined variable:
#1

[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>&lt;?php $employees_list_show_results['employees_name']?&gt;</td>
    <td>&lt;?php $employees_list_show_results['store_name']?&gt;</td>
    <td>test_name</td>
    <td class="center"> 90% - Pass</td>
    <td class="center">
    &lt;?php $employees_list_show_results['manager_name']?&gt;</td>
     </tr>
     &lt;?php } ?&gt;
     &lt;?php endforeach; ?&gt;


Messages In This Thread
Undefined variable: - by El Forum - 07-14-2014, 10:01 AM
Undefined variable: - by El Forum - 07-14-2014, 11:38 AM
Undefined variable: - by El Forum - 07-14-2014, 12:14 PM
Undefined variable: - by El Forum - 07-14-2014, 02:19 PM
Undefined variable: - by El Forum - 07-14-2014, 02:41 PM
Undefined variable: - by El Forum - 07-14-2014, 03:01 PM
Undefined variable: - by El Forum - 07-19-2014, 06:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB