/*
Navicat MySQL Data Transfer

Source Server         : localhost_3306
Source Server Version : 50051
Source Host           : localhost:3306
Source Database       : imeeting_bk

Target Server Type    : MYSQL
Target Server Version : 50051
File Encoding         : 65001

Date: 2013-02-22 08:50:41
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `tbbooking`
-- ----------------------------
DROP TABLE IF EXISTS `tbbooking`;
CREATE TABLE `tbbooking` (
  `id` int(11) NOT NULL auto_increment,
  `wtype` tinyint(4) default '0' COMMENT '0=จองห้องประชุม,1=จองรถ',
  `doc_id` int(11) default NULL,
  `room_id` int(11) default NULL,
  `rdate` date default NULL,
  `start_time` varchar(10) default NULL,
  `end_time` varchar(10) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbbooking
-- ----------------------------

-- ----------------------------
-- Table structure for `tbbooking_car`
-- ----------------------------
DROP TABLE IF EXISTS `tbbooking_car`;
CREATE TABLE `tbbooking_car` (
  `id` int(11) NOT NULL auto_increment,
  `wtype` tinyint(4) default '0' COMMENT '0=จองห้องประชุม,1=จองรถ',
  `doc_id` int(11) default NULL,
  `car_id` int(11) default NULL,
  `rdate` date default NULL,
  `start_time` varchar(10) default NULL,
  `end_time` varchar(10) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbbooking_car
-- ----------------------------

-- ----------------------------
-- Table structure for `tbbooking_equip`
-- ----------------------------
DROP TABLE IF EXISTS `tbbooking_equip`;
CREATE TABLE `tbbooking_equip` (
  `id` int(11) NOT NULL auto_increment,
  `doc_id` int(11) default NULL,
  `equip_id` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbbooking_equip
-- ----------------------------

-- ----------------------------
-- Table structure for `tbcar`
-- ----------------------------
DROP TABLE IF EXISTS `tbcar`;
CREATE TABLE `tbcar` (
  `id` int(11) NOT NULL auto_increment,
  `code` varchar(20) default NULL COMMENT 'ทะเบียน',
  `brand` varchar(100) default NULL,
  `model` varchar(200) default NULL,
  `detail` text COMMENT 'รายละเอียดอื่นๆ',
  `status` tinyint(4) default '0' COMMENT '0=ยืมได้,1=งดยืมชั่วคราว,2=อยู่ระหว่างซ๋อมแซม',
  `status_text` text,
  `picture1` varchar(120) default NULL,
  `picture2` varchar(120) default NULL,
  `picture3` varchar(120) default NULL,
  `picture4` varchar(120) default NULL,
  `pre_hours` int(11) default '0',
  `oilstatus` float default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- ----------------------------
-- Records of tbcar
-- ----------------------------

-- ----------------------------
-- Table structure for `tbcarreserv`
-- ----------------------------
DROP TABLE IF EXISTS `tbcarreserv`;
CREATE TABLE `tbcarreserv` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(250) default 'จุดประสงค์การใช้รถ',
  `cdate` datetime default NULL COMMENT 'วันที่บันทึก',
  `member_id` int(11) default NULL,
  `car_id` int(11) default NULL,
  `rdate` date default NULL COMMENT 'วันที่จอง',
  `start_time` varchar(10) default NULL,
  `end_time` varchar(10) default NULL,
  `amount_people` smallint(6) default '0',
  `employee` text COMMENT 'ผู้เข้าร่วมการประชุม',
  `contact_name` varchar(200) default NULL,
  `contact_tel` varchar(100) default NULL,
  `contact_email` varchar(50) default NULL,
  `detail` text COMMENT 'คำอธิบายงานที่ใช้',
  `status` tinyint(4) default '0' COMMENT '0=รอการอนุมัติ,1=อนุมัติ,2=ไม่อนุมัติ',
  `status_detail` text COMMENT 'หมายเหตุสถานะ',
  `approve_time` datetime default NULL,
  `detail_use` text,
  `approve_id` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbcarreserv
-- ----------------------------

-- ----------------------------
-- Table structure for `tbconfig`
-- ----------------------------
DROP TABLE IF EXISTS `tbconfig`;
CREATE TABLE `tbconfig` (
  `id` int(11) NOT NULL auto_increment,
  `sendemail` tinyint(4) default '0' COMMENT '0=ไม่่ส่งเมลล์,1=ส่งเมลล์',
  `email` varchar(50) default NULL,
  `email_password` varchar(50) default NULL,
  `email2` varchar(50) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbconfig
-- ----------------------------
INSERT INTO `tbconfig` VALUES ('1', '0', 'pgmthailand@gmail.com', 'vkiN9l6fs]jv', 'codeexit@hotmail.com');

-- ----------------------------
-- Table structure for `tbdepart`
-- ----------------------------
DROP TABLE IF EXISTS `tbdepart`;
CREATE TABLE `tbdepart` (
  `id` int(11) NOT NULL auto_increment,
  `team_id` int(11) default NULL,
  `code` varchar(50) default NULL,
  `name` varchar(255) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbdepart
-- ----------------------------

-- ----------------------------
-- Table structure for `tbequip`
-- ----------------------------
DROP TABLE IF EXISTS `tbequip`;
CREATE TABLE `tbequip` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) default NULL,
  `detail` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbequip
-- ----------------------------

-- ----------------------------
-- Table structure for `tblog`
-- ----------------------------
DROP TABLE IF EXISTS `tblog`;
CREATE TABLE `tblog` (
  `id` int(11) NOT NULL auto_increment,
  `cdate` datetime default NULL,
  `member_id` int(11) default NULL,
  `log` text,
  `log_from` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tblog
-- ----------------------------

-- ----------------------------
-- Table structure for `tbmember`
-- ----------------------------
DROP TABLE IF EXISTS `tbmember`;
CREATE TABLE `tbmember` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(200) default NULL,
  `position` varchar(200) default NULL,
  `username` varchar(20) default NULL,
  `password` text,
  `mobile` varchar(20) default NULL,
  `tel` varchar(20) default NULL,
  `depart_id` int(11) default NULL,
  `status` tinyint(4) default NULL COMMENT '0=รอการอนุมัติ,1=ใช้งาน,2=ระงับการใช้งาน',
  `mem_type` tinyint(4) default '0' COMMENT 'ประเภทสมาชิก 0=ทั่วไป,1=admin, 2=ผู้อนุมัติประจำแผนก',
  `email` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbmember
-- ----------------------------

-- ----------------------------
-- Table structure for `tbmembertodepart`
-- ----------------------------
DROP TABLE IF EXISTS `tbmembertodepart`;
CREATE TABLE `tbmembertodepart` (
  `id` int(11) NOT NULL auto_increment,
  `member_id` int(11) default NULL,
  `depart_id` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbmembertodepart
-- ----------------------------

-- ----------------------------
-- Table structure for `tbreserv`
-- ----------------------------
DROP TABLE IF EXISTS `tbreserv`;
CREATE TABLE `tbreserv` (
  `id` int(11) NOT NULL auto_increment,
  `meet_name` varchar(250) default 'หัวข้อการประชุม',
  `cdate` datetime default NULL COMMENT 'วันที่บันทึก',
  `member_id` int(11) default NULL,
  `room_id` int(11) default NULL,
  `rdate` date default NULL COMMENT 'วันที่จอง',
  `start_time` varchar(10) default NULL,
  `end_time` varchar(10) default NULL,
  `amount_people` smallint(6) default '0',
  `equip` text,
  `contact_name` varchar(200) default NULL,
  `contact_tel` varchar(100) default NULL,
  `contact_email` varchar(50) default NULL,
  `employee` text COMMENT 'ผู้เข้าร่วมการประชุม',
  `meet_detail` text,
  `status` tinyint(4) default '0' COMMENT '0=รอการอนุมัติ,1=อนุมัติ,2=ไม่อนุมัติ',
  `status_detail` text COMMENT 'หมายเหตุสถานะ',
  `approve_time` datetime default NULL,
  `chairman` text COMMENT 'ประธานการประชุม',
  `approve_id` int(11) default NULL,
  `file_name` text,
  `file_fullpath` text,
  `file_tmpname` varchar(200) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbreserv
-- ----------------------------

-- ----------------------------
-- Table structure for `tbroom`
-- ----------------------------
DROP TABLE IF EXISTS `tbroom`;
CREATE TABLE `tbroom` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(120) default NULL,
  `room_size` varchar(50) default '0',
  `sit_amount` smallint(4) default '0',
  `air` tinyint(2) default '0',
  `projector` tinyint(2) default '0',
  `whiteboard` tinyint(2) default '0',
  `computer` smallint(6) default '0',
  `description` text,
  `picture1` varchar(255) default NULL,
  `picture2` varchar(255) default NULL,
  `picture3` varchar(255) default NULL,
  `picture4` varchar(255) default NULL,
  `pre_hours` int(11) default '0',
  `status` tinyint(4) default '0',
  `ma_email` varchar(100) default NULL,
  `ma_name` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbroom
-- ----------------------------

-- ----------------------------
-- Table structure for `tbteam`
-- ----------------------------
DROP TABLE IF EXISTS `tbteam`;
CREATE TABLE `tbteam` (
  `id` int(11) NOT NULL auto_increment,
  `code` varchar(50) default NULL,
  `name` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbteam
-- ----------------------------

-- ----------------------------
-- Table structure for `tbtimerange`
-- ----------------------------
DROP TABLE IF EXISTS `tbtimerange`;
CREATE TABLE `tbtimerange` (
  `id` int(11) NOT NULL auto_increment,
  `wtime` varchar(10) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=49 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of tbtimerange
-- ----------------------------
INSERT INTO `tbtimerange` VALUES ('1', '00:00');
INSERT INTO `tbtimerange` VALUES ('2', '00:30');
INSERT INTO `tbtimerange` VALUES ('3', '01:00');
INSERT INTO `tbtimerange` VALUES ('4', '01:30');
INSERT INTO `tbtimerange` VALUES ('5', '02:00');
INSERT INTO `tbtimerange` VALUES ('6', '02:30');
INSERT INTO `tbtimerange` VALUES ('7', '03:00');
INSERT INTO `tbtimerange` VALUES ('8', '03:30');
INSERT INTO `tbtimerange` VALUES ('9', '04:00');
INSERT INTO `tbtimerange` VALUES ('10', '04:30');
INSERT INTO `tbtimerange` VALUES ('11', '05:00');
INSERT INTO `tbtimerange` VALUES ('12', '05:30');
INSERT INTO `tbtimerange` VALUES ('13', '06:00');
INSERT INTO `tbtimerange` VALUES ('14', '06:30');
INSERT INTO `tbtimerange` VALUES ('15', '07:00');
INSERT INTO `tbtimerange` VALUES ('16', '07:30');
INSERT INTO `tbtimerange` VALUES ('17', '08:00');
INSERT INTO `tbtimerange` VALUES ('18', '08:30');
INSERT INTO `tbtimerange` VALUES ('19', '09:00');
INSERT INTO `tbtimerange` VALUES ('20', '09:30');
INSERT INTO `tbtimerange` VALUES ('21', '10:00');
INSERT INTO `tbtimerange` VALUES ('22', '10:30');
INSERT INTO `tbtimerange` VALUES ('23', '11:00');
INSERT INTO `tbtimerange` VALUES ('24', '11:30');
INSERT INTO `tbtimerange` VALUES ('25', '12:00');
INSERT INTO `tbtimerange` VALUES ('26', '12:30');
INSERT INTO `tbtimerange` VALUES ('27', '13:00');
INSERT INTO `tbtimerange` VALUES ('28', '13:30');
INSERT INTO `tbtimerange` VALUES ('29', '14:00');
INSERT INTO `tbtimerange` VALUES ('30', '14:30');
INSERT INTO `tbtimerange` VALUES ('31', '15:00');
INSERT INTO `tbtimerange` VALUES ('32', '15:30');
INSERT INTO `tbtimerange` VALUES ('33', '16:00');
INSERT INTO `tbtimerange` VALUES ('34', '16:30');
INSERT INTO `tbtimerange` VALUES ('35', '17:00');
INSERT INTO `tbtimerange` VALUES ('36', '17:30');
INSERT INTO `tbtimerange` VALUES ('37', '18:00');
INSERT INTO `tbtimerange` VALUES ('38', '18:30');
INSERT INTO `tbtimerange` VALUES ('39', '19:00');
INSERT INTO `tbtimerange` VALUES ('40', '19:30');
INSERT INTO `tbtimerange` VALUES ('41', '20:00');
INSERT INTO `tbtimerange` VALUES ('42', '20:30');
INSERT INTO `tbtimerange` VALUES ('43', '21:00');
INSERT INTO `tbtimerange` VALUES ('44', '21:30');
INSERT INTO `tbtimerange` VALUES ('45', '22:00');
INSERT INTO `tbtimerange` VALUES ('46', '22:30');
INSERT INTO `tbtimerange` VALUES ('47', '23:00');
INSERT INTO `tbtimerange` VALUES ('48', '23:30');
