-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 26, 2026 at 12:34 PM
-- Server version: 8.0.45
-- PHP Version: 8.2.30

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

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

--
-- Table structure for table `cards`
--

DROP TABLE IF EXISTS `cards`;
CREATE TABLE `cards` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `card_number` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `card_holder` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiry_date` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cvv` varchar(4) COLLATE utf8mb4_unicode_ci NOT NULL,
  `card_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Visa',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `is_frozen` int NOT NULL DEFAULT '0',
  `intl_active` int NOT NULL DEFAULT '1',
  `nfc_active` int NOT NULL DEFAULT '1',
  `pin` varchar(4) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1234'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cards`
--

INSERT INTO `cards` (`id`, `user_id`, `card_number`, `card_holder`, `expiry_date`, `cvv`, `card_type`, `status`, `created_at`, `is_frozen`, `intl_active`, `nfc_active`, `pin`) VALUES
(16, 12, '4532534778433062', 'ADAMS WILIAMS', '05/30', '566', 'Visa', 'Active', '2026-05-26 07:43:19', 0, 1, 1, '1234'),
(17, 12, '5412563424028472', 'ADAMS WILIAMS', '05/30', '610', 'Mastercard', 'Active', '2026-05-26 10:17:13', 0, 1, 1, '1234');

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

--
-- Table structure for table `cheques`
--

DROP TABLE IF EXISTS `cheques`;
CREATE TABLE `cheques` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `front_image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `back_image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `fixed_deposits`
--

DROP TABLE IF EXISTS `fixed_deposits`;
CREATE TABLE `fixed_deposits` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `duration_months` int NOT NULL,
  `interest_rate` decimal(5,2) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `investments`
--

DROP TABLE IF EXISTS `investments`;
CREATE TABLE `investments` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `plan_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `daily_profit_rate` decimal(5,2) NOT NULL,
  `duration_days` int NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `loans`
--

DROP TABLE IF EXISTS `loans`;
CREATE TABLE `loans` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `duration_months` int NOT NULL,
  `interest_rate` decimal(5,2) NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `system_settings`
--

DROP TABLE IF EXISTS `system_settings`;
CREATE TABLE `system_settings` (
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `val` text COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `system_settings`
--

INSERT INTO `system_settings` (`name`, `val`) VALUES
('activation_required', '1'),
('admin_password', 'admin'),
('admin_username', 'admin'),
('bank_account_name', 'Skyboard Intel.'),
('bank_account_number', '1029384752'),
('bank_deposit_enabled', '1'),
('bank_name', 'Skyboard Bank'),
('bitcoin_deposit_enabled', '1'),
('bitcoin_wallet_address', 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh'),
('cot_required', '1'),
('frontend_email', 'support@skyboard.com'),
('frontend_phone', '+8801682648101'),
('imf_required', '1'),
('live_chat_enabled', '1'),
('live_chat_script', '<!-- Smartsupp Live Chat script -->\r\n<script type=\"text/javascript\">\r\nvar _smartsupp = _smartsupp || {};\r\n_smartsupp.key = \'610aec8c16f7b27d4862ecb3ffd49047fe8957ae\';\r\nwindow.smartsupp||(function(d) {\r\n  var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];\r\n  s=d.getElementsByTagName(\'script\')[0];c=d.createElement(\'script\');\r\n  c.type=\'text/javascript\';c.charset=\'utf-8\';c.async=true;\r\n  c.src=\'https://www.smartsuppchat.com/loader.js?\';s.parentNode.insertBefore(c,s);\r\n})(document);\r\n</script>\r\n<noscript>Powered by <a href=\"https://www.smartsupp.com\" target=\"_blank\">Smartsupp</a></noscript>'),
('pin_login_enabled', '1'),
('scroll_to_top_enabled', '0'),
('website_title', 'Skyboard Bank');

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

--
-- Table structure for table `transactions`
--

DROP TABLE IF EXISTS `transactions`;
CREATE TABLE `transactions` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `reference_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sender_receiver` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bank_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `account_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Pending',
  `proof_file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `note` text COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`id`, `user_id`, `type`, `category`, `amount`, `reference_id`, `sender_receiver`, `bank_name`, `account_number`, `status`, `proof_file`, `created_at`, `note`) VALUES
(60, 12, 'Credit', 'Services', 98000.00, 'skyb-84b6dcf8', 'Credit Balance', 'Skyboard System', NULL, 'Successful', NULL, '2026-05-26 07:48:07', NULL),
(61, 12, 'Debit', 'Transfer', 4500.00, 'skyb-56a99f86', 'Auto car repair', 'Bank of America', '2297302216', 'Successful', NULL, '2014-07-26 07:56:00', 'Charity donation'),
(62, 12, 'Debit', 'Transfer', 1000.00, 'skyb-d07679e8', 'External Beneficiary', 'Capital One', '1663689174', 'Pending', NULL, '2026-05-26 08:20:33', 'Flight Booking'),
(63, 12, 'Debit', 'Transfer', 9500.00, 'skyb-80d56733', 'External Beneficiary', 'Citigroup', '2182432249', 'Failed', NULL, '2026-05-26 08:24:38', 'House Rent'),
(64, 12, 'Debit', 'Transfer', 5600.00, 'skyb-1b7fa789', 'Hopital Fee', 'Scotiabank', '3182438247', 'Successful', NULL, '2023-07-20 08:34:00', 'School fee'),
(65, 12, 'Debit', 'Card', 10.00, 'skyb-7fd1a79d', 'New Card Issuance Fee', 'Skyboard Cards', NULL, 'Successful', NULL, '2026-05-26 10:17:13', NULL);

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

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

DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int NOT NULL,
  `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fname` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lname` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_number` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `balance` decimal(15,2) NOT NULL DEFAULT '0.00',
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Active',
  `kyc_status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Verified',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `profile_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'United States',
  `currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
  `gender` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Male',
  `account_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Savings',
  `branch` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Main Branch',
  `dob` date NOT NULL DEFAULT '1990-01-01',
  `login_pin` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '$2y$10$aB4HncS6upzNbyUsxp1mTeJ7nn5bM2GCBLRrYLab8aku9pGkmw0nO',
  `transaction_pin` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '$2y$10$godvoQ9qiXBoU/cijmRiauMSe3oYS2F3v53e1jlTAytPDo91xY28K',
  `cot_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `imf_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activation_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `username`, `email`, `phone`, `fname`, `lname`, `password`, `account_number`, `balance`, `status`, `kyc_status`, `created_at`, `profile_image`, `country`, `currency`, `gender`, `account_type`, `branch`, `dob`, `login_pin`, `transaction_pin`, `cot_code`, `imf_code`, `activation_code`) VALUES
(12, 'Adams', 'codedwebmsaters@gmail.com', '+10916146885', 'Adams', 'Wiliams', 'raziboy11', '250725603', 86890.00, 'Active', 'Verified', '2026-05-25 23:00:00', 'uploads/d5a52e29f6e34a07b9b753d4091a28a0.jpg', 'United States', 'USD', 'Male', 'Savings', 'New York Main Branch', '1982-06-08', '1992', '1992', '000000', '000000', '000000');

--
-- Indexes for dumped tables
--

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

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

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

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

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

--
-- Indexes for table `system_settings`
--
ALTER TABLE `system_settings`
  ADD PRIMARY KEY (`name`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `cards`
--
ALTER TABLE `cards`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `cheques`
--
ALTER TABLE `cheques`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `fixed_deposits`
--
ALTER TABLE `fixed_deposits`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `investments`
--
ALTER TABLE `investments`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `loans`
--
ALTER TABLE `loans`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- Constraints for dumped tables
--

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

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

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

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

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

--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
  ADD CONSTRAINT `transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
SET FOREIGN_KEY_CHECKS = 1;
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 */;
