--
-- Host: localhost    Database: byte
-- ------------------------------------------------------


--
-- Table structure for table `nasreload`
--

CREATE TABLE `nasreload` (
  `nasipaddress` varchar(15) NOT NULL,
  `reloadtime` datetime NOT NULL,
  PRIMARY KEY (`nasipaddress`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `nasreload`
--


--
-- Table structure for table `radacct`
--

CREATE TABLE `radacct` (
  `radacctid` bigint NOT NULL AUTO_INCREMENT,
  `acctsessionid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `acctuniqueid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `realm` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `nasipaddress` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `nasportid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `nasporttype` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `acctstarttime` datetime DEFAULT NULL,
  `acctupdatetime` datetime DEFAULT NULL,
  `acctstoptime` datetime DEFAULT NULL,
  `acctinterval` int DEFAULT NULL,
  `acctsessiontime` int unsigned DEFAULT NULL,
  `acctauthentic` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `connectinfo_start` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `connectinfo_stop` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `acctinputoctets` bigint DEFAULT NULL,
  `acctoutputoctets` bigint DEFAULT NULL,
  `calledstationid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `callingstationid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `acctterminatecause` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `servicetype` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `framedprotocol` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `framedipaddress` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `framedipv6address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `framedipv6prefix` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `framedinterfaceid` varchar(44) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `delegatedipv6prefix` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `class` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`radacctid`),
  UNIQUE KEY `acctuniqueid` (`acctuniqueid`),
  KEY `username` (`username`),
  KEY `framedipaddress` (`framedipaddress`),
  KEY `framedipv6address` (`framedipv6address`),
  KEY `framedipv6prefix` (`framedipv6prefix`),
  KEY `framedinterfaceid` (`framedinterfaceid`),
  KEY `delegatedipv6prefix` (`delegatedipv6prefix`),
  KEY `acctsessionid` (`acctsessionid`),
  KEY `acctsessiontime` (`acctsessiontime`),
  KEY `acctstarttime` (`acctstarttime`),
  KEY `acctinterval` (`acctinterval`),
  KEY `acctstoptime` (`acctstoptime`),
  KEY `nasipaddress` (`nasipaddress`),
  KEY `class` (`class`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `radacct`
--


--
-- Table structure for table `radcheck`
--

CREATE TABLE `radcheck` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `attribute` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `op` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '==',
  `value` varchar(253) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `username` (`username`(32))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `radcheck`
--


--
-- Table structure for table `radgroupcheck`
--

CREATE TABLE `radgroupcheck` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `groupname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `attribute` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `op` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '==',
  `value` varchar(253) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `groupname` (`groupname`(32))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `radgroupcheck`
--


--
-- Table structure for table `radgroupreply`
--

CREATE TABLE `radgroupreply` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `groupname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `attribute` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `op` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '=',
  `value` varchar(253) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `plan_id` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `groupname` (`groupname`(32))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `radgroupreply`
--


--
-- Table structure for table `radreply`
--

CREATE TABLE `radreply` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `attribute` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `op` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '=',
  `value` varchar(253) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `username` (`username`(32))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `radreply`
--


--
-- Table structure for table `radusergroup`
--

CREATE TABLE `radusergroup` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `groupname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `priority` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `username` (`username`(32))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `radusergroup`
--


--
-- Table structure for table `tb_languages`
--

CREATE TABLE `tb_languages` (
  `id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tb_languages`
--


--
-- Table structure for table `tbl_appconfig`
--

CREATE TABLE `tbl_appconfig` (
  `id` int NOT NULL AUTO_INCREMENT,
  `setting` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_appconfig`
--

INSERT INTO `tbl_appconfig` VALUES (1,'CompanyName','ByteRadius'),(2,'currency_code','Kes.'),(3,'language','english'),(4,'show-logo','1'),(5,'nstyle','blue'),(6,'timezone','Asia/Jakarta'),(7,'dec_point',','),(8,'thousands_sep','.'),(9,'rtl','0'),(10,'address',''),(11,'phone',''),(12,'date_format','d M Y'),(13,'note','Thank you...'),(14,'api_key','60|wMNX8WcxrIuRAal5LseGW8ixwGlMljl4nIrMQpN5'),(15,'CompanyFooter','wifi mtaani'),(16,'printer_cols','37'),(17,'theme','default'),(18,'payment_usings',''),(19,'disable_voucher','no'),(20,'voucher_format','numbers'),(21,'disable_registration','no'),(22,'voucher_redirect',''),(23,'radius_enable','1'),(24,'radius_client',''),(25,'extend_expired','1'),(26,'extend_days',''),(27,'extend_confirmation',''),(28,'enable_balance','yes'),(29,'allow_balance_transfer','yes'),(30,'minimum_transfer',''),(31,'telegram_bot','7082555418:AAHSQ2AAMYzX1VekBHjH1eldpC7dWkvBuKU'),(32,'telegram_target_id','7082555418'),(33,'sms_url','https://api.netguru.co.ke/bytewave.php?message=[text]&phone=[number]&senderid=Lineserve&api=60|wMNX8WcxrIuRAal5LseGW8ixwGlMljl4nIrMQpN5'),(34,'wa_url',''),(35,'smtp_host',''),(36,'smtp_port',''),(37,'smtp_user',''),(38,'smtp_pass',''),(39,'smtp_ssltls',''),(40,'mail_from',''),(41,'mail_reply_to',''),(42,'user_notification_expired','none'),(43,'user_notification_payment','none'),(44,'user_notification_reminder','none'),(45,'tawkto',''),(46,'http_proxy',''),(47,'http_proxyauth',''),(48,'allow_phone_otp','no'),(49,'phone_otp_type','sms'),(50,'extend_expiry','no'),(51,'enable_tax','no'),(52,'tax_rate','0.5'),(53,'custom_tax_rate',''),(54,'hide_mrc','no'),(55,'hide_tms','no'),(56,'hide_aui','no'),(57,'hide_al','no'),(58,'hide_uet','no'),(59,'hide_vs','no'),(60,'hide_pg','no'),(61,'country_code_phone','254'),(62,'radius_plan','Radius Plan'),(63,'hotspot_plan','Hotspot Plan'),(64,'pppoe_plan','PPPOE Plan'),(65,'payment_gateway','mpesa'),(66,'maintenance_mode','0'),(67,'maintenance_mode_logout','0'),(68,'maintenance_date',''),(69,'sms_provider','bytewave'),(70,'sender_id','Lineserve');

--
-- Table structure for table `tbl_bandwidth`
--

CREATE TABLE `tbl_bandwidth` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name_bw` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `rate_down` int unsigned NOT NULL,
  `rate_down_unit` enum('Kbps','Mbps') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `rate_up` int unsigned NOT NULL,
  `rate_up_unit` enum('Kbps','Mbps') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `burst` varchar(128) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_bandwidth`
--

INSERT INTO `tbl_bandwidth` VALUES (1,'10M_10M',10,'Mbps',10,'Mbps',''),(2,'3M_3M',3,'Mbps',3,'Mbps',''),(3,'2M_2M',2,'Mbps',2,'Mbps','');

--
-- Table structure for table `tbl_customers_fields`
--

CREATE TABLE `tbl_customers_fields` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `field_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `field_value` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_id` (`customer_id`),
  CONSTRAINT `tbl_customers_fields_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `tbl_customers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_customers_fields`
--


--
-- Table structure for table `tbl_logs`
--

CREATE TABLE `tbl_logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `date` datetime DEFAULT NULL,
  `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `userid` int NOT NULL,
  `ip` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_logs`
--

INSERT INTO `tbl_logs` VALUES (1,'2024-05-23 12:38:42','SuperAdmin','admin Login Successful',1,'154.159.252.213'),(2,'2024-05-23 12:43:40','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(3,'2024-05-23 12:46:31','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(4,'2024-05-23 13:40:21','SuperAdmin','admin Login Successful',1,'41.81.58.72'),(5,'2024-05-23 23:16:07','SuperAdmin','admin Login Successful',1,'41.72.199.210'),(6,'2024-05-23 23:16:34','SuperAdmin','Admin Login Successful',1,'154.159.252.213'),(7,'2024-05-23 23:22:10','SuperAdmin','Admin Failed Login',0,'105.21.41.234'),(8,'2024-05-23 23:22:26','SuperAdmin','Admin Failed Login',0,'105.21.41.234'),(9,'2024-05-23 23:22:43','SuperAdmin','admin Login Successful',1,'105.21.41.234'),(10,'2024-05-24 02:09:37','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(11,'2024-05-24 02:31:40','SuperAdmin','admin Login Successful',1,'154.159.252.213'),(12,'2024-05-24 02:37:22','SuperAdmin','admin Login Successful',1,'154.159.252.213'),(13,'2024-05-24 02:41:21','SuperAdmin','admin Login Successful',1,'154.159.252.213'),(14,'2024-05-24 03:37:45','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(15,'2024-05-24 03:46:08','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(16,'2024-05-24 03:47:52','User','admin Failed Login',0,'154.159.252.213'),(17,'2024-05-24 07:23:33','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(18,'2024-05-24 07:24:13','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(19,'2024-05-24 07:57:38','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(20,'2024-05-24 07:58:42','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(21,'2024-05-24 08:21:27','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(22,'2024-05-24 08:32:19','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(23,'2024-05-24 08:32:36','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(24,'2024-05-24 08:32:48','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(25,'2024-05-24 08:38:44','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(26,'2024-05-24 08:39:04','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(27,'2024-05-24 08:39:16','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(28,'2024-05-24 08:41:27','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(29,'2024-05-24 08:41:37','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(30,'2024-05-24 08:44:02','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(31,'2024-05-24 08:47:39','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(32,'2024-05-24 08:49:09','SuperAdmin','[admin]: $username User Updated Successfully',1,'154.159.252.213'),(33,'2024-05-24 08:55:59','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(34,'2024-05-24 08:56:14','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(35,'2024-05-24 08:56:22','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(36,'2024-05-24 08:57:47','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(37,'2024-05-24 08:59:53','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(38,'2024-05-24 09:02:21','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(39,'2024-05-24 09:02:30','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(40,'2024-05-24 09:06:47','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(41,'2024-05-24 18:18:04','SuperAdmin','[admin]: Settings Saved Successfully',1,'105.160.115.197'),(42,'2024-05-24 20:56:15','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(43,'2024-05-24 21:09:57','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(44,'2024-05-24 21:10:07','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(45,'2024-05-24 21:13:34','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(46,'2024-05-24 21:13:44','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(47,'2024-05-24 21:16:06','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(48,'2024-05-24 21:17:09','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(49,'2024-05-24 21:19:22','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(50,'2024-05-24 21:25:26','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(51,'2024-05-24 21:29:21','SuperAdmin','[admin]: Settings Saved Successfully',1,'105.160.61.19'),(52,'2024-05-24 21:34:28','SuperAdmin','[admin]: Settings Saved Successfully',1,'154.159.252.213'),(53,'2024-05-25 00:02:30','User','254718167262 Login Successful',7,'41.90.65.175'),(54,'2024-05-25 00:05:07','SuperAdmin','admin Login Successful',1,'41.90.65.175');

--
-- Table structure for table `tbl_message`
--

CREATE TABLE `tbl_message` (
  `id` int NOT NULL AUTO_INCREMENT,
  `from_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `to_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `title` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` enum('0','1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0',
  `date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1245675 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_message`
--

INSERT INTO `tbl_message` VALUES (1245674,'464767657456','56786754315','vbgfxvc','cxvcxzc','0','2024-05-23 19:13:38');

--
-- Table structure for table `tbl_payment_gateway`
--

CREATE TABLE `tbl_payment_gateway` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `gateway` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'xendit | midtrans',
  `gateway_trx_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `plan_id` int NOT NULL,
  `plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `routers_id` int NOT NULL,
  `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `pg_url_payment` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `payment_method` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `payment_channel` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `pg_request` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `pg_paid_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `expired_date` datetime DEFAULT NULL,
  `created_date` datetime NOT NULL,
  `paid_date` datetime DEFAULT NULL,
  `trx_invoice` varchar(25) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'from tbl_transactions',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 unpaid 2 paid 3 failed 4 canceled',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_payment_gateway`
--


--
-- Table structure for table `tbl_plans`
--

CREATE TABLE `tbl_plans` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name_plan` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `id_bw` int NOT NULL,
  `price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `type` enum('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `typebp` enum('Unlimited','Limited') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `limit_type` enum('Time_Limit','Data_Limit','Both_Limit') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `time_limit` int unsigned DEFAULT NULL,
  `time_unit` enum('Mins','Hrs') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `data_limit` int unsigned DEFAULT NULL,
  `data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `validity` int NOT NULL,
  `validity_unit` enum('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `shared_users` int DEFAULT NULL,
  `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius',
  `pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `pool_expired` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `list_expired` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'address list',
  `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled',
  `allow_purchase` enum('yes','no') COLLATE utf8mb4_general_ci DEFAULT 'yes' COMMENT 'allow to show package in buy package page',
  `prepaid` enum('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'yes' COMMENT 'is prepaid',
  `plan_type` enum('Business','Personal') COLLATE utf8mb4_general_ci DEFAULT 'Personal' COMMENT 'For switching plan according to user type',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_plans`
--

INSERT INTO `tbl_plans` VALUES (1,'SURF 20BOB',1,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(2,'SURF DAILY',2,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(3,'SURF WEEKLY',2,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(4,'SURF 2 WEEKS',2,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(5,'SURF MONTHLY',2,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(6,'SURF 10BOB',2,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(7,'SURF3mbps',1,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(8,'Free Data',2,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal'),(9,'10 Mins_Unlimited',3,'10000','Hotspot','Unlimited','Time_Limit',0,'Hrs',0,'MB',30,'Days',NULL,'MAIN ROUTER',0,NULL,'','',1,'yes','yes','Personal');

--
-- Table structure for table `tbl_pool`
--

CREATE TABLE `tbl_pool` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pool_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `range_ip` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `routers` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_pool`
--


--
-- Table structure for table `tbl_transactions`
--

CREATE TABLE `tbl_transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `invoice` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `recharged_on` date NOT NULL,
  `recharged_time` time NOT NULL DEFAULT '00:00:00',
  `expiration` date NOT NULL,
  `time` time NOT NULL,
  `method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `type` enum('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `note` varchar(256) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'for note',
  `admin_id` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_transactions`
--


--
-- Table structure for table `tbl_user_recharges`
--

CREATE TABLE `tbl_user_recharges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `plan_id` int NOT NULL,
  `namebp` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `recharged_on` date NOT NULL,
  `recharged_time` time NOT NULL DEFAULT '00:00:00',
  `expiration` date NOT NULL,
  `time` time NOT NULL,
  `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `admin_id` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_user_recharges`
--


--
-- Table structure for table `tbl_voucher`
--

CREATE TABLE `tbl_voucher` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` enum('Hotspot','PPPOE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `id_plan` int NOT NULL,
  `code` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `user` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `generated_by` int NOT NULL DEFAULT '0' COMMENT 'id admin',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tbl_voucher`
--



