DROP TABLE IF EXISTS `#__jltcenter_cart`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_cart` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `event_id` int(11) NOT NULL,
  `add_time` int(11) NOT NULL DEFAULT '0',
  `uniqid` varchar(32) NOT NULL DEFAULT '',
  `ticket_type` int(11) NOT NULL,
  `ticket_price` float(11,2) NOT NULL DEFAULT '0.00',
  `quantity` int(11) unsigned NOT NULL,
  `event_type` int(2) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniqid` (`uniqid`,`event_id`,`ticket_type`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

DROP TABLE IF EXISTS `#__jltcenter_city`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_city` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `city_name` varchar(50) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `country_id` int(11) NOT NULL,
  `state_id` int(11) NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) 
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_country`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_country` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(2) NOT NULL,
  `country` varchar(50) NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=2 ;

DROP TABLE IF EXISTS `#__jltcenter_delivery_method`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_delivery_method` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT '',
  `description` text NOT NULL,
  `price` float(11,2) NOT NULL DEFAULT '0.00',
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  `send_by_mail` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_events`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_events` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `event_name` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `event_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `event_end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `performer_id` int(11) NOT NULL,
  `venue_id` int(11) NOT NULL,
  `city_id` int(11) NOT NULL,
  `country_id` int(11) NOT NULL,
  `state_id` int(11) NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  `ticket_price` float(11,2) NOT NULL DEFAULT '0.00',
  `tickets` int(11) NOT NULL DEFAULT '0',
  `tickets_sold` int(11) NOT NULL DEFAULT '0',
  `hits` int(11) NOT NULL DEFAULT '0',
  `tickets_basket` int(11) NOT NULL DEFAULT '0',
  `tickets_ordered` int(10) unsigned NOT NULL DEFAULT '0',
  `fb_event_id` varchar(40) NOT NULL DEFAULT '',
  `event_type` int(2) unsigned NOT NULL DEFAULT '0',
  `event_img` varchar(255) NOT NULL DEFAULT '',
  `short_desc` text NOT NULL,
  `pre_sale_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `pre_sale_discount` int(2) unsigned NOT NULL DEFAULT '0',
  `feature` int(1) unsigned NOT NULL DEFAULT '0',
  `ticket_template` INTEGER UNSIGNED NOT NULL DEFAULT 0,
  `meta_title` VARCHAR(255) NOT NULL DEFAULT '',
  `meta_desc` VARCHAR(255) NOT NULL DEFAULT '',
  `meta_keyword` VARCHAR(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_events_ticket_type`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_events_ticket_type` (
  `event_id` int(11) NOT NULL,
  `ticket_type` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ticket_desc` varchar(100) NOT NULL DEFAULT '',
  `ticket_price` float(11,2) NOT NULL DEFAULT '0.00',
  `tickets` int(11) NOT NULL DEFAULT '0',
  `tickets_sold` int(11) NOT NULL DEFAULT '0',
  `tickets_ordered` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`ticket_type`),
  UNIQUE KEY `event_tickets` (`event_id`,`ticket_type`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_order`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_order` (
  `order_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `client_id` int(10) unsigned DEFAULT '0',
  `user_id` int(10) unsigned DEFAULT '0',
  `order_status` int(2) DEFAULT '0',
  `order_total` float DEFAULT '0',
  `order_ip` varchar(20) DEFAULT '',
  `manager_remark` text,
  `greeting` text,
  `remark` text,
  `delivery_method` int(10) unsigned DEFAULT '0',
  `delivery_rate` float(6,2) DEFAULT '0.00',
  `payment_method` int(10) unsigned DEFAULT '0',
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_by` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `commission` FLOAT(6,2) NOT NULL DEFAULT 0,
  `tax` FLOAT(6,2) NOT NULL DEFAULT 0,
  `hearabout` varchar(150) NOT NULL DEFAULT '',
  PRIMARY KEY (`order_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1;

DROP TABLE IF EXISTS `#__jltcenter_order_lines`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_order_lines` (
  `line_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_id` int(11) NOT NULL,
  `event_id` int(11) NOT NULL,
  `ticket_type` int(11) NOT NULL,
  `ticket_price` float(11,2) NOT NULL DEFAULT '0.00',
  `quantity` int(11) NOT NULL,
  `commission` FLOAT(6,2) NOT NULL DEFAULT 0,
  PRIMARY KEY (`line_id`),
  UNIQUE KEY `order_line` (`order_id`,`event_id`,`ticket_type`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1;

DROP TABLE IF EXISTS `#__jltcenter_payment_log`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_payment_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_time` datetime NOT NULL,
  `order_id` int(10) unsigned NOT NULL DEFAULT '0',
  `payment_method` varchar(45) NOT NULL DEFAULT '',
  `amount` float NOT NULL DEFAULT '0',
  `status` int(10) unsigned NOT NULL DEFAULT '0',
  `transactionid` varchar(45) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_payment_method`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_payment_method` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT '',
  `description` varchar(50) NOT NULL,
  `published` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  `credit_cart` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `log` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `paymentMethodName` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_performer`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_performer` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `performer_name` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `performer_website` varchar(255) NOT NULL DEFAULT '',
  `cat_id` int(11) NOT NULL DEFAULT '0',
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  `hits` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_setup`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_setup` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(100) NOT NULL,
  `value` varchar(255) NOT NULL DEFAULT '',
  `group` varchar(100) NOT NULL DEFAULT '',
  `ordering` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_state`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_state` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(2) NOT NULL,
  `state_name` varchar(50) NOT NULL,
  `country_id` int(10) unsigned NOT NULL DEFAULT '0',
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=2 ;

DROP TABLE IF EXISTS `#__jltcenter_users`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_users` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `first_name` varchar(30) NOT NULL DEFAULT '',
  `last_name` varchar(30) NOT NULL DEFAULT '',
  `phone_num` varchar(20) NOT NULL DEFAULT '',
  `street` varchar(45) NOT NULL DEFAULT '',
  `city` varchar(45) NOT NULL DEFAULT '',
  `state` varchar(25) NOT NULL DEFAULT '',
  `country` varchar(30) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL DEFAULT '',
  `zip_code` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1;

DROP TABLE IF EXISTS `#__jltcenter_venue`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_venue` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `venue_name` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `address` text NOT NULL,
  `seats` int(11) NOT NULL DEFAULT '0',
  `city_id` int(11) NOT NULL,
  `country_id` int(11) NOT NULL,
  `state_id` int(11) NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  `seats_chart` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`) 
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ;

DROP TABLE IF EXISTS `#__jltcenter_ticket_template`;
CREATE TABLE IF NOT EXISTS `#__jltcenter_ticket_template` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `template_type` int(3) NOT NULL DEFAULT '0',
  `name` varchar(50) NOT NULL DEFAULT '',
  `email_title` varchar(250) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `ticket_remark` text NOT NULL,
  `background` varchar(255) NOT NULL DEFAULT '',
  `width` int(3) NOT NULL DEFAULT '0',
  `height` int(3) NOT NULL DEFAULT '0',
  `defualt` tinyint(1) NOT NULL DEFAULT '0',
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ordering` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

DROP TABLE IF EXISTS `#__jltcenter_used_tickets`;
CREATE TABLE  `#__jltcenter_used_tickets`(
  `event_id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `line_id` int(11) NOT NULL,
  `line_id_counter` int(11) NOT NULL DEFAULT '0',
  `event_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  UNIQUE KEY `ticket_id` (`event_id`,`order_id`,`line_id`,`line_id_counter`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `#__jltcenter_referrals`;
CREATE TABLE  `#__jltcenter_referrals` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) NOT NULL,
  `hear_about_value` varchar(100) NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  `checked_out` int(11) unsigned NOT NULL DEFAULT '0',
  `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `#__jltcenter_payment_method` (`id`, `name`, `description`, `published`, `checked_out`, `checked_out_time`, `ordering`, `credit_cart`, `log`) VALUES
(1, 'Paypal', 'Paypal', 1, 0, '0000-00-00 00:00:00', 2, 0, 0),
(3, 'phone', 'Order By Phone', 1, 0, '0000-00-00 00:00:00', 5, 0, 0),
(4, 'paypal_api', 'Credit Card (Paypal Pro)', 1, 0, '0000-00-00 00:00:00', 0, 1, 1),
(5, 'Cash', 'Cash', 1, 0, '0000-00-00 00:00:00', 5, 0, 0),
(6, 'eSelect', 'eSelect - Hosted Paypage', 0, 42, '2013-02-04 10:52:34', 6, 0, 0);

INSERT INTO `#__jltcenter_delivery_method` (`id`, `name`, `description`, `price`, `published`, `checked_out`, `checked_out_time`, `ordering`, `send_by_mail`) VALUES
(1, 'Email Voucher', '<p>please print voucher and bring it with you to cashier on event  with photo ID</p>', 0.00, 1, 0, '0000-00-00 00:00:00', 0, 1),
(2, 'UPS 2nd Day Air', '<div class="delivery-type-message">\r\n<p>Your tickets will be shipped  via UPS 2nd Day Air. Tickets will arrive within 2 business days of your  order being processed &amp; printed. You will receive a shipping  confirmation &amp; tracking email from UPS directly when your tickets  are shipped. Please note: we cannot ship to PO Boxes.  US only;  International shipping not available.</p>\r\n</div>', 4.99, 1, 0, '0000-00-00 00:00:00', 1, 0),
(3, 'Standard Mail', '<p>Your tickets will arrive at your billing address in a plain, unmarked  white envelope within 10 business days of your order placement.  US/Canada only; International shipping not available.</p>', 1.99, 1, 0, '0000-00-00 00:00:00', 2, 0);

INSERT INTO `#__jltcenter_setup` (`id`, `key`, `value`, `group`, `ordering`) VALUES
(1, 'display_venue', '2', 'components_links', 0),
(2, 'display_city', '2', 'components_links', 0),
(3, 'display_state', '2', 'components_links', 0),
(4, 'display_country', '2', 'components_links', 0),
(5, 'cart_countdown', '10', 'cart', 0),
(6, 'qty_max', '10', 'cart', 0),
(7, 'def_qty', '2', 'cart', 0),
(8, 'currency_symbol', '$', 'currency', 0),
(9, 'currency_code', 'USD', 'currency', 0),
(10, 'tax_rate', '0', 'currency', 0),
(11, 'order_sign', '<p>Order Signup</p>\r\n<p>�</p>', 'terms', 0),
(12, 'ticket_remarks', '<p>Ticket remarks</p>\r\n<p>�</p>\r\n<p>�</p>', 'terms', 0),
(13, 'ticket_site_desc', '<p>Site desc</p>', 'terms', 0),
(14, 'logo', 'jomland_logo.png', 'images', 0),
(15, 'register_user', '0', '', 0),
(82, 'fb_page_id', '0', '', 0),
(18, 'fb_sync_events', '', 'facebook', 0),
(17, 'fb_app_secret', '', 'facebook', 0),
(16, 'fb_app_id', '', 'facebook', 0),
(83, 'free_event_delivery_method', '1', '', 0),
(84, 'commission_type', '0', '', 0),
(85, 'commission_value', '0', '', 0),
(86, 'hide_soldout', '0', 'components_links', 5),
(87, 'display_stock', '0', 'components_links', 6),
(89, 'bcc_order_to_admin', '', '', 0),
(90, 'images_on_tables', '0', 'components_links', 0),
(91, 'individual_tickets', '0', 'general', 5),
(92, 'tos', '0', 'general', 5),
(93, 'checkout_time', '0', 'cart', 5),
(94, 'smart_cart_manage', '0', 'cart', 6),
(98, 'cron_password', '', 'cart', 7),
(99, 'pending_order_days', '0', 'cart', 8),
(100, 'pdf_tickets', '0', 'general', 5),
(101, 'enable_qr_code', '0', 'qr_code', 0),
(102, 'qr_code_size', '120', 'qr_code', 1),
(103, 'cart_first_name', '1', 'cart_fields', 0),
(104, 'cart_last_name', '1', 'cart_fields', 1),
(105, 'cart_phone_num', '0', 'cart_fields', 2),
(106, 'cart_street', '1', 'cart_fields', 3),
(107, 'cart_city', '1', 'cart_fields', 4),
(108, 'cart_state', '0', 'cart_fields', 5),
(109, 'cart_country', '0', 'cart_fields', 6),
(110, 'cart_zip_code', '0', 'cart_fields', 7),
(111, 'cart_hear_us', '-1', 'cart_fields', 0),
(112, 'cart_hear_us_vals', 'Radio, Newspaper, Mailer,  Google, Other', 'cart', 0);
