-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 11, 2025 at 01:58 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: `nexus`
--

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

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

CREATE TABLE `admins` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `role` enum('Super Admin','Admin','Manager') DEFAULT 'Admin',
  `status` enum('Active','Inactive') DEFAULT 'Active',
  `last_login` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `admins` (`id`, `username`, `email`, `password_hash`, `role`, `status`, `last_login`, `created_at`) VALUES
(1, 'admin', 'admin@trustbeamcredit.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Super Admin', 'Active', '2025-09-11 10:23:54', '2025-09-11 10:22:32');

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

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

CREATE TABLE `deposits` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `deposit_method` enum('Bank Transfer','Cash','Check','Mobile Money') NOT NULL,
  `reference_number` varchar(50) NOT NULL,
  `status` enum('Pending','Approved','Rejected') DEFAULT 'Pending',
  `notes` text DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `approved_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `deposits` (`id`, `user_id`, `amount`, `deposit_method`, `reference_number`, `status`, `notes`, `approved_at`, `approved_by`, `created_at`) VALUES
(1, 1, 1000.00, 'Bank Transfer', 'DEP001', 'Approved', 'Initial deposit', NULL, NULL, '2025-09-11 10:22:32'),
(2, 2, 2000.00, 'Cash', 'DEP002', 'Approved', 'Cash deposit', NULL, NULL, '2025-09-11 10:22:32'),
(3, 3, 5000.00, 'Check', 'DEP003', 'Approved', 'Business check', NULL, NULL, '2025-09-11 10:22:32'),
(4, 4, 3000.00, 'Bank Transfer', 'DEP004', 'Pending', 'Salary deposit', NULL, NULL, '2025-09-11 10:22:32'),
(5, 5, 1500.00, 'Mobile Money', 'DEP005', 'Pending', 'Mobile payment', NULL, NULL, '2025-09-11 10:22:32');

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

--
-- Table structure for table `email_logs`
--

CREATE TABLE `email_logs` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `admin_id` int(11) DEFAULT NULL,
  `email_type` enum('Welcome','Password Reset','Account Update','Transaction Alert','System Notification') NOT NULL,
  `recipient_email` varchar(100) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `status` enum('Sent','Failed','Pending') DEFAULT 'Pending',
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `email_logs`
--

INSERT INTO `email_logs` (`id`, `user_id`, `admin_id`, `email_type`, `recipient_email`, `subject`, `message`, `status`, `sent_at`, `created_at`) VALUES
(1, NULL, 1, 'Welcome', 'brainybox9@gmail.com', 'Welcome to NexusBank', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Welcome to NexusBank</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi actor,</p><p>Your account has been created successfully. Below are your key details:</p><ul style=\"padding-left:18px;margin:0 0 16px 0;\">\r\n            <li><strong>Account Number:</strong> 0306343243</li>\r\n            <li><strong>Account Type:</strong> Savings</li>\r\n        </ul><p>You can sign in anytime to manage your banking.</p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 10:51:17'),
(2, NULL, 1, 'Transaction Alert', 'brainybox9@gmail.com', 'Credit Alert - CREDIT17575879768861', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Credit Alert</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi actor,</p><p>You have a <strong>credit</strong> transaction on your account.</p><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;border-collapse:collapse;margin:12px 0;\">\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Amount</td><td style=\"padding:8px 0;text-align:right;color:#111827;\"><strong>$6,000.00</strong></td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Type</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">Credit</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Reference</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">CREDIT17575879768861</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Description</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">hello</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Date</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">2025-09-11 12:52</td></tr>\r\n        </table><p>Available balance: <strong>$6,000.00</strong></p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 10:52:58'),
(3, 1, 1, 'Transaction Alert', 'john.doe@email.com', 'Credit Alert - CREDIT17575880816277', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Credit Alert</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi John,</p><p>You have a <strong>credit</strong> transaction on your account.</p><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;border-collapse:collapse;margin:12px 0;\">\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Amount</td><td style=\"padding:8px 0;text-align:right;color:#111827;\"><strong>$120,000.00</strong></td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Type</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">Credit</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Reference</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">CREDIT17575880816277</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Description</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">hello</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Date</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">2025-09-11 12:54</td></tr>\r\n        </table><p>Available balance: <strong>$125,000.00</strong></p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 10:54:43'),
(4, NULL, 1, 'Transaction Alert', 'brainybox9@gmail.com', 'Debit Alert - DEBIT17575882047919', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Debit Alert</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi actor,</p><p>You have a <strong>debit</strong> transaction on your account.</p><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;border-collapse:collapse;margin:12px 0;\">\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Amount</td><td style=\"padding:8px 0;text-align:right;color:#111827;\"><strong>$6,000.00</strong></td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Type</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">Debit</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Reference</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">DEBIT17575882047919</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Description</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">hello</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Date</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">2025-09-11 12:56</td></tr>\r\n        </table><p>Available balance: <strong>$0.00</strong></p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 10:56:46'),
(5, NULL, 1, 'Welcome', 'ehisagbons76@gmail.com', 'Welcome to NexusBank', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Welcome to NexusBank</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi alice,</p><p>Your account has been created successfully. Below are your key details:</p><ul style=\"padding-left:18px;margin:0 0 16px 0;\">\r\n            <li><strong>Account Number:</strong> 0399233172</li>\r\n            <li><strong>Account Type:</strong> Savings</li>\r\n        </ul><p>You can sign in anytime to manage your banking.</p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 11:03:11'),
(6, NULL, 1, 'Transaction Alert', 'ehisagbons76@gmail.com', 'Credit Alert - CREDIT17575886336980', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Credit Alert</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi alice,</p><p>You have a <strong>credit</strong> transaction on your account.</p><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;border-collapse:collapse;margin:12px 0;\">\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Amount</td><td style=\"padding:8px 0;text-align:right;color:#111827;\"><strong>$500,000.00</strong></td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Type</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">Credit</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Reference</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">CREDIT17575886336980</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Description</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">cool</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Date</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">2025-09-11 13:03</td></tr>\r\n        </table><p>Available balance: <strong>$500,000.00</strong></p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 11:03:55'),
(7, 8, 1, 'Welcome', 'brainybox9@gmail.com', 'Welcome to NexusBank', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Welcome to NexusBank</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi brain,</p><p>Your account has been created successfully. Below are your key details:</p><ul style=\"padding-left:18px;margin:0 0 16px 0;\">\r\n            <li><strong>Account Number:</strong> 0370674003</li>\r\n            <li><strong>Account Type:</strong> Savings</li>\r\n        </ul><p>You can sign in anytime to manage your banking.</p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 11:08:22'),
(8, 8, 1, 'Transaction Alert', 'brainybox9@gmail.com', 'Credit Alert - CREDIT17575889371023', '\r\n    <div style=\"margin:0;padding:0;background:#f5f7fb;width:100%;\">\r\n      <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background:#f5f7fb;padding:24px 0;\">\r\n        <tr>\r\n          <td align=\"center\">\r\n            <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;max-width:90%;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 8px 28px rgba(25,118,210,0.15);\">\r\n              <tr>\r\n                <td style=\"padding:0;background:linear-gradient(135deg,#d32f2f 0%,#1976d2 100%);\">\r\n                  <div style=\"padding:28px 32px;\">\r\n                    <div style=\"font:700 20px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:#ffffff;display:flex;align-items:center;gap:10px;\"><span style=\"margin-left:10px;vertical-align:middle;\">NexusBank</span></div>\r\n                    <div style=\"margin-top:8px;font:600 18px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#ffffff;\">Credit Alert</div>\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td style=\"padding:28px 32px;font:400 15px/1.7 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu;color:#1f2937;\">\r\n                  <p>Hi brain,</p><p>You have a <strong>credit</strong> transaction on your account.</p><table cellpadding=\"0\" cellspacing=\"0\" style=\"width:100%;border-collapse:collapse;margin:12px 0;\">\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Amount</td><td style=\"padding:8px 0;text-align:right;color:#111827;\"><strong>$500,000.00</strong></td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Type</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">Credit</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Reference</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">CREDIT17575889371023</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Description</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">cool</td></tr>\r\n          <tr><td style=\"padding:8px 0;color:#6b7280;\">Date</td><td style=\"padding:8px 0;text-align:right;color:#111827;\">2025-09-11 13:08</td></tr>\r\n        </table><p>Available balance: <strong>$500,000.00</strong></p>\r\n                  <div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb;color:#6b7280;font-size:13px;\">\r\n                    This email was sent by NexusBank. If you prefer not to receive these messages, you can disable notifications from your account settings.\r\n                  </div>\r\n                </td>\r\n              </tr>\r\n            </table>\r\n          </td>\r\n        </tr>\r\n      </table>\r\n    </div>', 'Failed', NULL, '2025-09-11 11:08:59');

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

--
-- Table structure for table `general_settings`
--

CREATE TABLE `general_settings` (
  `id` int(11) NOT NULL DEFAULT 1,
  `site_name` varchar(150) DEFAULT 'NexusBank',
  `logo_path` varchar(255) DEFAULT NULL,
  `mobile_number` varchar(30) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `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 `general_settings`
--

INSERT INTO `general_settings` (`id`, `site_name`, `logo_path`, `mobile_number`, `address`, `updated_at`) VALUES
(1, 'NexusBank', NULL, '+192330303', 'cold street, backhood', '2025-09-11 10:38:34');

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

--
-- Table structure for table `hero_images`
--

CREATE TABLE `hero_images` (
  `id` int(11) NOT NULL,
  `image_path` varchar(255) NOT NULL,
  `title` varchar(150) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `hero_images`
--

INSERT INTO `hero_images` (`id`, `image_path`, `title`, `created_at`) VALUES
(1, 'uploads/site/hero_1757587081_46a3dc.jpg', '', '2025-09-11 10:38:01');

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

--
-- Table structure for table `irs_refunds`
--

CREATE TABLE `irs_refunds` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `refund_amount` decimal(15,2) NOT NULL,
  `tax_year` int(11) NOT NULL,
  `status` enum('Pending','Processing','Completed','Rejected') DEFAULT 'Pending',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `loan_applications`
--

CREATE TABLE `loan_applications` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `loan_amount` decimal(15,2) NOT NULL,
  `loan_type` enum('Personal','Business','Mortgage','Auto') NOT NULL,
  `purpose` text DEFAULT NULL,
  `status` enum('Pending','Approved','Rejected','Active','Completed') DEFAULT 'Pending',
  `interest_rate` decimal(5,2) DEFAULT NULL,
  `term_months` int(11) DEFAULT NULL,
  `monthly_payment` decimal(15,2) 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;

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

--
-- Table structure for table `support_tickets`
--

CREATE TABLE `support_tickets` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `status` enum('Open','Pending','Closed') DEFAULT 'Open',
  `response` 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_general_ci;

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

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

CREATE TABLE `system_settings` (
  `id` int(11) NOT NULL DEFAULT 1,
  `email_enabled` tinyint(1) DEFAULT 1,
  `from_email` varchar(100) DEFAULT 'no-reply@nexusbank.local',
  `from_name` varchar(100) DEFAULT 'NexusBank Notifications',
  `smtp_enabled` tinyint(1) DEFAULT 0,
  `smtp_host` varchar(255) DEFAULT NULL,
  `smtp_port` int(11) DEFAULT 465,
  `smtp_username` varchar(255) DEFAULT NULL,
  `smtp_password` varchar(255) DEFAULT NULL,
  `smtp_encryption` enum('ssl','tls','none') DEFAULT 'ssl',
  `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 `system_settings`
--

INSERT INTO `system_settings` (`id`, `email_enabled`, `from_email`, `from_name`, `smtp_enabled`, `smtp_host`, `smtp_port`, `smtp_username`, `smtp_password`, `smtp_encryption`, `updated_at`) VALUES
(1, 1, 'no-reply@nexusbank.local', 'NexusBank Notifications', 1, 'smtp.gmail.com', 465, 'brainybox9@gmail.com', 'vwrb tsxz dnkl irjf', 'ssl', '2025-09-11 11:00:43');

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

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

CREATE TABLE `transactions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `transaction_type` enum('Deposit','Withdrawal','Transfer','Loan','Refund') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `description` text DEFAULT NULL,
  `reference_number` varchar(50) NOT NULL,
  `status` enum('Pending','Completed','Failed','Cancelled') DEFAULT 'Pending',
  `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`, `transaction_type`, `amount`, `description`, `reference_number`, `status`, `created_at`) VALUES
(1, 1, 'Deposit', 1000.00, 'Initial deposit', 'TXN001', 'Completed', '2025-09-11 10:22:32'),
(2, 2, 'Deposit', 2000.00, 'Salary deposit', 'TXN002', 'Completed', '2025-09-11 10:22:32'),
(3, 3, 'Deposit', 5000.00, 'Business payment', 'TXN003', 'Completed', '2025-09-11 10:22:32'),
(4, 1, 'Withdrawal', 500.00, 'ATM withdrawal', 'TXN004', 'Completed', '2025-09-11 10:22:32'),
(5, 2, 'Transfer', 1000.00, 'Transfer to savings', 'TXN005', 'Completed', '2025-09-11 10:22:32'),
(6, NULL, '', 6000.00, 'hello', 'CREDIT17575879768861', 'Completed', '2025-09-11 10:52:56'),
(7, 1, '', 120000.00, 'hello', 'CREDIT17575880816277', 'Completed', '2025-09-11 10:54:41'),
(8, NULL, '', 6000.00, 'hello', 'DEBIT17575882047919', 'Completed', '2025-09-11 10:56:44'),
(9, NULL, '', 500000.00, 'cool', 'CREDIT17575886336980', 'Completed', '2025-09-11 11:03:53'),
(10, 8, '', 500000.00, 'cool', 'CREDIT17575889371023', 'Completed', '2025-09-11 11:08:57');

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `firstname` varchar(50) NOT NULL,
  `middlename` varchar(50) DEFAULT NULL,
  `lastname` varchar(50) NOT NULL,
  `username` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `nationality` varchar(50) DEFAULT NULL,
  `account_number` varchar(20) NOT NULL,
  `swift_code` varchar(10) DEFAULT NULL,
  `swift_enabled` tinyint(1) DEFAULT 1,
  `imf_code` varchar(10) DEFAULT NULL,
  `imf_enabled` tinyint(1) DEFAULT 1,
  `cot_code` varchar(10) DEFAULT NULL,
  `cot_enabled` tinyint(1) DEFAULT 1,
  `transaction_pin` varchar(4) DEFAULT NULL,
  `account_type` enum('Savings','Current','Business','Premium') DEFAULT 'Savings',
  `profile_photo` varchar(255) DEFAULT NULL,
  `balance` decimal(15,2) DEFAULT 0.00,
  `currency` varchar(10) DEFAULT '$',
  `email_notifications_enabled` tinyint(1) DEFAULT 1, 
  `status` enum('Active','Inactive','Suspended','Pending') DEFAULT 'Pending',
  `last_login` timestamp NULL 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 `users`
--

INSERT INTO `users` (`id`, `firstname`, `middlename`, `lastname`, `username`, `email`, `password_hash`, `phone`, `address`, `date_of_birth`, `nationality`, `account_number`, `swift_code`, `swift_enabled`, `imf_code`, `imf_enabled`, `cot_code`, `cot_enabled`, `transaction_pin`, `account_type`, `profile_photo`, `balance`, `currency`, `email_notifications_enabled`, `status`, `last_login`, `created_at`, `updated_at`) VALUES
(1, 'John', NULL, 'Doe', 'johndoe', 'john.doe@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '+1234567890', '123 Main St, City, State', NULL, 'American', 'ACC001234567', NULL, 1, NULL, 1, NULL, 1, NULL, 'Savings', NULL, 125000.00, 'USD', 1, 'Active', NULL, '2025-09-11 10:22:32', '2025-09-11 10:54:41'),
(2, 'Jane', NULL, 'Smith', 'janesmith', 'jane.smith@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '+1234567891', '456 Oak Ave, City, State', NULL, 'American', 'ACC001234568', NULL, 1, NULL, 1, NULL, 1, NULL, 'Current', NULL, 7500.00, 'EUR', 1, 'Active', NULL, '2025-09-11 10:22:32', '2025-09-11 10:22:32'),
(3, 'Mike', NULL, 'Johnson', 'mikejohnson', 'mike.johnson@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '+1234567892', '789 Pine Rd, City, State', NULL, 'American', 'ACC001234569', NULL, 1, NULL, 1, NULL, 1, NULL, 'Business', NULL, 15000.00, 'GBP', 1, 'Active', NULL, '2025-09-11 10:22:32', '2025-09-11 10:22:32'),
(4, 'Sarah', NULL, 'Williams', 'sarahwilliams', 'sarah.williams@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '+1234567893', '321 Elm St, City, State', NULL, 'American', 'ACC001234570', NULL, 1, NULL, 1, NULL, 1, NULL, 'Premium', NULL, 25000.00, 'SEK', 1, 'Active', NULL, '2025-09-11 10:22:32', '2025-09-11 10:22:32'),
(5, 'David', NULL, 'Brown', 'davidbrown', 'david.brown@email.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '+1234567894', '654 Maple Dr, City, State', NULL, 'American', 'ACC001234571', NULL, 1, NULL, 1, NULL, 1, NULL, 'Savings', NULL, 3000.00, 'CAD', 1, 'Active', NULL, '2025-09-11 10:22:32', '2025-09-11 10:22:32'),
(8, 'brain', 'bozz', 'cool', 'brainy123', 'brainybox9@gmail.com', '$2y$10$c86hQU7sjeKlP5S4qxXABu6mC33hzV7NTiA0yutV7dUsHIftX0yVm', '+1234567890', 'gggg', '2025-09-26', 'Azerbaijan', '0370674003', '6D1432', 1, '7CDECB', 1, 'CAD6BD', 1, '2905', 'Savings', 'uploads/profiles/68c2ada3f29be.jpg', 500000.00, 'USD', 1, 'Active', NULL, '2025-09-11 11:08:20', '2025-09-11 11:08:57');

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

--
-- Table structure for table `virtual_cards`
--

CREATE TABLE `virtual_cards` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `card_number` varchar(16) NOT NULL,
  `card_type` enum('Visa','Mastercard','American Express') NOT NULL,
  `expiry_date` date NOT NULL,
  `cvv` varchar(4) NOT NULL,
  `status` enum('Active','Inactive','Blocked') DEFAULT 'Active',
  `daily_limit` decimal(15,2) DEFAULT 1000.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `deposits`
--
ALTER TABLE `deposits`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `reference_number` (`reference_number`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `approved_by` (`approved_by`);

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

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

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

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

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

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

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

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `reference_number` (`reference_number`),
  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`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `deposits`
--
ALTER TABLE `deposits`
  ADD CONSTRAINT `deposits_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `deposits_ibfk_2` FOREIGN KEY (`approved_by`) REFERENCES `admins` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `email_logs`
--
ALTER TABLE `email_logs`
  ADD CONSTRAINT `email_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `email_logs_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE SET NULL;

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

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

--
-- Constraints for table `support_tickets`
--
ALTER TABLE `support_tickets`
  ADD CONSTRAINT `support_tickets_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 SET NULL;

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