--
-- Host: localhost    Database: espresso
-- ------------------------------------------------------


--
-- Table structure for table `config_data`
--

CREATE TABLE `config_data` (
  `pid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `key` varchar(100) NOT NULL DEFAULT '',
  `value` varchar(2048) NOT NULL DEFAULT '',
  KEY `i_pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `config_data`
--

INSERT INTO `config_data` (`pid`, `key`, `value`) VALUES (1015,'templates_folder',''),(1015,'default_id','1009');

--
-- Table structure for table `config_host_headers`
--

CREATE TABLE `config_host_headers` (
  `pid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `host_header` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`host_header`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `config_host_headers`
--

INSERT INTO `config_host_headers` (`pid`, `host_header`) VALUES (1015,'control.espresso-reklam-eu.localhost'),(1015,'control.espresso-reklam.eu');

--
-- Table structure for table `config_name`
--

CREATE TABLE `config_name` (
  `id` bigint(20) unsigned NOT NULL,
  `name` varchar(100) NOT NULL DEFAULT '',
  `is_default` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `config_name`
--

INSERT INTO `config_name` (`id`, `name`, `is_default`) VALUES (1015,'main',0);

--
-- Table structure for table `content`
--

CREATE TABLE `content` (
  `ID` bigint(20) unsigned NOT NULL DEFAULT '0',
  `ID_CATEGORY` bigint(20) unsigned NOT NULL DEFAULT '0',
  `OWNER_ID` bigint(20) unsigned NOT NULL DEFAULT '0',
  `CREATE_DATE` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `CODE` varchar(32) NOT NULL DEFAULT '',
  `CHILD_CODE` varchar(32) DEFAULT NULL,
  `ON_TOP` int(11) DEFAULT NULL,
  `STAT` tinyint(4) NOT NULL DEFAULT '0',
  `TITLE` varchar(500) NOT NULL DEFAULT '',
  `CONTENT_DATE` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `SHOW_IN_MENU` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `SHOW_IN_MENU_FOR_AUTH` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `DISPLAY_IF_IN_FUTURE` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `CHANGER_ID` bigint(20) unsigned NOT NULL DEFAULT '1',
  `ORDER_BY` varchar(64) NOT NULL DEFAULT 'is_folder desc, id',
  `GROUP_ID` bigint(20) unsigned NOT NULL DEFAULT '6',
  `PERMISSION` int(11) unsigned NOT NULL DEFAULT '0',
  `IS_FOLDER` tinyint(4) NOT NULL DEFAULT '1',
  `ANNOUNCE` varchar(1024) NOT NULL DEFAULT '',
  `TEXT` mediumtext,
  `EXTRA_FIELDS` text,
  `EXTRA_FILES` text,
  `META_TITLE` varchar(200) NOT NULL DEFAULT '',
  `META_DESCRIPTION` varchar(200) NOT NULL DEFAULT '',
  `META_KEYWORDS` varchar(200) NOT NULL DEFAULT '',
  `TO_DO` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `i_id_category` (`ID_CATEGORY`),
  KEY `i_order_by` (`ORDER_BY`),
  KEY `k_folder` (`STAT`,`IS_FOLDER`),
  KEY `i_stat` (`STAT`),
  KEY `i_pid_stat` (`ID_CATEGORY`,`STAT`),
  FULLTEXT KEY `i_full` (`TITLE`,`TEXT`,`ANNOUNCE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `content`
--

INSERT INTO `content` (`ID`, `ID_CATEGORY`, `OWNER_ID`, `CREATE_DATE`, `CODE`, `CHILD_CODE`, `ON_TOP`, `STAT`, `TITLE`, `CONTENT_DATE`, `SHOW_IN_MENU`, `SHOW_IN_MENU_FOR_AUTH`, `DISPLAY_IF_IN_FUTURE`, `CHANGER_ID`, `ORDER_BY`, `GROUP_ID`, `PERMISSION`, `IS_FOLDER`, `ANNOUNCE`, `TEXT`, `EXTRA_FIELDS`, `EXTRA_FILES`, `META_TITLE`, `META_DESCRIPTION`, `META_KEYWORDS`, `TO_DO`) VALUES (1,0,1,'2017-02-18 21:51:37','','#id#',0,1,'EspressoAdmin','0000-00-00 00:00:00',0,1,0,1,'is_folder desc, my_order desc, id',6,0,1,'','','[]','[]','','','',''),(2,1,1,'2017-02-18 21:31:42','admin','#id#',0,1,'Admin','0000-00-00 00:00:00',0,1,0,1,'id',4,1,0,'','','[{\"TOPF\":[\"top\",\"1\"]}]','[]','','','',''),(1017,1013,1,'2017-02-18 22:59:14','record','#id#',0,1,'Billing Record Info','2017-02-19 01:58:25',1,1,0,1,'is_folder desc, my_order desc, id',6,1,0,'','','[]','[]','','','','BillingRecord'),(4,2,1,'2017-02-18 21:31:04','users','#id#',0,1,'Users','0000-00-00 00:00:00',0,1,0,1,'id',6,1,1,'','','[]','[]','','','','UsersAdmin'),(3,2,1,'2008-01-27 19:12:09','cms','#id#',0,1,'CMS','0000-00-00 00:00:00',0,1,0,39,'id',6,1,1,'','text ','a:0:{}','a:0:{}','','','','CMS'),(5,1,1,'2017-01-12 13:17:30','error404','#id#',0,1,'Page Not Found','0000-00-00 00:00:00',0,1,0,1,'id',6,0,0,'','<p>The page not found. There is no Internet, it is honey, only very bad.</p>','[]','[]','','','',''),(6,1,1,'2017-01-12 13:16:54','auth','#id#',0,1,'Auth','2007-07-10 16:38:55',0,1,0,1,'is_folder desc, my_order desc, id',4,0,0,'','','[]','[]','','','','Config'),(7,2,1,'2017-02-18 21:31:15','groups','#id#',0,1,'User groups','2007-07-11 11:46:13',0,1,0,1,'id',6,1,1,'','','[]','[]','','','','GroupsAdmin'),(8,3,1,'2008-08-01 15:18:27','constrain','#id#',0,1,'Привязка одного документа к другому','2008-08-01 19:14:31',0,1,0,1,'id',6,1,0,'','','a:0:{}','a:0:{}','','','','ConstrainedContentAdmin'),(9,2,1,'2017-02-18 21:31:31','config','#id#',0,1,'Sites configuration','2008-12-14 17:22:36',0,1,0,1,'id',4,1,1,'','','[{\"TOPF\":[\"top\",\"\"]}]','[]','','','','Config'),(1009,1,1,'2017-02-19 11:24:32','users','#id#',0,1,'Users','2017-02-19 00:42:59',0,1,0,1,'is_folder desc, my_order desc, id',6,1,1,'','','[]','[]','','','','UsersAdminPublic'),(10,2,1,'2008-12-17 12:01:30','files','#id#',0,1,'Файловый менеджер','2008-12-16 18:14:23',0,1,0,1,'id',6,1,0,'','','a:1:{i:0;a:1:{s:4:\"TOPF\";a:2:{i:0;s:3:\"top\";i:1;s:0:\"\";}}}','a:0:{}','','','','FileManager'),(11,2,1,'2014-06-15 11:12:40','media','#id#',0,1,'Медиа','2014-06-15 15:12:12',1,1,0,1,'id',6,1,0,'','','a:1:{i:0;a:1:{s:4:\"TOPF\";a:2:{i:0;s:3:\"top\";i:1;s:0:\"\";}}}','a:0:{}','','','','Media(admin)'),(1011,1,1,'2017-02-18 23:14:54','banners','#id#',0,1,'Banners','2017-02-19 00:43:18',0,1,0,1,'is_folder desc, my_order desc, id',6,1,1,'','','[]','[]','','','','Banners'),(1013,1,1,'2017-02-18 22:47:59','billing','#id#',0,1,'Billing Log','2017-02-19 00:44:02',0,1,0,1,'is_folder desc, my_order desc, id',6,1,1,'','','[]','[]','','','','Billing'),(1027,1009,1,'2017-02-19 12:09:12','login-as','#id#',0,1,'Login As','2017-02-19 15:08:47',1,1,0,1,'is_folder desc, my_order desc, id',6,1,0,'','','[]','[]','','','','UserLoginAs');

--
-- Table structure for table `content_constraint`
--

CREATE TABLE `content_constraint` (
  `master_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `slave_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `INT_PATH` varchar(255) DEFAULT '',
  `TEXT_PATH` varchar(255) DEFAULT '',
  `TEXT_PATH_HASH` int(11) unsigned DEFAULT '0',
  `MY_ORDER` int(11) DEFAULT '0',
  `IS_REF` tinyint(1) unsigned DEFAULT '0',
  PRIMARY KEY (`master_id`,`slave_id`),
  KEY `i_slave_id` (`slave_id`),
  KEY `i_path_hash` (`TEXT_PATH_HASH`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `content_constraint`
--

INSERT INTO `content_constraint` (`master_id`, `slave_id`, `INT_PATH`, `TEXT_PATH`, `TEXT_PATH_HASH`, `MY_ORDER`, `IS_REF`) VALUES (0,1,'1','/',2043925204,0,0),(1,2,'2,1','/admin',152366123,0,0),(2,4,'4,2,1','/admin/users',3313262808,0,0),(2,3,'3,2,1','/admin/cms',174214763,0,0),(1,5,'5,1','/error404',429104458,0,0),(1,6,'6,1','/auth',1546199181,0,0),(2,7,'7,2,1','/admin/groups',2707605135,0,0),(3,8,'8,3,2,1','/admin/cms/constrain',4100701102,0,0),(2,9,'9,2,1','/admin/config',2240139395,0,0),(2,10,'10,2,1','/admin/files',3620373864,0,0),(2,11,'11,2,1','/admin/media',3151193149,0,0),(1,1009,'1009,1','/users',2509849780,0,0),(1,1011,'1011,1','/banners',4246164869,0,0),(1,1013,'1013,1','/billing',876231751,0,0),(1013,1017,'1017,1013,1','/billing/record',3903056841,0,0),(1009,1027,'1027,1009,1','/users/login-as',285883520,0,0);

--
-- Table structure for table `content_lang`
--

CREATE TABLE `content_lang` (
  `ID` bigint(20) unsigned NOT NULL DEFAULT '0',
  `LANG_ID` varchar(3) NOT NULL DEFAULT '',
  `TITLE` varchar(255) NOT NULL DEFAULT '',
  `ANNOUNCE` text NOT NULL,
  `TEXT` mediumtext NOT NULL,
  PRIMARY KEY (`ID`,`LANG_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `content_lang`
--


--
-- Table structure for table `content_tag`
--

CREATE TABLE `content_tag` (
  `content_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `tag_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  KEY `i_cid` (`content_id`),
  KEY `i_tid` (`tag_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `content_tag`
--


--
-- Table structure for table `file_to_content`
--

CREATE TABLE `file_to_content` (
  `file_id` bigint(20) unsigned DEFAULT '0',
  `content_id` bigint(20) unsigned DEFAULT '0',
  `order_index` int(11) DEFAULT '0',
  KEY `i_file_id` (`file_id`),
  KEY `i_content_id` (`content_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `file_to_content`
--


--
-- Table structure for table `files_category`
--

CREATE TABLE `files_category` (
  `id` bigint(20) unsigned NOT NULL,
  `pid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `files_category`
--


--
-- Table structure for table `files_data`
--

CREATE TABLE `files_data` (
  `id` bigint(20) unsigned NOT NULL,
  `pid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `ext` varchar(10) NOT NULL DEFAULT '',
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `revision` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `i_pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `files_data`
--


--
-- Table structure for table `media_files`
--

CREATE TABLE `media_files` (
  `id` int(11) unsigned NOT NULL,
  `pid` int(11) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `filename` varchar(128) NOT NULL DEFAULT '',
  `filesize` bigint(18) NOT NULL DEFAULT '0',
  `original_url` varchar(100) DEFAULT '',
  `image_url` varchar(100) NOT NULL DEFAULT '',
  `thumb_url` varchar(100) NOT NULL DEFAULT '',
  `preview_url` varchar(100) NOT NULL DEFAULT '',
  `type` tinyint(1) NOT NULL DEFAULT '0',
  `big_text` text NOT NULL,
  `my_order` int(11) DEFAULT '0',
  `is_default` int(11) DEFAULT '0',
  `author` varchar(64) NOT NULL DEFAULT '',
  `copyright` varchar(64) NOT NULL DEFAULT '',
  `create_at` datetime DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  KEY `i_pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `media_files`
--


--
-- Table structure for table `sec_group_permiss`
--

CREATE TABLE `sec_group_permiss` (
  `cid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `gid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `for_admin` tinyint(2) NOT NULL DEFAULT '0',
  `permiss` varchar(5) NOT NULL DEFAULT '',
  KEY `i_gid` (`gid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sec_group_permiss`
--

INSERT INTO `sec_group_permiss` (`cid`, `gid`, `for_admin`, `permiss`) VALUES (11,6,0,'1'),(10,6,0,'1'),(7,6,0,'1'),(4,6,0,'1'),(8,6,0,'1'),(3,6,0,'1'),(2,6,0,'1'),(1009,1019,0,'1'),(1027,1019,0,'1'),(1011,1019,0,'1'),(1013,1019,0,'1'),(1017,1019,0,'1');

--
-- Table structure for table `sec_groups`
--

CREATE TABLE `sec_groups` (
  `id` bigint(20) unsigned NOT NULL,
  `pid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `name` varchar(100) NOT NULL DEFAULT '',
  `is_deletable` smallint(2) NOT NULL DEFAULT '1',
  `blocked` tinyint(1) NOT NULL DEFAULT '0',
  `comment` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sec_groups`
--

INSERT INTO `sec_groups` (`id`, `pid`, `name`, `is_deletable`, `blocked`, `comment`) VALUES (4,0,'root',0,0,'супервизор'),(1,6,'usual user',1,0,'обыкновенный'),(6,5,'content',1,0,'контент-манагер'),(5,4,'admin',1,0,'admin'),(1005,6,'global ads trader',1,0,'global ads trader'),(1007,6,'global ads publisher',1,0,'global ads publisher'),(1019,5,'users owner',1,0,'Custom users owner'),(1021,1019,'owner ads trader',1,0,'Custom user trader');

--
-- Table structure for table `sec_groups_user`
--

CREATE TABLE `sec_groups_user` (
  `uid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `gid` bigint(20) unsigned NOT NULL DEFAULT '0',
  KEY `i_uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sec_groups_user`
--

INSERT INTO `sec_groups_user` (`uid`, `gid`) VALUES (1,5),(1,6),(1,1),(1025,1021);

--
-- Table structure for table `sequence`
--

CREATE TABLE `sequence` (
  `name` varchar(16) NOT NULL,
  `current_value` bigint(11) unsigned NOT NULL DEFAULT '1',
  `increment` int(11) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sequence`
--

INSERT INTO `sequence` (`name`, `current_value`, `increment`) VALUES ('default',1027,2);

--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` bigint(20) unsigned NOT NULL,
  `tag_hash` char(32) NOT NULL DEFAULT '',
  `name` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `i_hash` (`tag_hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tags`
--


--
-- Table structure for table `tokens`
--

CREATE TABLE `tokens` (
  `item_id` bigint(20) unsigned DEFAULT '0',
  `token_type` int(10) unsigned DEFAULT '0',
  `token` char(64) NOT NULL,
  `create_at` datetime NOT NULL,
  UNIQUE KEY `token` (`token`),
  KEY `i_dt` (`create_at`),
  KEY `i_tp_dt` (`token_type`,`create_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tokens`
--

INSERT INTO `tokens` (`item_id`, `token_type`, `token`, `create_at`) VALUES (14,1,'0rRn7hZvZtZzEn6mF56SrsJ.GPLkQsELZAYAx~ry$wkmUerDoRqdkV$RZ-9roIXc','2017-02-19 20:55:24'),(16,1,'AcSKbYkOHMDM075vM5jnA_dp0v5J9NIY-@ChX4~vjntllWn1obOCqBXx7pXaamZH','2017-02-19 21:00:30'),(1,1,'AYKmGdJD0KQsuVpOzMx-zcgKoow7xhg5rmRvK-@Lvz@e-3bRwC11_l@LsqoOgjBA','2017-02-19 21:01:32'),(1,1,'gjbDaMZYBgefLvR6mLLfSlQSmIEdR3@CXw8XdUo06QHLLgtSvl5C.oBVmDUaCVeQ','2017-02-19 21:09:08'),(16,1,'omD9xgn_k5$6454809QC5SwFIXOaQxF_GlRJF~aa4-xskX6@K1yJP@3OenWhxL$S','2017-02-19 21:02:14'),(16,1,'swR~BU3jxAsTBaLGPx7TXrLE9v91zYXLEUWlke8AGOgc79ItM0n$9N$nK5ZaE0Fc','2017-02-19 21:07:32'),(16,1,'tD7zB9EL89wQiWmcch-ieibfw-ErT0gG.t-hZTzDq6f3pl5B.tOwQNk$d$l~0LIg','2017-02-19 21:09:29'),(1,1,'y.LBH-3erRCVTYbP~VRaNqXLcQWFq4uqNCob$bXmyZ._YUezszyQ~z.AFdmSfyP-','2017-02-19 21:08:41'),(16,1,'yqTYagfP.46IhZ~JiKJDuivUv3FBOT7_vLJuOte88ms-thJSXs$eD1gjIZaDrnRx','2017-02-19 21:00:53'),(1,1,'z@Rhpwl3@YIrFAQNIrArEeB8s@_sZuUc_WfiHXxjcKId.rM9hueWqxPtdct@jOGo','2017-02-19 01:08:39');

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `ID` bigint(20) unsigned NOT NULL,
  `LOGIN` varchar(32) DEFAULT '',
  `PASSWD` varchar(255) DEFAULT '',
  `E_MAIL` varchar(100) NOT NULL DEFAULT '',
  `NAME` varchar(64) NOT NULL DEFAULT '',
  `STATUS` int(11) NOT NULL DEFAULT '0',
  `BLOCKED` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `GUID` varchar(32) DEFAULT '',
  `CREATE_AT` datetime DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`ID`),
  UNIQUE KEY `i_login` (`LOGIN`),
  KEY `U_STATUS` (`STATUS`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`ID`, `LOGIN`, `PASSWD`, `E_MAIL`, `NAME`, `STATUS`, `BLOCKED`, `GUID`, `CREATE_AT`) VALUES (1,'breeze@2sun.su','$2y$10$vMpNE.zTsgNWjuTCbP0kaeIlXLQRDASzOt2lmnrLwEhvjTIqu8zmK','breeze@2sun.su','Breeze',4,0,'b7315b4d4a71cb864b7baf398a1ef83c','2017-02-18 21:28:43'),(2,'breeze@dir.bg','6dca173568fe6d15d8c7839dc4322114aabc8d5c','breeze@dir.bg','Alex G',1007,0,'311634c2373465eab95d9e68723ccee5','2014-09-26 14:29:23'),(3,'george@dir.bg','744faaa1341796a09f7525b613092db42df715a2','george@dir.bg','жоро жоро',1005,0,'77679392c0dd7cf34cf3065cbe8b47d0','2014-09-26 13:49:18'),(4,'jeglov@dir.bg','2bbaa06678059627266ef4b0ddfc5cb7ec904000','jeglov@dir.bg','vladimir Jeglov',1007,0,'d47f03f31d0d1e89cca5f4662efef4d7','2014-10-01 12:19:06'),(5,'groag@mail.bg','180aaa0de38afe1af71e917bfcf33d7e59dff8de','groag@mail.bg','kjsd dsak',1005,0,'1f3d923a7fbb2648fd5698b9a5be3165','2014-10-16 01:02:44'),(6,'breeze@yaroslavka.ru','274f9e0f37f9f04e8db3160688b18acca9f115df','breeze@yaroslavka.ru','alex g',1005,0,'58c19039ba9d591d782fc0fab288f379','2014-10-23 16:27:38'),(7,'gchavdarov@dirbg.com','d151dcc0e73bb07b75daa383fcd550564d8575f5','gchavdarov@dirbg.com','george ',1005,0,'37450553ee27493bb4995212e12454cd','2014-10-24 09:53:09'),(8,'hebo@dir.bg','757ba620a8246a8eab148c06d360fa45064e7511','hebo@dir.bg','az az',1007,0,'61d53c8090c10832227e0ef320931a34','2014-10-24 12:16:15'),(9,'jeglov@gmail.com','ae79f9b40eae52bd1860263cd438ff109066bc96','jeglov@gmail.com','vlad iva',1005,0,'af2185f583d3ba5968503a17b2ca5950','2014-10-26 11:24:11'),(10,'zheglov@dir.bg','2a3525db280faf7b1794e17f92f1ee3c90b498d4','zheglov@dir.bg','Ivailo Zheglov',1005,0,'21d2d85005924e095ef074f2077eb396','2014-10-27 15:27:45'),(11,'klementina@cafereklam.bg','9a8e913bee96f91b21205f5df6e7d6124692f1a7','klementina@cafereklam.bg','Klementina Stambolova',1007,0,'4c1f7ef81d587817387161cac7ac40ff','2014-11-07 11:43:08'),(12,'zastrahovalnik@directins.bg','6c5be7304a00f530c7a0290e0c8275e832565379','zastrahovalnik@directins.bg','Zastrahovalnik Zastrahovalnik',1005,0,'be4a0d3e13111f009bb92c46d408b0da','2014-11-16 20:51:27'),(13,'spiralabg@gmail.com','678ecdd38d67b3be3de3ca16b7e434fddbf6da5a','spiralabg@gmail.com','Biostore Spirala',1005,0,'80ceb739491264d1c3a5693689eb19b8','2014-12-01 21:59:19'),(14,'adashe@dir.bg','0e52436341c3054f7836c8887e4579d08d456ac4','adashe@dir.bg','Boris Hadzhistoyanov',1005,0,'4be76e8afa25c34659eb45c8fe45811b','2015-06-22 13:00:31'),(15,'evaangelis@dir.bg','3507ae65137e3c4c3d3db88df51b0c3e2adaac5d','evaangelis@dir.bg','Eva Angelis',1005,0,'0e099562026deac1474ec095e8a5e471','2015-07-06 14:07:21'),(16,'smartbio@dir.bg','55fdd14a81b427d4d1b128d33471bc301521764e','smartbio@dir.bg','Smart Bio',1005,0,'ef398743f66a3ce3dc278aa92702f262','2015-07-06 14:10:18'),(17,'gkb@tarasoft.bg','753a2a2bbec3e3cca639c71b051c4b4a45de73b3','gkb@tarasoft.bg','Georgi Baldzhiev',1005,0,'5e0b4f4a250e907b1e05805f2752bbb6','2015-07-09 12:58:07'),(18,'k.lefterow@gmail.com','83e1ab29e7fad698a146776acdf0a8fa6d8e94ab','k.lefterow@gmail.com','Kiril Lefterov',1007,0,'096ac013dfa48004555686a9e20a19c7','2015-07-20 17:19:20'),(19,'technomarket@dir.bg','432d387c79b97fd0af63a12da82703bf3fc6b497','technomarket@dir.bg','Techno Market',1005,0,'0a4013c056e6be4a47e7330bece6c481','2015-10-02 13:02:24'),(20,'niki@cafereklam.bg','7a9cf14c45cae9bb6864b55b4361fa2a2bfe63be','niki@cafereklam.bg','Nikolay Marinov',1007,0,'a76c26cb88926d3b76fb8e4decef900f','2015-10-05 14:58:39'),(21,'contact@affpage.com','be843a6444c7a4a1a173a598d77fb32af7a73b24','contact@affpage.com','Mo Mcho',1007,0,'7792529cd75fae2f2ab45d3dce8e53bc','2015-11-08 03:19:25'),(22,'siya@pik.bg','a2c338721e9e714c8217ac9c241fb94ecbf4f28e','siya@pik.bg','Pik News',1007,0,'0a8800674a1af5f138b4f0cbfe090c8d','2016-03-11 13:57:51'),(23,'datavd@mail.bg','8a144978aab3e1f764868829cd68e6d217144599','datavd@mail.bg','a b',1005,0,'686a3df38b58af9b4f2e450b5e77198c','2016-04-08 19:55:49'),(24,'ncm@dir.bg','7abf964b82c69c3c1b65a5ad1128f6ed5060134e','ncm@dir.bg','Sevex Pharma',1005,0,'c10c3308800f8d3aca838dc4c1720082','2016-04-20 15:19:08');

--
-- Table structure for table `users_ext`
--

CREATE TABLE `users_ext` (
  `uid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `first_name` varchar(100) NOT NULL DEFAULT '',
  `last_name` varchar(100) NOT NULL DEFAULT '',
  `phone` varchar(100) NOT NULL DEFAULT '',
  `org` varchar(100) NOT NULL DEFAULT '',
  `address` varchar(100) NOT NULL DEFAULT '',
  `city` varchar(100) NOT NULL DEFAULT '',
  `is_physic` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `users_ext`
--

INSERT INTO `users_ext` (`uid`, `first_name`, `last_name`, `phone`, `org`, `address`, `city`, `is_physic`) VALUES (2,'Alex','G','','Dir.BG','','',1),(4,'vladimir','Jeglov','','','','',1),(8,'az','az','','','','',0),(11,'Klementina','Stambolova','','','','',0),(18,'Kiril','Lefterov','','','','',0),(20,'Nikolay','Marinov','','','','',0),(21,'Mo','Mcho','','','','',0),(22,'Pik','News','','','','',0),(1,'Zemoda.BG','','','Zemoda.BG','','',0),(3,'жоро','жоро','','','','',0),(5,'kjsd','dsak','','','','',0),(6,'alex','g','','','','',0),(7,'george','','','','','',0),(9,'vlad','iva','','','','',0),(10,'Ivailo','Zheglov','','','','',0),(12,'Zastrahovalnik','Zastrahovalnik','','','Sofia','Sofia',0),(13,'Biostore','Spirala','','','','',0),(14,'Boris','Hadzhistoyanov','','','','',0),(15,'Eva','Angelis','','','','',0),(16,'Smart','Bio','','','','',0),(17,'Georgi','Baldzhiev','','','','',0),(19,'Techno','Market','','','','',0),(23,'a','b','','','','',0),(24,'Sevex','Pharma','','','','',0);

--
-- Table structure for table `users_new`
--

CREATE TABLE `users_new` (
  `uid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `confirm_code` varchar(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `i_cc` (`confirm_code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `users_new`
--


--
-- Table structure for table `users_online`
--

CREATE TABLE `users_online` (
  `uid` bigint(20) unsigned NOT NULL DEFAULT '0',
  `start_time` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`uid`),
  KEY `i_time` (`start_time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `users_online`
--

INSERT INTO `users_online` (`uid`, `start_time`) VALUES (1,1487528167);

--
-- Table structure for table `users_referals`
--

CREATE TABLE `users_referals` (
  `referal_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  `user_id` bigint(20) unsigned NOT NULL DEFAULT '0',
  KEY `referal_id` (`referal_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users_referals`
--


--
-- Dumping routines for database 'espresso'
--
/*!50003 DROP FUNCTION IF EXISTS `currval` */;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `currval`(`seq_name` VARCHAR(16)) RETURNS bigint(20)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
		DECLARE value INTEGER;
		SET value = 0;
		SELECT current_value INTO value
		FROM sequence
		WHERE name = seq_name;
		RETURN value;
	END ;;
DELIMITER ;
/*!50003 DROP FUNCTION IF EXISTS `nextval` */;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `nextval`(`seq_name` VARCHAR(16)) RETURNS bigint(20)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
		UPDATE sequence
		SET current_value = current_value + increment
		WHERE name = seq_name;
		RETURN currval(seq_name);
	END ;;
DELIMITER ;
/*!50003 DROP FUNCTION IF EXISTS `setval` */;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` FUNCTION `setval`(`seq_name` VARCHAR(16), `value` INT) RETURNS bigint(20)
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
		UPDATE sequence
		SET current_value = value
		WHERE name = seq_name;
		RETURN currval(seq_name);
	END ;;
DELIMITER ;


