diff --git a/app/Controllers/Country.php b/app/Controllers/Country.php index 690f8e4..4fe474b 100644 --- a/app/Controllers/Country.php +++ b/app/Controllers/Country.php @@ -13,7 +13,16 @@ class Country extends Controller { public function index() { try { - $sql = "select * from country"; + + $Country = $this->request->getVar('Country'); + + if ($Country != null) { + $filterQuery = " WHERE Country LIKE '%$Country%'"; + } else { + $filterQuery = ""; + } + + $sql = "SELECT IntCountryID, CountryID, Country FROM country $filterQuery"; $data = $this->db->query($sql)->getResultArray(); return $this->respond([