-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 30, 2026 at 10:42 PM
-- Server version: 10.11.18-MariaDB-cll-lve
-- PHP Version: 8.4.22

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: `ntsazwmq_bmyaaa`
--

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

--
-- Table structure for table `events`
--

CREATE TABLE `events` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `event_date` date NOT NULL,
  `event_time` time DEFAULT NULL,
  `venue` varchar(255) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `max_attendees` int(11) DEFAULT NULL,
  `current_attendees` int(11) DEFAULT 0,
  `status` enum('upcoming','ongoing','completed','cancelled') DEFAULT 'upcoming',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `event_registrations`
--

CREATE TABLE `event_registrations` (
  `id` int(11) NOT NULL,
  `event_id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `registration_date` datetime DEFAULT current_timestamp(),
  `status` enum('confirmed','cancelled') DEFAULT 'confirmed'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `members`
--

CREATE TABLE `members` (
  `id` int(11) NOT NULL,
  `membership_number` varchar(50) NOT NULL,
  `fullname` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `gender` enum('male','female','other') DEFAULT NULL,
  `address` text DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `state` varchar(100) DEFAULT NULL,
  `country` varchar(100) DEFAULT 'India',
  `pincode` varchar(20) DEFAULT NULL,
  `occupation` varchar(100) DEFAULT NULL,
  `profile_photo` varchar(255) DEFAULT 'default.jpg',
  `membership_type_id` int(11) DEFAULT NULL,
  `join_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `status` enum('active','expired','suspended') DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `members`
--

INSERT INTO `members` (`id`, `membership_number`, `fullname`, `email`, `password`, `phone`, `dob`, `gender`, `address`, `city`, `state`, `country`, `pincode`, `occupation`, `profile_photo`, `membership_type_id`, `join_date`, `expiry_date`, `status`, `created_at`, `updated_at`) VALUES
(4, 'BMYA/2026/CBE130', 'Anup Sinha', 'anupsinha.amugo@gmail.com', '565c0b71bb80e1ea34eeb1220af276d2', '7086299453', '1983-08-02', 'male', 'Dullabcherra', 'Guwahati', 'Assam', 'India', '788736', 'Private', '1780413100_6a1ef2acbe15a.jpg', 1, '2026-06-02', '2027-06-02', 'active', '2026-06-02 15:11:40', '2026-06-02 15:11:40'),
(5, 'BMYA/2026/924D51', 'Kiron Kumar Singh', 'kiron85.rip@gmail.com', 'f91e15dbec69fc40f81f0876e7009648', '7993091705', '1990-06-11', 'male', 'New Bhakatpur', 'Silchar', 'Assam', 'India', '788005', 'Bancassurance', '1781215017_6a2b2f2924d78.jpg', 1, '2026-06-12', '2027-06-12', 'active', '2026-06-11 21:56:57', '2026-06-11 21:56:57'),
(6, 'BMYA/2026/613F67', 'VICTOR SINHA', 'victorsinha3080@gmail.com', 'b50bed0059f2fa25d4b1ef75a45ad9e8', '8787657561', '2003-04-03', 'male', 'Anjuli Barabazar', 'Shillong', 'Meghalaya', 'India', '793002', '12 pass', '1781629276_6a31815c132ed.jpg', 1, '2026-06-16', '2027-06-16', 'active', '2026-06-16 16:50:46', '2026-06-16 17:01:16'),
(7, 'BMYA/2026/5AE3DB', 'Sourav Sinha', 'souravsinha9089@gmail.com', '231f009004ef61cee94304a5b0f4f052', '8132089869', '1996-12-02', 'male', 'Kanchanbari, H4-02', 'Kumarghat', 'Tripura', 'India', '799288', '', 'default.jpg', 1, '2026-06-24', '2027-06-24', 'active', '2026-06-23 18:36:21', '2026-06-23 18:36:21'),
(8, 'BMYA/2026/0BCD23', 'Ajit Sinha', 'ajit@mail.com', '4b85bba57c6c51ad7a4970b92a0cd1ae', '758968569', '1986-02-05', 'male', 'Fatak Bazar, Silchar', 'Silchar', 'Assam', 'India', '788112', 'Ex Army', '1782411872_6a3d7260bcd47.png', 1, '2026-06-25', '2027-06-25', 'active', '2026-06-25 18:24:32', '2026-06-25 18:24:32'),
(9, 'BMYA/2026/4B1E53', 'Aryan Sinha', 'aryan@mail.com', '4b85bba57c6c51ad7a4970b92a0cd1ae', '785698658', '1994-02-09', 'male', 'Fatak Bazar, Silchar', 'Silchar', 'Assam', 'India', '788112', 'Ex Army', '1782412052_6a3d7314b1e75.png', 1, '2026-06-25', '2027-06-25', 'active', '2026-06-25 18:27:32', '2026-06-25 18:27:32'),
(10, 'BMYA/2026/A43BE0', 'PRABIN KUMAR SINHA', 'prabinkr86@gmail.com', 'd339494832d9ca020c68174436a1d342', '9954321112', '1986-04-02', 'male', 'Vill & P.O- Bhubaneswar Nagar, Sewti Part- III, P. Kalain, District- Cachar', 'Silchar', 'Assam', 'India', '788817', 'Govt. Servant', '1783758458_6a51fe7a43bfa.jpg', 2, '2026-07-11', '2029-07-11', 'active', '2026-07-11 08:27:38', '2026-07-11 08:30:49'),
(11, 'BMYA/2026/D8C1BB', 'Bikranta Sinha', 'bikrantasinha123@gmail.com', '6e6264737db7f099e42ebfa2dd5298c0', '6009651482', '1996-03-02', 'male', 'Kanchanchhara Manipuri para \r\nAnd Kanchanbari', 'Kumarghat', 'Tripura', 'India', '799266', 'Private School Teacher', '1785262174_6a68f05e8d4a6.jpg', 2, '2026-07-28', NULL, 'active', '2026-07-28 18:03:41', '2026-07-28 18:09:34');

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

--
-- Table structure for table `membership_types`
--

CREATE TABLE `membership_types` (
  `id` int(11) NOT NULL,
  `type` varchar(100) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `duration_months` int(11) DEFAULT 12,
  `description` text DEFAULT NULL,
  `features` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `membership_types`
--

INSERT INTO `membership_types` (`id`, `type`, `amount`, `duration_months`, `description`, `features`, `created_at`, `updated_at`) VALUES
(1, 'Free Member', 0.00, 12, 'General membership', 'Limited benefits', '2026-05-28 12:25:56', '2026-06-02 15:08:45'),
(2, 'Premium Member', 200.00, 0, 'Lifetime membership', 'All benefits', '2026-05-28 12:25:56', '2026-06-02 15:09:21');

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

--
-- Table structure for table `renewals`
--

CREATE TABLE `renewals` (
  `id` int(11) NOT NULL,
  `member_id` int(11) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(50) DEFAULT 'online',
  `transaction_id` varchar(255) DEFAULT NULL,
  `renewal_date` date NOT NULL,
  `expiry_date` date NOT NULL,
  `status` enum('pending','completed','failed') DEFAULT 'completed',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `renewals`
--

INSERT INTO `renewals` (`id`, `member_id`, `amount`, `payment_method`, `transaction_id`, `renewal_date`, `expiry_date`, `status`, `created_at`) VALUES
(2, 10, 200.00, 'online', NULL, '2026-07-11', '2027-07-11', 'completed', '2026-07-11 08:29:06'),
(3, 10, 200.00, 'online', NULL, '2026-07-11', '2028-07-11', 'completed', '2026-07-11 08:29:15'),
(4, 10, 200.00, 'online', NULL, '2026-07-11', '2029-07-11', 'completed', '2026-07-11 08:30:49');

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`id`, `setting_key`, `setting_value`, `created_at`, `updated_at`) VALUES
(1, 'system_name', 'BISHNUPRIYA MANIPURI YOUTH ASSOCIATION', '2026-05-28 12:25:56', '2026-06-01 19:34:24'),
(2, 'system_email', 'info@bmyouth.org', '2026-05-28 12:25:56', '2026-05-28 12:25:56'),
(5, 'system_phone', '+91 1234567890', '2026-06-01 19:34:24', '2026-06-01 19:34:24'),
(6, 'system_address', 'Manipur, India', '2026-06-01 19:34:24', '2026-06-01 19:34:24'),
(7, 'currency_symbol', '₹', '2026-06-01 19:34:24', '2026-06-01 19:34:24'),
(8, 'currency_code', 'INR', '2026-06-01 19:34:24', '2026-06-01 19:34:24'),
(9, 'footer_text', '© Bishnupriya Manipuri Youth Association', '2026-06-01 19:34:24', '2026-06-01 19:34:24'),
(10, 'logo', '1780342464_6a1ddec02934d.png', '2026-06-01 19:34:24', '2026-06-01 19:34:24'),
(11, 'favicon', '1780342464_6a1ddec029fe7.png', '2026-06-01 19:34:24', '2026-06-01 19:34:24');

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('admin','member') DEFAULT 'member',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `email`, `password`, `role`, `created_at`, `updated_at`) VALUES
(4, 'anupsinha.amugo@gmail.com', '565c0b71bb80e1ea34eeb1220af276d2', 'admin', '2026-06-02 15:11:40', '2026-06-02 15:12:08'),
(5, 'kiron85.rip@gmail.com', 'f91e15dbec69fc40f81f0876e7009648', 'member', '2026-06-11 21:56:57', '2026-06-11 21:56:57'),
(6, 'victorsinha3080@gmail.com', 'b50bed0059f2fa25d4b1ef75a45ad9e8', 'member', '2026-06-16 16:50:46', '2026-06-16 16:50:46'),
(7, 'souravsinha9089@gmail.com', '231f009004ef61cee94304a5b0f4f052', 'member', '2026-06-23 18:36:21', '2026-06-23 18:36:21'),
(8, 'ajit@mail.com', '4b85bba57c6c51ad7a4970b92a0cd1ae', 'member', '2026-06-25 18:24:32', '2026-06-25 18:24:32'),
(9, 'aryan@mail.com', '4b85bba57c6c51ad7a4970b92a0cd1ae', 'member', '2026-06-25 18:27:32', '2026-06-25 18:27:32'),
(10, 'prabinkr86@gmail.com', 'd339494832d9ca020c68174436a1d342', 'member', '2026-07-11 08:27:38', '2026-07-11 08:27:38'),
(11, 'bikrantasinha123@gmail.com', '6e6264737db7f099e42ebfa2dd5298c0', 'member', '2026-07-28 18:03:41', '2026-07-28 18:03:41');

--
-- Indexes for dumped tables
--

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

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

--
-- Indexes for table `members`
--
ALTER TABLE `members`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_membership_number` (`membership_number`),
  ADD UNIQUE KEY `idx_email` (`email`),
  ADD KEY `membership_type_id` (`membership_type_id`);

--
-- Indexes for table `membership_types`
--
ALTER TABLE `membership_types`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_type` (`type`);

--
-- Indexes for table `renewals`
--
ALTER TABLE `renewals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_member_id` (`member_id`),
  ADD KEY `idx_renewal_date` (`renewal_date`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_setting_key` (`setting_key`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_email` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `events`
--
ALTER TABLE `events`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `event_registrations`
--
ALTER TABLE `event_registrations`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

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

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

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  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=12;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `members`
--
ALTER TABLE `members`
  ADD CONSTRAINT `members_ibfk_1` FOREIGN KEY (`membership_type_id`) REFERENCES `membership_types` (`id`) ON DELETE SET 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 */;
