-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2026 at 09:28 AM
-- Server version: 10.4.24-MariaDB
-- PHP Version: 8.1.6

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

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

--
-- Table structure for table `balance`
--

CREATE TABLE `balance` (
  `BalanceID` int(11) NOT NULL,
  `Mid` int(11) NOT NULL,
  `Amount` decimal(10,2) NOT NULL DEFAULT 0.00,
  `TransactionUUID` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `complain`
--

CREATE TABLE `complain` (
  `complain_id` int(11) NOT NULL,
  `complain` varchar(20) DEFAULT NULL,
  `Mid` int(11) DEFAULT NULL,
  `cdate` varchar(20) DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `contact`
--

CREATE TABLE `contact` (
  `contact_id` int(11) NOT NULL,
  `Mid` int(11) DEFAULT NULL,
  `message` varchar(200) DEFAULT NULL,
  `cdate` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `loan`
--

CREATE TABLE `loan` (
  `Lid` int(11) NOT NULL,
  `loanamt` int(11) DEFAULT NULL,
  `Mid` int(11) NOT NULL,
  `loandate` varchar(20) DEFAULT NULL,
  `loanreturndate` varchar(20) DEFAULT NULL,
  `loan_status` varchar(20) DEFAULT NULL,
  `loanlpurpose` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `loan_amount`
--

CREATE TABLE `loan_amount` (
  `LoanID` int(11) NOT NULL,
  `LAmount` decimal(10,2) NOT NULL,
  `LDate` date NOT NULL,
  `Mid` int(11) NOT NULL,
  `LoanStatus` enum('Pending','Not_Paid','Paid') NOT NULL DEFAULT 'Pending',
  `ReturnDate` date DEFAULT NULL,
  `LoanReason` text DEFAULT NULL,
  `Rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `Time` int(11) NOT NULL DEFAULT 0,
  `TotalAmount` decimal(10,2) DEFAULT 0.00,
  `LoanDate` date NOT NULL DEFAULT curdate()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

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

CREATE TABLE `members` (
  `Mid` int(11) NOT NULL,
  `MembersName` varchar(50) DEFAULT NULL,
  `Email` varchar(50) DEFAULT NULL,
  `PhoneNo` varchar(16) DEFAULT NULL,
  `Address` varchar(50) DEFAULT NULL,
  `OTP` varchar(50) DEFAULT NULL,
  `PassKey` varchar(100) DEFAULT NULL,
  `MPid` int(11) DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL,
  `image` varchar(80) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

INSERT INTO `members` (`Mid`, `MembersName`, `Email`, `PhoneNo`, `Address`, `OTP`, `PassKey`, `MPid`, `status`, `image`) VALUES
(96, 'Admin', 'admin@gmail.com', '1234567989', 'Newroad', NULL, '$2y$10$xe/8f0bZyYpt6s0iVtExLu0yVA0FgstPlzy1Bq/JJIvrTtg7ZqRgC', 1, 'verify', 'images/6845286c02bd7_Untitled design.png');

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

--
-- Table structure for table `notification`
--

CREATE TABLE `notification` (
  `nid` int(11) NOT NULL,
  `notification` varchar(200) DEFAULT NULL,
  `MPid` int(11) DEFAULT NULL,
  `date` varchar(20) DEFAULT NULL,
  `img` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `position`
--

CREATE TABLE `position` (
  `Pid` int(11) NOT NULL,
  `Position` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `position`
--

INSERT INTO `position` (`Pid`, `Position`) VALUES
(1, 'Admin'),
(2, 'permanmentmember');

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

--
-- Table structure for table `saving`
--

CREATE TABLE `saving` (
  `SavingID` int(11) NOT NULL,
  `Mid` int(11) NOT NULL,
  `Amount` decimal(10,2) NOT NULL,
  `SavingDate` date NOT NULL DEFAULT curdate(),
  `status` varchar(20) DEFAULT 'Pending',
  `TransactionUUID` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `balance`
--
ALTER TABLE `balance`
  ADD PRIMARY KEY (`BalanceID`),
  ADD KEY `Mid` (`Mid`),
  ADD KEY `TransactionUUID` (`TransactionUUID`);

--
-- Indexes for table `complain`
--
ALTER TABLE `complain`
  ADD PRIMARY KEY (`complain_id`),
  ADD KEY `complain_ibfk_1` (`Mid`);

--
-- Indexes for table `contact`
--
ALTER TABLE `contact`
  ADD PRIMARY KEY (`contact_id`),
  ADD KEY `contact_ibfk_1` (`Mid`);

--
-- Indexes for table `loan`
--
ALTER TABLE `loan`
  ADD PRIMARY KEY (`Lid`),
  ADD KEY `loan_ibfk_1` (`Mid`);

--
-- Indexes for table `loan_amount`
--
ALTER TABLE `loan_amount`
  ADD PRIMARY KEY (`LoanID`),
  ADD KEY `loan_amount_ibfk_1` (`Mid`);

--
-- Indexes for table `members`
--
ALTER TABLE `members`
  ADD PRIMARY KEY (`Mid`),
  ADD KEY `members_ibfk_1` (`MPid`);
ALTER TABLE `members` ADD FULLTEXT KEY `MembersName` (`MembersName`,`Email`,`Address`,`PhoneNo`,`status`);
ALTER TABLE `members` ADD FULLTEXT KEY `MembersName_2` (`MembersName`,`Email`,`Address`,`PhoneNo`,`status`);

--
-- Indexes for table `notification`
--
ALTER TABLE `notification`
  ADD PRIMARY KEY (`nid`),
  ADD KEY `notification_ibfk_1` (`MPid`);

--
-- Indexes for table `position`
--
ALTER TABLE `position`
  ADD PRIMARY KEY (`Pid`);
ALTER TABLE `position` ADD FULLTEXT KEY `Position` (`Position`);

--
-- Indexes for table `saving`
--
ALTER TABLE `saving`
  ADD PRIMARY KEY (`SavingID`),
  ADD UNIQUE KEY `TransactionUUID` (`TransactionUUID`),
  ADD KEY `saving_ibfk_1` (`Mid`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `balance`
--
ALTER TABLE `balance`
  MODIFY `BalanceID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65;

--
-- AUTO_INCREMENT for table `complain`
--
ALTER TABLE `complain`
  MODIFY `complain_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `contact`
--
ALTER TABLE `contact`
  MODIFY `contact_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `loan`
--
ALTER TABLE `loan`
  MODIFY `Lid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `loan_amount`
--
ALTER TABLE `loan_amount`
  MODIFY `LoanID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=257;

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

--
-- AUTO_INCREMENT for table `notification`
--
ALTER TABLE `notification`
  MODIFY `nid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- AUTO_INCREMENT for table `position`
--
ALTER TABLE `position`
  MODIFY `Pid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `saving`
--
ALTER TABLE `saving`
  MODIFY `SavingID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `balance`
--
ALTER TABLE `balance`
  ADD CONSTRAINT `balance_ibfk_1` FOREIGN KEY (`Mid`) REFERENCES `members` (`Mid`) ON DELETE CASCADE,
  ADD CONSTRAINT `balance_ibfk_2` FOREIGN KEY (`TransactionUUID`) REFERENCES `saving` (`TransactionUUID`);

--
-- Constraints for table `complain`
--
ALTER TABLE `complain`
  ADD CONSTRAINT `complain_ibfk_1` FOREIGN KEY (`Mid`) REFERENCES `members` (`Mid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contact`
--
ALTER TABLE `contact`
  ADD CONSTRAINT `contact_ibfk_1` FOREIGN KEY (`Mid`) REFERENCES `members` (`Mid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `loan`
--
ALTER TABLE `loan`
  ADD CONSTRAINT `loan_ibfk_1` FOREIGN KEY (`Mid`) REFERENCES `members` (`Mid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `loan_amount`
--
ALTER TABLE `loan_amount`
  ADD CONSTRAINT `loan_amount_ibfk_1` FOREIGN KEY (`Mid`) REFERENCES `members` (`Mid`) ON DELETE CASCADE;

--
-- Constraints for table `members`
--
ALTER TABLE `members`
  ADD CONSTRAINT `members_ibfk_1` FOREIGN KEY (`MPid`) REFERENCES `position` (`Pid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `notification`
--
ALTER TABLE `notification`
  ADD CONSTRAINT `notification_ibfk_1` FOREIGN KEY (`MPid`) REFERENCES `position` (`Pid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `saving`
--
ALTER TABLE `saving`
  ADD CONSTRAINT `saving_ibfk_1` FOREIGN KEY (`Mid`) REFERENCES `members` (`Mid`) 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 */;
