Update Country, menambahkan method get untuk pencarian nama country
This commit is contained in:
parent
dabc1ccef7
commit
7d9cbb1b69
@ -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([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user