-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 13, 2020 at 08:40 AM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.1.33 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; 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 utf8mb4 */; -- -- Database: `access_control` -- -- -------------------------------------------------------- -- -- Table structure for table `area` -- CREATE TABLE `area` ( `id` int(11) NOT NULL, `code` int(11) NOT NULL, `pid` int(11) NOT NULL DEFAULT 0, `name` varchar(100) NOT NULL, `description` text DEFAULT NULL, `created_at` int(11) NOT NULL DEFAULT 0, `modified_at` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `area` -- INSERT INTO `area` (`id`, `code`, `pid`, `name`, `description`, `created_at`, `modified_at`) VALUES (1, 1, 0, 'AreaName', NULL, 0, 0), (4, 2, 1, 'Khu vực 2', '123', 1602227006, 1602227006), (5, 3, 2, 'Khu vực 1', '', 1602227907, 1602227907); -- -------------------------------------------------------- -- -- Table structure for table `auth_assignment` -- CREATE TABLE `auth_assignment` ( `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_assignment` -- INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES ('administrator', '1', 1569900053); -- -------------------------------------------------------- -- -- Table structure for table `auth_item` -- CREATE TABLE `auth_item` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `type` smallint(6) NOT NULL, `description` text COLLATE utf8_unicode_ci DEFAULT NULL, `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `data` blob DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `auth_item` -- INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES ('administrator', 1, 'Administrator', NULL, NULL, 1535011160, 1535011160); -- -------------------------------------------------------- -- -- Table structure for table `auth_item_child` -- CREATE TABLE `auth_item_child` ( `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `auth_rule` -- CREATE TABLE `auth_rule` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `data` blob DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `department` -- CREATE TABLE `department` ( `id` int(11) NOT NULL, `code` int(11) NOT NULL, `pid` int(11) NOT NULL, `name` varchar(100) NOT NULL, `created_at` int(11) NOT NULL, `modified_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `department` -- INSERT INTO `department` (`id`, `code`, `pid`, `name`, `created_at`, `modified_at`) VALUES (1, 1, 0, 'CompanyName', 0, 0), (2, 2, 1, 'Phòng CNTT', 1602151686, 1602151686), (3, 3, 2, 'Phòng AI', 1602151780, 1602151780), (4, 4, 2, 'Phòng OP', 1602151789, 1602151828); -- -------------------------------------------------------- -- -- Table structure for table `device` -- CREATE TABLE `device` ( `id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `serial` varchar(50) DEFAULT NULL, `ip_address` varchar(20) DEFAULT NULL, `subnet_mask` varchar(20) DEFAULT NULL, `gateway` varchar(20) DEFAULT NULL, `mac_address` varchar(20) DEFAULT NULL, `status` int(11) NOT NULL, `type` varchar(20) DEFAULT NULL, `version` varchar(100) DEFAULT NULL, `area_id` int(11) NOT NULL, `created_at` int(11) NOT NULL DEFAULT 0, `modified_at` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `device` -- INSERT INTO `device` (`id`, `name`, `serial`, `ip_address`, `subnet_mask`, `gateway`, `mac_address`, `status`, `type`, `version`, `area_id`, `created_at`, `modified_at`) VALUES (4, 'Thiết bị 1', 'AJNV193560605', '192.168.1.200', '255.255.252.0', '192.168.0.1', '00:17:61:C9:6B:A4', 1, 'C3-200', 'AC Ver 4.3.4 Jan 5 2019', 1, 1602563228, 1602563228); -- -------------------------------------------------------- -- -- Table structure for table `door` -- CREATE TABLE `door` ( `id` int(11) NOT NULL, `device_id` int(11) NOT NULL, `name` varchar(100) NOT NULL, `code` int(11) NOT NULL, `created_at` int(11) NOT NULL DEFAULT 0, `modified_at` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `door` -- INSERT INTO `door` (`id`, `device_id`, `name`, `code`, `created_at`, `modified_at`) VALUES (7, 4, 'Thiết bị 1-1', 1, 1602563228, 1602563228), (8, 4, 'Thiết bị 1-2', 2, 1602563228, 1602563228); -- -------------------------------------------------------- -- -- Table structure for table `staff` -- CREATE TABLE `staff` ( `id` int(11) NOT NULL, `code` int(11) NOT NULL, `name` varchar(100) NOT NULL, `card_number` int(11) NOT NULL DEFAULT 0, `department_id` int(11) NOT NULL DEFAULT 0, `gender` varchar(10) NOT NULL, `birthday` int(11) NOT NULL DEFAULT 0, `email` varchar(100) DEFAULT NULL, `phone` varchar(20) DEFAULT NULL, `date_in` int(11) NOT NULL DEFAULT 0, `address` text DEFAULT NULL, `created_at` int(11) NOT NULL DEFAULT 0, `modified_at` int(11) NOT NULL DEFAULT 0, `card_register_time` int(11) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `staff` -- INSERT INTO `staff` (`id`, `code`, `name`, `card_number`, `department_id`, `gender`, `birthday`, `email`, `phone`, `date_in`, `address`, `created_at`, `modified_at`, `card_register_time`) VALUES (1, 1, 'Phạm Đức Đông', 1001, 1, 'M', 691231867, '', '', 1602319867, '', 1602319867, 1602319867, 1602326177), (2, 2, 'Ngô Văn Dũng', 1002, 1, 'M', 608719882, '', '', 1602319882, '', 1602319882, 1602319882, 1602326183), (3, 3, 'Hoàng Hồng Sơn', 0, 1, 'M', 622544932, NULL, NULL, 1602320932, NULL, 1602320932, 1602320932, 1602319867), (4, 4, 'Lê Hải Châu', 0, 1, 'M', 1602323106, '', '', 1602323106, '', 1602323106, 1602323106, 1602325273), (5, 5, 'Nguyễn Hữu Hoàng Sơn', 0, 1, 'M', 1602324895, '', '', 1602324895, '', 1602324895, 1602324895, 1602324895); -- -------------------------------------------------------- -- -- Table structure for table `system_logs` -- CREATE TABLE `system_logs` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `time` int(11) NOT NULL, `action` varchar(10) NOT NULL, `description` text NOT NULL, `type` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `system_logs` -- INSERT INTO `system_logs` (`id`, `user_id`, `time`, `action`, `description`, `type`) VALUES (1, 1, 1602151686, 'insert', 'Thêm mới phòng ban: Phòng CNTT', 'department'), (2, 1, 1602151780, 'insert', 'Thêm mới phòng ban: Phòng AI', 'department'), (3, 1, 1602151789, 'insert', 'Thêm mới phòng ban: Phòng OP', 'department'), (4, 1, 1602151794, 'update', 'Chỉnh sửa phòng ban: Phòng OP', 'department'), (5, 1, 1602151810, 'insert', 'Thêm mới phòng ban: gffdg', 'department'), (6, 1, 1602151813, 'delete', 'Xóa phòng ban: gffdg', 'department'), (7, 1, 1602151828, 'update', 'Chỉnh sửa phòng ban: Phòng OP', 'department'), (8, 1, 1602225712, 'insert', 'Thêm mới khu vực: Khu vực 2', 'area'), (9, 1, 1602226072, 'update', 'Chỉnh sửa khu vực: Khu vực 1', 'area'), (10, 1, 1602226081, 'update', 'Chỉnh sửa khu vực: Khu vực 1', 'area'), (11, 1, 1602226091, 'update', 'Chỉnh sửa khu vực: Khu vực 1', 'area'), (12, 1, 1602226793, 'delete', 'Xóa khu vực: Khu vực 1', 'area'), (13, 1, 1602226793, 'delete', 'Xóa khu vực: Khu vực 2', 'area'), (14, 1, 1602227006, 'insert', 'Thêm mới khu vực: Khu vực 2', 'area'), (15, 1, 1602227907, 'insert', 'Thêm mới khu vực: Khu vực 1', 'area'), (16, 1, 1602316450, 'insert', 'Thêm mới nhân viên: Phạm Đức Đông', 'staff'), (17, 1, 1602317528, 'update', 'Chỉnh sửa nhân viên: Phạm Đức Đông', 'staff'), (18, 1, 1602318491, 'update', 'Chỉnh sửa nhân viên: Phạm Đức Đông', 'staff'), (19, 1, 1602318858, 'insert', 'Thêm mới nhân viên: Ngô Văn Dũng', 'staff'), (20, 1, 1602318893, 'delete', 'Xóa 2 nhân viên', 'staff'), (21, 1, 1602319867, 'insert', 'Thêm mới nhân viên: Phạm Đức Đông', 'staff'), (22, 1, 1602319882, 'insert', 'Thêm mới nhân viên: Ngô Văn Dũng', 'staff'), (23, 1, 1602320932, 'import', 'Nhập dữ liệu: 1 nhân viên mới', 'staff'), (24, 1, 1602323106, 'insert', 'Thêm mới nhân viên: Lê Hải Châu', 'staff'), (25, 1, 1602324895, 'insert', 'Thêm mới nhân viên: Nguyễn Hữu Hoàng Sơn', 'staff'), (26, 1, 1602324933, 'register', 'Đăng ký thẻ mới: Lê Hải Châu', 'card-register'), (27, 1, 1602325239, 'update', 'Thay đổi đăng ký thẻ: Lê Hải Châu', 'card-register'), (28, 1, 1602325273, 'update', 'Thay đổi đăng ký thẻ: Lê Hải Châu', 'card-register'), (29, 1, 1602325978, 'delete', 'Xóa đăng ký thẻ: 4 nhân viên', 'card-register'), (30, 1, 1602326177, 'register', 'Đăng ký thẻ mới: Phạm Đức Đông', 'card-register'), (31, 1, 1602326183, 'register', 'Đăng ký thẻ mới: Ngô Văn Dũng', 'card-register'), (32, 1, 1602478486, 'insert', 'Thêm mới thiết bị: Thiết bị 1', 'device'), (33, 1, 1602484460, 'insert', 'Thêm mới thiết bị: Thiết bị 2', 'device'), (34, 1, 1602487344, 'insert', 'Thêm mới thiết bị: Thiết bị 1', 'device'), (35, 1, 1602487352, 'insert', 'Thêm mới thiết bị: Thiết bị 2', 'device'), (36, 1, 1602489265, 'update', 'Chỉnh sửa thiết bị: Thiết bị 2232', 'device'), (37, 1, 1602489271, 'update', 'Chỉnh sửa thiết bị: Thiết bị 2', 'device'), (38, 1, 1602489594, 'delete', 'Xóa thiết bị: Thiết bị 1', 'device'), (39, 1, 1602489594, 'delete', 'Xóa thiết bị: Thiết bị 2', 'device'), (40, 1, 1602489718, 'insert', 'Thêm mới thiết bị: Thiết bị 1', 'device'), (41, 1, 1602489725, 'insert', 'Thêm mới thiết bị: Thiết bị 2', 'device'), (42, 1, 1602490553, 'delete', 'Xóa thiết bị: Thiết bị 1', 'device'), (43, 1, 1602490553, 'delete', 'Xóa thiết bị: Thiết bị 2', 'device'), (44, 1, 1602490559, 'insert', 'Thêm mới thiết bị: Thiết bị 1', 'device'), (45, 1, 1602490566, 'insert', 'Thêm mới thiết bị: Thiết bị 2', 'device'), (46, 1, 1602493420, 'delete', 'Xóa thiết bị: Thiết bị 1', 'device'), (47, 1, 1602493420, 'delete', 'Xóa thiết bị: Thiết bị 2', 'device'), (48, 1, 1602561201, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (49, 1, 1602561202, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (50, 1, 1602561313, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (51, 1, 1602561314, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (52, 1, 1602561316, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (53, 1, 1602561418, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (54, 1, 1602561420, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (55, 1, 1602561422, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (56, 1, 1602561547, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (57, 1, 1602561548, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (58, 1, 1602561549, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (59, 1, 1602561666, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (60, 1, 1602561667, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (61, 1, 1602561669, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (62, 1, 1602562223, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (63, 1, 1602562225, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (64, 1, 1602562226, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (65, 1, 1602562546, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (66, 1, 1602562547, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (67, 1, 1602562548, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (68, 1, 1602562578, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (69, 1, 1602562580, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (70, 1, 1602562581, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (71, 1, 1602562649, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (72, 1, 1602562650, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (73, 1, 1602562653, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (74, 1, 1602562727, 'insert', 'Thêm mới thiết bị: 192.168.1.200', 'device'), (75, 1, 1602562729, 'insert', 'Thêm mới thiết bị: 192.168.1.202', 'device'), (76, 1, 1602562730, 'insert', 'Thêm mới thiết bị: 192.168.1.203', 'device'), (77, 1, 1602562860, 'delete', 'Xóa thiết bị: 192.168.1.200', 'device'), (78, 1, 1602562860, 'delete', 'Xóa thiết bị: 192.168.1.202', 'device'), (79, 1, 1602562860, 'delete', 'Xóa thiết bị: 192.168.1.203', 'device'), (80, 1, 1602563228, 'insert', 'Thêm mới thiết bị: Thiết bị 1', 'device'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `first_name` varchar(250) NOT NULL, `last_name` varchar(250) DEFAULT NULL, `phone_number` varchar(30) DEFAULT NULL, `username` varchar(250) NOT NULL, `email` varchar(500) DEFAULT NULL, `password` varchar(250) NOT NULL, `authKey` varchar(250) DEFAULT NULL, `password_reset_token` varchar(250) DEFAULT NULL, `user_image` varchar(500) DEFAULT NULL, `quota` int(11) NOT NULL DEFAULT 2 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `first_name`, `last_name`, `phone_number`, `username`, `email`, `password`, `authKey`, `password_reset_token`, `user_image`, `quota`) VALUES (1, 'Administrator', '', '12313', 'admin', 'admin@bitraffic.vn', 'ceea23519f6f86ad67e9f798bf8002cb', NULL, NULL, '', 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `area` -- ALTER TABLE `area` ADD PRIMARY KEY (`id`); -- -- Indexes for table `auth_assignment` -- ALTER TABLE `auth_assignment` ADD PRIMARY KEY (`item_name`,`user_id`), ADD KEY `auth_assignment_user_id_idx` (`user_id`); -- -- Indexes for table `auth_item` -- ALTER TABLE `auth_item` ADD PRIMARY KEY (`name`), ADD KEY `rule_name` (`rule_name`), ADD KEY `idx-auth_item-type` (`type`); -- -- Indexes for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD PRIMARY KEY (`parent`,`child`), ADD KEY `child` (`child`); -- -- Indexes for table `auth_rule` -- ALTER TABLE `auth_rule` ADD PRIMARY KEY (`name`); -- -- Indexes for table `department` -- ALTER TABLE `department` ADD PRIMARY KEY (`id`); -- -- Indexes for table `device` -- ALTER TABLE `device` ADD PRIMARY KEY (`id`); -- -- Indexes for table `door` -- ALTER TABLE `door` ADD PRIMARY KEY (`id`); -- -- Indexes for table `staff` -- ALTER TABLE `staff` ADD PRIMARY KEY (`id`); -- -- Indexes for table `system_logs` -- ALTER TABLE `system_logs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username` (`username`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `area` -- ALTER TABLE `area` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `department` -- ALTER TABLE `department` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `device` -- ALTER TABLE `device` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `door` -- ALTER TABLE `door` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `staff` -- ALTER TABLE `staff` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `system_logs` -- ALTER TABLE `system_logs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=81; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=202; -- -- Constraints for dumped tables -- -- -- Constraints for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!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 */;