-- Create admin table if it doesn't exist
CREATE TABLE IF NOT EXISTS `admin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `device_id` varchar(100) NOT NULL,
  `key` varchar(50) NOT NULL,
  `last_login` datetime DEFAULT NULL,
  `status` enum('on','off') NOT NULL DEFAULT 'on',
  `app_using_time` int(11) DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `device_id` (`device_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Insert 5 dummy admin records
INSERT INTO `admin` (`name`, `device_id`, `key`, `last_login`, `status`, `app_using_time`) VALUES
('Admin One', 'DEVICE123456789', 'admin123', '2023-06-15 10:30:00', 'on', 1200),
('Admin Two', 'DEVICE987654321', 'admin456', '2023-06-14 15:45:00', 'on', 980),
('Admin Three', 'DEVICE555555555', 'admin789', '2023-06-13 08:20:00', 'on', 2500),
('Admin Four', 'DEVICE111111111', 'admin444', '2023-06-10 12:10:00', 'off', 300),
('Admin Five', 'DEVICE999999999', 'admin555', '2023-06-12 09:55:00', 'on', 1850); 