CREATE TABLE IF NOT EXISTS `{WPDB_PREFIX}tblight_orders` (
	`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`order_number` varchar(100) NOT NULL,
	`names` varchar(255) NOT NULL DEFAULT '',
	`email` varchar(255) NOT NULL DEFAULT '',
	`phone` varchar(40) NOT NULL DEFAULT '',
	`country_id` smallint(6) NOT NULL DEFAULT 0 COMMENT 'Foreign Key to #__tblight_countries.country_id',
	`country_calling_code` varchar(10) NOT NULL COMMENT 'Country calling code',
	`booking_type` varchar(30) NOT NULL,
	`sub_total` decimal(10,2) NOT NULL DEFAULT 0.00,
	`flat_cost` decimal(10,2) NOT NULL DEFAULT 0.00,
	`percentage_cost` decimal(10,2) NOT NULL DEFAULT 0.00,
	`cprice` decimal(10,2) NOT NULL DEFAULT 0.00,
	`selpassengers` smallint(6) UNSIGNED NOT NULL DEFAULT '0',
	`selchildseats` smallint(6) UNSIGNED NOT NULL DEFAULT '0',
	`selluggage` smallint(6) UNSIGNED NOT NULL DEFAULT '0',
	`datetime1` varchar(20) NOT NULL DEFAULT '',
	`datetime2` varchar(20) NOT NULL DEFAULT '',
	`distance` decimal(10,5) NOT NULL DEFAULT 0.00000 COMMENT 'Disance is in KM or Mile based on unit distance settings',
	`duration` int(11) NOT NULL COMMENT '(seconds)',
	`duration_text` varchar(255) NOT NULL,
	`begin` varchar(255) NOT NULL DEFAULT '',
	`stops` text NOT NULL,
	`end` varchar(255) NOT NULL DEFAULT '',
	`state` tinyint(1) DEFAULT 0,
	`driver_id` int(11) NOT NULL DEFAULT 0,
	`payment` varchar(10) DEFAULT NULL,
	`payment_name` VARCHAR(100) NOT NULL,
	`vehicletype` smallint(6) UNSIGNED NOT NULL DEFAULT '0',
	`vehicle_title` varchar(100) NOT NULL,
	`created` datetime DEFAULT NULL,
	`created_by` int(11) NOT NULL,
	`invoice_title` varchar(100) NOT NULL,
	`custom_car` varchar(255) NOT NULL,
	`price_override` decimal(10,2) NOT NULL DEFAULT -1.00,
	`custom_payment` varchar(255) NOT NULL,
	`payment_notes` text NOT NULL,
	`modified` datetime NOT NULL,
	`modified_by` int(11) NOT NULL,
	`source` enum('backend','frontend','drivenot') NOT NULL DEFAULT 'frontend',
	`pickup_lat` decimal(10,8) NOT NULL,
	`pickup_lng` decimal(11,8) NOT NULL,
	`dropoff_lat` decimal(10,8) NOT NULL,
	`dropoff_lng` decimal(11,8) NOT NULL,
	`ip_address` varchar(15) NOT NULL,
	`language` char(7) NOT NULL DEFAULT '*' COMMENT 'The site language code while submitting this order',
	`reminder_sent` tinyint(4) NOT NULL DEFAULT 0,
	`user_agent` text NOT NULL,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;