-- https://www.phpmyadmin.net/
--

START TRANSACTION;



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

--
-- Table structure for table `copy_traders`
--

CREATE TABLE `copy_traders` (
  `id` int NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `profile_pic` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `trading_level` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  `followers` int DEFAULT '0',
  `min_amount` decimal(10,2) NOT NULL,
  `trades` int DEFAULT NULL,
  `win_rate` decimal(5,2) DEFAULT NULL,
  `total_wins` int DEFAULT NULL,
  `total_losses` int DEFAULT NULL,
  `profit_share` decimal(5,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `copy_traders`
--

INSERT INTO `copy_traders` (`id`, `name`, `profile_pic`, `trading_level`, `followers`, `min_amount`, `trades`, `win_rate`, `total_wins`, `total_losses`, `profit_share`) VALUES
(16, 'Marcia Susie', '67e841f68fed7_se.jpg', 'Intermediate', 3499, 1200.00, 874, 89.90, 782, 232, 90.50),
(17, 'Future Fx', '67f9e05f90342_neon-lights-7340790.jpg', 'Expert', 3000, 500.00, 1234, 70.00, 45, 32, 100.00);

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

--
-- Table structure for table `copy_trading_requests`
--

CREATE TABLE `copy_trading_requests` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `trader_id` int NOT NULL,
  `status` enum('requested','copying','cancelled') COLLATE utf8mb4_general_ci DEFAULT 'requested',
  `request_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `is_active` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `copy_trading_requests`
--

INSERT INTO `copy_trading_requests` (`id`, `user_id`, `trader_id`, `status`, `request_time`, `is_active`) VALUES
(47, 18, 16, 'cancelled', '2025-04-21 13:28:30', 0),
(50, 18, 17, 'cancelled', '2025-06-22 17:25:04', 0);

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

--
-- Table structure for table `crypto_addresses`
--

CREATE TABLE `crypto_addresses` (
  `id` int NOT NULL,
  `currency` varchar(10) COLLATE utf8mb4_general_ci NOT NULL,
  `address` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `crypto_addresses`
--

INSERT INTO `crypto_addresses` (`id`, `currency`, `address`, `is_active`, `created_at`) VALUES
(1, 'btc', 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq', 1, '2025-06-22 19:39:05'),
(2, 'eth', '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', 1, '2025-06-22 19:39:05'),
(3, 'usdterc20', '0x3f5CE5FBFe3E9af3971dD833D26bA9b5C936f0bE', 1, '2025-06-22 19:39:05'),
(4, 'usdc', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 1, '2025-06-22 19:39:06');

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

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

CREATE TABLE `deposits` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(10) COLLATE utf8mb4_general_ci NOT NULL,
  `order_id` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `payment_proof` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` enum('pending','completed','failed') COLLATE utf8mb4_general_ci DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `deposits` (`id`, `user_id`, `amount`, `currency`, `order_id`, `payment_proof`, `status`, `created_at`, `updated_at`) VALUES
(117, 18, 456.00, 'BTC', 'DEP_1750663469_4aa0f1e6', 'uploads/payment/DEP_1750663469_4aa0f1e6_1750663486.png', 'completed', '2025-06-23 07:24:29', '2025-06-23 09:07:39'),
(118, 18, 1200.00, 'BTC', 'DEP_1750669420_343084c8', 'uploads/payment/DEP_1750669420_343084c8_1750669440.jpg', 'failed', '2025-06-23 09:03:40', '2025-06-23 09:56:34'),
(119, 18, 500.00, 'USDC', 'DEP_1750669779_97f4938e', 'uploads/payment/DEP_1750669779_97f4938e_1750669791.jpg', 'failed', '2025-06-23 09:09:39', '2025-06-23 09:53:23');

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

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

CREATE TABLE `notifications` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `title` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `message` text COLLATE utf8mb4_general_ci NOT NULL,
  `status` enum('unread','read') COLLATE utf8mb4_general_ci DEFAULT 'unread',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `settings` (
  `id` int NOT NULL,
  `sitename` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `siteurl` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `sitemail` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `admin_email` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `tawk_url` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `reg_bonus_amt` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0',
  `reg_bonus` int NOT NULL DEFAULT '0',
  `ref_bonus_amt` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0',
  `ref_bonus` int NOT NULL DEFAULT '0',
  `live_trading` enum('true','false') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'true'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `settings` (`id`, `sitename`, `siteurl`, `sitemail`, `admin_email`, `tawk_url`, `reg_bonus_amt`, `reg_bonus`, `ref_bonus_amt`, `ref_bonus`, `live_trading`) VALUES
(1, 'VertexOption', 'https://app.vertexoption.com', 'support@vertexoption.com', NULL, 'https://embed.tawk.to/6807e2054a25191909a01d53/1ipfclphu', '10', 0, '12', 1, 'false');

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

--
-- Table structure for table `signals`
--

CREATE TABLE `signals` (
  `id` int NOT NULL,
  `months_valid` int NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `features` text COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `signals`
--

INSERT INTO `signals` (`id`, `months_valid`, `price`, `features`, `created_at`) VALUES
(1, 1, 29.99, 'Daily forex signals, Basic support, Email alerts', '2025-04-12 06:57:07'),
(2, 3, 79.99, 'Daily forex+gold signals, Priority support, SMS alerts', '2025-04-12 06:57:07'),
(3, 6, 149.99, 'Forex+Gold+Crypto signals, VIP support, Telegram group access', '2025-04-12 06:57:07'),
(5, 12, 200.00, 'Daily forex signals, top support, Email alerts', '2025-06-23 09:25:55');

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

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `id` int NOT NULL,
  `plan_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `features` text COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `subscriptions`
--

INSERT INTO `subscriptions` (`id`, `plan_name`, `price`, `features`, `created_at`) VALUES
(2, 'Bronze', 5000.00, 'Signal: Basic trading signal, 24hrs Expert Support, 20+ Currencies', '2025-03-24 16:10:56'),
(3, 'Silver', 2000.00, 'Signal: Premium trading signal, 24hrs Expert Support, 50+ Currencies', '2025-03-24 16:11:19');

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

--
-- Table structure for table `trading_history`
--

CREATE TABLE `trading_history` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `trade_type` enum('Signal Trade','Copy Trade') COLLATE utf8mb4_general_ci NOT NULL,
  `trader_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `signal_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `entry_price` decimal(18,8) NOT NULL,
  `exit_price` decimal(18,8) NOT NULL,
  `profit_loss` decimal(18,8) NOT NULL,
  `trade_outcome` enum('Win','Loss') COLLATE utf8mb4_general_ci NOT NULL,
  `trade_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `trading_tb`
--

CREATE TABLE `trading_tb` (
  `td_id` int NOT NULL,
  `td_uid` int NOT NULL,
  `td_email` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
  `type` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `pair` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `lot_size` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `price` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `loss` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `profit` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `direction` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `transactions` (
  `id` int NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `descr` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `ref` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `amount` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `d_currency` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `uid` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `transactions` (`id`, `email`, `descr`, `ref`, `amount`, `d_currency`, `type`, `uid`, `status`, `date`) VALUES
(281, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750666867_45967a', '29.99', '0', 'signal', '18', 'completed', '2025-06-23 09:21:07'),
(282, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750666900_60cdd0', '79.99', '0', 'signal', '18', 'completed', '2025-06-23 09:21:40'),
(283, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750667076_99c854', '29.99', '0', 'signal', '18', 'completed', '2025-06-23 09:24:36'),
(284, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750667141_1a74fe', '79.99', '0', 'signal', '18', 'completed', '2025-06-23 09:25:41'),
(285, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750667179_424fc4', '29.99', '0', 'signal', '18', 'completed', '2025-06-23 09:26:19'),
(286, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750667308_f54a20', '79.99', '0', 'signal', '18', 'completed', '2025-06-23 09:28:28'),
(287, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750667946_07a690', '29.99', 'USD', 'signal', '18', 'completed', '2025-06-23 09:39:06'),
(288, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750668038_e68bfb', '149.99', 'USD', 'signal', '18', 'completed', '2025-06-23 09:40:38'),
(289, 'sylanravenwood@gmail.com', 'Upgrade', 'UPGRADE_1750669069_5e65e2', '5000', 'USD', 'subscription', '18', 'completed', '2025-06-23 09:57:49'),
(290, 'sylanravenwood@gmail.com', 'Deposit (BTC)', 'DEP_1750669420_343084c8', '1200', 'BTC', 'deposit', '18', 'failed', '2025-06-23 09:56:34'),
(291, 'sylanravenwood@gmail.com', 'Deposit (USDC)', 'DEP_1750669779_97f4938e', '500', 'USDC', 'deposit', '18', 'failed', '2025-06-23 09:53:23'),
(292, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750680770_0601f3', '79.99', 'EUR', 'signal', '18', 'completed', '2025-06-23 13:12:50'),
(293, 'sylanravenwood@gmail.com', 'Signal', 'SIGBAL_1750680790_3db244', '149.99', 'EUR', 'signal', '18', 'completed', '2025-06-23 13:13:10');

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

--
-- Table structure for table `withraw_tb`
--

CREATE TABLE `withraw_tb` (
  `id` int NOT NULL,
  `userId` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `email` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `amount` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `currency` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `status` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `acct_receiver` text CHARACTER SET latin1 COLLATE latin1_swedish_ci,
  `date` datetime DEFAULT NULL,
  `method` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `narration` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `withraw_tb`
--

INSERT INTO `withraw_tb` (`id`, `userId`, `email`, `amount`, `currency`, `status`, `acct_receiver`, `date`, `method`, `narration`) VALUES
(60, '27', 'jdfxtd@gmail.com', '500', 'USD', 'Completed', 'Wallet Address - Fgfdgyr', '2025-04-22 00:14:14', 'BITCOIN', ''),
(61, '27', 'jdfxtd@gmail.com', '200', 'USD', 'Completed', 'Wallet Address - Ftyyf', '2025-04-22 18:11:59', 'BITCOIN', '');

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

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

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

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

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

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

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

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

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

--
-- Indexes for table `trading_tb`
--
ALTER TABLE `trading_tb`
  ADD PRIMARY KEY (`td_id`);

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

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

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

--
-- AUTO_INCREMENT for table `copy_trading_requests`
--
ALTER TABLE `copy_trading_requests`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT for table `crypto_addresses`
--
ALTER TABLE `crypto_addresses`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `deposits`
--
ALTER TABLE `deposits`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=120;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

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

--
-- AUTO_INCREMENT for table `signals`
--
ALTER TABLE `signals`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `trading_history`
--
ALTER TABLE `trading_history`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `trading_tb`
--
ALTER TABLE `trading_tb`
  MODIFY `td_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

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

--
-- AUTO_INCREMENT for table `withraw_tb`
--
ALTER TABLE `withraw_tb`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `copy_trading_requests`
--
ALTER TABLE `copy_trading_requests`
  ADD CONSTRAINT `copy_trading_requests_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `copy_trading_requests_ibfk_2` FOREIGN KEY (`trader_id`) REFERENCES `copy_traders` (`id`) ON DELETE CASCADE;

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

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

