-- --------------------------------------------------------

--
-- Table structure for table `tbl_cfgdb`
--

CREATE TABLE IF NOT EXISTS `tbl_cfgdb` (
  `cfgdb_id` int(11) NOT NULL AUTO_INCREMENT,
  `ckey` varchar(40) DEFAULT NULL,
  `cval` text DEFAULT NULL,
  PRIMARY KEY (`cfgdb_id`),
  UNIQUE KEY `ckey` (`ckey`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1007 ;

INSERT INTO `tbl_cfgdb` (`cfgdb_id`, `ckey`, `cval`) VALUES
(1001, 'tpl.reg.user', '{"subject":"Welcome to Pick-A-Box Contest!","body":"Dear %first-name%,\\n\\nThank you for your registration!\\n\\nTo log into the Contest Fundraising admin panel, click the link below and enter your username and password.\\n\\nAdmin Panel URL:\\n%url-admin%\\n\\nUsername : %username%\\nPassword : %password%\\n"}'),
(1002, 'tpl.reg.admin', '{"subject":"Pick-A-Box Contest Registration","body":"First Name:\\n%first-name%\\n\\nLast Name:\\n%last-name%\\n\\nEmail Address:\\n%email%\\n\\nType of Organization:\\n%user-type%\\n\\nPayment Options:\\n%payment-options%\\n\\nOrganization Name:\\n%organization%\\n\\nUsername:\\n%username%\\n\\nPassword:\\n%password%\\n\\nQuestions/Comments:\\n%comments%\\n\\nSite Creation Service:\\n%q1%"}'),
(1003, 'tpl.trans', '{"subject":"Pick-A-Box Contest","body":"Dear %first-name%,\\n\\nThank you for your donation!\\nHere is your ticket ID:\\n%ticket-id%\\nThe ticket ID will allow you to play %qty% times. \\nTo play the contest, enter the Ticket ID in the contest page.\\n\\n%begin-url-hostpage%\\nClick the following link to go to the contest page:\\n%url-hostpage%\\n%end-url-hostpage%\\n\\n=======================================\\nContest Title: %contest-title%\\nPayPal txn_id: %txn-id%\\n=======================================\\n"}'),
(1004, 'tpl.wprize', '{"subject":"You Win! [Pick-A-Box Contest]","body":"Dear %first-name%,\\n\\nYou Win:\\n%prize-desc%\\n\\n==================================\\nContest Name: %contest-title%\\n=================================="}'),
(1005, 'cfgsmtp', '{"hostname":"mail.mysite.com","sender-email":"sender@mysite.com","port":25,"b-smtp-auth":0,"username":"myusername","password":"mypassword"}'),
(1006, 'cfgpaypal', '{"pp-email":"mypaypal@mysite.com","pp-currency-code":"USD","pp-url-thankyou":"","pp-url-cancel":""}');

-- --------------------------------------------------------

--
-- Table structure for table `tbl_cnts`
--

CREATE TABLE IF NOT EXISTS `tbl_cnts` (
  `cnts_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `title` varchar(300) DEFAULT NULL,
  `idata` text DEFAULT NULL,
  PRIMARY KEY (`cnts_id`),
  KEY `group_id` (`group_id`),
  KEY `title` (`title`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_ipnlog`
--

CREATE TABLE IF NOT EXISTS `tbl_ipnlog` (
  `ipnlog_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime NOT NULL,
  `mode` varchar(10) DEFAULT NULL,
  `ipaddr` varchar(15) DEFAULT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `txn_id` varchar(30) DEFAULT NULL,
  `result` varchar(100) DEFAULT NULL,
  `logtxt` text DEFAULT NULL,
  PRIMARY KEY (`ipnlog_id`),
  KEY `dt_create` (`dt_create`),
  KEY `email` (`email`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_maillog`
--

CREATE TABLE IF NOT EXISTS `tbl_maillog` (
  `maillog_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime DEFAULT NULL,
  `sender` varchar(200) DEFAULT NULL,
  `email` varchar(200) DEFAULT NULL,
  `txt` text DEFAULT NULL,
  PRIMARY KEY (`maillog_id`),
  KEY `dt_create` (`dt_create`),
  KEY `email` (`email`),
  KEY `sender` (`sender`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_pic`
--

CREATE TABLE IF NOT EXISTS `tbl_pic` (
  `pic_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime NOT NULL,
  `status` tinyint(4) NOT NULL,
  `ext` varchar(5) DEFAULT NULL,
  PRIMARY KEY (`pic_id`),
  KEY `dt_create` (`dt_create`),
  KEY `status` (`status`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_pzbox`
--

CREATE TABLE IF NOT EXISTS `tbl_pzbox` (
  `pzbox_id` int(11) NOT NULL AUTO_INCREMENT,
  `cnts_id` int(11) NOT NULL,
  `idx` int(11) NOT NULL,
  `pic_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`pzbox_id`),
  KEY `idx` (`idx`),
  KEY `cnts_id` (`cnts_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_pzitem`
--

CREATE TABLE IF NOT EXISTS `tbl_pzitem` (
  `pzitem_id` int(11) NOT NULL AUTO_INCREMENT,
  `pzbox_id` int(11) NOT NULL,
  `idx` int(11) NOT NULL,
  `desc` varchar(300) DEFAULT NULL,
  `qty` int(11) NOT NULL DEFAULT '0',
  `pic_id` INT NOT NULL DEFAULT '0',
  PRIMARY KEY (`pzitem_id`),
  KEY `idx` (`idx`),
  KEY `pzbox_id` (`pzbox_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_trans`
--

CREATE TABLE IF NOT EXISTS `tbl_trans` (
  `trans_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime NOT NULL,
  `status` tinyint(11) NOT NULL,
  `cnts_id` int(11) NOT NULL,
  `tid` varchar(30) DEFAULT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `txn_id` varchar(30) DEFAULT NULL,
  `mc_gross` decimal(10,2) DEFAULT NULL,
  `mc_currency` varchar(10) DEFAULT NULL,
  `qty` int(11) DEFAULT NULL,
  `qty_stock` int(11) DEFAULT NULL,
  `ipnlog_id` int(11) DEFAULT NULL,
  `maillog_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`trans_id`),
  KEY `tid` (`tid`),
  KEY `cnts_id` (`cnts_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_user`
--

CREATE TABLE IF NOT EXISTS `tbl_user` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime DEFAULT NULL,
  `group_id` int(11) DEFAULT NULL,
  `status` tinyint(4) NOT NULL,
  `b_admin` tinyint(4) NOT NULL DEFAULT '0',
  `username` varchar(100) DEFAULT NULL,
  `password` varchar(24) DEFAULT NULL,
  `sess_exp` datetime DEFAULT NULL,
  `sess_sig` varchar(100) DEFAULT NULL,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `user_type` varchar(10) DEFAULT NULL,
  `payment_options` varchar(10) DEFAULT NULL,
  `organization` varchar(100) DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `q1` varchar(10) DEFAULT NULL,
  `maillog_id_user` int(11) DEFAULT NULL,
  `maillog_id_admin` int(11) DEFAULT NULL,
  `ipnlog_id` int(11) DEFAULT NULL,
  `mc_gross` decimal(10,2) DEFAULT NULL,
  `mc_currency` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`user_id`),
  KEY `status` (`status`),
  KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1002 ;

INSERT INTO `tbl_user` (`user_id`, `dt_create`, `group_id`, `status`, `b_admin`, `username`, `password`, `sess_exp`, `sess_sig`, `first_name`, `last_name`, `email`, `user_type`, `payment_options`, `organization`, `comments`, `q1`, `maillog_id_user`, `maillog_id_admin`, `ipnlog_id`, `mc_gross`, `mc_currency`) VALUES
(1001, '2000-01-01 00:00:00', 1001, 1, 1, 'admin', 'password', '2001-01-01 00:00:00', NULL, 'Administrator', 'Administrator', 'admin@admin.com', 'indiv', '0', '', '', '1', NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `tbl_wprize`
--

CREATE TABLE IF NOT EXISTS `tbl_wprize` (
  `wprize_id` int(11) NOT NULL AUTO_INCREMENT,
  `dt_create` datetime NOT NULL,
  `cnts_id` int(11) NOT NULL,
  `pzbox_id` int(11) NOT NULL,
  `pzitem_id` int(11) NOT NULL,
  `trans_id` int(11) NOT NULL,
  `desc` varchar(300) DEFAULT NULL,
  `qty_stock` int(11) DEFAULT NULL,
  `maillog_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`wprize_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1001 ;


