--
-- Host: localhost    Database: vms_web
-- ------------------------------------------------------


--
-- Table structure for table `tbl_auto_description`
--

CREATE TABLE `tbl_auto_description` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `device_id` int(11) NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=197 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_auto_description`
--


--
-- Table structure for table `tbl_check_user`
--

CREATE TABLE `tbl_check_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_check_user` (`user_id`),
  CONSTRAINT `FK_check_user` FOREIGN KEY (`user_id`) REFERENCES `tbl_users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_check_user`
--


--
-- Table structure for table `tbl_feedback`
--

CREATE TABLE `tbl_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `message` text COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `feedback_user_id_user_id` (`user_id`),
  CONSTRAINT `feedback_user_id_user_id` FOREIGN KEY (`user_id`) REFERENCES `tbl_users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_feedback`
--


--
-- Table structure for table `tbl_groups`
--

CREATE TABLE `tbl_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8_unicode_ci,
  `refresh` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_groups`
--


--
-- Table structure for table `tbl_part`
--

CREATE TABLE `tbl_part` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `route` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `menu` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci,
  `real_route` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_part`
--

INSERT INTO `tbl_part` VALUES (1,'/map','Карта','Просмотр пути на карте','rs/getMap'),(2,'/report','Старые Отчеты','Старые Отчеты','rs/getReportList'),(3,'/last','Последние данные','Просмотр времени передачи последних данных','rs/getLastData'),(4,'/online','Старый мониторинг','Мониторинг в реальном времени','rs/getOnline'),(10,'/monitoring','Мониторинг','Новый мониторинг','rs/monitoring'),(11,'/dispatcher','Диспетчер','Быстрый просмотр треков',' /dispatcher'),(12,'/gibddmonitoring','Мониторинг ГИБДД',NULL,'rs/gibddmonitoring'),(13,'/asyncreport','Отчеты','Отчеты','/asyncreport');

--
-- Table structure for table `tbl_part_user`
--

CREATE TABLE `tbl_part_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `part_id` int(11) NOT NULL,
  `order` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_part_user_part` (`part_id`),
  KEY `FK_part_user` (`user_id`),
  CONSTRAINT `FK_part_user` FOREIGN KEY (`user_id`) REFERENCES `tbl_users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FK_part_user_part` FOREIGN KEY (`part_id`) REFERENCES `tbl_part` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13348 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_part_user`
--

INSERT INTO `tbl_part_user` VALUES (11440,64,13,9000),(11894,64,1,1560),(12109,64,11,1580),(12324,64,10,1600),(12539,64,3,10000),(13323,63,1,20),(13324,63,10,40),(13325,63,11,60),(13326,63,13,80),(13327,63,3,100);

--
-- Table structure for table `tbl_profiles`
--

CREATE TABLE `tbl_profiles` (
  `user_id` int(11) NOT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_profiles`
--

INSERT INTO `tbl_profiles` VALUES (63),(64);

--
-- Table structure for table `tbl_profiles_fields`
--

CREATE TABLE `tbl_profiles_fields` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `varname` varchar(50) NOT NULL,
  `title` varchar(255) NOT NULL,
  `field_type` varchar(50) NOT NULL,
  `field_size` int(3) NOT NULL DEFAULT '0',
  `field_size_min` int(3) NOT NULL DEFAULT '0',
  `required` int(1) NOT NULL DEFAULT '0',
  `match` varchar(255) NOT NULL DEFAULT '',
  `range` varchar(255) NOT NULL DEFAULT '',
  `error_message` varchar(255) NOT NULL DEFAULT '',
  `other_validator` varchar(255) NOT NULL DEFAULT '',
  `default` varchar(255) NOT NULL DEFAULT '',
  `widget` varchar(255) NOT NULL DEFAULT '',
  `widgetparams` varchar(5000) NOT NULL DEFAULT '',
  `position` int(3) NOT NULL DEFAULT '0',
  `visible` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `varname` (`varname`,`widget`,`visible`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_profiles_fields`
--


--
-- Table structure for table `tbl_settings`
--

CREATE TABLE `tbl_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `map_lon` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `map_lat` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `map_zoom` int(11) DEFAULT NULL,
  `map_day_shift` int(11) DEFAULT NULL,
  `online_lon` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `online_lat` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `online_zoom` int(11) DEFAULT NULL,
  `copyright` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `online_refresh` int(11) DEFAULT NULL,
  `monitoring_tail` int(11) DEFAULT NULL,
  `monitoring_filter_time` int(11) DEFAULT NULL,
  `monitoring_hide_not_conn` int(11) DEFAULT NULL,
  `monitoring_small_popup_fields` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `monitoring_popup_fields` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `monitoring_table_fields` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `settings_user_id_user_id` (`user_id`),
  CONSTRAINT `settings_user_id_user_id` FOREIGN KEY (`user_id`) REFERENCES `tbl_users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tbl_settings`
--

INSERT INTO `tbl_settings` VALUES (10,NULL,'58.0492',12,-1,'38.8269','58.0492',12,'Софтком',NULL,NULL,50,60,1,'','speed, parameters, time_elapsed, time_last, gsm_level, code','color, regnum, speed, parameters, time_elapsed, time_last, gsm_level');


