SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE IF NOT EXISTS `tb_accessblock` (
  `id` int(11) NOT NULL auto_increment,
  `ip` varchar(15) NOT NULL,
  `wmid` varchar(12) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `tb_addbanner` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `plan` varchar(5) NOT NULL,
  `urlsite` varchar(150) NOT NULL,
  `urlpic` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=4 ;

CREATE TABLE IF NOT EXISTS `tb_adminmess` (
  `id` int(11) NOT NULL auto_increment,
  `data` varchar(20) NOT NULL,
  `text` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=2 ;

CREATE TABLE IF NOT EXISTS `tb_ads` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `ip` varchar(15) NOT NULL,
  `tipo` varchar(150) NOT NULL,
  `visitime` varchar(150) NOT NULL,
  `ident` int(20) NOT NULL,
  `fechainicia` varchar(150) NOT NULL,
  `paypalname` varchar(150) NOT NULL,
  `paypalemail` varchar(150) NOT NULL,
  `plan` varchar(150) NOT NULL,
  `bold` varchar(150) NOT NULL,
  `highlight` varchar(150) NOT NULL,
  `url` varchar(150) NOT NULL,
  `description` varchar(150) NOT NULL,
  `category` varchar(150) NOT NULL,
  `members` varchar(150) NOT NULL default '0',
  `outside` varchar(150) NOT NULL default '0',
  `total` varchar(150) NOT NULL default '0',
  `timer` varchar(3) NOT NULL default '20',
  `dopsec` varchar(1) NOT NULL default '0',
  `vip` varchar(1) NOT NULL default '0',
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=58 ;

CREATE TABLE IF NOT EXISTS `tb_adsblock` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `url` varchar(150) NOT NULL,
  `text` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=4 ;

CREATE TABLE IF NOT EXISTS `tb_adsdate` (
  `id` int(11) NOT NULL auto_increment,
  `data` varchar(10) NOT NULL,
  `kolvo` varchar(5) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=8 ;

CREATE TABLE IF NOT EXISTS `tb_advban` (
  `id` int(11) NOT NULL auto_increment,
  `urlsite` varchar(150) NOT NULL,
  `urlpic` varchar(150) NOT NULL,
  `begindate` varchar(150) NOT NULL,
  `numdays` int(5) NOT NULL default '0',
  `curview` varchar(1) NOT NULL default '0',
  `wmid` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=11 ;

CREATE TABLE IF NOT EXISTS `tb_advertisers` (
  `id` int(11) NOT NULL auto_increment,
  `pname` varchar(150) NOT NULL,
  `pemail` varchar(150) NOT NULL,
  `plan` varchar(150) NOT NULL,
  `url` varchar(150) NOT NULL,
  `description` varchar(150) NOT NULL,
  `ip` varchar(15) NOT NULL,
  `bold` varchar(150) NOT NULL,
  `highlight` varchar(150) NOT NULL,
  `tipo` varchar(150) NOT NULL,
  `money` varchar(150) NOT NULL,
  `timer` varchar(3) NOT NULL default '20',
  `dopsec` varchar(1) NOT NULL default '0',
  `vip` varchar(1) NOT NULL default '0',
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=29 ;

CREATE TABLE IF NOT EXISTS `tb_autorefreq` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `plan` varchar(1) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `tb_chat` (
  `id` int(15) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `ip` varchar(15) NOT NULL,
  `message` varchar(500) NOT NULL,
  `data` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=38 ;

CREATE TABLE IF NOT EXISTS `tb_chatads` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `link` varchar(150) NOT NULL,
  `text` varchar(100) NOT NULL,
  `enddate` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `tb_chatadsreq` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `link` varchar(150) NOT NULL,
  `text` varchar(100) NOT NULL,
  `plan` varchar(5) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `tb_chatban` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `reason` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `tb_chatcens` (
  `id` int(15) NOT NULL auto_increment,
  `text` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `tb_comp` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) NOT NULL,
  `startdate` varchar(10) NOT NULL,
  `enddate` varchar(10) NOT NULL,
  `deldate` varchar(10) NOT NULL,
  `lidername` varchar(1) NOT NULL default '0',
  `param` varchar(2) NOT NULL default '0',
  `min` varchar(10) NOT NULL default '0',
  `descr` varchar(1000) NOT NULL,
  `pris1type` varchar(1) NOT NULL default '0',
  `pris1value` varchar(10) NOT NULL,
  `pris2type` varchar(1) NOT NULL default '0',
  `pris2value` varchar(10) NOT NULL,
  `pris3type` varchar(1) NOT NULL default '0',
  `pris3value` varchar(10) NOT NULL,
  `pris1status` varchar(1) NOT NULL default '0',
  `pris2status` varchar(1) NOT NULL default '0',
  `pris3status` varchar(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=9 ;

CREATE TABLE IF NOT EXISTS `tb_compdata` (
  `id` int(11) NOT NULL auto_increment,
  `idk` int(11) NOT NULL,
  `user` varchar(50) NOT NULL,
  `resvalue` int(10) NOT NULL default '0',
  `purse` varchar(13) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `tb_config` (
  `id` int(11) NOT NULL auto_increment,
  `item` varchar(15) NOT NULL,
  `howmany` varchar(15) NOT NULL,
  `price` varchar(150) NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=56 ;

INSERT INTO `tb_config` (`id`, `item`, `howmany`, `price`) VALUES
(1, 'click', '1', '0.02'),
(1, 'referalclick', '1', '0.005'),
(1, 'hits', '1', '0.035'),
(1, 'payment', '1', '0.5'),
(1, 'upgrade', '1', '70'),
(2, 'recordonline', '307', '0'),
(6, 'referal', '1', '5'),
(4, 'vipclick', '1', '0.03'),
(5, 'viprefclick', '1', '0.01'),
(7, 'advbanner', '1', '3'),
(8, 'advstatlink', '1', '4'),
(9, 'mfabanner', '1', '4'),
(10, 'mfastatlink', '1', '5'),
(11, 'mfadyn', '1', '0.04'),
(12, 'hldyn', '1', '3'),
(13, 'mfahldyn', '1', '4'),
(14, 'upgrade1', '1', '135'),
(15, 'upgrade2', '1', '200'),
(16, 'finsetact', '1', '15'),
(17, 'finsetref', '1', '10'),
(18, 'adblock', '1', '0.2'),
(19, 'textads', '1', '4'),
(20, 'taskminprice', '1', '0.1'),
(21, 'taskmincount', '1', '10'),
(22, 'timer5', '1', '10'),
(23, 'wmframeads', '1', '4'),
(24, 'frameads', '1', '5'),
(25, 'refbot5', '', '20'),
(26, 'refbot10', '', '35'),
(27, 'refbot20', '', '70'),
(28, 'refbot50', '', '185'),
(29, 'refbot100', '', '380'),
(30, 'chatmess', '1', '0.001'),
(31, 'upgrade3', '1', '395'),
(32, 'upgrade4', '1', '700'),
(33, 'dopsec', '1', '15'),
(34, 'leftblock', '1', '2'),
(35, 'autoref', '1', '150'),
(36, 'reflinkprice', '1', '0.001'),
(37, 'vipblock', '1', '15'),
(38, 'vipcount', '1', '10'),
(39, 'wmchatads', '1', '3'),
(40, 'autoref', '2', '290'),
(41, 'autoref', '3', '430'),
(42, 'maxautopay', '1', '10'),
(43, 'refmax', '0', '50'),
(44, 'refmax', '1', '70'),
(45, 'autodeluser', '1', '30'),
(46, 'refbirjcomm', '1', '0.5'),
(47, 'refbirjminclick', '1', '0'),
(48, 'ddosmaxhits', '1', '2'),
(49, 'ddosperiod', '1', '1'),
(50, 'ddoscrits', '1', '10'),
(51, 'captcha', '1', '20'),
(54, 'taskcomm', '1', '15'),
(55, 'taskhl', '1', '10');

CREATE TABLE IF NOT EXISTS `tb_frameads` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `link` varchar(150) NOT NULL,
  `text` varchar(100) NOT NULL,
  `enddate` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `tb_frameadsreq` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `link` varchar(150) NOT NULL,
  `text` varchar(100) NOT NULL,
  `plan` varchar(5) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `tb_history` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `date` varchar(150) NOT NULL,
  `amount` double default '0',
  `method` varchar(150) NOT NULL,
  `status` varchar(150) NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=2 ;

CREATE TABLE IF NOT EXISTS `tb_hosts` (
  `id` int(20) NOT NULL auto_increment,
  `ip` varchar(15) NOT NULL,
  `data` varchar(15) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=110 ;

CREATE TABLE IF NOT EXISTS `tb_mail` (
  `id` int(10) NOT NULL auto_increment,
  `sender` varchar(150) NOT NULL,
  `recipient` varchar(150) NOT NULL,
  `subject` varchar(20) NOT NULL,
  `message` varchar(10000) NOT NULL,
  `status` varchar(1) NOT NULL default '0',
  `data` varchar(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=2 ;

CREATE TABLE IF NOT EXISTS `tb_mta` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `amount` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `tb_news` (
  `id` int(10) NOT NULL auto_increment,
  `data` varchar(150) NOT NULL,
  `newstext` varchar(10000) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=4 ;

CREATE TABLE IF NOT EXISTS `tb_payme` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(150) NOT NULL,
  `pasword` varchar(150) NOT NULL,
  `pemail` varchar(150) NOT NULL,
  `country` varchar(150) NOT NULL,
  `money` varchar(150) NOT NULL,
  `ip` varchar(15) NOT NULL,
  `datetime` varchar(30) NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=4 ;

CREATE TABLE IF NOT EXISTS `tb_refbirj` (
  `id` int(11) NOT NULL auto_increment,
  `iduser` int(10) NOT NULL,
  `price` varchar(10) NOT NULL default '0.000',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=11 ;

CREATE TABLE IF NOT EXISTS `tb_refbot` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `refbottarif` varchar(3) NOT NULL,
  `data` varchar(150) NOT NULL,
  `visits` varchar(150) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=11 ;

CREATE TABLE IF NOT EXISTS `tb_refbotreq` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `tarif` varchar(3) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=14 ;

CREATE TABLE IF NOT EXISTS `tb_refreq` (
  `id` int(11) NOT NULL auto_increment,
  `referer` varchar(150) NOT NULL,
  `referal` int(11) NOT NULL default '0',
  `refcount` int(5) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `tb_restorepass` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `tb_site` (
  `id` varchar(11) NOT NULL,
  `sitename` varchar(30) NOT NULL,
  `wmid` varchar(12) NOT NULL,
  `purse` varchar(13) NOT NULL,
  `valuta` varchar(1) NOT NULL,
  `valutaname` varchar(10) NOT NULL,
  `startdate` varchar(150) NOT NULL default '01.01.2009',
  `comment` varchar(150) NOT NULL default 'Выплата с :sitename: пользователю :username:',
  `blockip` varchar(15) NOT NULL,
  `ctrlword` varchar(150) NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;

INSERT INTO `tb_site` (`id`, `sitename`, `wmid`, `purse`, `valuta`, `valutaname`, `startdate`, `comment`, `blockip`, `ctrlword`) VALUES
('1', 'WMR-Bux', '849381610650', 'R392037300186', 'R', 'руб', '04.07.2009', 'Выплата с :sitename: пользователю :username:', '', '');

CREATE TABLE IF NOT EXISTS `tb_statlinks` (
  `id` int(11) NOT NULL auto_increment,
  `url` varchar(150) NOT NULL,
  `description` varchar(150) NOT NULL,
  `begindate` varchar(150) NOT NULL,
  `numdays` int(5) NOT NULL,
  `wmid` varchar(150) NOT NULL,
  `leftblock` varchar(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=2 ;

CREATE TABLE IF NOT EXISTS `tb_statlinksreq` (
  `id` int(11) NOT NULL auto_increment,
  `url` varchar(150) NOT NULL,
  `description` varchar(150) NOT NULL,
  `wmid` varchar(12) NOT NULL,
  `plan` varchar(5) NOT NULL,
  `leftblock` varchar(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `tb_task` (
  `id` int(11) NOT NULL auto_increment,
  `author` varchar(30) NOT NULL,
  `title` varchar(50) NOT NULL,
  `descr` varchar(10000) NOT NULL,
  `amount` float NOT NULL default '0',
  `kolvo` varchar(10) NOT NULL default '0',
  `starturl` varchar(150) NOT NULL,
  `verinfo` varchar(1000) NOT NULL,
  `data` varchar(20) NOT NULL,
  `hltask` varchar(7) NOT NULL default '#ffffff',
  `good` varchar(10) NOT NULL default '0',
  `bad` varchar(10) NOT NULL default '0',
  `wait` varchar(10) NOT NULL default '0',
  `balance` varchar(10) NOT NULL default '0.00',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=8 ;

CREATE TABLE IF NOT EXISTS `tb_taskstats` (
  `id` int(11) NOT NULL auto_increment,
  `idtask` int(11) NOT NULL default '0',
  `verinfo` varchar(1000) NOT NULL,
  `amount` float NOT NULL default '0',
  `status` varchar(1) NOT NULL default '0',
  `user` varchar(50) NOT NULL,
  `data` varchar(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `tb_textads` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `url` varchar(150) NOT NULL,
  `text` varchar(255) NOT NULL,
  `enddate` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `tb_textadsreq` (
  `id` int(11) NOT NULL auto_increment,
  `wmid` varchar(12) NOT NULL,
  `url` varchar(150) NOT NULL,
  `text` varchar(255) NOT NULL,
  `plan` varchar(5) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `tb_upgrade` (
  `id` int(11) NOT NULL auto_increment,
  `user` varchar(150) NOT NULL,
  `enddate` varchar(150) NOT NULL,
  `requpgrade` int(1) NOT NULL default '0',
  `srok` varchar(150) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `users_online` (
  `visitor` varchar(15) NOT NULL,
  `lastvisit` int(14) NOT NULL,
  `user` varchar(25) NOT NULL,
  `urlpage` varchar(150) NOT NULL,
  `loading` int(6) NOT NULL default '0',
  `blocked` varchar(1) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=cp1251;