<?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;
        }
    }

}
