-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 24, 2026 at 03:45 AM
-- Server version: 10.6.25-MariaDB
-- PHP Version: 8.4.16

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

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

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

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

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

INSERT INTO `admins` (`id`, `username`, `password`, `created_at`) VALUES
(1, 'admin', '$2y$10$XrGI73uubefPswSuJsQN..TzdrqXMIIXSNE.8NoV/zG.Hgh/8/v/y', '2026-02-14 14:36:29');

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

--
-- Table structure for table `announcements`
--

CREATE TABLE `announcements` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `type` varchar(30) NOT NULL DEFAULT 'message' COMMENT 'message, ad, contest',
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `black_list`
--

CREATE TABLE `black_list` (
  `id` int(255) NOT NULL,
  `info` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `chats`
--

CREATE TABLE `chats` (
  `id` int(255) NOT NULL,
  `user_id` bigint(10) NOT NULL,
  `create_date` int(255) NOT NULL,
  `title` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `category` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `state` int(5) NOT NULL,
  `rate` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `chats_info`
--

CREATE TABLE `chats_info` (
  `id` int(255) NOT NULL,
  `chat_id` int(255) NOT NULL,
  `sent_date` int(255) NOT NULL,
  `msg_type` varchar(50) DEFAULT NULL,
  `text` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `discounts`
--

CREATE TABLE `discounts` (
  `id` int(255) NOT NULL,
  `hash_id` varchar(100) NOT NULL,
  `type` varchar(10) NOT NULL,
  `amount` int(255) NOT NULL,
  `expire_date` int(255) NOT NULL,
  `expire_count` int(255) NOT NULL,
  `used_by` text DEFAULT NULL,
  `can_use` int(255) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `gift_list`
--

CREATE TABLE `gift_list` (
  `id` int(255) NOT NULL,
  `server_id` int(255) NOT NULL,
  `volume` int(255) NOT NULL,
  `day` int(255) NOT NULL,
  `offset` int(255) DEFAULT 0,
  `server_offset` int(255) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `increase_day`
--

CREATE TABLE `increase_day` (
  `id` int(255) NOT NULL,
  `volume` float NOT NULL,
  `price` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `increase_order`
--

CREATE TABLE `increase_order` (
  `id` int(255) NOT NULL,
  `userid` varchar(30) NOT NULL,
  `server_id` int(255) NOT NULL,
  `inbound_id` int(255) NOT NULL,
  `remark` varchar(100) NOT NULL,
  `amount` int(255) NOT NULL,
  `date` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `increase_plan`
--

CREATE TABLE `increase_plan` (
  `id` int(255) NOT NULL,
  `volume` float NOT NULL,
  `price` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `needed_sofwares`
--

CREATE TABLE `needed_sofwares` (
  `id` int(255) NOT NULL,
  `title` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_persian_ci NOT NULL,
  `link` varchar(250) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `needed_sofwares`
--

INSERT INTO `needed_sofwares` (`id`, `title`, `link`, `status`) VALUES
(1, 'ios fair-vpn', 'https://apps.apple.com/us/app/fair-vpn/id1533873488', 1),
(2, 'ios napsternetv', 'https://apps.apple.com/us/app/napsternetv/id1629465476', 1),
(3, 'ios oneclick', 'https://apps.apple.com/us/app/id1545555197', 1),
(4, 'android v2rayng', 'https://play.google.com/store/apps/details?id=com.v2ray.ang&hl=en&gl=US', 1),
(5, 'android sagernet', 'https://play.google.com/store/apps/details?id=io.nekohasekai.sagernet&hl=de&gl=US', 1),
(6, 'android onclick', 'https://play.google.com/store/apps/details?id=earth.oneclick', 1),
(7, 'windows v2rayng', 'https://google.com', 1),
(8, 'mac fair', 'https://apps.apple.com/us/app/fair-vpn/id1533873488', 1);

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

--
-- Table structure for table `orders_list`
--

CREATE TABLE `orders_list` (
  `id` int(11) NOT NULL,
  `userid` varchar(30) NOT NULL,
  `site_customer_id` int(11) DEFAULT NULL,
  `token` varchar(1000) NOT NULL,
  `transid` varchar(150) NOT NULL,
  `fileid` int(11) NOT NULL,
  `server_id` int(11) NOT NULL,
  `inbound_id` int(11) NOT NULL DEFAULT 0,
  `remark` varchar(100) NOT NULL,
  `uuid` text NOT NULL,
  `protocol` varchar(20) NOT NULL,
  `expire_date` int(11) NOT NULL,
  `link` text NOT NULL,
  `amount` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `date` varchar(50) NOT NULL,
  `notif` int(11) NOT NULL DEFAULT 0,
  `rahgozar` int(10) DEFAULT 0,
  `agent_bought` int(1) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci;

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

--
-- Table structure for table `panels`
--

CREATE TABLE `panels` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `url` varchar(500) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `proxy_type` varchar(20) DEFAULT NULL COMMENT 'نوع proxy: socks5',
  `proxy_host` varchar(255) DEFAULT NULL COMMENT 'آدرس proxy',
  `proxy_port` int(11) DEFAULT NULL COMMENT 'پورت proxy',
  `proxy_username` varchar(255) DEFAULT NULL COMMENT 'نام کاربری proxy',
  `proxy_password` varchar(255) DEFAULT NULL COMMENT 'رمز عبور proxy',
  `use_proxy` tinyint(1) DEFAULT 0 COMMENT 'استفاده از proxy در صورت خطا',
  `subscription_base_url` varchar(500) DEFAULT NULL COMMENT 'آدرس پایه برای لینک subscription (مثلاً https://sub.example.com)',
  `status` varchar(20) DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `panels`
--

INSERT INTO `panels` (`id`, `name`, `url`, `username`, `password`, `proxy_type`, `proxy_host`, `proxy_port`, `proxy_username`, `proxy_password`, `use_proxy`, `subscription_base_url`, `status`, `created_at`) VALUES
(27, 'irancell', 'http://5.75.174.88:2053/mute', 'ujadmin', 'ujadmin', '', '', NULL, '', '', 0, '', 'active', '2026-02-23 03:55:19');

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

--
-- Table structure for table `panel_inbounds`
--

CREATE TABLE `panel_inbounds` (
  `id` int(11) NOT NULL,
  `panel_id` int(11) NOT NULL,
  `inbound_id` int(11) NOT NULL COMMENT 'ID اینباند در پنل 3x-ui',
  `user_limit` int(11) NOT NULL DEFAULT 0 COMMENT 'حداکثر کاربر کل روی این اینباند، 0=نامحدود',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pays`
--

CREATE TABLE `pays` (
  `id` int(255) NOT NULL,
  `hash_id` varchar(1000) NOT NULL,
  `description` varchar(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `payid` varchar(500) DEFAULT NULL,
  `user_id` bigint(10) NOT NULL,
  `site_customer_id` int(11) DEFAULT NULL,
  `type` varchar(100) DEFAULT NULL,
  `plan_id` int(255) DEFAULT NULL,
  `volume` int(255) DEFAULT NULL,
  `day` int(255) DEFAULT NULL,
  `price` int(255) NOT NULL,
  `request_date` int(255) NOT NULL,
  `state` varchar(255) NOT NULL,
  `agent_bought` int(1) NOT NULL DEFAULT 0,
  `agent_count` int(255) NOT NULL DEFAULT 0,
  `message_id` int(11) DEFAULT NULL,
  `chat_id` varchar(500) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `representatives`
--

CREATE TABLE `representatives` (
  `id` int(11) NOT NULL,
  `username` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `full_name` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `panel_id` int(11) NOT NULL,
  `traffic_limit` bigint(20) DEFAULT 0 COMMENT 'حد ترافیک کل نماینده (بایت)',
  `used_traffic` bigint(20) DEFAULT 0 COMMENT 'ترافیک مصرف شده نماینده (بایت)',
  `expiry_date` datetime DEFAULT NULL COMMENT 'تاریخ انقضای دسترسی نماینده',
  `last_activity` datetime DEFAULT NULL COMMENT 'آخرین زمان فعالیت نماینده',
  `wallet_balance` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT 'موجودی کیف پول',
  `default_remark` varchar(255) DEFAULT NULL COMMENT 'ریمارک پیش‌فرض در ساخت کاربر',
  `price_per_gb` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT 'قیمت هر گیگ (0=حساب نشود)',
  `price_per_day` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT 'قیمت هر روز اعتبار (0=حساب نشود)',
  `discount_percent` tinyint(3) NOT NULL DEFAULT 0 COMMENT 'تخفیف درصدی نماینده (0-100)',
  `status` varchar(20) DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `credit_limit` decimal(15,2) NOT NULL DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representatives`
--

INSERT INTO `representatives` (`id`, `username`, `password`, `full_name`, `email`, `phone`, `panel_id`, `traffic_limit`, `used_traffic`, `expiry_date`, `last_activity`, `wallet_balance`, `default_remark`, `price_per_gb`, `price_per_day`, `discount_percent`, `status`, `created_at`, `credit_limit`) VALUES
(17, 'admin', '$2y$10$mMuP9a6Fwo3I5Iig1JPam.MxkgKMR74.edDHh6Gi2p99crpH5tJIa', '', '', '', 27, 0, 0, NULL, '2026-02-23 21:23:42', 1000000.00, NULL, 0.00, 0.00, 0, 'active', '2026-02-23 20:09:58', 0.00);

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

--
-- Table structure for table `representative_inbounds`
--

CREATE TABLE `representative_inbounds` (
  `id` int(11) NOT NULL,
  `representative_id` int(11) NOT NULL,
  `panel_id` int(11) DEFAULT NULL COMMENT 'پنل این اینباند',
  `inbound_id` int(11) NOT NULL COMMENT 'ID inbound در پنل 3x-ui',
  `inbound_name` varchar(255) DEFAULT NULL COMMENT 'نام inbound برای نمایش',
  `user_limit` int(11) NOT NULL DEFAULT 0 COMMENT 'حداکثر کاربر برای این اینباند، 0=نامحدود',
  `status` varchar(20) DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representative_inbounds`
--

INSERT INTO `representative_inbounds` (`id`, `representative_id`, `panel_id`, `inbound_id`, `inbound_name`, `user_limit`, `status`, `created_at`) VALUES
(1, 4, NULL, 2, NULL, 0, 'active', '2026-02-14 18:31:05'),
(3, 5, NULL, 2, NULL, 0, 'active', '2026-02-14 19:06:27'),
(4, 6, NULL, 2, NULL, 0, 'active', '2026-02-14 19:14:40'),
(6, 7, NULL, 22, NULL, 50, 'active', '2026-02-17 23:55:39'),
(7, 8, NULL, 22, NULL, 100, 'active', '2026-02-18 00:15:37'),
(8, 9, NULL, 21, NULL, 200, 'active', '2026-02-18 03:37:15'),
(10, 11, NULL, 21, NULL, 200, 'active', '2026-02-18 04:00:52'),
(13, 13, 17, 21, NULL, 200, 'active', '2026-02-18 04:12:23'),
(14, 12, 16, 20, NULL, 200, 'active', '2026-02-18 04:12:29'),
(24, 14, 16, 20, NULL, 200, 'active', '2026-02-18 06:24:59'),
(25, 14, 14, 22, NULL, 200, 'active', '2026-02-18 06:24:59'),
(26, 14, 15, 1, NULL, 200, 'active', '2026-02-18 06:24:59'),
(27, 14, 15, 2, NULL, 200, 'active', '2026-02-18 06:24:59'),
(28, 14, 19, 3, NULL, 200, 'active', '2026-02-18 06:24:59'),
(29, 14, 19, 4, NULL, 200, 'active', '2026-02-18 06:24:59'),
(30, 14, 19, 5, NULL, 200, 'active', '2026-02-18 06:24:59'),
(31, 14, 19, 6, NULL, 200, 'active', '2026-02-18 06:24:59'),
(32, 14, 21, 7, NULL, 200, 'active', '2026-02-18 06:24:59'),
(33, 14, 21, 8, NULL, 200, 'active', '2026-02-18 06:24:59'),
(34, 14, 21, 9, NULL, 200, 'active', '2026-02-18 06:24:59'),
(35, 14, 21, 10, NULL, 200, 'active', '2026-02-18 06:24:59'),
(36, 14, 21, 11, NULL, 200, 'active', '2026-02-18 06:24:59'),
(37, 14, 21, 12, NULL, 200, 'active', '2026-02-18 06:24:59'),
(38, 15, 22, 21, NULL, 200, 'active', '2026-02-18 06:50:17'),
(39, 16, 14, 22, NULL, 200, 'active', '2026-02-19 12:20:40'),
(40, 17, 27, 33, NULL, 200, 'active', '2026-02-23 20:09:58'),
(41, 17, 27, 34, NULL, 200, 'active', '2026-02-23 20:09:58'),
(42, 17, 27, 35, NULL, 200, 'active', '2026-02-23 20:09:58');

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

--
-- Table structure for table `representative_logs`
--

CREATE TABLE `representative_logs` (
  `id` int(11) NOT NULL,
  `representative_id` int(11) NOT NULL,
  `action` varchar(100) NOT NULL COMMENT 'نوع عمل: create_user, update_user, delete_user',
  `user_id` int(11) DEFAULT NULL COMMENT 'ID کاربر در reseller_users',
  `details` text DEFAULT NULL COMMENT 'جزئیات عمل',
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `representative_logs`
--

INSERT INTO `representative_logs` (`id`, `representative_id`, `action`, `user_id`, `details`, `ip_address`, `created_at`) VALUES
(1, 4, 'create_user', 1, 'ایجاد کاربر: 4123412', '168.119.186.37', '2026-02-14 18:45:05'),
(2, 4, 'create_user', 2, 'ایجاد کاربر: ahmadtesdt', '168.119.186.37', '2026-02-14 18:45:47'),
(3, 4, 'create_user', 3, 'ایجاد کاربر: ahmadtest2', '168.119.186.37', '2026-02-14 18:49:34'),
(4, 5, 'create_user', 4, 'ایجاد کاربر: 1', '213.195.1.28', '2026-02-14 19:06:59'),
(5, 6, 'create_user', 5, 'ایجاد کاربر: 122', '213.195.1.28', '2026-02-14 19:15:12'),
(6, 6, 'create_user', 6, 'ایجاد کاربر: 456456436', '213.195.1.28', '2026-02-14 19:47:20'),
(7, 6, 'create_user', 7, 'ایجاد کاربر: 123', '213.195.1.28', '2026-02-14 19:52:23'),
(8, 6, 'create_user', 8, 'ایجاد کاربر: rrr', '213.195.1.28', '2026-02-14 20:04:41'),
(9, 6, 'delete_user', 8, 'حذف کاربر: rrr', '213.195.1.28', '2026-02-14 20:05:41'),
(10, 6, 'delete_user', 7, 'حذف کاربر: 123', '213.195.1.28', '2026-02-14 20:05:47'),
(11, 6, 'delete_user', 6, 'حذف کاربر: 456456436', '213.195.1.28', '2026-02-14 20:05:53'),
(12, 7, 'create_user', 9, 'ایجاد کاربر: 12', '213.195.4.212', '2026-02-17 22:21:55'),
(13, 7, 'delete_user', 9, 'حذف کاربر: 12', '213.195.4.212', '2026-02-17 22:27:16'),
(14, 7, 'create_user', 10, 'ایجاد کاربر: 1', '213.195.4.212', '2026-02-17 22:27:39'),
(15, 7, 'delete_user', 10, 'حذف کاربر: 1', '213.195.4.212', '2026-02-17 22:32:50'),
(16, 7, 'create_user', 11, 'ایجاد کاربر: 1111', '65.109.221.112', '2026-02-17 23:13:26'),
(17, 15, 'create_user', 293, 'ایجاد کاربر: 12', '213.195.0.194', '2026-02-18 07:07:51'),
(18, 15, 'delete_user', 293, 'حذف کاربر: 12', '213.195.0.194', '2026-02-18 07:08:09'),
(19, 14, 'create_user', 294, 'ایجاد کاربر: masood', '213.195.2.185', '2026-02-19 09:22:36'),
(20, 16, 'create_user', 295, 'ایجاد کاربر: masood22', '91.107.181.52', '2026-02-19 12:23:40'),
(21, 16, 'delete_user', 295, 'حذف کاربر: masood22', '91.107.181.52', '2026-02-19 12:29:16'),
(22, 16, 'create_user', 296, 'ایجاد کاربر: 1121', '91.107.181.52', '2026-02-19 12:29:26'),
(23, 16, 'create_user', 297, 'ایجاد کاربر: 12', '91.107.172.89', '2026-02-19 13:32:56'),
(24, 16, 'delete_user', 296, 'حذف کاربر: 1121', '91.107.172.89', '2026-02-19 13:37:32'),
(25, 16, 'delete_user', 297, 'حذف کاربر: 12', '91.107.172.89', '2026-02-19 13:37:34'),
(26, 16, 'create_user', 298, 'ایجاد کاربر: 4tt', '91.107.172.89', '2026-02-19 13:43:20'),
(27, 16, 'create_user', 299, 'ایجاد کاربر: tst2', '213.195.3.160', '2026-02-19 17:13:58'),
(28, 16, 'delete_user', 299, 'حذف کاربر: tst2', '213.195.3.160', '2026-02-19 17:21:34'),
(29, 16, 'create_user', 300, 'ایجاد کاربر: 10', '213.195.3.160', '2026-02-19 17:22:17'),
(30, 16, 'create_user', 301, 'ایجاد کاربر: 22222', '188.245.122.112', '2026-02-19 17:24:31'),
(31, 16, 'delete_user', 301, 'حذف کاربر: 22222', '213.195.3.160', '2026-02-19 17:34:30'),
(32, 16, 'delete_user', 300, 'حذف کاربر: 10', '213.195.3.160', '2026-02-19 17:34:33'),
(33, 16, 'delete_user', 298, 'حذف کاربر: 4tt', '213.195.3.160', '2026-02-19 17:34:37'),
(34, 16, 'create_user', 302, 'ایجاد کاربر: t1test', '213.195.3.160', '2026-02-19 17:40:45'),
(35, 16, 'delete_user', 302, 'حذف کاربر: t1test', '188.245.122.112', '2026-02-19 17:43:29'),
(36, 16, 'create_user', 303, 'ایجاد کاربر: 1t11', '188.245.122.112', '2026-02-19 17:43:44'),
(37, 16, 'delete_user', 303, 'حذف کاربر: 1t11', '91.107.172.89', '2026-02-19 17:58:07'),
(38, 16, 'create_user', 304, 'ایجاد کاربر: tqq', '91.107.172.89', '2026-02-19 17:58:25'),
(39, 16, 'delete_user', 304, 'حذف کاربر: tqq', '213.195.2.185', '2026-02-19 18:21:02'),
(40, 16, 'create_user', 305, 'ایجاد کاربر: 1111', '213.195.2.185', '2026-02-19 18:21:14'),
(41, 16, 'delete_user', 305, 'حذف کاربر: 1111', '213.195.2.185', '2026-02-19 18:22:38'),
(42, 16, 'create_user', 306, 'ایجاد کاربر: 1111111', '91.107.172.89', '2026-02-19 20:54:24'),
(43, 16, 'create_user', 307, 'ایجاد کاربر: 112', '213.195.3.160', '2026-02-19 21:48:55'),
(44, 16, 'delete_user', 307, 'حذف کاربر: 112', '91.107.181.52', '2026-02-19 22:42:45'),
(45, 16, 'delete_user', 306, 'حذف کاربر: 1111111', '91.107.181.52', '2026-02-19 22:42:48'),
(46, 16, 'create_user', 308, 'ایجاد کاربر: 112343', '91.107.181.52', '2026-02-19 22:42:59'),
(47, 16, 'create_user', 309, 'ایجاد کاربر: tq1', '91.107.181.52', '2026-02-19 22:47:27'),
(48, 16, 'delete_user', 309, 'حذف کاربر: tq1', '91.107.181.52', '2026-02-19 23:12:31'),
(49, 16, 'delete_user', 308, 'حذف کاربر: 112343', '91.107.181.52', '2026-02-19 23:12:35'),
(50, 16, 'create_user', 310, 'ایجاد کاربر: 123', '91.107.181.52', '2026-02-19 23:12:47'),
(51, 16, 'create_user', 311, 'ایجاد کاربر: we', '91.107.181.52', '2026-02-20 01:05:07'),
(52, 16, 'delete_user', 310, 'حذف کاربر: 123', '91.107.181.52', '2026-02-20 01:07:04'),
(53, 16, 'create_user', 312, 'ایجاد کاربر: 12', '91.107.181.52', '2026-02-20 01:07:30'),
(54, 16, 'create_user', 313, 'ایجاد کاربر: 11233', '213.195.0.98', '2026-02-20 02:21:13'),
(55, 16, 'create_user', 314, 'ایجاد کاربر: 232345234', '91.107.165.174', '2026-02-20 03:50:01'),
(56, 16, 'delete_user', 311, 'حذف کاربر: we', '91.107.181.52', '2026-02-20 03:52:46'),
(57, 16, 'delete_user', 312, 'حذف کاربر: 12', '213.195.0.98', '2026-02-20 03:53:15'),
(58, 16, 'delete_user', 313, 'حذف کاربر: 11233', '213.195.0.98', '2026-02-20 03:53:18'),
(59, 12, 'create_user', 315, 'ایجاد کاربر: 22', '91.107.172.89', '2026-02-21 23:24:40'),
(60, 12, 'create_user', 316, 'ایجاد کاربر: 33', '91.107.181.52', '2026-02-21 23:28:08'),
(61, 17, 'create_user', 317, 'ایجاد کاربر: 11', '91.107.172.89', '2026-02-23 20:11:28');

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

--
-- Table structure for table `reseller_users`
--

CREATE TABLE `reseller_users` (
  `id` int(11) NOT NULL,
  `representative_id` int(11) NOT NULL,
  `panel_id` int(11) NOT NULL,
  `xray_user_id` varchar(255) DEFAULT NULL,
  `sub_id` varchar(64) DEFAULT NULL COMMENT 'شناسه subscription کلاینت در پنل 3x-ui',
  `inbound_id` int(11) DEFAULT NULL,
  `email` varchar(255) NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `total_traffic` bigint(20) DEFAULT 0,
  `traffic_limit` bigint(20) DEFAULT 0,
  `expiry_date` datetime DEFAULT NULL,
  `status` varchar(20) DEFAULT 'active',
  `check_token` varchar(64) DEFAULT NULL COMMENT 'کد استعلام وضعیت',
  `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;

--
-- Dumping data for table `reseller_users`
--

INSERT INTO `reseller_users` (`id`, `representative_id`, `panel_id`, `xray_user_id`, `sub_id`, `inbound_id`, `email`, `remark`, `total_traffic`, `traffic_limit`, `expiry_date`, `status`, `check_token`, `created_at`, `updated_at`) VALUES
(317, 17, 27, '603bb818-e875-4f0a-8a29-e9b22c2a5099', '8d21d39e-e2ee-429d-b2f9-87978424d560', 33, '11', '1', 0, 11811160064, '2026-03-06 20:11:28', 'active', 'bde90764d4e27543f572b6f96b3fee4e', '2026-02-23 20:11:28', '2026-02-23 20:11:28');

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

--
-- Table structure for table `send_list`
--

CREATE TABLE `send_list` (
  `id` int(255) NOT NULL,
  `offset` int(255) NOT NULL DEFAULT 0,
  `type` varchar(20) NOT NULL,
  `text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `chat_id` bigint(10) DEFAULT NULL,
  `message_id` int(255) DEFAULT NULL,
  `file_id` varchar(500) DEFAULT NULL,
  `state` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `servers`
--

CREATE TABLE `servers` (
  `id` int(11) NOT NULL,
  `ip` varchar(200) NOT NULL,
  `port` int(10) NOT NULL,
  `username` varchar(200) NOT NULL,
  `password` varchar(200) NOT NULL,
  `name` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_persian_ci NOT NULL,
  `panel` varchar(100) NOT NULL,
  `status` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci;

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

--
-- Table structure for table `server_categories`
--

CREATE TABLE `server_categories` (
  `id` int(11) NOT NULL,
  `server_id` varchar(20) NOT NULL,
  `title` varchar(50) NOT NULL,
  `parent` int(11) NOT NULL DEFAULT 0,
  `step` int(11) NOT NULL,
  `active` int(11) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci;

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

--
-- Table structure for table `server_config`
--

CREATE TABLE `server_config` (
  `id` int(11) NOT NULL,
  `panel_url` varchar(254) NOT NULL,
  `ip` text NOT NULL,
  `sni` varchar(254) NOT NULL,
  `header_type` enum('none','http') NOT NULL,
  `request_header` text NOT NULL,
  `response_header` text NOT NULL,
  `security` enum('xtls','tls','none') NOT NULL,
  `tlsSettings` text NOT NULL,
  `type` varchar(100) DEFAULT NULL,
  `username` varchar(100) NOT NULL,
  `password` varchar(100) NOT NULL,
  `port_type` varchar(10) DEFAULT 'auto',
  `reality` varchar(10) DEFAULT 'false'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `server_info`
--

CREATE TABLE `server_info` (
  `id` int(11) NOT NULL,
  `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `ucount` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `remark` varchar(100) NOT NULL,
  `flag` varchar(100) NOT NULL,
  `active` int(11) NOT NULL DEFAULT 0,
  `state` int(255) NOT NULL DEFAULT 1
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci;

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

--
-- Table structure for table `server_plans`
--

CREATE TABLE `server_plans` (
  `id` int(11) NOT NULL,
  `fileid` varchar(250) NOT NULL,
  `catid` int(11) NOT NULL,
  `server_id` int(11) NOT NULL,
  `inbound_id` int(11) NOT NULL DEFAULT 0,
  `acount` bigint(20) NOT NULL,
  `limitip` int(11) NOT NULL DEFAULT 1,
  `title` varchar(150) NOT NULL,
  `protocol` varchar(100) NOT NULL,
  `days` float NOT NULL,
  `volume` float NOT NULL,
  `type` varchar(50) NOT NULL,
  `price` int(11) NOT NULL,
  `descr` text NOT NULL,
  `pic` varchar(100) NOT NULL,
  `active` int(11) NOT NULL DEFAULT 0,
  `step` int(11) NOT NULL,
  `date` varchar(50) NOT NULL,
  `rahgozar` int(10) DEFAULT 0,
  `dest` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `serverNames` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `spiderX` varchar(500) DEFAULT NULL,
  `flow` varchar(50) DEFAULT 'None',
  `custom_path` int(10) DEFAULT 1,
  `custom_port` int(255) NOT NULL DEFAULT 0,
  `custom_sni` varchar(500) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci;

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

--
-- Table structure for table `setting`
--

CREATE TABLE `setting` (
  `id` int(255) NOT NULL,
  `type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `setting`
--

INSERT INTO `setting` (`id`, `type`, `value`) VALUES
(1, 'TICKETS_CATEGORY', 'شکایت'),
(2, 'INVITE_BANNER_AMOUNT', '3000'),
(3, 'INVITE_BANNER_TEXT', '{\"type\":\"photo\",\"caption\":\"ud83dudd30u0628u0631u062au0631u06ccu0646 u0648 u0628u0647u062au0631u06ccu0646 u0631u0628u0627u062a vpn u0628u0627 u06a9u0627u0646u06a9u0634u0646 u0647u0627u06cc u0631u0627u06ccu06afu0627u0646\nu2705 u062du062au0645u0627 u0639u0636u0648 u0631u0628u0627u062a u0628u0634u06ccu062f u0648 u0627u0632 u062au062eu0641u06ccu0641 u0647u0627u06cc u0648u06ccu0698u0647 u0644u0630u062a u0628u0628u0631u06ccu0646\n\nud83dudd17 LINK\",\"file_id\":\"AgACAgQAAxkBAAJRKWRtX3wObRa3qAR_gkJgyKDdkHZsAAKAuzEbRaBpU3QQ2kLLt7MVAQADAgADeAADLwQ\"}'),
(4, 'PAYMENT_KEYS', '{\"nowpayment\":\"cccc-cccc-cccc-cccc\",\"zarinpal\":\"aaaa-aaaa-aaaa-aaaa\",\"nextpay\":\"bbbb-bbbb-bbbb-bbbb\",\"bankAccount\":\"6104-6104-6104-6104\",\"holderName\":\"u0648u06ccu0632u0648u06ccu0632\"}'),
(5, 'BOT_STATES', '{\"requirePhone\":\"off\",\"requireIranPhone\":\"off\",\"sellState\":\"on\",\"botState\":\"on\",\"searchState\":\"on\",\"rewaredTime\":\"3\",\"cartToCartState\":\"on\",\"nextpay\":\"on\",\"zarinpal\":\"on\",\"nowPaymentWallet\":\"on\",\"nowPaymentOther\":\"on\",\"walletState\":\"on\",\"rewardChannel\":\"@wizwizdev\",\"lockChannel\":\"@wizwizch\",\"changeProtocolState\":null,\"renewAccountState\":null,\"switchLocationState\":\"on\",\"increaseTimeState\":\"on\",\"increaseVolumeState\":\"on\",\"gbPrice\":\"100\",\"dayPrice\":\"100\",\"subLinkState\":\"on\",\"plandelkhahState\":\"off\",\"weSwapState\":\"on\"}');

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

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

CREATE TABLE `settings` (
  `name` varchar(100) NOT NULL,
  `value` text DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `settings` (`name`, `value`, `updated_at`) VALUES
('allow_inbound_change', '1', '2026-02-22 00:05:45'),
('allow_refund', '1', '2026-02-22 00:05:45'),
('cron_secret_key', 'sdfao8uasdofuasdfnklas;dfsdhfpashdfpaspdhfaspdfpashdfashgdfaspdghfasdfa23452352345fdsgsdgGGFFGGSADYIFA78nasadifouya8978OIUYHDSAFIUA', '2026-02-20 04:15:18'),
('default_discount_percent', '0', '2026-02-18 03:22:46'),
('default_inbound_user_limit', '200', '2026-02-18 03:33:18'),
('max_traffic_per_user_gb', '70', '2026-02-22 00:05:45'),
('max_users_per_representative', '100', '2026-02-22 00:05:45'),
('min_traffic_extra_charge', '20000', '2026-02-22 00:05:45'),
('min_traffic_gb_for_normal_price', '10', '2026-02-20 04:15:18'),
('min_traffic_per_user_gb', '10', '2026-02-22 00:05:45'),
('referral_enabled', '1', '2026-02-22 00:05:45'),
('referral_reward_amount', '150000', '2026-02-22 00:05:45'),
('telegram_bot_token', '8195835335:AAHKYcS0qmnufSKz-zkQ0x3cEDlKnmuOkSo', '2026-02-18 03:51:12'),
('wallet_price_per_config', '0', '2026-02-18 03:25:46'),
('wallet_price_per_day', '0', '2026-02-18 03:03:49'),
('wallet_price_per_gb', '2000', '2026-02-18 03:25:46');

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

--
-- Table structure for table `site_customers`
--

CREATE TABLE `site_customers` (
  `id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `name` varchar(150) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `id` int(11) NOT NULL,
  `representative_id` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'open' COMMENT 'open, answered, closed',
  `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;

--
-- Dumping data for table `tickets`
--

INSERT INTO `tickets` (`id`, `representative_id`, `subject`, `status`, `created_at`, `updated_at`) VALUES
(1, 12, 'پشتیبانی نماینده mazi', 'open', '2026-02-23 03:48:27', '2026-02-23 03:48:27');

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

--
-- Table structure for table `ticket_messages`
--

CREATE TABLE `ticket_messages` (
  `id` int(11) NOT NULL,
  `ticket_id` int(11) NOT NULL,
  `sender_type` varchar(20) NOT NULL COMMENT 'representative یا admin',
  `sender_id` int(11) DEFAULT NULL COMMENT 'id ادمین یا نماینده',
  `message` text NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `userid` varchar(40) NOT NULL,
  `name` varchar(100) NOT NULL,
  `username` varchar(100) NOT NULL,
  `refcode` varchar(50) NOT NULL,
  `wallet` int(11) NOT NULL DEFAULT 0,
  `date` varchar(50) NOT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `refered_by` bigint(10) DEFAULT NULL,
  `step` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'none',
  `freetrial` varchar(10) DEFAULT NULL,
  `isAdmin` tinyint(1) NOT NULL DEFAULT 0,
  `first_start` varchar(10) DEFAULT NULL,
  `temp` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `is_agent` int(1) NOT NULL DEFAULT 0,
  `discount_percent` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `agent_date` int(255) NOT NULL DEFAULT 0,
  `spam_info` varchar(500) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_persian_ci;

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

--
-- Table structure for table `wallet_transactions`
--

CREATE TABLE `wallet_transactions` (
  `id` int(11) NOT NULL,
  `representative_id` int(11) NOT NULL,
  `amount` decimal(12,2) NOT NULL COMMENT 'مثبت=واریز، منفی=برداشت',
  `type` varchar(50) NOT NULL DEFAULT 'create_user',
  `ref_id` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `wallet_transactions`
--

INSERT INTO `wallet_transactions` (`id`, `representative_id`, `amount`, `type`, `ref_id`, `description`, `created_at`) VALUES
(1, 7, 200000.00, 'admin_deposit', NULL, 'واریز توسط ادمین', '2026-02-17 22:42:07'),
(2, 7, -1000.00, 'create_user', NULL, 'ساخت کاربر: 1111', '2026-02-17 23:13:26'),
(3, 8, 200000.00, 'admin_deposit', NULL, 'احمد', '2026-02-18 00:16:14'),
(4, 16, 20000.00, 'admin_deposit', NULL, 'واریز توسط ادمین', '2026-02-19 12:21:17'),
(5, 16, 2000000.00, 'admin_deposit', NULL, 'واریز توسط ادمین', '2026-02-19 12:21:33'),
(6, 16, -90000.00, 'create_user', NULL, 'ساخت کاربر: masood22 (30 GB)', '2026-02-19 12:23:40'),
(7, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 4tt (1 GB)', '2026-02-19 13:43:20'),
(8, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: tst2 (1 GB)', '2026-02-19 17:13:58'),
(9, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 22222 (1 GB)', '2026-02-19 17:24:31'),
(10, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: test (1 GB)', '2026-02-19 17:40:17'),
(11, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: t1test (1 GB)', '2026-02-19 17:40:45'),
(12, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 1t11 (1 GB)', '2026-02-19 17:43:44'),
(13, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: tqq (1 GB)', '2026-02-19 17:58:25'),
(14, 16, -33000.00, 'create_user', NULL, 'ساخت کاربر: 1111 (11 GB)', '2026-02-19 18:21:14'),
(15, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 1111111 (1 GB)', '2026-02-19 20:54:24'),
(16, 16, -99000.00, 'create_user', NULL, 'ساخت کاربر: 112 (33 GB)', '2026-02-19 21:48:55'),
(17, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 112343 (1 GB)', '2026-02-19 22:42:58'),
(18, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: tq1 (1 GB)', '2026-02-19 22:47:27'),
(19, 16, -33000.00, 'create_user', NULL, 'ساخت کاربر: 123 (11 GB)', '2026-02-19 23:12:46'),
(20, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: we (1 GB)', '2026-02-20 01:05:06'),
(21, 16, -66000.00, 'create_user', NULL, 'ساخت کاربر: 12 (22 GB)', '2026-02-20 01:07:30'),
(22, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 11233 (1 GB)', '2026-02-20 02:21:13'),
(23, 16, -3000.00, 'create_user', NULL, 'ساخت کاربر: 232345234 (1 GB)', '2026-02-20 03:50:00'),
(24, 12, 500000.00, 'admin_deposit', NULL, 'واریز توسط ادمین', '2026-02-21 23:14:08'),
(25, 12, -3000.00, 'create_user', NULL, 'ساخت کاربر: 22 (1 GB)', '2026-02-21 23:24:39'),
(26, 12, -30000.00, 'create_user', NULL, 'ساخت کاربر: 33 (10 GB)', '2026-02-21 23:28:07'),
(27, 17, 1000000.00, 'admin_deposit', NULL, 'واریز توسط ادمین', '2026-02-23 20:10:10');

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

--
-- Table structure for table `wizwiz_admins`
--

CREATE TABLE `wizwiz_admins` (
  `id` int(10) NOT NULL,
  `username` varchar(200) NOT NULL,
  `password` varchar(200) NOT NULL,
  `backupchannel` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `lang` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `wizwiz_admins`
--

INSERT INTO `wizwiz_admins` (`id`, `username`, `password`, `backupchannel`, `lang`) VALUES
(1, 'e5oAiqMGjvU$X1t', '9KM4l@xCaATf3Zh', '-1002545458541', 'en'),
(2, 'OpelZYDSuhBbkTx', 'oqcJHImnUMTVRp7', '-1002545458541', 'en');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `announcements`
--
ALTER TABLE `announcements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `active` (`active`);

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

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

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

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

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

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

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

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

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

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

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

--
-- Indexes for table `panel_inbounds`
--
ALTER TABLE `panel_inbounds`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_panel_inbound` (`panel_id`,`inbound_id`),
  ADD KEY `panel_id` (`panel_id`);

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

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

--
-- Indexes for table `representative_inbounds`
--
ALTER TABLE `representative_inbounds`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_rep_inbound` (`representative_id`,`inbound_id`),
  ADD KEY `representative_id` (`representative_id`);

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

--
-- Indexes for table `reseller_users`
--
ALTER TABLE `reseller_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `check_token` (`check_token`),
  ADD KEY `representative_id` (`representative_id`),
  ADD KEY `panel_id` (`panel_id`),
  ADD KEY `email` (`email`),
  ADD KEY `status` (`status`),
  ADD KEY `expiry_date` (`expiry_date`);

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

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

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

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

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

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

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

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

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

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

--
-- Indexes for table `ticket_messages`
--
ALTER TABLE `ticket_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ticket_id` (`ticket_id`);

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

--
-- AUTO_INCREMENT for table `black_list`
--
ALTER TABLE `black_list`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chats`
--
ALTER TABLE `chats`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chats_info`
--
ALTER TABLE `chats_info`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discounts`
--
ALTER TABLE `discounts`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gift_list`
--
ALTER TABLE `gift_list`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `increase_day`
--
ALTER TABLE `increase_day`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `increase_order`
--
ALTER TABLE `increase_order`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `increase_plan`
--
ALTER TABLE `increase_plan`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

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

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

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

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

--
-- AUTO_INCREMENT for table `pays`
--
ALTER TABLE `pays`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

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

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

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

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

--
-- AUTO_INCREMENT for table `send_list`
--
ALTER TABLE `send_list`
  MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;

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

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `representatives`
--
ALTER TABLE `representatives`
  ADD CONSTRAINT `fk_representatives_panel` FOREIGN KEY (`panel_id`) REFERENCES `panels` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reseller_users`
--
ALTER TABLE `reseller_users`
  ADD CONSTRAINT `fk_reseller_users_panel` FOREIGN KEY (`panel_id`) REFERENCES `panels` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_reseller_users_representative` FOREIGN KEY (`representative_id`) REFERENCES `representatives` (`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 */;
