-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 06, 2025 at 11:13 PM
-- Server version: 9.1.0
-- PHP Version: 8.3.14

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `mips`
--

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

--
-- Table structure for table `admin`
--
CREATE DATABASE mips;
use mips;

DROP TABLE IF EXISTS `admin`;
CREATE TABLE IF NOT EXISTS `admin` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `admin`
--

INSERT INTO `admin` (`id`, `username`, `password`) VALUES
(1, 'Admin', '$2y$10$ADf4/1ZvpaBdeZ5s7jcuyeQeQAetiktyifwuxfBi3tbi/p.TXmQuO');

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

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

DROP TABLE IF EXISTS `attendance`;
CREATE TABLE IF NOT EXISTS `attendance` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `checkin_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `participant_type` varchar(255) NOT NULL,
  `fullname` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_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');

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

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

DROP TABLE IF EXISTS `meal_deductions`;
CREATE TABLE IF NOT EXISTS `meal_deductions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` varchar(50) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `time` datetime DEFAULT NULL,
  `meal_type` enum('Lunch','Dinner') DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_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');

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

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

DROP TABLE IF EXISTS `promotional_materials`;
CREATE TABLE IF NOT EXISTS `promotional_materials` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `material_collected` varchar(255) NOT NULL DEFAULT '',
  `collection_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `status` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_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);

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

--
-- Table structure for table `sub_user`
--

DROP TABLE IF EXISTS `sub_user`;
CREATE TABLE IF NOT EXISTS `sub_user` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fullname` varchar(250) NOT NULL,
  `email` varchar(250) NOT NULL,
  `phone` varchar(50) NOT NULL,
  `gender` varchar(10) NOT NULL,
  `password` varchar(200) NOT NULL,
  `role` varchar(50) NOT NULL DEFAULT 'sub_admin',
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
  `id` int NOT NULL AUTO_INCREMENT,
  `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,
  `meals_allocated` int DEFAULT '0',
  `meals_remaining` int DEFAULT '0',
  `promotion_material` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_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);
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 */;
