-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 09, 2026 at 01:05 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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

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

--
-- Table structure for table `certificates`
--

CREATE TABLE `certificates` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `registration_no` varchar(50) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `gender` varchar(20) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `place_of_birth` varchar(255) DEFAULT NULL,
  `date_of_registration` date DEFAULT NULL,
  `mother_name` varchar(100) DEFAULT NULL,
  `father_name` varchar(100) DEFAULT NULL,
  `present_address` text DEFAULT NULL,
  `permanent_address` text DEFAULT NULL,
  `date_of_issue` datetime DEFAULT NULL,
  `token` varchar(255) DEFAULT NULL,
  `status` enum('active','deleted') DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `certificates`
--

INSERT INTO `certificates` (`id`, `user_id`, `registration_no`, `name`, `gender`, `dob`, `place_of_birth`, `date_of_registration`, `mother_name`, `father_name`, `present_address`, `permanent_address`, `date_of_issue`, `token`, `status`, `created_at`) VALUES
(2, 2, 'MCDOLIR-1622-5353795', 'LALMATI DEVI', 'Female / महिला', '2026-02-09', 'NORTH DELHI', '2026-02-09', 'LILA DEVI', 'LALAN PRASAD', 'NORTH DELHI', 'VILL - MAJHAULI POST SUHAI SAHPUR PS - BANIAPUR\r\nBIHAR- 841403', '2026-02-09 15:21:25', 'a3573a44d05b62421aeda5898b564851', 'active', '2026-02-09 09:53:53');

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

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

CREATE TABLE `settings` (
  `id` int(11) NOT NULL,
  `website_name` varchar(100) DEFAULT 'Certificate System',
  `website_logo` varchar(255) DEFAULT NULL,
  `certificate_charge` decimal(10,2) DEFAULT 50.00,
  `upi_id` varchar(100) DEFAULT NULL,
  `upi_name` varchar(100) DEFAULT NULL,
  `payment_instructions` text DEFAULT NULL,
  `template_path` varchar(255) DEFAULT NULL,
  `qr_verification_enabled` tinyint(1) DEFAULT 1,
  `registration_enabled` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `settings` (`id`, `website_name`, `website_logo`, `certificate_charge`, `upi_id`, `upi_name`, `payment_instructions`, `template_path`, `qr_verification_enabled`, `registration_enabled`) VALUES
(1, 'Certificate System', NULL, 50.00, 'onlinein72@okicici', 'admin', '', 'uploads/templates/certificate_template.jpg', 1, 1);

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) DEFAULT NULL,
  `role` enum('admin','user') DEFAULT 'user',
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `balance` decimal(10,2) DEFAULT 0.00,
  `status` enum('active','blocked') DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `username`, `role`, `name`, `email`, `phone`, `password`, `balance`, `status`, `created_at`) VALUES
(1, 'admin', 'admin', 'System Admin', 'admin@gmail.com', '990909090', '$2y$10$1fjiZU32rVFOkzQc1kZAk.dP8K9AYEIN6fVJ/Y9qrFVGB144F10OO', 199898.00, 'active', '2026-02-09 07:29:13'),
(2, 'demo', 'user', 'demo', 'demo@gmail.com', '998989889', '$2y$10$ZVWAzSJgJRBou8ESir1YW.XqJlOLafNopMkGLPdrVz8YUR4/4NeyK', 2050.00, 'active', '2026-02-09 07:34:10');

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

--
-- Table structure for table `wallet_requests`
--

CREATE TABLE `wallet_requests` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL,
  `utr_number` varchar(100) DEFAULT NULL,
  `screenshot_path` varchar(255) DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `request_date` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `wallet_requests`
--

INSERT INTO `wallet_requests` (`id`, `user_id`, `amount`, `utr_number`, `screenshot_path`, `status`, `request_date`) VALUES
(1, 2, 100.00, '654655565', 'uploads/payments/6989b1a6a92a2.jpg', 'approved', '2026-02-09 10:06:30'),
(2, 2, 100.00, '654655565', 'uploads/payments/6989b1b917f5f.jpg', 'approved', '2026-02-09 10:06:49'),
(3, 2, 100.00, '654655565', 'uploads/payments/6989b1c0ad037.jpg', 'rejected', '2026-02-09 10:06:56');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `certificates`
--
ALTER TABLE `certificates`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `registration_no` (`registration_no`),
  ADD UNIQUE KEY `token` (`token`),
  ADD KEY `user_id` (`user_id`);

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `certificates`
--
ALTER TABLE `certificates`
  ADD CONSTRAINT `certificates_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `wallet_requests`
--
ALTER TABLE `wallet_requests`
  ADD CONSTRAINT `wallet_requests_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
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 */;
