diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 896c04971..1bbd291b4 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -57,7 +57,7 @@ class Items extends Secure_Controller $filters = array_merge($filters, $filledup); $items = $this->Item->search($search, $filters, $limit, $offset, $sort, $order); - $total_rows = $this->xss_clean($this->Item->get_found_rows($search, $filters)); + $total_rows = $this->Item->get_found_rows($search, $filters); $data_rows = array(); foreach($items->result() as $item) diff --git a/application/models/Sale.php b/application/models/Sale.php index 76d3d8a5c..ba8be2977 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -51,10 +51,10 @@ class Sale extends CI_Model else { $this->db->group_start(); - $this->db->like('last_name', $search); - $this->db->or_like('first_name', $search); - $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); - $this->db->or_like('company_name', $search); + $this->db->like('person.last_name', $search); + $this->db->or_like('person.first_name', $search); + $this->db->or_like('CONCAT(person.first_name, " ", person.last_name)', $search); + $this->db->or_like('customer.company_name', $search); $this->db->group_end(); } }