<?php

/*
 * 站点相关信息查询
 */

class Site_model extends CI_Model {
    /*

      tour
      single-city-tour
      yangtzecruise
      hotel
      china-flights
      travelguide

     */

    var $SSC_ParentID = 0;
    var $menus = 0;

    function __construct() {
        parent::__construct();
        $this->HT = $this->load->database('HT', TRUE);
    }
    
    function get_country_by_id($id,$lgc=FALSE) {
        if ($lgc===FALSE)
        {
            $lgc = $this->config->item('Site_LGC');
        }
        elseif (!is_numeric($lgc))
        {
            return array();
        }
        $sql = "SELECT ci2.COI2_COI_SN, \n"
                . "       ci2.COI2_Country \n"
                . "FROM   COuntryInfo2 ci2 \n"
                . "WHERE  ci2.COI2_LGC = ? and COI2_COI_SN = ?";
        $query = $this->HT->query($sql, array($lgc,$id));
        return $query->result();
    }   
}