DROP TABLE IF EXISTS `zhuna_ad`;

CREATE TABLE `zhuna_ad` (
  `ad_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `ad_cid` smallint(5) unsigned NOT NULL COMMENT '广告位所属ad_cid',
  `ad_title` varchar(60) NOT NULL,
  `ad_link` varchar(255) NOT NULL,
  `ad_width` varchar(10) NOT NULL,
  `ad_height` varchar(10) NOT NULL,
  `ad_type_radio` tinyint(2) NOT NULL,
  `ad_uploadfile` varchar(255) NOT NULL,
  `ad_order` smallint(5) unsigned NOT NULL,
  `ad_starttime` int(10) unsigned NOT NULL,
  `ad_endtime` int(10) unsigned NOT NULL,
  `ad_state_radio` tinyint(2) NOT NULL,
  `ad_addtime` int(11) NOT NULL,
  `ad_externallinks` text NOT NULL,
  `ad_area` varchar(60) NOT NULL COMMENT '广告位名称',
  `ad_name` varchar(60) NOT NULL COMMENT '广告位名称代码',
  PRIMARY KEY (`ad_id`),
  KEY `ad_cid` (`ad_cid`),
  KEY `ad_order` (`ad_order`),
  KEY `ad_state_radio` (`ad_state_radio`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_admin`;

CREATE TABLE `zhuna_admin` (
  `id` mediumint(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` char(20) NOT NULL,
  `password` char(32) NOT NULL,
  `name` char(20) NOT NULL,
  `rank` mediumint(5) unsigned NOT NULL,
  `logintime` int(11) unsigned NOT NULL,
  `loginip` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `rank` (`rank`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_adminlog`;

CREATE TABLE `zhuna_adminlog` (
  `logid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `rank` mediumint(5) unsigned NOT NULL,
  `id` mediumint(10) unsigned NOT NULL,
  `name` char(20) NOT NULL,
  `logip` char(15) NOT NULL,
  `logtime` int(11) unsigned NOT NULL,
  PRIMARY KEY (`logid`),
  KEY `id` (`id`),
  KEY `rank` (`rank`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_admintype`;

CREATE TABLE `zhuna_admintype` (
  `rank` mediumint(5) unsigned NOT NULL,
  `typename` varchar(30) NOT NULL,
  `system` smallint(6) unsigned NOT NULL,
  `purviews` text NOT NULL,
  PRIMARY KEY (`rank`),
  KEY `system` (`system`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_article`;

CREATE TABLE `zhuna_article` (
  `aid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `class_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  `title` char(60) NOT NULL,
  `content` mediumtext NOT NULL,
  `author` char(20) NOT NULL,
  `order` int(11) unsigned NOT NULL DEFAULT '0',
  `state_radio` tinyint(2) unsigned NOT NULL,
  `time` int(11) unsigned NOT NULL,
  `view_num` int(11) unsigned NOT NULL,
  `img` varchar(200) NOT NULL,
  `CityID` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`aid`),
  KEY `class_id` (`class_id`),
  KEY `order` (`order`),
  KEY `state_radio` (`state_radio`),
  KEY `CityID` (`CityID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_article_class`;

CREATE TABLE `zhuna_article_class` (
  `class_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `class_name` char(30) NOT NULL,
  `pid` smallint(5) unsigned NOT NULL,
  `orderid` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`class_id`),
  KEY `pid` (`pid`),
  KEY `orderid` (`orderid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_cbd`;

CREATE TABLE `zhuna_cbd` (
  `cbd_id` int(11) NOT NULL AUTO_INCREMENT,
  `cityid` int(11) NOT NULL,
  `cbd_name` varchar(50) CHARACTER SET utf8 NOT NULL,
  `hotelnum` int(11) NOT NULL,
  PRIMARY KEY (`cbd_id`),
  KEY `cityid` (`cityid`),
  KEY `hotelnum` (`hotelnum`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `zhuna_chain`;

CREATE TABLE `zhuna_chain` (
  `chain_id` int(11) NOT NULL AUTO_INCREMENT,
  `chain_fullname` int(60) NOT NULL,
  `chain_name` varchar(30) CHARACTER SET utf8 NOT NULL,
  `chain_shortname` varchar(20) CHARACTER SET utf8 NOT NULL,
  `picture` varchar(100) CHARACTER SET utf8 NOT NULL,
  `hotelnum` int(5) NOT NULL,
  `pinyin` varchar(60) CHARACTER SET utf8 NOT NULL,
  `jibie` tinyint(2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`chain_id`),
  KEY `hotelnum` (`hotelnum`),
  KEY `jibie` (`jibie`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `zhuna_chainnum`;

CREATE TABLE `zhuna_chainnum` (
  `chainnum_id` int(11) NOT NULL AUTO_INCREMENT,
  `CityId` int(11) NOT NULL,
  `CityName` varchar(30) NOT NULL,
  `chain_id` int(11) NOT NULL,
  `chain_num` int(11) NOT NULL,
  PRIMARY KEY (`chainnum_id`),
  KEY `CityId` (`CityId`),
  KEY `chain_id` (`chain_id`),
  KEY `chain_num` (`chain_num`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_city`;

CREATE TABLE `zhuna_city` (
  `CityID` int(11) NOT NULL AUTO_INCREMENT,
  `CityName` varchar(35) CHARACTER SET utf8 NOT NULL,
  `Pid` int(11) NOT NULL,
  `Pname` varchar(35) CHARACTER SET utf8 NOT NULL,
  `Hotelnum` int(11) NOT NULL,
  `ABCD` varchar(5) CHARACTER SET utf8 NOT NULL,
  `pinyin` varchar(100) CHARACTER SET utf8 NOT NULL,
  `suoxie` varchar(10) CHARACTER SET utf8 NOT NULL,
  `province` tinyint(2) NOT NULL DEFAULT '0',
  `citypic` varchar(200) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`CityID`),
  KEY `Pid` (`Pid`),
  KEY `Hotelnum` (`Hotelnum`),
  KEY `province` (`province`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `zhuna_expo`;

CREATE TABLE `zhuna_expo` (
  `expo_id` int(11) NOT NULL,
  `Title` varchar(255) NOT NULL,
  `CityID` int(11) NOT NULL,
  `CityName` varchar(35) NOT NULL,
  `st` datetime NOT NULL,
  `et` datetime NOT NULL,
  `Content` longtext NOT NULL,
  `Place` varchar(100) NOT NULL,
  `Nearbyhotels` longtext NOT NULL,
  PRIMARY KEY (`expo_id`),
  KEY `CityID` (`CityID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_flink`;

CREATE TABLE `zhuna_flink` (
  `flink_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `flink_title` char(30) NOT NULL,
  `flink_link` char(60) NOT NULL,
  `flink_type_radio` tinyint(2) unsigned NOT NULL,
  `flink_uploadfile` varchar(255) NOT NULL,
  `flink_order` smallint(5) unsigned NOT NULL,
  `flink_starttime` int(11) unsigned NOT NULL,
  `flink_endtime` int(11) unsigned NOT NULL,
  `flink_state_radio` tinyint(2) unsigned NOT NULL,
  `flink_addtime` int(11) unsigned NOT NULL,
  `flink_addusername` varchar(20) NOT NULL,
  `flink_externallinks` varchar(255) NOT NULL,
  PRIMARY KEY (`flink_id`),
  KEY `flink_type_radio` (`flink_type_radio`),
  KEY `flink_order` (`flink_order`),
  KEY `flink_state_radio` (`flink_state_radio`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_hotel`;

CREATE TABLE `zhuna_hotel` (
  `hotel_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `HotelName` varchar(255) NOT NULL,
  `star` smallint(6) unsigned NOT NULL,
  `Traffic` text NOT NULL,
  `Traffic_zhinan` text NOT NULL,
  `Address` varchar(255) NOT NULL,
  `Content` longtext NOT NULL,
  `Rongyu` text NOT NULL,
  `Service` varchar(255) NOT NULL,
  `Card` varchar(255) NOT NULL,
  `Canyin` text NOT NULL,
  `yulejianshen` text NOT NULL,
  `kefangsheshi` text NOT NULL,
  `kaiye` varchar(20) NOT NULL,
  `zhuangxiu` varchar(20) NOT NULL,
  `picture` varchar(255) NOT NULL,
  `CityID` int(10) NOT NULL,
  `CityName` varchar(35) NOT NULL,
  `cbd_id` int(11) NOT NULL,
  `cbd_name` varchar(50) NOT NULL,
  `chain_name` varchar(50) NOT NULL,
  `chain_id` smallint(11) NOT NULL,
  `MapPoint` varchar(100) NOT NULL,
  `Auditing` tinyint(2) NOT NULL DEFAULT '0',
  `Min_price` int(11) NOT NULL,
  `Max_price` int(11) NOT NULL,
  `Px_comment` int(11) NOT NULL,
  `Px_commend` int(11) NOT NULL,
  `Px_hot` int(11) NOT NULL,
  `Px_Index` int(11) NOT NULL,
  `HaoPing` varchar(100) NOT NULL,
  `ZaocanPrice` varchar(100) NOT NULL,
  `BedPrice` varchar(100) NOT NULL,
  `ADSL` varchar(30) NOT NULL,
  `Tags` varchar(255) NOT NULL,
  `Hotelpictures` longtext NOT NULL,
  `NearbyHotels` longtext NOT NULL,
  `NearbyPoints` longtext NOT NULL,
  `x` int(11) unsigned NOT NULL,
  `y` int(11) unsigned NOT NULL,
  `uptime` int(11) unsigned NOT NULL COMMENT '酒店更新时间',
  PRIMARY KEY (`hotel_id`),
  KEY `star` (`star`),
  KEY `CityID` (`CityID`),
  KEY `cbd_id` (`cbd_id`),
  KEY `chain_id` (`chain_id`),
  KEY `Min_price` (`Min_price`),
  KEY `Max_price` (`Max_price`),
  KEY `Px_comment` (`Px_comment`),
  KEY `Px_commend` (`Px_commend`),
  KEY `Px_hot` (`Px_hot`),
  KEY `Px_Index` (`Px_Index`),
  KEY `x` (`x`),
  KEY `y` (`y`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_keywords`;

CREATE TABLE `zhuna_keywords` (
  `k_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `k_pagename` varchar(30) NOT NULL,
  `k_page` varchar(60) NOT NULL,
  `k_title` varchar(250) NOT NULL,
  `k_keywords` text NOT NULL,
  `k_description` text NOT NULL,
  `k_time` int(11) unsigned NOT NULL,
  `k_rule` varchar(255) NOT NULL,
  PRIMARY KEY (`k_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_point_class`;

CREATE TABLE `zhuna_point_class` (
  `class_id` int(11) NOT NULL AUTO_INCREMENT,
  `ClassName` varchar(20) CHARACTER SET utf8 NOT NULL,
  `ParentID` int(10) NOT NULL,
  `pinyin` varchar(60) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`class_id`),
  KEY `ParentID` (`ParentID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `zhuna_point_info`;

CREATE TABLE `zhuna_point_info` (
  `id` int(11) NOT NULL,
  `name` varchar(20) CHARACTER SET utf8 NOT NULL,
  `cityid` int(11) NOT NULL,
  `class_id` int(11) NOT NULL,
  `nums` int(11) NOT NULL,
  `PinYin` varchar(60) CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `zhuna_search`;

CREATE TABLE `zhuna_search` (
  `s_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `s_title` varchar(255) NOT NULL,
  `s_url` varchar(255) NOT NULL,
  `s_key` varchar(255) NOT NULL,
  `s_hn` varchar(255) NOT NULL,
  `s_cityid` int(11) unsigned NOT NULL,
  `s_updatetime` int(11) unsigned NOT NULL,
  `s_count` int(11) unsigned NOT NULL,
  PRIMARY KEY (`s_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `zhuna_sysconfig`;

CREATE TABLE `zhuna_sysconfig` (
  `sysid` smallint(8) NOT NULL AUTO_INCREMENT,
  `varname` varchar(30) NOT NULL,
  `info` varchar(150) NOT NULL,
  `type` varchar(10) NOT NULL,
  `value` text NOT NULL,
  `item` text NOT NULL,
  `nameaction` varchar(255) NOT NULL,
  `help` varchar(255) DEFAULT NULL,
  `order` smallint(8) unsigned NOT NULL,
  PRIMARY KEY (`sysid`),
  KEY `order` (`order`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

