-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `mips`
--

-- --------------------------------------------------------

--
-- Table structure for table `activity_log`
--

CREATE TABLE `activity_log` (
  `id` int(11) NOT NULL,
  `action` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `user_type` varchar(50) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `activity_log`
--

INSERT INTO `activity_log` (`id`, `action`, `description`, `user_type`, `created_at`) VALUES
(1, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 10:38:49'),
(2, 'Participant Registered', 'Registered Test Malawi (Service Provider)', 'admin', '2026-07-24 10:52:17'),
(3, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 11:15:24'),
(4, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 11:49:43'),
(5, 'Participant Registered', 'Registered Wonder (Staff)', 'admin', '2026-07-24 12:11:36'),
(6, 'Participant Registered', 'Registered Unathi Nkhonde (Sponsor)', 'admin', '2026-07-24 12:37:10'),
(7, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 12:40:52'),
(8, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 12:58:50'),
(9, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 14:32:15'),
(10, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 14:47:29'),
(11, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 15:01:44'),
(12, 'Admin Login', 'Admin logged in', 'admin', '2026-07-24 15:11:35'),
(13, 'Attendance Check-in', 'Unathi Nkhonde checked in (Sponsor)', 'admin', '2026-07-24 15:14:59'),
(14, 'Meal Deducted', 'Dinner deducted for Unathi Nkhonde', 'admin', '2026-07-24 15:16:08'),
(15, 'Promo Collected', 'Unathi Nkhonde collected: Shirt, Cap, Bag, Mug', 'admin', '2026-07-24 15:16:34'),
(16, 'Participant Registered', 'Registered Ethan Nkhonde (Deligates)', 'admin', '2026-07-24 15:19:45'),
(17, 'Admin Login', 'Admin logged in', 'admin', '2026-07-26 23:49:23'),
(18, 'Admin Login', 'Admin logged in', 'admin', '2026-07-27 00:10:34');

-- --------------------------------------------------------

--
-- Table structure for table `attendance`
--

CREATE TABLE `attendance` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `checkin_time` datetime DEFAULT current_timestamp(),
  `participant_type` varchar(255) NOT NULL,
  `fullname` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `attendance`
--

INSERT INTO `attendance` (`id`, `user_id`, `checkin_time`, `participant_type`, `fullname`) VALUES
(31, 28, '2025-08-07 01:08:58', 'Deligates', 'Dean Magombo'),
(32, 33, '2026-07-24 15:14:59', 'Sponsor', 'Unathi Nkhonde');

-- --------------------------------------------------------

--
-- Table structure for table `meal_deductions`
--

CREATE TABLE `meal_deductions` (
  `id` int(11) NOT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `meal_type` enum('Lunch','Dinner') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `meal_deductions`
--

INSERT INTO `meal_deductions` (`id`, `user_id`, `name`, `time`, `meal_type`) VALUES
(32, '28', 'Dean Magombo', '2025-08-07 01:09:11', 'Lunch'),
(33, '33', 'Unathi Nkhonde', '2026-07-24 15:16:08', 'Dinner');

-- --------------------------------------------------------

--
-- Table structure for table `promotional_materials`
--

CREATE TABLE `promotional_materials` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `material_collected` varchar(255) NOT NULL DEFAULT '',
  `collection_time` datetime DEFAULT current_timestamp(),
  `status` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `promotional_materials`
--

INSERT INTO `promotional_materials` (`id`, `user_id`, `material_collected`, `collection_time`, `status`) VALUES
(10, 28, 'Shirt, Cap, Bag, Mug', '2025-08-07 01:09:40', 1),
(11, 33, 'Shirt, Cap, Bag, Mug', '2026-07-24 15:16:34', 1);

-- --------------------------------------------------------

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `participant_type` varchar(100) NOT NULL,
  `fullname` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `phone` varchar(50) NOT NULL,
  `payment_status` enum('Paid','Not Paid') NOT NULL,
  `commitment_status` enum('Approved') DEFAULT NULL,
  `hotel` varchar(50) NOT NULL,
  `institution` varchar(150) NOT NULL,
  `membership_type` varchar(100) NOT NULL,
  `qr_code` text DEFAULT NULL,
  `meals_allocated` int(11) DEFAULT 0,
  `meals_remaining` int(11) DEFAULT 0,
  `promotion_material` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `participant_type`, `fullname`, `email`, `phone`, `payment_status`, `commitment_status`, `hotel`, `institution`, `membership_type`, `qr_code`, `meals_allocated`, `meals_remaining`, `promotion_material`) VALUES
(28, 'Deligates', 'Dean Magombo', 'magombodean84@gmail.com', '+265883573037', 'Paid', NULL, 'Club Makokola', 'Game', 'Full Member', 'qrcodes/user_28.png', 6, 6, NULL),
(29, 'Sponsor', 'Albert Kamanga', 'gnkhonde@nls.mw', '0992844066', 'Paid', NULL, 'Meals Only', 'Zeeya', 'Corporate', '../qrcodes/user_29.png', 3, 3, NULL),
(30, 'Service Provider', 'Test Malawi', 'gnkhonde@nls.mw', '0992844066', 'Paid', NULL, 'Participation_only', 'NLS', 'Non-Member', '../qrcodes/user_30.png', 3, 3, NULL),
(31, 'Service Provider', 'Test Malawi', 'gnkhonde@nls.mw', '0992844066', 'Paid', NULL, 'Participation_only', 'NLS', 'Non-Member', 'qrcodes/user_31.png', 3, 3, NULL),
(32, 'Staff', 'Wonder', 'wpenembe@gmail.com', '0995284042', 'Paid', NULL, 'Nkopola', 'Wanpex', 'Non-Member', 'qrcodes/user_32.png', 3, 3, NULL),
(33, 'Sponsor', 'Unathi Nkhonde', 'gabrielnkhonde@gmail.com', '0881122746', 'Paid', NULL, 'Sunbird', 'Una', 'Corporate', 'qrcodes/user_33.png', 3, 3, NULL),
(34, 'Deligates', 'Ethan Nkhonde', 'ethan@gmail.com', '0992844066', 'Paid', NULL, 'Club Makokola', 'NLS', 'Student', 'qrcodes/user_34.png', 3, 3, NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_log`
--
ALTER TABLE `activity_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `created_at` (`created_at`);

--
-- Indexes for table `attendance`
--
ALTER TABLE `attendance`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `meal_deductions`
--
ALTER TABLE `meal_deductions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `promotional_materials`
--
ALTER TABLE `promotional_materials`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `activity_log`
--
ALTER TABLE `activity_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `attendance`
--
ALTER TABLE `attendance`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `meal_deductions`
--
ALTER TABLE `meal_deductions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `promotional_materials`
--
ALTER TABLE `promotional_materials`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;
COMMIT;

