 
 CREATE TABLE `ca_booking` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT,
-  `bsource` int(1) NOT NULL DEFAULT '0',
-  `bsrcid` bigint(20) NOT NULL DEFAULT '0',
-  `bid` varchar(25) NOT NULL DEFAULT 'xxx',
+  `bksrctypeid` int(11) NOT NULL DEFAULT '0',
+  `rsvid` bigint(20) NOT NULL DEFAULT '0',
   `guestid` bigint(20) NOT NULL DEFAULT '0',
   `rmtypeid` bigint(20) NOT NULL DEFAULT '0',
-  `rmid` bigint(20) NOT NULL DEFAULT '0',
-  `overnight` bit(1) NOT NULL DEFAULT b'0',
-  `guestcount` int(11) NOT NULL DEFAULT '1',
-  `adultshare` int(11) NOT NULL DEFAULT '1',
-  `childshare` int(11) NOT NULL DEFAULT '1',
-  `createdbyid` bigint(20) NOT NULL DEFAULT '0',
-  `datecreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
-  `modifiedbyid` bigint(20) NOT NULL DEFAULT '0',
-  `datemodified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
-  PRIMARY KEY (`id`,`bsrcid`,`bid`)
+  `roomid` bigint(20) NOT NULL DEFAULT '0',
+  `guesta` int(11) NOT NULL DEFAULT '0',
+  `guestc` int(11) NOT NULL DEFAULT '0',
+  `isovernight` bit(1) NOT NULL DEFAULT b'0',
+  `createdbyid` bigint(20) NOT NULL DEFAULT '0',
+  `datecreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `modifiedbyid` bigint(20) NOT NULL DEFAULT '0',
+  `datemodified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (`id`,`rsvid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 /*Data for the table `ca_booking` */
+
+/*Table structure for table `ca_booking_guest` */
+
+DROP TABLE IF EXISTS `ca_booking_guest`;
+
+CREATE TABLE `ca_booking_guest` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `bkid` bigint(20) NOT NULL DEFAULT '0',
+  `bcid` bigint(20) NOT NULL DEFAULT '0',
+  `gname` varchar(50) DEFAULT NULL,
+  `gclass` int(11) NOT NULL DEFAULT '1',
+  `timein` time DEFAULT NULL,
+  `expdate` datetime DEFAULT NULL,
+  `createdbyid` bigint(20) NOT NULL DEFAULT '0',
+  `datecreate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+  PRIMARY KEY (`id`,`bkid`,`bcid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+/*Data for the table `ca_booking_guest` */
+
+/*Table structure for table `ca_booking_items` */
+
+DROP TABLE IF EXISTS `ca_booking_items`;
+
+CREATE TABLE `ca_booking_items` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `bkid` bigint(20) NOT NULL DEFAULT '0',
+  `itemtype` int(11) NOT NULL DEFAULT '0',
+  `itemdesc` varchar(150) NOT NULL DEFAULT 'Item-0',
+  `itemqty` int(11) NOT NULL DEFAULT '1',
+  `itemamt` decimal(10,2) NOT NULL DEFAULT '0.00',
+  `ispaid` bit(1) NOT NULL DEFAULT b'0',
+  `createdbyid` bigint(20) NOT NULL DEFAULT '0',
+  `datecreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+/*Data for the table `ca_booking_items` */
 
 /*Table structure for table `ca_guest_info` */
 

  `roomcode` varchar(25) NOT NULL,
  `roomdesc` varchar(100) NOT NULL,
  `capacity` int(11) NOT NULL DEFAULT '1',
  `datecreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdbyid` bigint(20) NOT NULL DEFAULT '0',
  `datemodified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedbyid` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1;

/*Data for the table `ca_rooms` */

insert  into `ca_rooms`(`id`,`typeid`,`roomcode`,`roomdesc`,`capacity`,`datecreated`,`createdbyid`,`datemodified`,`modifiedbyid`) values (1,1,'UM01','Umbrella 1',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(2,1,'GA01','Gazebo 1',15,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(3,1,'CA01','Cabanas 1',20,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(4,2,'ST01','Standard Room 1',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(5,2,'ST02','Standard Room 2',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(6,2,'ST03','Standard Room 3',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(7,2,'ST04','Standard Room 4',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(8,2,'ST05','Standard Room 5',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(9,2,'ST06','Standard Room 6',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(10,2,'ST07','Standard Room 7',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(11,2,'ST08','Standard Room 8',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(12,2,'FA01','Family Room 1',20,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(13,2,'FA02','Family Room 2',20,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(14,3,'VI01','Villa 1',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(15,3,'VI02','Villa 2',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(16,3,'VI03','Villa 3',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(17,3,'VI04','Villa 4',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(18,3,'VI05','Villa 5 (Open Villa)',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(19,3,'VI06','Villa 6',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(20,4,'FH01','Function Hall 1',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0),(21,4,'PV01','Pavillon 1',10,'2017-02-09 00:06:32',0,'2017-02-09 00:06:32',0);

/*Table structure for table `ca_roomtype` */


DROP TABLE IF EXISTS `ca_reservation`;

CREATE TABLE `ca_reservation` (
  `id` bigint(20) NOT NULL DEFAULT '0',
  `rsid` varchar(20) NOT NULL DEFAULT 'RESV-000000-00000000',
  `guestid` bigint(20) NOT NULL DEFAULT '0',
  `rmtypeid` bigint(20) NOT NULL DEFAULT '0',
  `roomid` bigint(20) NOT NULL DEFAULT '0',
  `rsdatetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `isovernight` bit(1) NOT NULL DEFAULT b'0',
  `estguestcnt` int(11) NOT NULL DEFAULT '1',
  `isdppaid` bit(1) NOT NULL DEFAULT b'0',
  `dptypeid` bit(1) NOT NULL DEFAULT b'0',
  `dpamount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `rsvstatus` int(11) NOT NULL DEFAULT '0',
  `createdbyid` bigint(20) NOT NULL DEFAULT '0',
  `datecreated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modifiedbyid` bigint(20) NOT NULL DEFAULT '0',
  `datemodified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`rsid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `ca_reservation` */
