SET sql_mode = 'ALLOW_INVALID_DATES';

DELETE FROM `admin_menus_description` WHERE `admin_menus_description`.`menu_id` = 107;
DELETE FROM `admin_menus_description` WHERE `admin_menus_description`.`menu_id` = 200;
DELETE FROM `admin_menus_description` WHERE `admin_menus_description`.`menu_id` = 208;
DELETE FROM `configuration_group` WHERE `configuration_group`.`configuration_group_id` = 90;

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
(1087, 'Gift Voucher Image', 'DEFAULT_GIFT_VOUCHER_IMAGE', 'gift_voucher1.png', 'Default Gift Voucher Image', 920, 31, '2023-01-01', '2023-01-01', NULL, NULL),
(1088, 'Ticket Image', 'DEFAULT_TICKET_IMAGE', 'ticket.png', 'Default Ticket Image', 920, 32, '2023-01-01', '2023-01-01', NULL, NULL);


UPDATE `address_format` SET `address_format` = '$firstname $lastname$cr$streets$cr$city$cr$postcode -$statecomma$country$cr$customer_phone$cr$customer_email\r\n' WHERE `address_format`.`address_format_id` = 3; 

UPDATE `configuration` SET `configuration_title` = 'Enable Box Office Access to Events while showing a message to visitors -Events Disabled Message-' WHERE `configuration`.`configuration_id` = 273; 
UPDATE `configuration` SET `configuration_description` = 'Show a message \'Event Disabled Message\' when an EVENT is disabled in Concert Details. This will also allow Box Office to continue to make orders from the front end. Visitors will not see products.' WHERE `configuration`.`configuration_id` = 273; 
UPDATE `configuration` SET `configuration_group_id` = '923' WHERE `configuration`.`configuration_id` = 273; 

UPDATE `configuration` SET `configuration_title` = 'Send Admin Email Confirmation (only one)' WHERE `configuration`.`configuration_id` = 8; 
UPDATE `configuration` SET `configuration_description` = 'Send admin confirmation order emails in this format: email@address (only one entry will work)' WHERE `configuration`.`configuration_id` = 8; 

UPDATE `configuration` SET `configuration_description` = 'Hide Delivery Address at Checkout Confirmation if not using shipping' WHERE `configuration`.`configuration_id` = 245; 

UPDATE `configuration` SET `configuration_title` = '(Left Column) Hide CMS listings in the INFORMATION infobox' WHERE `configuration`.`configuration_id` = 279; 

UPDATE `configuration` SET `configuration_title` = 'EXTRA! Set Conditions at Payment' WHERE `configuration`.`configuration_id` = 1055; 

UPDATE `configuration` SET `configuration_title` = 'Show Discount Popup (recommended)' WHERE `configuration`.`configuration_id` = 275; 

UPDATE `configuration` SET `configuration_title` = 'Customer Account Review (read <a target=\'_blank\' href=\'https://www.osconcert.com/faq/how-can-i-activate-account-under-review-feature\'>FAQ</a>)' WHERE `configuration`.`configuration_id` = 276; 

UPDATE `configuration` SET `configuration_group_id` = '16' WHERE `configuration`.`configuration_id` = 1045; 

UPDATE `configuration` SET `configuration_title` = '(Left Column) Expand Menus List' WHERE `configuration`.`configuration_id` = 247; 


INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
(1089, 'Always Show Nested Categories', 'SHOW_NESTED_CATEGORIES', 'false', 'Show Nested Categories at all times', 19, 72, '2020-01-01 00:00:00', '2020-01-01 00:00:00', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

INSERT INTO `admin_files` (`admin_files_id`, `admin_files_name`, `admin_files_is_boxes`, `admin_files_to_boxes`, `admin_groups_id`, `admin_files_type`, `admin_files_help_id`, `admin_new_group_id`) VALUES ('1222', 'orders_history.php', '0', '0', '1', 'D', 'D', NULL); 

UPDATE `general_templates` SET `template_id` = 5,`template_type` = 'TIC5',`template_width` = '18.0000',`template_height` = '7.0000',`template_content` = 'shop_logo_image{}ticket.png{}shop_logo_position{}L{}event_details_content{}[[Products Name]] \n\n[[Voucher Code]] \nPrice: [[Voucher Price]]\n\nVoucher Ref: [[Ref ID]][[Order ID]]_[[Prd ID]]{}event_details_position{}L{}sponsor_logo_image{}sponsor_logo.png{}sponsor_logo_position{}R{}event_condition_content{}Refundable only if event is cancelled{}event_condition_position{}L{}bar_image_position{}' WHERE `general_templates`.`template_id` = 5;

UPDATE `configuration` SET `configuration_description` = 'Show the Ticket Discount on the PDF eTickets' WHERE `configuration`.`configuration_id` = 917; 
UPDATE `configuration` SET `configuration_title` = 'Display Discount on eTickets' WHERE `configuration`.`configuration_id` = 917; 

INSERT INTO `admin_files` (`admin_files_id`, `admin_files_name`, `admin_files_is_boxes`, `admin_files_to_boxes`, `admin_groups_id`, `admin_files_type`, `admin_files_help_id`, `admin_new_group_id`) VALUES (NULL, 'payment_sales_csv.php', '0', '0', '1', 'D', 'D', NULL); 

INSERT INTO `admin_menus` (`menu_id`, `parent_id`, `admin_groups_id`, `menu_pos`, `filename`, `params`, `menu_item_type`) VALUES (437, '8', '1', '260', 'payment_sales_csv.php', '', '');

INSERT INTO `admin_menus_description` (`menu_id`, `menu_text`, `language_id`) VALUES (437, 'Payment Sales', '1'); 

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
(1090, 'Global Expiry Difference', 'EXPIRE_DIFFERENCE', '0', 'Global Expiry - Minus sign indicates that we are subtracting seconds from the expiry date and time', 929, 21, '2023-01-20 00:00:00', '2023-01-20 00:00:00', NULL, 'tep_cfg_time_expire(');

DELETE FROM configuration WHERE `configuration`.`configuration_id` = 1042;
DELETE FROM configuration WHERE `configuration`.`configuration_id` = 1046;

UPDATE `configuration_group` SET `configuration_access_key` = 'Products Advanced Reminder Product' WHERE `configuration_group`.`configuration_group_id` = 933; 

UPDATE `admin_menus` SET `params` = 'gID=929' WHERE `admin_menus`.`menu_id` = 436; 
UPDATE `admin_menus` SET `params` = '' WHERE `admin_menus`.`menu_id` = 432; 
UPDATE `admin_menus_description` SET `menu_text` = 'Global Event Expiry' WHERE `admin_menus_description`.`menu_id` = 436; 
UPDATE `admin_menus_description` SET `menu_text` = 'Reminder Product' WHERE `admin_menus_description`.`menu_id` = 432;

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
(161,'NEWSLETTER EMAILS use WYSIWYG HTMLAREA?','HTML_AREA_WYSIWYG_DISABLE_NEWSLETTER','Enable','Use WYSIWYG Area in Email Newsletter',112,30,'0000-00-00','2007-04-26 17:35:46',NULL,'tep_cfg_select_option(array(''Enable'', ''Disable''),');

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
(1091, 'Show Newsletter Button', 'SHOW_NEWSLETTER_BUTTON', 'Enable', 'Show Newsletter Button in the footer', 934, 2, '2010-01-01', '2010-01-01', NULL, 'tep_cfg_select_option(array(\"Enable\", \"Disable\"),'),
(1092, 'Alternative Text', 'OTHER_FOOTER_TEXT', '', 'Alternative Text in the Newsletter Button Space', 934, 3, '2010-01-01', '2010-01-01', NULL, 'tep_cfg_textarea('),
(1093, 'Your Newsletter Landing Page - Get it <a target=\"_blank\" href=\"https://www.mailerlite.com/a/xfpketezmg\">here</a>', 'NEWSLETTER_LANDING_PAGE', '', 'The Full URL of your Newsletter-Landing-Page',  934, 4, '2023-01-01', '2023-01-01', NULL, NULL);

INSERT INTO `admin_menus_description` (`menu_id`, `menu_text`, `language_id`) VALUES
(438, 'Footer Newsletter', 1);
INSERT INTO `admin_menus` (`menu_id`, `parent_id`, `admin_groups_id`, `menu_pos`, `filename`, `params`, `menu_item_type`) VALUES
(438, 7, '1', 438, 'configuration.php', 'gID=934', '');

UPDATE `configuration` SET `configuration_group_id` = '0' WHERE `configuration`.`configuration_id` = 75; 

UPDATE `configuration` SET `configuration_value` = 'osConcert Version 9.9' WHERE `configuration`.`configuration_id` = 242; 

UPDATE `configuration` SET `configuration_description` = 'Show Data Export Tools in Concert Details' WHERE `configuration`.`configuration_id` = 957; 
UPDATE `configuration` SET `configuration_title` = 'Show Data Export' WHERE `configuration`.`configuration_id` = 957; 

UPDATE `configuration` SET `configuration_value` = 'true' WHERE `configuration`.`configuration_id` = 247; 
UPDATE `configuration` SET `configuration_value` = 'no' WHERE `configuration`.`configuration_id` = 279; 

DROP TABLE IF EXISTS `template`;
CREATE TABLE `template` (
  `template_id` int(11) NOT NULL,
  `template_name` varchar(64) DEFAULT '0',
  `date_added` datetime DEFAULT NULL,
  `last_modified` datetime DEFAULT NULL,
  `template_image` varchar(64) DEFAULT NULL,
  `show_footer` varchar(3) NOT NULL DEFAULT 'no',
  `include_column_left` varchar(64) NOT NULL,
  `include_column_right` varchar(64) NOT NULL,
  `howto` varchar(4) NOT NULL,
  `header_banner` text DEFAULT NULL,
  `show_breadcrumb` varchar(6) DEFAULT 'yes',
  `active` char(1) NOT NULL DEFAULT '1',
  `show_header_pane` varchar(6) DEFAULT 'no',
  `languages_in_header` char(3) DEFAULT 'no',
  `container_border` char(3) NOT NULL,
  `cart_in_header` varchar(6) DEFAULT 'yes',
  `show_page_login` char(3) NOT NULL,
  `customer_greeting` char(3) NOT NULL DEFAULT 'yes',
  `show_topbar` varchar(6) DEFAULT 'no',
  `template_color` varchar(28) NOT NULL,
  `header_height` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `template` (`template_id`, `template_name`, `date_added`, `last_modified`, `template_image`, `show_footer`, `include_column_left`, `include_column_right`, `howto`, `header_banner`, `show_breadcrumb`, `active`, `show_header_pane`, `languages_in_header`, `container_border`, `cart_in_header`, `show_page_login`, `customer_greeting`, `show_topbar`, `template_color`, `header_height`) VALUES
(1, 'darkzone', '2020-04-21 00:00:00', '2024-01-05 00:00:00', '', 'no', 'no', 'no', 'no', 'no', 'yes', '1', 'no', 'no', 'yes', 'yes', 'no', 'yes', 'yes', 'red', 84),
(2, 'blackzone', '2020-04-21 00:00:00', '2024-01-05 00:00:00', '', 'no', 'no', 'no', 'no', 'no', 'yes', '1', 'no', 'no', 'yes', 'yes', 'no', 'yes', 'yes', 'gold', 84),
(3, 'newzone', '2020-04-16 00:00:00', '2024-01-05 00:00:00', '', 'no', 'no', 'no', 'no', 'no', 'yes', '1', 'no', 'no', '', 'yes', 'no', 'yes', 'no', 'victoria', 84),
(4, 'theevent', '2020-04-21 00:00:00', '2022-02-11 00:00:00', '', '', 'no', 'no', 'no', '', 'yes', '1', 'yes', 'no', '', 'yes', 'no', 'yes', 'no', 'red', 84),
(5, 'restaurantly', '2022-02-11 00:00:00', '2022-02-11 00:00:00', '', '', 'no', 'no', 'no', '', 'yes', '1', 'yes', 'no', '', 'yes', 'no', 'yes', 'yes', 'default', 75),
(6, 'lightzone', '2020-04-21 00:00:00', '2024-01-05 00:00:00', '', 'no', 'no', 'no', 'no', 'no', 'yes', '1', 'no', 'no', 'yes', 'yes', 'no', 'yes', 'no', 'default', 84);


ALTER TABLE `template`
  ADD PRIMARY KEY (`template_id`),
  ADD KEY `IDX_TEMPLATE_NAME` (`template_name`);


ALTER TABLE `template`
  MODIFY `template_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  

INSERT INTO `infobox_configuration` (`template_id`, `infobox_id`, `infobox_file_name`, `infobox_define`, `infobox_display`, `display_in_column`, `location`, `sort_order`, `last_modified`, `date_added`, `box_heading`, `box_template`) VALUES
(6, 113, 'languages.php', 'BOX_HEADING_LANGUAGES', 'no', 'left', 0, 6, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Languages', 'infobox'),
(6, 114, 'manufacturer_info.php', 'BOX_HEADING_MANUFACTURER_INFO', 'no', 'left', 0, 7, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Manufacturers Info', 'infobox'),
(6, 115, 'manufacturers.php', 'BOX_HEADING_MANUFACTURERS', 'no', 'left', 1, 8, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Manufacturers', 'infobox'),
(6, 116, 'order_history.php', 'BOX_HEADING_CUSTOMER_ORDERS', 'no', 'left', 0, 9, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Order History', 'infobox'),
(6, 117, 'search.php', 'BOX_HEADING_SEARCH', 'no', 'left', 3, 12, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Quick Find', 'infobox'),
(6, 118, 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'no', 'left', 0, 1, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Shopping Cart', 'infobox'),
(6, 119, 'specials.php', 'BOX_HEADING_SPECIALS', 'no', 'left', 0, 14, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Specials', 'infobox'),
(6, 120, 'whats_new.php', 'BOX_HEADING_WHATS_NEW', 'no', 'left', 0, 16, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Latest products', 'infobox'),
(6, 121, 'theme_select.php', 'BOX_HEADING_TEMPLATE_SELECT', 'no', 'left', 0, 18, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Select Template', 'infobox'),
(6, 122, 'featured.php', 'BOX_HEADING_FEATURED', 'no', 'left', 0, 4, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Featured Products', 'infobox'),
(6, 123, 'best_sellers.php', 'BOX_HEADING_BESTSELLERS', 'no', 'left', 13, 1, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Best Sellers', 'infobox'),
(6, 124, 'categories.php', 'BOX_HEADING_CATEGORIES', 'yes', 'left', 1, 2, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Our Shows', 'infobox'),
(6, 125, 'currencies.php', 'BOX_HEADING_CURRENCIES', 'no', 'left', 0, 3, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Currencies', 'infobox'),
(6, 126, 'information.php', 'BOX_HEADING_INFORMATION', 'yes', 'left', 2, 5, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Information', 'infobox'),
(6, 127, 'loginbox.php', 'BOX_HEADING_LOGIN', 'no', 'left', 0, 22, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Login', 'infobox'),
(6, 128, 'wallet.php', 'BOX_HEADING_WALLET', 'no', 'left', 0, 6, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'My Wallet', 'infobox'),
(6, 129, 'featured_categories.php', 'BOX_HEADING_FEATURED_CATEGORIES', 'no', 'left', 0, 4, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Featured Events', 'infobox'),
(6, 130, 'donate.php', 'BOX_HEADING_DONATE', 'no', 'left', 0, 0, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Donate', 'infobox'),
(6, 131, 'banner.php', 'BOX_HEADING_BANNER', 'no', 'left', 0, 0, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Banner', 'infobox'),
(6, 132, 'box_office.php', 'BOX_HEADING_BOX_OFFICE', 'no', 'left', 1, 0, '2001-01-20 00:00:00', '2021-04-20 00:00:00', 'Box Office', 'infobox'),
(1, 5, 'shopping_cart.php', 'BOX_HEADING_SHOPPING_CART', 'no', 'left', 0, 1, '2001-01-20 00:00:00', '2001-01-20 00:00:00', 'Shopping Cart', 'infobox');
  
  UPDATE `configuration` SET `configuration_description` = 'The pixel width of heading LOGO images' WHERE `configuration`.`configuration_id` = 32; 
  UPDATE `configuration` SET `configuration_description` = 'The pixel height of heading LOGO images' WHERE `configuration`.`configuration_id` = 33; 
  UPDATE `customers_info_fields` SET `textbox_max_length` = '25' WHERE `customers_info_fields`.`info_id` = 6; 
  UPDATE `configuration` SET `configuration_title` = 'Ticket Background from left (or right)' WHERE `configuration`.`configuration_id` = 1056; 
  UPDATE `configuration` SET `configuration_description` = 'Adjustment to move the ticket background image from the left side (L) or from the right (R)' WHERE `configuration`.`configuration_id` = 1056; 
  UPDATE `configuration` SET `set_function` = 'tep_cfg_select_option(array(\'desktop\'),' WHERE `configuration`.`configuration_id` = 1047; 
  
	DROP TABLE IF EXISTS `email_data`;

	CREATE TABLE `email_data` (
	  `email_id` int(11) NOT NULL,
	  `customer_id` int(11) NOT NULL,
	  `order_id` int(11) NOT NULL,
	  `send_data` longtext NOT NULL,
	  `merge_data` longtext NOT NULL,
	  `email_sending` int(11) NOT NULL DEFAULT 0
	) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

	ALTER TABLE `email_data`
	  ADD PRIMARY KEY (`email_id`);

	ALTER TABLE `email_data`
	  MODIFY `email_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE orders MODIFY payment_return1 VARCHAR(255);
INSERT INTO `sql_queries` VALUES('osconcert_v9_0_9.sql', CURDATE());
INSERT INTO `sql_queries` VALUES('osconcert_v9_0_9.sql', CURDATE());