SET sql_mode = 'ALLOW_INVALID_DATES';

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

CREATE TABLE IF NOT EXISTS `orders_vouchers` (
  `voucher_id` int(11) NOT NULL AUTO_INCREMENT,
  `orders_id` int(11) NOT NULL,
  `orders_products_id` int(11) NOT NULL,
  `products_name` varchar(128) NOT NULL,
  `coupon_code` varchar(20) NOT NULL,
  `coupon_amount` decimal(10,2) NOT NULL,
  PRIMARY KEY (voucher_id)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

ALTER TABLE `coupons` ADD `gift_coupon` INT(1) NOT NULL AFTER `orders_id`;


ALTER TABLE `seat_plan` ADD COLUMN `products_w` INT(11) NOT NULL AFTER `products_y`;
ALTER TABLE `seat_plan` ADD COLUMN `products_h` INT(11) NOT NULL AFTER `products_w`;
ALTER TABLE `seat_plan` ADD COLUMN `products_r` INT(11) NOT NULL AFTER `products_h`;
ALTER TABLE `seat_plan` ADD COLUMN `products_sx` INT(11) NOT NULL AFTER `products_r`;
ALTER TABLE `seat_plan` ADD COLUMN `products_sy` INT(11) NOT NULL AFTER `products_sx`;
ALTER TABLE `seat_plan` ADD COLUMN `product_type` CHAR(1) NOT NULL AFTER `products_sy`;

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

(1232, 'how-to-use-popups.php', 0, 0, '1', 'D', 'D', NULL),
(1233, 'popups.php', 0, 0, '1', 'D', 'D', NULL);

UPDATE `quick_links` SET `title` = 'SP Generator v2' WHERE `quick_links`.`links_id` = 7; 


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 ('1234', 'ajax_get_static_page.php', '0', '0', '1', 'D', 'D', NULL);


INSERT INTO `configuration_group` (`configuration_group_id`, `configuration_group_title`, `configuration_group_description`, `sort_order`, `visible`, `configuration_access_key`) VALUES ('934', 'Pop Up Marketing', 'Pop Up Marketing', '9', '1', 'Marketing Pop Up Marketing');

INSERT INTO `admin_menus` (`menu_id`, `parent_id`, `admin_groups_id`, `menu_pos`, `filename`, `params`, `menu_item_type`) VALUES ('439', '7', '1', '439', 'popups.php', '', '');

INSERT INTO `admin_menus_description` (`menu_id`, `menu_text`, `language_id`) VALUES ('439', 'Popups', '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
(1094, 'Enable Pop Up 1', 'POPUP1_ENABLED', '0', 'Enable Pop Up 1', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1095, 'Pop Up 2', 'POPUP2', '', 'Pop Up 2', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1096, 'Enable Pop Up 2', 'POPUP2_ENABLED', '0', 'Enable Pop Up 2', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1097, 'Pop Up 1 BG', 'POPUP1_BG', 'goldstars.jpg', 'Pop Up 1 background', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1098, 'Pop Up 2 BG', 'POPUP2_BG', '', 'Pop Up 2 background', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1099, 'Pop Up 1 Target', 'POPUP1_TARGET', 'index.php', 'Pop Up 1 target', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1100, 'Pop Up 2 Target', 'POPUP2_TARGET', '', 'Pop Up 2 target', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1101, 'Pop Up 1 Message', 'POPUP1_PAGE_ID', '6', 'Pop Up 1 Message from the Static CMS Table', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL),
(1102, 'Pop Up 2 Message', 'POPUP2_PAGE_ID', '', 'Pop Up 2 Message from the Static CMS Table', 935, 31, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, NULL);

INSERT INTO `main_pages` (`page_id`, `parent_id`, `date_created`, `date_modified`, `sort_order`, `page_status`) VALUES
(10, 0, '2025-02-28 09:45:23', NULL, 6, 0);
INSERT INTO `main_page_description` (`page_id`, `page_name`, `description`, `language_id`) VALUES
(10, 'Pop Up 1', '<h1 style=\"text-align: center;\">Special Offer</h1><h2 style=\"text-align: center;\">Buy 2 Tickets</h2><h1 style=\"color: #f50e09; text-align: center;\">Get 2 FREE!</h1>', 1);
#WARNING 1087
UPDATE `configuration` SET `configuration_title` = 'Default Gift Voucher Image' WHERE `configuration`.`configuration_id` = 1087; 
UPDATE `configuration` SET `configuration_description` = 'This references the Default Gift Voucher Image' WHERE `configuration`.`configuration_id` = 1087; 

UPDATE `configuration` SET `configuration_value` = '1100' WHERE `configuration`.`configuration_id` = 37; 
UPDATE `configuration` SET `configuration_description` = 'Image Upload Width Restriction. NOTE: Design Mode Background Images should be default 1100px width for full responsive design and ultimate quality' WHERE `configuration`.`configuration_id` = 37; 

UPDATE `configuration` SET `set_function` = 'tep_cfg_select_option(array(\"400\",\"450\",\"500\",\"550\",\"600\",\"650\",\"700\",\"750\",\"800\",\"900\",\"1000\",\"1100\"),' WHERE `configuration`.`configuration_id` = 37; 

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;

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
(1103, 'Default Design Background Height', 'DESIGN_DEFAULT_BG', '500', 'Default Design Background Height for testing purposes in Box Office Design Mode only', 923, 10, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, 'tep_cfg_select_option(array(\"2000\",\"1500\",\"1000\",\"500\"),'),
(1104, 'Set JQGrid', 'SHOW_ALL_GRID', '2', 'Do you want to restrict categories that you see in concert details by plan_id? ', 922, 10, '2025-01-01 00:00:00', '2025-01-01 00:00:00', NULL, 'tep_cfg_select_option(array(\"1\",\"2\",\"3\",\"4\"),');

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, 'section_check.php', '0', '0', '1', 'D', 'D', NULL); 
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, 'export_sp.php', '0', '0', '1', 'D', 'D', NULL);

DELETE FROM configuration WHERE `configuration`.`configuration_id` = 7;
DELETE FROM configuration WHERE `configuration`.`configuration_id` = 916;
DELETE FROM configuration WHERE `configuration`.`configuration_id` = 957;
DELETE FROM configuration WHERE `configuration`.`configuration_id` = 949;
DELETE FROM configuration WHERE `configuration`.`configuration_id` = 952;

DELETE FROM admin_menus_description WHERE `admin_menus_description`.`menu_id` = 47;
DELETE FROM admin_menus_description WHERE `admin_menus_description`.`menu_id` = 238;
DELETE FROM admin_menus_description WHERE `admin_menus_description`.`menu_id` = 314;

INSERT INTO `admin_menus` (`menu_id`, `parent_id`, `admin_groups_id`, `menu_pos`, `filename`, `params`, `menu_item_type`) VALUES (440, '4', '1', '10', 'seatplan_generator.php', '', ''); 
INSERT INTO `admin_menus_description` (`menu_id`, `menu_text`, `language_id`) VALUES ('440', 'Seat Plan Generator', '1'); 

DELETE FROM `template` WHERE `template`.`template_id` = 2;
DELETE FROM `template` WHERE `template`.`template_id` = 3;

UPDATE `main_pages` SET `page_status` = '0' WHERE `main_pages`.`page_id` = 1; 
UPDATE `main_pages` SET `page_status` = '0' WHERE `main_pages`.`page_id` = 4; 
UPDATE `main_pages` SET `page_status` = '0' WHERE `main_pages`.`page_id` = 5; 

DELETE FROM configuration WHERE `configuration`.`configuration_id` = 269;
DELETE FROM configuration WHERE `configuration`.`configuration_id` = 270;
DELETE FROM infobox_configuration WHERE `infobox_configuration`.`infobox_id` = 108;


INSERT INTO `sql_queries` VALUES('osconcert_v9_1_1.sql', CURDATE());
INSERT INTO `sql_queries` VALUES('osconcert_v9_1_1.sql', CURDATE());