For some reason when I do order by Date_Scheduled desc it is still leaving the oldest date first. I am trying to get it so that the newest date shows first and oldest date last. Not sure is I am writing this correctly.
Here is my model it is the get employee function.
<?php
class Employee_model extends CI_Model
{
public function insert_employee($data)
{
$this->db->insert('employee_list',$data);
return $this->db->insert_id();
}
public function get_employee()
{
$this->db->select('*');
$this->db->from('employee_list');
$this->db->where('status',1);
$this->db->order_by ("Date_Scheduled", "desc");
$this->db->order_by("Scheduled_Area", "desc");
$this->db->order_by("Time_Reported", "desc");
$query =$this->db->get();
return $query->result();
}
public function delete_employee($id,$data)
{
$this->db->where('id',$id);
$this->db->update('employee_list',$data);
return print_r($data);
}
public function edit_employee($id)
{
$this->db->select('*');
$this->db->from('employee_list');
$this->db->where('id',$id);
$this->db->where('status',1);
$query =$this->db->get();
return $query->result();
}
public function update_employee($data,$id)
{
$this->db->where('id',$id);
$this->db->update('employee_list',$data);
return print_r($data);
}
}