-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 04, 2026 at 03:48 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: `liongate`
--

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

--
-- Table structure for table `admin`
--

CREATE TABLE `admin` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `full_name` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `admin` (`id`, `username`, `password`, `full_name`, `email`, `created_at`) VALUES
(1, 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Administrator', 'admin@example.com', '2026-03-09 10:42:49');

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

--
-- Table structure for table `admins`
--

CREATE TABLE `admins` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `email` varchar(100) NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `admins`
--

INSERT INTO `admins` (`id`, `username`, `password`, `email`, `created_at`) VALUES
(1, 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'admin@liongatecapitals.com', '2026-03-07 20:56:56');

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

--
-- Table structure for table `admin_activity_log`
--

CREATE TABLE `admin_activity_log` (
  `id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `action` varchar(100) NOT NULL,
  `details` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `admin_logs`
--

CREATE TABLE `admin_logs` (
  `id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `action` varchar(200) NOT NULL,
  `target_user_id` int(11) DEFAULT NULL,
  `details` text DEFAULT NULL,
  `ip_address` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `admin_notices`
--

CREATE TABLE `admin_notices` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `action_url` varchar(500) DEFAULT NULL,
  `status` enum('active','inactive') DEFAULT 'active',
  `show_to_new_users` tinyint(1) DEFAULT 0,
  `expires_at` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `created_by` int(10) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `admin_settings`
--

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

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

--
-- Table structure for table `admin_transactions`
--

CREATE TABLE `admin_transactions` (
  `id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `admin_transactions`
--

INSERT INTO `admin_transactions` (`id`, `admin_id`, `user_id`, `type`, `amount`, `description`, `created_at`) VALUES
(1, 0, 13, 'profit', 300.00, 'Admin credit via profit', '2026-03-08 20:48:46'),
(2, 0, 13, 'profit', 300.00, 'Admin credit via profit', '2026-03-08 20:49:56'),
(3, 0, 13, 'bonus', 1000.00, 'Admin credit via bonus', '2026-03-08 20:51:13'),
(4, 0, 13, 'referral', 2000.00, 'Admin credit via referral', '2026-03-08 20:56:40'),
(5, 0, 13, 'referral', 2000.00, 'Admin credit via referral', '2026-03-08 21:07:05'),
(6, 0, 12, 'profit', 5000.00, 'Admin credit via profit', '2026-03-09 08:19:04'),
(7, 0, 13, 'referral', 600.00, 'Admin credit via referral', '2026-03-09 12:02:14'),
(8, 0, 13, 'deposit_approval', 700.00, 'Approved deposit #3', '2026-03-09 12:11:46'),
(9, 0, 12, 'deposit_approval', 600.00, 'Approved deposit #5 - Funded $600.00', '2026-03-09 12:37:00'),
(10, 0, 12, 'deposit_approval', 600.00, 'Approved deposit #5 - Funded $600.00', '2026-03-09 12:38:32'),
(11, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #6 - Funded $1,000.00', '2026-03-09 12:49:06'),
(12, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #14 - Funded $1,000.00', '2026-03-09 13:00:03'),
(13, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #13 - Funded $1,000.00', '2026-03-09 13:00:48'),
(14, 0, 13, 'deposit_approval', 500.00, 'Approved deposit #15 - Funded $500.00', '2026-03-09 13:07:05'),
(15, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #12 - Funded $1,000.00', '2026-03-09 13:33:03'),
(16, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #11 - Funded $1,000.00', '2026-03-09 14:01:53'),
(17, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #10 - Funded $1,000.00', '2026-03-09 15:19:40'),
(18, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #8 - Funded $1,000.00', '2026-03-09 15:19:45'),
(19, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #9 - Funded $1,000.00', '2026-03-09 15:19:50'),
(20, 0, 13, 'deposit_approval', 1000.00, 'Approved deposit #7 - Funded $1,000.00', '2026-03-09 15:19:53'),
(21, 1, 13, 'profit', 300.00, 'Admin credited $300.00 as profit', '2026-03-09 18:50:23'),
(22, 1, 13, 'deposit', 500.00, 'Admin credited $500.00 as deposit', '2026-03-09 18:51:22'),
(23, 1, 13, 'profit', 400.00, 'Admin credited $400.00 as profit', '2026-03-09 18:51:49'),
(24, 1, 13, 'bonus', 500.00, 'Admin credited $500.00 as bonus', '2026-03-09 18:52:17'),
(25, 1, 13, 'bonus', 500.00, 'Admin credited $500.00 as bonus', '2026-03-09 20:08:45'),
(26, 1, 13, 'profit', 60000.00, 'Admin credited $60,000.00 as profit', '2026-03-09 20:09:01'),
(27, 1, 13, 'profit', 1000.00, 'Admin credited $1,000.00 as profit', '2026-03-09 20:13:43'),
(28, 1, 13, 'bonus', 3000.00, 'Admin credited $3,000.00 as bonus', '2026-03-09 20:26:32'),
(29, 1, 13, 'profit', 60000.00, 'Admin credited $60,000.00 as profit', '2026-03-09 20:27:16'),
(30, 1, 12, 'deposit', 400.00, 'Admin credited $400.00 as deposit', '2026-03-09 20:28:56'),
(31, 1, 12, 'deposit', 400.00, 'Admin credited $400.00 as deposit', '2026-03-09 20:55:53'),
(32, 1, 12, 'deposit', 400.00, 'Admin credited $400.00 as deposit', '2026-03-09 20:55:57'),
(33, 1, 14, 'deposit', 50000.00, 'Admin credited $50,000.00 as deposit', '2026-03-10 12:47:34'),
(34, 1, 15, 'deposit', 5000.00, 'Admin credited $5,000.00 as deposit', '2026-03-10 13:59:06'),
(35, 1, 15, 'deposit', 1000.00, 'Admin credited $1,000.00 as deposit', '2026-03-10 14:02:38'),
(36, 1, 15, 'deposit', 1000.00, 'Admin credited $1,000.00 as deposit', '2026-03-10 14:06:08'),
(37, 1, 12, 'loan_approval', 7000.00, 'Approved loan #5 - $7,000.00 for wilsons (Local Purchase Orders Finance)', '2026-03-10 14:15:47'),
(38, 1, 15, 'loan_approval', 6000.00, 'Approved loan #6 - $6,000.00 for jeyy (Retail TOD)', '2026-03-10 14:17:21'),
(39, 1, 15, 'loan_approval', 6000.00, 'Approved loan #7 - $6,000.00 for jeyy (Retail TOD)', '2026-03-10 14:20:47'),
(40, 1, 15, 'deposit_approval', 500.00, 'Approved deposit #24 - Funded $500.00', '2026-03-10 17:58:18'),
(41, 1, 15, 'deposit_approval', 700.00, 'Approved deposit #25 - Funded $700.00', '2026-03-10 21:31:23'),
(42, 1, 15, 'deposit', 800.00, 'Admin credited $800.00 as deposit', '2026-03-11 11:10:55'),
(43, 1, 15, 'profit', 600.00, 'Admin credited $600.00 as profit', '2026-03-11 12:24:06'),
(44, 1, 15, 'profit', 600.00, 'Admin credited $600.00 as profit', '2026-03-11 12:28:24'),
(45, 1, 15, 'profit', 500.00, 'Admin credited $500.00 as profit', '2026-03-11 12:31:54'),
(46, 1, 15, 'profit', 500.00, 'Admin credited $500.00 as profit', '2026-03-11 12:34:24'),
(47, 1, 15, 'loan_approval', 600000.00, 'Approved loan #8 - Credited $600,000.00 to jeyy (Salary loans)', '2026-03-11 12:48:05'),
(48, 1, 15, 'bonus', 600.00, 'Admin credited $600.00 as bonus', '2026-03-11 14:11:30'),
(49, 1, 14, 'deposit_approval', 3000.00, 'Approved deposit #27 - Funded $3,000.00', '2026-03-11 14:32:14'),
(50, 1, 16, 'user_creation', 600.00, 'Created new user: ed with initial balance $600.00', '2026-03-11 17:04:37'),
(51, 1, 15, 'loan_approval', 600000.00, 'Approved loan #9 - Credited $600,000.00 to jeyy (Salary loans)', '2026-03-11 17:06:58'),
(52, 1, 17, 'user_creation', 2000.00, 'Created new user: sx with initial balance $2,000.00', '2026-03-11 17:33:41'),
(53, 1, 15, 'withdrawal_approval', 5000.00, 'Approved withdrawal #7 - Deducted $5,000.00 from jeyy', '2026-03-11 17:38:41'),
(54, 1, 12, 'withdrawal_approval', 200.00, 'Approved withdrawal #5 - Deducted $200.00 from wilsons', '2026-03-11 17:39:40'),
(55, 1, 12, 'withdrawal_approval', 5000.00, 'Approved withdrawal #8 - Deducted $5,000.00 from wilsons', '2026-03-11 17:39:46'),
(56, 1, 12, 'loan_approval', 6000.00, 'Approved loan #10 - Credited $6,000.00 to wilsons (Operational Vehicles)', '2026-03-11 17:42:47'),
(57, 1, 14, 'withdrawal_approval', 800.00, 'Approved withdrawal #9 - Deducted $800.00 from reward', '2026-03-11 18:27:56'),
(58, 1, 13, 'withdrawal_approval', 19500.00, 'Approved withdrawal #6 - Deducted $19,500.00 from jetus', '2026-03-11 21:02:02'),
(59, 1, 12, 'loan_approval', 6000.00, 'Approved loan #11 - Credited $6,000.00 to wilsons (Operational Vehicles)', '2026-03-12 09:30:23'),
(60, 1, 18, 'deposit', 50000.00, 'Admin credited $50,000.00 as deposit', '2026-03-12 20:40:01'),
(61, 1, 18, 'withdrawal_approval', 10000.00, 'Approved withdrawal #10 - Deducted $10,000.00 from janies', '2026-03-12 20:52:04'),
(62, 1, 18, 'withdrawal_approval', 6000.00, 'Approved withdrawal #13 - Deducted $6,000.00 from janies', '2026-03-14 14:57:20'),
(63, 1, 18, 'withdrawal_approval', 400.00, 'Approved withdrawal #12 - Deducted $400.00 from janies', '2026-03-14 14:57:24'),
(64, 1, 18, 'withdrawal_approval', 30000.00, 'Approved withdrawal #11 - Deducted $30,000.00 from janies', '2026-03-14 14:57:38');

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

--
-- Table structure for table `balance_logs`
--

CREATE TABLE `balance_logs` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` varchar(50) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `action` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `bonuses`
--

CREATE TABLE `bonuses` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `type` enum('referral','signup','promotion','loyalty') DEFAULT 'referral',
  `description` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bonuses`
--

INSERT INTO `bonuses` (`id`, `user_id`, `amount`, `type`, `description`, `created_at`) VALUES
(1, 13, 1000.00, 'referral', 'Admin bonus credit', '2026-03-08 20:51:13'),
(2, 13, 2000.00, 'referral', 'Referral commission (Admin)', '2026-03-08 20:56:40'),
(3, 13, 2000.00, 'referral', 'Referral commission (Admin)', '2026-03-08 21:07:05'),
(4, 13, 600.00, 'referral', 'Referral commission (Admin)', '2026-03-09 12:02:14'),
(5, 13, 500.00, 'referral', 'Admin bonus credit', '2026-03-09 15:13:19'),
(6, 13, 500.00, 'referral', 'Admin bonus credit', '2026-03-09 18:52:17'),
(7, 13, 500.00, 'referral', 'Admin bonus credit', '2026-03-09 20:08:45'),
(8, 13, 3000.00, 'referral', 'Admin bonus credit', '2026-03-09 20:26:32'),
(9, 15, 600.00, 'referral', 'Admin bonus credit', '2026-03-11 14:11:30');

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

--
-- Table structure for table `copy_experts`
--

CREATE TABLE `copy_experts` (
  `id` int(11) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `tag` varchar(100) DEFAULT 'Professional Trader',
  `description` text DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `risk_level` enum('low','medium','high') DEFAULT 'medium',
  `trading_style` enum('crypto','forex','stocks','mixed') DEFAULT 'mixed',
  `monthly_return` decimal(10,2) DEFAULT 0.00,
  `total_return` decimal(10,2) DEFAULT 0.00,
  `win_rate` int(3) DEFAULT 50,
  `total_trades` int(11) DEFAULT 0,
  `followers` int(11) DEFAULT 0,
  `min_investment` decimal(15,2) DEFAULT 100.00,
  `status` enum('active','inactive','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;

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

--
-- Table structure for table `deposits`
--

CREATE TABLE `deposits` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(255) NOT NULL,
  `proof` varchar(255) NOT NULL,
  `status` varchar(50) DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `approved_at` datetime DEFAULT NULL,
  `approved_by` varchar(50) DEFAULT NULL,
  `hold_reason` text DEFAULT NULL,
  `rejected_reason` text DEFAULT NULL,
  `method` varchar(50) DEFAULT 'bitcoin',
  `rejection_reason` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `deposits`
--

INSERT INTO `deposits` (`id`, `user_id`, `amount`, `payment_method`, `proof`, `status`, `created_at`, `updated_at`, `approved_at`, `approved_by`, `hold_reason`, `rejected_reason`, `method`, `rejection_reason`) VALUES
(1, 9, 66.00, 'Bitcoin', 'uploads/deposit_69aaf27eaabd7.jpg', 'approved', '2026-03-06 15:27:58', '2026-03-07 04:25:09', NULL, NULL, NULL, NULL, 'bitcoin', NULL),
(2, 11, 500.00, 'Bitcoin', 'uploads/deposit_69aba9977d4f4.png', 'approved', '2026-03-07 04:29:11', '2026-03-07 04:31:48', NULL, NULL, NULL, NULL, 'bitcoin', NULL),
(3, 13, 700.00, 'Bitcoin', 'uploads/deposit_69ac8cf0d03bc.jpg', 'completed', '2026-03-07 20:39:12', '2026-03-09 12:11:46', '2026-03-09 13:11:46', '0', NULL, NULL, 'bitcoin', NULL),
(4, 13, 500.00, 'Bitcoin', 'uploads/deposit_69ade508d79eb.jpg', 'completed', '2026-03-08 21:07:20', '2026-03-09 10:51:15', '2026-03-09 11:51:15', '0', NULL, NULL, 'bitcoin', NULL),
(5, 12, 600.00, 'Bitcoin', 'uploads/deposit_69ae87e7d3370.jpg', 'completed', '2026-03-09 08:42:15', '2026-03-09 12:38:31', '2026-03-09 13:38:31', '0', NULL, NULL, 'ethereum', NULL),
(6, 13, 1000.00, 'bitcoin', 'uploads/deposit_69aec1891f417.jpg', 'completed', '2026-03-09 12:48:09', '2026-03-09 12:49:06', '2026-03-09 13:49:06', '0', NULL, NULL, 'bitcoin', NULL),
(7, 13, 1000.00, 'bitcoin', 'uploads/deposit_69aec2e9136f2.png', 'completed', '2026-03-09 12:54:01', '2026-03-09 15:19:53', '2026-03-09 16:19:53', '0', NULL, NULL, 'bitcoin', NULL),
(8, 13, 1000.00, 'bitcoin', 'uploads/deposit_69aec30209fa1.png', 'completed', '2026-03-09 12:54:26', '2026-03-09 15:19:45', '2026-03-09 16:19:45', '0', NULL, NULL, 'bitcoin', NULL),
(9, 13, 1000.00, 'ethereum', 'uploads/deposit_69aec313570d3.jpg', 'completed', '2026-03-09 12:54:43', '2026-03-09 15:19:50', '2026-03-09 16:19:50', '0', NULL, NULL, 'bitcoin', NULL),
(10, 13, 1000.00, 'ethereum', 'uploads/deposit_69aec329c629d.jpg', 'completed', '2026-03-09 12:55:05', '2026-03-09 15:19:40', '2026-03-09 16:19:40', '0', NULL, NULL, 'bitcoin', NULL),
(11, 13, 1000.00, 'ethereum', 'uploads/deposit_69aec33fa5ae7.png', 'completed', '2026-03-09 12:55:27', '2026-03-09 14:01:53', '2026-03-09 15:01:53', '0', NULL, NULL, 'bitcoin', NULL),
(12, 13, 1000.00, 'ethereum', 'uploads/deposit_69aec38126ec7.png', 'completed', '2026-03-09 12:56:33', '2026-03-09 13:33:03', '2026-03-09 14:33:03', '0', NULL, NULL, 'bitcoin', NULL),
(13, 13, 1000.00, 'ethereum', 'uploads/deposit_69aec3910357f.jpg', 'completed', '2026-03-09 12:56:49', '2026-03-09 13:00:48', '2026-03-09 14:00:48', '0', NULL, NULL, 'bitcoin', NULL),
(14, 13, 1000.00, 'ethereum', 'uploads/deposit_69aec42d21cae.jpg', 'completed', '2026-03-09 12:59:25', '2026-03-09 13:00:03', '2026-03-09 14:00:03', '0', NULL, NULL, 'bitcoin', NULL),
(15, 13, 500.00, 'ethereum', 'uploads/deposit_69aec5dfac0db.jpg', 'completed', '2026-03-09 13:06:39', '2026-03-09 13:07:05', '2026-03-09 14:07:05', '0', NULL, NULL, 'bitcoin', NULL),
(16, 13, 500.00, '', '', 'completed', '2026-03-09 18:51:22', '2026-03-09 18:51:22', NULL, NULL, NULL, NULL, 'admin', NULL),
(17, 12, 400.00, '', '', 'completed', '2026-03-09 20:28:56', '2026-03-09 20:28:56', NULL, NULL, NULL, NULL, 'admin', NULL),
(18, 12, 400.00, '', '', 'completed', '2026-03-09 20:55:53', '2026-03-09 20:55:53', NULL, NULL, NULL, NULL, 'admin', NULL),
(19, 12, 400.00, '', '', 'completed', '2026-03-09 20:55:57', '2026-03-09 20:55:57', NULL, NULL, NULL, NULL, 'admin', NULL),
(20, 14, 50000.00, '', '', 'completed', '2026-03-10 12:47:34', '2026-03-10 12:47:34', NULL, NULL, NULL, NULL, 'admin', NULL),
(21, 15, 5000.00, '', '', 'completed', '2026-03-10 13:59:06', '2026-03-10 13:59:06', NULL, NULL, NULL, NULL, 'admin', NULL),
(22, 15, 1000.00, '', '', 'completed', '2026-03-10 14:02:38', '2026-03-10 14:02:38', NULL, NULL, NULL, NULL, 'admin', NULL),
(23, 15, 1000.00, '', '', 'completed', '2026-03-10 14:06:08', '2026-03-10 14:06:08', NULL, NULL, NULL, NULL, 'admin', NULL),
(24, 15, 500.00, 'jerry btc bank', 'uploads/deposits/deposit_15_69b05ba6938126.63238275.jpg', 'completed', '2026-03-10 17:57:58', '2026-03-10 17:58:17', '2026-03-10 18:58:17', '1', NULL, NULL, 'bitcoin', NULL),
(25, 15, 700.00, 'bank transfer', 'uploads/deposits/deposit_15_69b08d8d631349.85986684.jpg', 'completed', '2026-03-10 21:30:53', '2026-03-10 21:31:23', '2026-03-10 22:31:23', '1', NULL, NULL, 'bitcoin', NULL),
(26, 15, 800.00, '', '', 'completed', '2026-03-11 11:10:55', '2026-03-11 11:10:55', NULL, NULL, NULL, NULL, 'admin', NULL),
(27, 14, 3000.00, 'bank transfer', 'uploads/deposits/deposit_14_69b17cca86bad4.77921758.jpg', 'completed', '2026-03-11 14:31:38', '2026-03-11 14:32:14', '2026-03-11 15:32:14', '1', NULL, NULL, 'bitcoin', NULL),
(28, 18, 50000.00, 'admin', '', 'completed', '2026-03-12 20:40:01', '2026-03-12 20:40:01', NULL, NULL, NULL, NULL, 'bitcoin', NULL);

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

--
-- Table structure for table `deposit_addresses`
--

CREATE TABLE `deposit_addresses` (
  `id` int(11) NOT NULL,
  `method` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `address` text NOT NULL,
  `network` varchar(100) DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `color` varchar(20) DEFAULT NULL,
  `min_amount` decimal(15,2) DEFAULT 50.00,
  `is_active` tinyint(1) DEFAULT 1,
  `sort_order` int(11) DEFAULT 0,
  `confirmations` varchar(100) DEFAULT '3 confirmations required',
  `qr_prefix` varchar(50) DEFAULT '',
  `note` text DEFAULT NULL,
  `bank_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`bank_details`)),
  `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_general_ci;

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

--
-- Table structure for table `deposit_details`
--

CREATE TABLE `deposit_details` (
  `id` int(11) NOT NULL,
  `method` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `instructions` text DEFAULT NULL,
  `min_amount` decimal(15,2) DEFAULT 50.00,
  `max_amount` decimal(15,2) DEFAULT 100000.00,
  `processing_time` varchar(100) DEFAULT '1-3 business days',
  `fees` varchar(100) DEFAULT '0%',
  `is_active` tinyint(1) DEFAULT 1,
  `icon` varchar(50) DEFAULT NULL,
  `color` varchar(20) DEFAULT NULL,
  `qr_code` text DEFAULT NULL,
  `wallet_address` text DEFAULT NULL,
  `network` varchar(100) DEFAULT NULL,
  `bank_name` varchar(100) DEFAULT NULL,
  `account_name` varchar(100) DEFAULT NULL,
  `account_number` varchar(100) DEFAULT NULL,
  `routing_number` varchar(100) DEFAULT NULL,
  `swift_code` varchar(100) 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_general_ci;

--
-- Dumping data for table `deposit_details`
--

INSERT INTO `deposit_details` (`id`, `method`, `name`, `description`, `instructions`, `min_amount`, `max_amount`, `processing_time`, `fees`, `is_active`, `icon`, `color`, `qr_code`, `wallet_address`, `network`, `bank_name`, `account_name`, `account_number`, `routing_number`, `swift_code`, `created_at`, `updated_at`) VALUES
(7, '', 'mukuru', 'f', 'f', 1.00, 5.00, '1-3 business days', '2', 1, 'diamond', 'yellow', NULL, 'fww', 'kwf', 'erf', '', 'rf', 'fr', '5423345', '2026-03-10 16:19:24', '2026-03-10 17:36:29'),
(19, 'bank transfer', 'bank transfer', 'be careful', 'instant credit', 2.00, 16.00, '1-3 business days', '0%', 1, 'bitcoin', 'green', NULL, 'werrrrrrrrrrrrrrrrrrr', 'wef', 'america', 'opay', '8076789275', '', '', '2026-03-10 21:28:40', '2026-03-14 09:38:52'),
(23, 'jerry btc bankss', 'bitcoin', 'rfffffffq', 'qwefffffff', 50.00, 100000.00, '1-3 business days', '0%', 1, 'gift', 'orange', NULL, 'wddddddddddddddddd', '', '', '', '', '', '', '2026-03-13 09:20:33', '2026-03-13 09:22:49');

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

--
-- Table structure for table `dismissed_notices`
--

CREATE TABLE `dismissed_notices` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `notice_id` int(11) NOT NULL,
  `dismissed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `dismissed_notices`
--

INSERT INTO `dismissed_notices` (`id`, `user_id`, `notice_id`, `dismissed_at`) VALUES
(1, 0, 1, '2026-03-07 03:11:45'),
(2, 1, 2, '2026-03-07 10:01:32');

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

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

CREATE TABLE `investments` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `plan_name` varchar(100) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `profit` decimal(15,2) DEFAULT 0.00,
  `roi_percent` decimal(5,2) DEFAULT 0.00,
  `status` enum('active','completed','cancelled') DEFAULT 'active',
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `investment_plans`
--

CREATE TABLE `investment_plans` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `min_amount` decimal(15,2) NOT NULL,
  `max_amount` decimal(15,2) NOT NULL,
  `roi_percent` decimal(5,2) NOT NULL,
  `duration_days` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `status` enum('active','inactive','deleted') DEFAULT 'active',
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `kyc`
--

CREATE TABLE `kyc` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `document_type` varchar(100) DEFAULT NULL,
  `document_front` varchar(300) DEFAULT NULL,
  `document_back` varchar(300) DEFAULT NULL,
  `selfie` varchar(300) DEFAULT NULL,
  `status` enum('unverified','pending','verified','rejected') DEFAULT 'pending',
  `admin_note` varchar(500) DEFAULT NULL,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `loans` (
  `id` int(11) UNSIGNED NOT NULL,
  `user_id` int(11) UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `duration` int(11) NOT NULL COMMENT 'Duration in months',
  `facility` varchar(100) NOT NULL,
  `income` varchar(50) NOT NULL,
  `purpose` text NOT NULL,
  `status` enum('pending','approved','rejected','active','completed','defaulted') DEFAULT 'pending',
  `interest_rate` decimal(5,2) DEFAULT 8.50 COMMENT 'Annual interest rate %',
  `monthly_payment` decimal(15,2) DEFAULT NULL,
  `total_repayable` decimal(15,2) DEFAULT NULL,
  `approved_by` int(11) UNSIGNED DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `rejected_reason` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `rejected_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loans`
--

INSERT INTO `loans` (`id`, `user_id`, `amount`, `duration`, `facility`, `income`, `purpose`, `status`, `interest_rate`, `monthly_payment`, `total_repayable`, `approved_by`, `approved_at`, `rejected_reason`, `created_at`, `updated_at`, `rejected_at`) VALUES
(1, 11, 6000.00, 6, 'StartUp/Products Financing', '11,000-20,000', 'for food', 'pending', 8.50, NULL, NULL, NULL, NULL, NULL, '2026-03-07 04:58:25', '2026-03-07 04:58:25', NULL),
(2, 11, 6000.00, 24, 'Joint Mortgage', '$5,001 - $10,000', 'for house rent', 'approved', 8.50, 272.73, 6545.62, NULL, NULL, NULL, '2026-03-07 05:12:36', '2026-03-07 05:13:25', NULL),
(3, 11, 6000.00, 24, 'Joint Mortgage', '$5,001 - $10,000', 'for house rent', 'pending', 8.50, 272.73, 6545.62, NULL, NULL, NULL, '2026-03-07 05:13:34', '2026-03-07 05:13:34', NULL),
(4, 11, 6000.00, 24, 'Joint Mortgage', '$5,001 - $10,000', 'for house rent', 'pending', 8.50, 272.73, 6545.62, NULL, NULL, NULL, '2026-03-07 05:13:43', '2026-03-07 05:13:43', NULL),
(5, 12, 7000.00, 12, 'Local Purchase Orders Finance', '$20,001 - $50,000', 'for drink', 'approved', 8.50, 610.54, 7326.46, 1, '2026-03-10 15:15:47', NULL, '2026-03-10 14:44:15', '2026-03-10 15:15:47', NULL),
(6, 15, 6000.00, 12, 'Retail TOD', '$10,001 - $20,000', 'jets', 'approved', 8.50, 523.32, 6279.82, 1, '2026-03-10 15:17:21', NULL, '2026-03-10 15:16:56', '2026-03-10 15:17:21', NULL),
(7, 15, 6000.00, 12, 'Retail TOD', '$10,001 - $20,000', 'jets', 'approved', 8.50, 523.32, 6279.82, 1, '2026-03-10 15:20:47', NULL, '2026-03-10 15:17:29', '2026-03-10 15:20:47', NULL),
(8, 15, 600000.00, 6, 'Salary loans', '$2,000 - $5,000', 'ejbhs,mn', 'approved', 8.50, 102493.75, 614962.49, 1, '2026-03-11 13:48:05', NULL, '2026-03-11 13:47:42', '2026-03-11 13:48:05', NULL),
(9, 15, 600000.00, 6, 'Salary loans', '$2,000 - $5,000', 'ejbhs,mn', 'approved', 8.50, 102493.75, 614962.49, 1, '2026-03-11 18:06:57', NULL, '2026-03-11 13:48:18', '2026-03-11 18:06:57', NULL),
(10, 12, 6000.00, 6, 'Operational Vehicles', '$20,001 - $50,000', 'hey', 'approved', 8.50, 1024.94, 6149.62, 1, '2026-03-11 18:42:46', NULL, '2026-03-11 18:42:35', '2026-03-11 18:42:46', NULL),
(11, 12, 6000.00, 6, 'Operational Vehicles', '$20,001 - $50,000', 'hey', 'approved', 8.50, 1024.94, 6149.62, 1, '2026-03-12 10:30:22', NULL, '2026-03-11 18:42:56', '2026-03-12 10:30:22', NULL);

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL COMMENT 'NULL = broadcast to all',
  `admin_id` int(11) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `type` enum('info','success','warning','danger') DEFAULT 'info',
  `is_read` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `profits`
--

CREATE TABLE `profits` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `referrals`
--

CREATE TABLE `referrals` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `referred_user_id` int(11) DEFAULT NULL,
  `commission` decimal(15,2) NOT NULL,
  `status` varchar(20) DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `credited_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `referral_earnings`
--

CREATE TABLE `referral_earnings` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `referred_user_id` int(11) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `trades`
--

CREATE TABLE `trades` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `asset` varchar(50) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `leverage` int(11) DEFAULT 1,
  `order_type` enum('Buy','Sell') DEFAULT 'Buy',
  `status` enum('open','closed','pending') DEFAULT 'open',
  `profit` decimal(15,2) DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `closed_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `trades`
--

INSERT INTO `trades` (`id`, `user_id`, `asset`, `amount`, `leverage`, `order_type`, `status`, `profit`, `created_at`, `closed_at`) VALUES
(3, 13, 'ADMIN_CREDIT', 0.00, 1, 'Buy', 'closed', 300.00, '2026-03-08 20:48:46', '2026-03-08 21:48:46'),
(4, 13, 'ADMIN_CREDIT', 0.00, 1, 'Buy', 'closed', 300.00, '2026-03-08 20:49:56', '2026-03-08 21:49:56'),
(5, 12, 'ADMIN_CREDIT', 0.00, 1, 'Buy', 'closed', 5000.00, '2026-03-09 08:19:04', '2026-03-09 09:19:04');

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

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

CREATE TABLE `transactions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `admin_id` int(11) DEFAULT NULL COMMENT 'Admin who performed action',
  `type` enum('deposit','withdrawal','profit','bonus','adjustment','referral') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `balance_before` decimal(15,2) NOT NULL DEFAULT 0.00,
  `balance_after` decimal(15,2) NOT NULL DEFAULT 0.00,
  `description` varchar(500) DEFAULT NULL,
  `reference` varchar(100) DEFAULT NULL,
  `status` enum('pending','completed','rejected') DEFAULT 'completed',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `transactions` (`id`, `user_id`, `admin_id`, `type`, `amount`, `balance_before`, `balance_after`, `description`, `reference`, `status`, `created_at`) VALUES
(1, 12, NULL, 'deposit', 6000.00, 0.00, 0.00, NULL, NULL, 'completed', '2026-03-07 05:22:50'),
(2, 12, NULL, 'bonus', 100.00, 0.00, 0.00, NULL, NULL, 'completed', '2026-03-07 05:50:32'),
(3, 13, NULL, 'deposit', 200.00, 0.00, 0.00, NULL, NULL, 'completed', '2026-03-07 17:19:54'),
(4, 13, NULL, 'deposit', 200.00, 0.00, 0.00, NULL, NULL, 'completed', '2026-03-07 17:21:01'),
(5, 13, NULL, 'profit', 1000.00, 0.00, 0.00, NULL, NULL, 'completed', '2026-03-08 20:44:47');

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `full_name` varchar(100) NOT NULL,
  `email` varchar(120) NOT NULL,
  `phone` varchar(30) NOT NULL,
  `country` varchar(80) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `balance` decimal(18,2) NOT NULL DEFAULT 0.00,
  `admin_notice_title` varchar(255) DEFAULT NULL,
  `is_admin` tinyint(1) NOT NULL DEFAULT 0,
  `status` enum('active','suspended','banned') DEFAULT 'active',
  `total_profit` decimal(10,2) DEFAULT 0.00,
  `total_deposit` decimal(10,2) DEFAULT 0.00,
  `total_withdrawal` decimal(10,2) DEFAULT 0.00,
  `bonus` decimal(10,2) DEFAULT 0.00,
  `admin_notice_message` text DEFAULT NULL,
  `admin_notice_action_url` varchar(500) DEFAULT NULL,
  `admin_notice_status` enum('active','dismissed','expired') DEFAULT NULL,
  `admin_notice_created_at` datetime DEFAULT NULL,
  `admin_notice_expires_at` datetime DEFAULT NULL,
  `profit` decimal(15,2) DEFAULT 0.00,
  `password` varchar(255) DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
  `wallet_type` varchar(50) DEFAULT NULL,
  `wallet_address` varchar(255) DEFAULT NULL,
  `wallet_name` varchar(100) DEFAULT NULL,
  `wallet_connected_at` datetime DEFAULT NULL,
  `wallet_status` varchar(20) DEFAULT NULL,
  `referral_earnings` decimal(15,2) DEFAULT 0.00,
  `wallet_connected` tinyint(1) DEFAULT 0,
  `wallet_network` varchar(50) DEFAULT NULL,
  `referral_code` varchar(20) DEFAULT NULL,
  `referred_by` int(11) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `username`, `full_name`, `email`, `phone`, `country`, `password_hash`, `created_at`, `balance`, `admin_notice_title`, `is_admin`, `status`, `total_profit`, `total_deposit`, `total_withdrawal`, `bonus`, `admin_notice_message`, `admin_notice_action_url`, `admin_notice_status`, `admin_notice_created_at`, `admin_notice_expires_at`, `profit`, `password`, `last_login`, `wallet_type`, `wallet_address`, `wallet_name`, `wallet_connected_at`, `wallet_status`, `referral_earnings`, `wallet_connected`, `wallet_network`, `referral_code`, `referred_by`, `deleted_at`) VALUES
(18, 'lamsca', 'janies', 'ovieamerica20@gmail.com', '1234564352', 'Afganistan', '$2y$10$ibirKdaBwLLVLC1Q7oLF1ep6jRNqrPFRgYVEQV73TQT7G1EEi1vHm', '2026-03-12 20:38:01', 3600.00, 'importance!', 0, 'active', 0.00, 0.00, 0.00, 0.00, 'hello sir ', NULL, 'active', '2026-03-14 21:18:14', NULL, 0.00, NULL, NULL, 'MetaMask', 'gdddddddd', NULL, NULL, NULL, 0.00, 1, 'bitcoin', NULL, NULL, NULL),
(20, 'eqqw', 'qwd', 'ovieamerica77@gmail.com', '6123778576', 'Afganistan', '$2y$10$3hXLBhKtvP6ogiqLf28w/OkqND1oa1m0wchdiHNQ8vt2g4BdBYt8C', '2026-03-21 10:51:16', 0.00, NULL, 0, 'active', 0.00, 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0, NULL, NULL, NULL, NULL),
(21, 'DSF', 'DF', 'DWFEW@GMAIL.COM', '6123778576', 'Argentina', '$2y$10$oDy9poR0EWDBgnNVz1JYpOGPD0hIWYH9ypYnWgebxgKF1l.lvhCs.', '2026-03-31 17:29:19', 0.00, NULL, 0, 'active', 0.00, 0.00, 0.00, 0.00, NULL, NULL, NULL, NULL, NULL, 0.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.00, 0, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `user_notices`
--

CREATE TABLE `user_notices` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `action_url` varchar(255) DEFAULT NULL,
  `is_read` tinyint(4) DEFAULT 0,
  `expires_at` datetime DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `user_notifications`
--

CREATE TABLE `user_notifications` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `type` varchar(50) DEFAULT 'general',
  `is_read` tinyint(1) DEFAULT 0,
  `action_url` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_notifications`
--

INSERT INTO `user_notifications` (`id`, `user_id`, `title`, `message`, `type`, `is_read`, `action_url`, `created_at`) VALUES
(10, 18, 'Withdrawal Approved', 'Your withdrawal of $10,000.00 has been approved successfully.', 'withdrawal', 0, NULL, '2026-03-12 20:52:04'),
(11, 18, 'Withdrawal Approved', 'Your withdrawal of $6,000.00 has been approved successfully.', 'withdrawal', 0, NULL, '2026-03-14 14:57:20'),
(12, 18, 'Withdrawal Approved', 'Your withdrawal of $400.00 has been approved successfully.', 'withdrawal', 0, NULL, '2026-03-14 14:57:24'),
(13, 18, 'Withdrawal Approved', 'Your withdrawal of $30,000.00 has been approved successfully.', 'withdrawal', 0, NULL, '2026-03-14 14:57:38');

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

--
-- Table structure for table `user_profits`
--

CREATE TABLE `user_profits` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `source` varchar(50) NOT NULL,
  `status` varchar(20) DEFAULT 'active',
  `created_by` varchar(50) DEFAULT 'admin',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_profits`
--

INSERT INTO `user_profits` (`id`, `user_id`, `amount`, `source`, `status`, `created_by`, `created_at`) VALUES
(1, 12, 500.00, 'trading', 'active', 'admin', '2026-03-07 05:36:21');

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

--
-- Table structure for table `user_wallets`
--

CREATE TABLE `user_wallets` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `wallet_type` varchar(100) NOT NULL,
  `wallet_address` text NOT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `withdrawals`
--

CREATE TABLE `withdrawals` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `amount` decimal(18,8) NOT NULL,
  `payment_method` varchar(50) NOT NULL,
  `wallet_address` varchar(255) NOT NULL,
  `status` varchar(20) DEFAULT 'pending',
  `admin_note` text DEFAULT NULL,
  `processed_by` int(10) UNSIGNED DEFAULT NULL,
  `processed_at` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `approved_by` varchar(255) DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `withdrawals`
--

INSERT INTO `withdrawals` (`id`, `user_id`, `amount`, `payment_method`, `wallet_address`, `status`, `admin_note`, `processed_by`, `processed_at`, `created_at`, `updated_at`, `approved_by`, `approved_at`) VALUES
(1, 6, 400.00000000, 'bitcoin', '34457764', 'Approved', NULL, NULL, NULL, '2026-03-05 16:49:06', '2026-03-05 16:49:37', NULL, NULL),
(2, 6, 600.00000000, 'usdt', '34457764', 'approved', 'hey', 6, '2026-03-05 18:13:45', '2026-03-05 17:01:36', '2026-03-05 17:13:45', NULL, NULL),
(3, 8, 100.00000000, 'bitcoin', '34457764', 'completed', 'LBJ | Completed: ', 8, '2026-03-05 18:33:08', '2026-03-05 17:20:51', '2026-03-05 17:33:08', NULL, NULL),
(4, 9, 1000.00000000, 'bank', '34457764', 'approved', 'ifheksn', 9, '2026-03-05 19:35:26', '2026-03-05 18:34:58', '2026-03-05 18:35:26', NULL, NULL),
(5, 12, 200.00000000, 'bank', '34457764', 'approved', NULL, NULL, NULL, '2026-03-07 05:47:25', '2026-03-11 17:39:40', '1', '2026-03-11 17:39:40'),
(6, 13, 19500.00000000, 'bitcoin', 'f3455ffffdsssssss354', 'approved', NULL, NULL, NULL, '2026-03-09 15:25:43', '2026-03-11 21:02:02', '1', '2026-03-11 21:02:02'),
(7, 15, 5000.00000000, 'bank', '34457764', 'approved', NULL, NULL, NULL, '2026-03-11 12:11:33', '2026-03-11 17:38:41', '1', '2026-03-11 17:38:41'),
(8, 12, 5000.00000000, 'bitcoin', 'f3455ffffdsssssss354', 'approved', NULL, NULL, NULL, '2026-03-11 17:39:25', '2026-03-11 17:39:46', '1', '2026-03-11 17:39:46'),
(9, 14, 800.00000000, 'bitcoin', 'f3455ffffdsssssss354', 'approved', NULL, NULL, NULL, '2026-03-11 18:27:32', '2026-03-11 18:27:56', '1', '2026-03-11 18:27:56'),
(10, 18, 10000.00000000, 'bitcoin', '34457764tggggggggggggggggggggggggg', 'approved', NULL, NULL, NULL, '2026-03-12 20:46:24', '2026-03-12 20:52:04', '1', '2026-03-12 20:52:04'),
(11, 18, 30000.00000000, 'bitcoin', '34457764tggggggggggggggggggggggggg', 'approved', NULL, NULL, NULL, '2026-03-12 21:04:06', '2026-03-14 14:57:38', '1', '2026-03-14 14:57:38'),
(12, 18, 400.00000000, 'bitcoin', '34457764', 'approved', NULL, NULL, NULL, '2026-03-12 21:04:24', '2026-03-14 14:57:24', '1', '2026-03-14 14:57:24'),
(13, 18, 6000.00000000, 'bitcoin', '34457764', 'approved', NULL, NULL, NULL, '2026-03-12 21:06:17', '2026-03-14 14:57:20', '1', '2026-03-14 14:57:20');

--
-- Indexes for dumped tables
--

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

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

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

--
-- Indexes for table `admin_logs`
--
ALTER TABLE `admin_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `admin_id` (`admin_id`),
  ADD KEY `created_at` (`created_at`);

--
-- Indexes for table `admin_notices`
--
ALTER TABLE `admin_notices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status_expires` (`status`,`expires_at`),
  ADD KEY `idx_created_at` (`created_at`);

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

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

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

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

--
-- Indexes for table `copy_experts`
--
ALTER TABLE `copy_experts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_risk` (`risk_level`),
  ADD KEY `idx_return` (`monthly_return`);

--
-- Indexes for table `deposits`
--
ALTER TABLE `deposits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_deposits_status` (`status`),
  ADD KEY `idx_deposits_user` (`user_id`),
  ADD KEY `idx_deposits_created` (`created_at`);

--
-- Indexes for table `deposit_addresses`
--
ALTER TABLE `deposit_addresses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `method` (`method`);

--
-- Indexes for table `deposit_details`
--
ALTER TABLE `deposit_details`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `method` (`method`);

--
-- Indexes for table `dismissed_notices`
--
ALTER TABLE `dismissed_notices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_notice` (`user_id`,`notice_id`);

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

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

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

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

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

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

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

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

--
-- Indexes for table `trades`
--
ALTER TABLE `trades`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_status` (`status`);

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `referral_code` (`referral_code`),
  ADD KEY `idx_notice_status` (`admin_notice_status`,`admin_notice_expires_at`),
  ADD KEY `referred_by` (`referred_by`);

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

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

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

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

--
-- Indexes for table `withdrawals`
--
ALTER TABLE `withdrawals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_id` (`user_id`),
  ADD KEY `idx_status` (`status`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

--
-- AUTO_INCREMENT for table `admin_notices`
--
ALTER TABLE `admin_notices`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `user_profits`
--
ALTER TABLE `user_profits`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

--
-- AUTO_INCREMENT for table `withdrawals`
--
ALTER TABLE `withdrawals`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- Constraints for dumped tables
--

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

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`referred_by`) REFERENCES `users` (`id`);

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

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

--
-- Constraints for table `user_wallets`
--
ALTER TABLE `user_wallets`
  ADD CONSTRAINT `user_wallets_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 */;
