You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
626 B
PHP
28 lines
626 B
PHP
<?php
|
|
|
|
class Air_model extends CI_Model {
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
$this->HT = $this->load->database('HT', TRUE);
|
|
}
|
|
|
|
function get_city_by_code($city_code) {
|
|
$sql = "
|
|
SELECT TOP 1 ac.CityEN
|
|
FROM AirCity ac
|
|
WHERE ac.CityCode = ?
|
|
|
|
";
|
|
$query = $this->HT->query($sql, $city_code);
|
|
//print_r($this->HT->queries);
|
|
if ($query->result()) {
|
|
$row = $query->row();
|
|
return mb_strtolower($row->CityEN);
|
|
} else {
|
|
return FALSE;
|
|
}
|
|
}
|
|
|
|
}
|