-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.3.0.6589
-- --------------------------------------------------------



-- Dumping database structure for project_mrderr
CREATE DATABASE IF NOT EXISTS `project_mrderr` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `project_mrderr`;

-- Dumping structure for table project_mrderr.items
CREATE TABLE IF NOT EXISTS `items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `barcode` varchar(255) DEFAULT NULL,
  `item_name` varchar(255) NOT NULL,
  `dateandtime` datetime NOT NULL,
  `delivery_contact_person` varchar(255) NOT NULL,
  `amount` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `serial_nr` int(11) DEFAULT NULL,
  `barcode_manufacturer` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `items_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table project_mrderr.items: ~9 rows (approximately)
INSERT INTO `items` (`id`, `barcode`, `item_name`, `dateandtime`, `delivery_contact_person`, `amount`, `price`, `serial_nr`, `barcode_manufacturer`, `user_id`) VALUES
	(1, 'CE309953957EE', '', '2023-10-12 10:37:00', '', 360, 0.00, 0, '', NULL),
	(2, 'CE309953957EE', '', '2023-10-12 10:37:00', '', 360, 0.00, 0, '', NULL),
	(3, '582941184CFD', 'tests', '2023-10-04 09:00:00', 'Roberts', 360, 2.00, 22252, '25248284trt', NULL),
	(4, '582941184CFD', 'tests', '2023-10-04 09:00:00', 'Roberts', 360, 2.00, 22252, '25248284trt', NULL),
	(5, '  CE440525078EE', 'burka', '2023-10-04 09:17:00', 'Ervins', 0, 2.00, 8248198, '25248284trt', NULL),
	(6, '123', 'Nick Gus', '2023-10-17 09:31:00', 'Mariuss, Kristans', 2, 3.00, 123, '123', NULL),
	(7, '22061985', 'pen', '2023-10-25 08:52:00', 'Kristans', 12, 3.00, 123, '22061985M', 29),
	(8, '2206198511', 'pen_black', '2023-10-24 08:52:00', 'Kristans', 13, 4.00, 1232, '22061985M11', 29),
	(9, '  CE440525078EE', 'burka', '2023-10-25 09:07:00', 'Ervins', 1, 2.00, 8248198, '25248284trt', 29);

-- Dumping structure for table project_mrderr.login_attempts
CREATE TABLE IF NOT EXISTS `login_attempts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `login_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `status` enum('success','failure') NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `login_attempts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table project_mrderr.login_attempts: ~25 rows (approximately)
INSERT INTO `login_attempts` (`id`, `username`, `password`, `login_time`, `status`, `user_id`) VALUES
	(1, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:10:54', 'success', NULL),
	(2, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:22:56', 'success', NULL),
	(3, 'tests', '123', '2023-10-03 06:23:59', 'success', NULL),
	(4, 'tests', '123', '2023-10-03 06:25:56', 'success', NULL),
	(5, 'tests', '123', '2023-10-03 06:25:59', 'success', NULL),
	(6, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:30:42', 'success', NULL),
	(7, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:30:52', 'success', NULL),
	(8, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:30:55', 'success', NULL),
	(9, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:31:20', 'success', NULL),
	(10, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:31:34', 'success', NULL),
	(11, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:31:47', 'success', NULL),
	(12, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:31:50', 'success', NULL),
	(13, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:32:03', 'success', NULL),
	(14, 'Swim_Mario', 'Gustins2005', '2023-10-03 06:32:05', 'success', NULL),
	(15, 'robus', '1', '2023-10-17 06:14:40', 'success', NULL),
	(16, 'robus', '1', '2023-10-17 06:14:52', 'success', NULL),
	(17, 'robus', '1', '2023-10-17 06:16:26', 'success', NULL),
	(18, 'robus', '19', '2023-10-17 06:18:53', 'failure', NULL),
	(19, 'robus', '1', '2023-10-17 06:19:10', 'success', NULL),
	(20, 'rob123', '123', '2023-10-17 06:29:26', 'success', NULL),
	(21, 'rob123', '123', '2023-10-17 06:30:35', 'success', NULL),
	(22, 'Swim_Mario', 'Gustins2005', '2023-10-22 16:19:20', 'success', NULL),
	(24, 'root', '123', '2023-10-24 06:19:55', 'success', 29),
	(25, 'root', '123', '2023-10-24 06:42:18', 'success', 29),
	(26, 'root', '123', '2023-10-24 06:46:10', 'success', 29),
	(27, 'root', '123', '2023-10-25 05:28:36', 'success', 29),
	(28, 'root', '123', '2023-10-25 05:36:43', 'success', 29),
	(29, 'root', '123', '2023-10-25 05:40:31', 'success', 29);

-- Dumping structure for table project_mrderr.removed_items
CREATE TABLE IF NOT EXISTS `removed_items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `barcode` varchar(255) DEFAULT NULL,
  `item_name` varchar(255) DEFAULT NULL,
  `dateandtime` datetime DEFAULT NULL,
  `delivery_contact_person` varchar(255) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `serial_nr` varchar(255) DEFAULT NULL,
  `barcode_manufacturer` varchar(255) DEFAULT NULL,
  `total_price` decimal(10,2) DEFAULT NULL,
  `original_item_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `original_item_id` (`original_item_id`),
  CONSTRAINT `removed_items_ibfk_1` FOREIGN KEY (`original_item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table project_mrderr.removed_items: ~5 rows (approximately)
INSERT INTO `removed_items` (`id`, `barcode`, `item_name`, `dateandtime`, `delivery_contact_person`, `amount`, `price`, `serial_nr`, `barcode_manufacturer`, `total_price`, `original_item_id`) VALUES
	(1, '  CE440525078EE', 'burka', '2023-10-13 13:34:54', 'Ervins', 3, NULL, '8248198', '25248284trt', NULL, NULL),
	(2, '  CE440525078EE', 'burka', '2023-10-13 13:38:51', 'Ervins', 3, 2.00, '8248198', '25248284trt', 6.00, NULL),
	(3, '  CE440525078EE', 'burka', '2023-10-13 13:40:10', 'Ervins', 1, 2.00, '8248198', '25248284trt', 2.00, NULL),
	(4, '  CE440525078EE', 'burka', '2023-10-17 08:07:13', 'Ervins', 3, 2.00, '8248198', '25248284trt', 6.00, NULL),
	(5, '123', 'Nick Gus', '2023-10-17 08:31:58', 'Mariuss', 1, 2.00, '123', '123', 2.00, NULL),
	(6, '  CE440525078EE', 'burka', '2023-10-24 08:30:08', 'Ervins', 1, 2.00, '8248198', '25248284trt', 2.00, 5),
	(7, '  CE440525078EE', 'burka', '2023-10-25 08:05:10', 'Ervins', 9, 2.00, '8248198', '25248284trt', 18.00, 5);

-- Dumping structure for table project_mrderr.users
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `first_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `agree_terms` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- Dumping data for table project_mrderr.users: ~28 rows (approximately)
INSERT INTO `users` (`id`, `first_name`, `last_name`, `email`, `username`, `password`, `agree_terms`) VALUES
	(1, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'Swim_Mario', '$2y$10$7SNWNpbIf67du.yoa2xccushlRzzAMws3yEkMgD8d3a.LuFAjL/Ty', 1),
	(2, 'Ervins', 'J', 'xxallihueyxx@gmail.com', 'tests', '$2y$10$6bcZ2StTV1AGTRXypoR0A.0Tgf5AMtU1RtI.qFrcqwvNgerZldPoy', 1),
	(3, 'PAtriks', 'Ozols', 'xxallihueyxx@gmail.com', 'mariussgustins', '$2y$10$pS8d9ZRCloT0Kr.87EqeK.vlzsUaOgArvo4hdpyAkHbdvBu6likwu', 1),
	(4, '', 'P', 'xxallihueyxx@gmail.com', 'tests2', '$2y$10$frWX4XqRiZk3OOhiyZey1uPcVD6OEeUojX/MBllXLYPUn2K1yzTBO', 1),
	(5, '', 'G', 'mariuss.gustins@outlook.com', 'user', '$2y$10$.BsVTlkRefzneWpUHPJkC.BYfXCs8.R/gw5O1raZ3okcn.HnZtGwC', 1),
	(6, 'Kristians', 'G', 'mariuss.gustins@outlook.com', 'user', '$2y$10$iI3q7oJilRqATbEWj/C/b.U6Ikr67NCuE0iuB/sCQi75K6c3nh2oa', 1),
	(7, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'xd', '$2y$10$VoBRXbUxNWAX7equ51cll.wTrj8d5ZnMbSvu/YnwPQCbu1.W2K.t2', 1),
	(8, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'reg', '$2y$10$cWhDK5r.pwwE/lYK2ncybex7jq.r5iqE76Q53s4wPVciOtUH2SKFm', 1),
	(9, 'PAtriks', 'Ozols', 'xxallihueyxx@gmail.com', 'robus', '$2y$10$t72lR9fkV5vuWNvI7oRTpOo50LYGO1iz0kvF/T6azs6K.idFhpnem', 1),
	(10, 'Rob', 'Rob', 'rob@rob.com', 'rob123', '$2y$10$lpIzYGRJ00xeyh9JQa5YueN/EIPspoiSLe9uSVSDGy/SLmIzQtpje', 1),
	(11, 'KRit', 'gus', 'marii@gmail.com', 'marioo', '$2y$10$U.wbwYez.MfDzPe4QlYm5OMJ4I4j0tHyKZ04OuwMbpIV9q7vde2de', 1),
	(12, 'Meeee', 'Zeee', 'xxallihueyxx@gmail.com', 'marioo', '$2y$10$ZWqQY7O7d4RvtjyXctqljOfJU7FdTowTH9iCQ7sxI.32GP3YS/cKu', 1),
	(13, 'euuu', 'eee', 'mariuss.gustins@outlook.com', 'ass', '$2y$10$ACz7Pu53vGWE8IHEL/qWOO7xWe7rhbftK2k86IUuWgYw9Z/t7DE2G', 1),
	(14, 'dss', 'dsd', 'demijakristianagustina@gmail.com', 'zb', '$2y$10$5tE48LCwi0rFCBl1zOTRouKlSolcaqTMuHm6Wp.DtSss24ZUA/h16', 1),
	(15, 'dss', 'dsd', 'demijakristianagustina@gmail.com', 'zb', '$2y$10$mEm8cqFsY0rOQGFZQXCgjuXhNZvkScixPB1mKO.j300H1t3iYZfI2', 1),
	(16, 'dss', 'dsd', 'demijakristianagustina@gmail.com', 'zb', '$2y$10$wFl5RYc8T2allHyoqNkXQ.qcqwqMZLbVov8ChfGQDIuwHP4BQlP2W', 1),
	(17, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', '1', '$2y$10$Upu3K7KBOUJQla6nDJOiN.ePmdFUBZrAxPDmoQevipyUngI.Va3GC', 1),
	(18, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal', '$2y$10$sdgatPyNfAJU1CcYDpUO.eNvbWjaLyxNdAj0r3NcKRrfQY0kDCT9a', 1),
	(19, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal1', '$2y$10$M0mHAeTeWyoYgCaoRW9adey7dARKeBNUEz7e61McP6FSCgMQN6bxW', 1),
	(20, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal11', '$2y$10$F3zUhFaD.1jNRVINjA7WMOlvJt/85PZd5oiLQAhoASIx3IRFruL3q', 1),
	(21, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal11', '$2y$10$w/bWfbqPtXaqqmFAKr9VTedhr0Z6jjImOg7MlXXxsxMx2moh710Qm', 1),
	(22, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal111', '$2y$10$/Di.8jKYCEOVxv5BxZJXOejKsym9PPaDGsuYe.EPHPblAII.mPKYG', 1),
	(23, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal111', '$2y$10$DGBlCwbb95jORDmUo5Qq6uyPCv0.XSRiMgGROy610cy7xmnUxhsty', 1),
	(24, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal111', '$2y$10$QwvXF2fg54GU8.c/XVOXuOAzbVnjML8tIEo07Hsv7niVHLj0ki7ji', 1),
	(25, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal111', '$2y$10$RpRM.eCEUaFD1X0tpKHzV.RdBjuPB/5uvbruD2T55eA3PTf.XMCay', 1),
	(26, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal111', '$2y$10$ALMPM9ZvLvBsJBczwZLT8.2v.2eTSKa2SrlDNTk9gmj4O9d59ZqUi', 1),
	(27, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'atkal111', '$2y$10$zOK8yaVT.0J0YA2uECcsz.e96toSNS999otZOc8zkRtmaK8xLLPZS', 1),
	(28, 'Mariuss', 'Gustins', 'mariuss.gustins@outlook.com', 'realacijas', '$2y$10$bvaQMpAgp21GTUhjEnlA1unQ8MzKKrUbObSm2esqF8yavJ4DFaSdC', 1),
	(29, 'Kristians', 'Abolee', 'mariuss.gustins@outlook.com', 'root', '$2y$10$HUuzdWsnzmszdUG1/SfMDOGWorfwyLXEwWdtwgvpbqr0F.XsAWTD6', 1);

