SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;


CREATE TABLE IF NOT EXISTS `admin_options` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `option_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `option_value` longtext COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=119 ;

INSERT INTO `admin_options` (`id`, `option_name`, `option_value`) VALUES
(1, 'check-source', ''),
(2, 'select_counter', 'time'),
(3, 'starts', '20-08-2013 23:20:00'),
(4, 'ends', '22-08-2013 14:43:00'),
(5, 'timezone', 'Europe/Berlin'),
(6, 'start_likes', '2640'),
(7, 'end_likes', '2659'),
(8, 'counter_classes', 'btn-inverse'),
(9, 'xbefore_end', '60'),
(10, 'counter_classes_ch', 'btn-danger'),
(11, 'not_start_title', 'New Event will be started soon!'),
(12, 'not_start_msg', 'It''s very reasonable to LIKE our page right now and get noticed when raffle really starts. We will post it on our timeline. Stay tuned.\r\n\r\n'),
(13, 'show_start_timer', 'ON'),
(14, 'title', 'Viral Lottery Demo App'),
(15, 'subtitle', 'Get tickets and WIN!'),
(16, 'description', '<h2>Welcome!</h2>\r\n<p>You are closer than never before to win something for absolutely free.</p>\r\n<p>Free script will be as First Price. Other two prices are visible for demo purpouses and will not give any reward.</p>\r\n<p>\r\nUse all available options to get more and more tickets.\r\nMore tickets = better chances to win!\r\n</p>\r\n<p>\r\n1. Share - Share it everywhere! Email, facebook page, twitter and so on. Your personal link will be posted along with every share and joined users will bring you in tickets.\r\n</p>\r\n<p>\r\n2. Requests - Invite your facebook friends.  Every friend joined via request, means you some more tickets.\r\n</p><p>\r\n3. Slot Machine - Spin it and Win! . Click the button and you''ll see, it is FUN!\r\n</p>\r\n<p>\r\nGood Luck!\r\n</p>\r\n<p><a href="http://www.flickr.com/photos/bradleypjohnson/" target="_blank">Picture credit</a></p>'),
(17, 'homepage_use_img', 'ON'),
(18, 'home_img', 'item_page_image_590x300_v2.jpg'),
(19, 'footer_info', 'Viral Lottery App  2013'),
(20, 'fangate', 'ON'),
(21, 'fangate_description', '<div class="jumbotron text-center">\r\n<p> </p>\r\n<h3>Please hit LIKE to continue!</h3>\r\n\r\n<p>We want to give out prizes to  our fans only, welcome to the club!</p>\r\n\r\n<p>Thank You!</p>\r\n</div>'),
(22, 'fangate_img', 'big_ticketlike.jpg'),
(23, 'sec_form_title', 'Additional Verification'),
(24, 'sec_form_description', 'Please provide us asked information to make our raffle more fair.'),
(25, 'sec_form_btn', 'Submit'),
(26, 'txt_1', 'ID card number'),
(27, 'txt1_mand', 'mandatory'),
(28, 'txt_2', 'Phone number'),
(29, 'prize_page_title', 'Available Prizes!'),
(30, 'prize1_amount', '1'),
(31, 'prize1_title', 'Demo Prize One'),
(32, 'prize1_description', 'This is demo version only, now win!'),
(33, 'prize1_img', 'item_page_image_590x300_v2.jpg'),
(34, 'prize2_amount', '1'),
(35, 'prize2_title', 'Demo Prize Two'),
(36, 'prize2_description', 'This is demo version only, now win!'),
(37, 'prize2_img', 'item_page_image_590x300_v2.jpg'),
(38, 'prize3_amount', '1'),
(39, 'prize3_title', 'Demo Prize Three'),
(40, 'prize3_description', 'This is demo version only, now win!'),
(41, 'prize3_img', 'item_page_image_590x300_v2.jpg'),
(42, 'timeline_img', 'img/timeline_placeholder.png'),
(43, 'send_ref_email', 'ON'),
(44, 'ref_email_subject', 'Hello [NAME]'),
(45, 'ref_email_body', 'Looks very nice, [NAME]\r\n\r\n[REFNAME] joined via your invitationand you got some tickets!\r\n\r\nGo to [APPLINK] \r\nand check how many tickets you have now!\r\n\r\n##### THIS EMAIL IS FROM DEMO APP, NO PRIZES WILL BE SHARED #####\r\n\r\nRegards,\r\nRaffle team\r\n\r\n'),
(46, 'send_win_email', 'ON'),
(47, 'win_email_subject', 'You won [NAME]'),
(48, 'win_email_body', '[NAME],\r\n\r\n##### THIS EMAIL IS FROM DEMO APP, NO PRIZES WILL BE SHARED #####\r\nYou won <strong>[PRIZE]</strong>\r\n\r\nGo with this link and click on winning ticket. It''s under your personal data on app page.\r\n[APPLINK]\r\n\r\nIn order to get your prize, please click winning ticket on the app page. You''ll find \r\nall your tickets below your user information on the right sidebar.\r\n\r\nRegards,\r\nRaffle team'),
(49, 'send_end_email', 'ON'),
(50, 'end_email_subject', 'Attention! Raffle is held.'),
(51, 'end_email_body', 'Your managed raffle was ended. Please follow link to the app page.\r\n'),
(52, 'send_new_email', 'ON'),
(53, 'new_email_subject', 'Hello!'),
(54, 'new_email_body', 'We have started new raffle with amazing prizes!\r\n\r\n[PRIZES]\r\n\r\nCome right now and participate. Click the link below:\r\n[APPLINK]\r\n\r\nAttention. Current raffle is for demo only!\r\n\r\nWith best regards,\r\nRaffle team'),
(55, 'rules_and_help_page', '<h3>Rules & Help</h3>\r\n\r\n<p>While it''s pretty self explanatory, some rules still worth of mentioning.</p>\r\n\r\n<ul>\r\n<li>Be honest</li>\r\n<li>You must know how to lose</li>\r\n<li>Do not hurt the nature</li>\r\n</ul>'),
(56, 'terms_page', 'Write here terms and conditions.'),
(57, 'disclaimer_page', 'No prizes, this is demo!'),
(58, 'btns_info_bubble', 'Choose between available options. You have three different ways to claim tickets.\r\nEvery button is under 12 hours time limit after you used it once.\r\n'),
(59, 'give_admin_tickets', 'ON'),
(60, 'use_share_tickets', 'ON'),
(61, 'sharethis_pubkey', ''),
(62, 'share_btn_txt', 'Share'),
(63, 'share_btn_color', 'btn-primary'),
(64, 'share_content', 'Come and join to WIN! Beautiful rewards!'),
(65, 'share_img', 'approve.jpg'),
(66, 'share_ticket_amount', '2'),
(67, 'share_ticket_int', '12'),
(68, 'use_app_requests', 'ON'),
(69, 'request_limit', '50'),
(70, 'request_ticket_amount', '2'),
(71, 'request_delete_day', '7'),
(72, 'req_btn_txt', 'Invite Your Friends'),
(73, 'req_btn_color', 'btn-primary'),
(74, 'request_ticket_int', '12'),
(75, 'use_slot', 'ON'),
(76, 'slot_btn_txt', 'Spin Slot Machine'),
(77, 'slot_btn_color', 'btn-primary'),
(78, 'slot_title', 'Slot Machine'),
(79, 'slot_description', 'Spin and win, it''s that simple!'),
(80, 'slot_free_spins', '10'),
(81, 'slot_ticket_int', '12'),
(82, 'reel_1', 'clover,heart,clover,clover,heart,star,clover'),
(83, 'reel_2', 'clover,heart,clover,star,clover'),
(84, 'reel_3', 'clover,heart,clover,star,clover'),
(85, 'clover_2_win', '1'),
(86, 'clover_3_win', '2'),
(87, 'heart_2_win', '3'),
(88, 'heart_3_win', '5'),
(89, 'star_2_win', '7'),
(90, 'star_3_win', '9'),
(91, 'slot_timeline_toggle', 'ON'),
(92, 'slot_msg_title', 'I won [AMOUNT] tickets!'),
(93, 'slot_msg_description', 'Just spinned on Slot Machine and see what happened :) Best way to collect tickets for free! I like it!'),
(94, 'slot_msg_caption', 'Just click and join with Raffle'),
(95, 'slotmsg_img', 'slot.jpg'),
(96, 'admin_email', 'your@email.com'),
(97, 'admin_name', 'Raffle Admin'),
(98, 'smtp_host', ''),
(99, 'smtp_port', '25'),
(100, 'smtp_user', ''),
(101, 'smtp_pass', ''),
(102, 'app_lang', 'en_US'),
(103, 'maint_msg', 'Page is under maintenance! We will be back very soon. Thanks for understanding.'),
(104, 'winner_pick', 'random'),
(105, 'min_participants', '1'),
(106, 'min_part_msg', '<h3>Attention! No winners picked at this time!</h3>\r\nUnfortunately we didn''t reached expected amount of participants. New raffle will be available soon!'),
(107, 'homepage_show_users_thumbs', '20'),
(108, 'homepage_show_stats', 'ON'),
(109, 'lboard_link', 'ON'),
(110, 'leaders_amount', '10'),
(111, 'long_token', 'ON'),
(112, 'head_ad', '<a href="http://codecanyon.net/item/viral-lottery-facebook-app/2510346?ref=CodeCafe" target="_blank">\r\n<img src="uploads/codecbanner728.jpg">\r\n</a>'),
(113, 'sidebar_ad', ''),
(114, 'mob_page_title', 'Join with Raffle!'),
(115, 'mob_page_description', 'Welcome. To participate, you must come back from computer. Our  Raffle has best options for you on our Facebook fanpage. And unfortunately fanpage tabs are not available via mobile.\r\nYou will find a button to click on the bottom of this page .\r\nIf you like to receive <strong>[TICKETAMOUNT] free tickets</strong>, then we will send you a unique link to your mailbox. After that you must go with computer, hit that link in your mailbaox and you''re IN.\r\n\r\nOur raffle will end [ENDTIME]'),
(116, 'mob_page_tickets', '3'),
(117, 'mob_email_subject', 'Hello [NAME]'),
(118, 'mob_email_message', 'Thanks for link request.\r\n\r\nHere is your link:\r\n[LINK]\r\n\r\nAttention! Use it only over computer browser, because our app will work only as a tab on our fanpage.\r\n\r\nGood Luck,\r\n\r\nRaffle team');

CREATE TABLE IF NOT EXISTS `app_requests` (
  `fb_user_id` varchar(25) NOT NULL,
  `request_id` varchar(35) NOT NULL,
  `fromuser` varchar(35) NOT NULL,
  `answered` tinyint(1) NOT NULL DEFAULT '0',
  `req_time` varchar(35) NOT NULL,
  UNIQUE KEY `unique_pair` (`fb_user_id`,`request_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `latest_winners` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `winners_data` text COLLATE utf8_unicode_ci NOT NULL,
  `prize` text COLLATE utf8_unicode_ci NOT NULL,
  `raftime` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `mob_links` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fb_id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `link` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `data` text COLLATE utf8_unicode_ci NOT NULL,
  `answer` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `sec_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fake_id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `option_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `option_value` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `slot_leaders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `fb_id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `score` int(11) NOT NULL,
  `result_time` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `slot_spins` (
  `user` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `spins` int(11) NOT NULL,
  `tickets` int(11) NOT NULL,
  `last_spin` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `done` tinyint(4) NOT NULL,
  PRIMARY KEY (`user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `tickets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fb_id` text COLLATE utf8_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
  `code` text COLLATE utf8_unicode_ci NOT NULL,
  `date` text COLLATE utf8_unicode_ci NOT NULL,
  `for_what` text COLLATE utf8_unicode_ci NOT NULL,
  `winner` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `fb_id` text COLLATE utf8_unicode_ci NOT NULL,
  `isadmin` text COLLATE utf8_unicode_ci NOT NULL,
  `offline_access` text COLLATE utf8_unicode_ci NOT NULL,
  `name` text COLLATE utf8_unicode_ci NOT NULL,
  `email` text COLLATE utf8_unicode_ci NOT NULL,
  `birthday` text COLLATE utf8_unicode_ci NOT NULL,
  `regdate` text COLLATE utf8_unicode_ci NOT NULL,
  `banned` text COLLATE utf8_unicode_ci NOT NULL,
  `longterm_token` text COLLATE utf8_unicode_ci NOT NULL,
  `token_expires` text COLLATE utf8_unicode_ci NOT NULL,
  `fake_id` text COLLATE utf8_unicode_ci NOT NULL,
  `verified` text COLLATE utf8_unicode_ci NOT NULL,
  `share_int` text COLLATE utf8_unicode_ci NOT NULL,
  `req_int` text COLLATE utf8_unicode_ci NOT NULL,
  `slot_int` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `winners` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` text COLLATE utf8_unicode_ci NOT NULL,
  `winners_data` text COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY `uniq_id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
