-- TOPUPMATE Technology Limited
-- Version 4.0
-- https://topupmate.com/welcome
--
-- Licensed VTU Script Software
-- All Right Reserved
-- support@topupmate.com
-- 07032529431

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `TOPUPMATE`
--

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

--
-- Table structure for table `airtime`
--

CREATE TABLE `airtime` (
  `aId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `aNetwork` varchar(10) NOT NULL,
  `aBuyDiscount` float NOT NULL DEFAULT 96,
  `aUserDiscount` float NOT NULL,
  `aAgentDiscount` float NOT NULL,
  `aVendorDiscount` float NOT NULL,
  `aType` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ALTER TABLE airtime ADD `aBuyDiscount` float NOT NULL DEFAULT 96;
--
-- Dumping data for table `TOPUPMATE Technology Limited`
--


--
-- Table structure for table `airtime`
--

CREATE TABLE `airtimepinprice` (
  `aId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `aNetwork` varchar(10) NOT NULL,
  `aUserDiscount` float NOT NULL,
  `aAgentDiscount` float NOT NULL,
  `aVendorDiscount` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `airtimepinprice`
--


-- --------------------------------------------------------
--
-- Table structure for table `apiconfigs`
--
-- --------------------------------------------------------

CREATE TABLE `apiconfigs` (

  `aId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(30) NOT NULL,
  `value` varchar(100) NULL
);


-- ADDITIONAL CONFIGS

INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletFourApi","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletFourProvider","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletFourProviderName","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletFiveApi","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletFiveProvider","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletFiveProviderName","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletSixApi","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletSixProvider","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("walletSixProviderName","");

-- For Thos Without Dat Pin Before

-- INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("dataPinApi","");
-- INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("dataPinProvider","");
-- INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("alphaApi","");
-- INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("alphaProvider","");

-- KUDA

INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaEmail","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaApi","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaWebhookUser","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaWebhookPass","");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaChargesType","flat"); -- flat or per
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaCharges","10");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("kudaStatus","Off");

-- GT BANK

INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("monifyGtStatus","Off");

-- AIRTIME TO CASH

INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashstatus","Off");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashmtnno","09011111111");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashmtnrate","80");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashairtelno","09011111111");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashairtelrate","80");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashglono","09011111111");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cashglorate","80");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cash9mobileno","09011111111");
INSERT INTO `apiconfigs` (`name`,`value`) VALUES ("airtime2cash9mobilerate","80");



-- --------------------------------------------------------
--
-- Table structure for table `apilinks`
--
-- --------------------------------------------------------

CREATE TABLE `apilinks` (
  `aId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(30) NOT NULL,
  `value` varchar(100) NULL,
  `type` varchar(20) NULL
);


INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/user/","Wallet");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/airtime/","Airtime");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/data/","Data");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/cabletv/verify/","CableVer");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/cabletv/","Cable");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/electricity/verify/","ElectricityVer");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/electricity/","Electricity");
INSERT INTO `apilinks` (`name`,`value`,`type`) VALUES ("Prime Biller","https://primebiller.com/api/v1/exam/","Exam");

-- --------------------------------------------------------
--
-- Table structure for table `sitesettings`
--
-- --------------------------------------------------------

CREATE TABLE `sitesettings` (
  `sId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `sitename` varchar(20) NULL,
  `siteurl` varchar(100) NULL,
  `agentupgrade` varchar(20) NULL,
  `vendorupgrade` varchar(20) NULL,
  `apidocumentation` varchar(100) NULL,
  `phone` varchar(20) NULL,
  `email` varchar(50) NULL,
  `whatsapp` varchar(20) NULL ,
  `whatsappgroup` varchar(100) NULL,
  `facebook` varchar(10) NULL,
  `twitter` varchar(200)  NULL,
  `instagram` varchar(200) NULL,
  `telegram` varchar(100) NULL,
  `referalupgradebonus` float NOT NULL DEFAULT 100,
  `referalairtimebonus` float NOT NULL DEFAULT 1,
  `referaldatabonus` float NOT NULL DEFAULT 1,
  `referalwalletbonus` float NOT NULL DEFAULT 1,
  `referalcablebonus` float NOT NULL DEFAULT 1,
  `referalexambonus` float NOT NULL DEFAULT 1,
  `referalmeterbonus` float NOT NULL DEFAULT 1,
  `wallettowalletcharges` float NOT NULL DEFAULT 50,
  `sitecolor` varchar(10) NOT NULL DEFAULT "#0000e6",
  `logindesign` varchar(10) NOT NULL DEFAULT "5",
  `homedesign` varchar(10) NOT NULL DEFAULT "5",
  `notificationStatus` varchar(5) NOT NULL DEFAULT "Off",
  `accountname` varchar(50)  NULL,
  `accountno` varchar(15) NULL,
  `bankname` varchar(20) NULL,
  `electricitycharges` varchar(5) NULL,
  `airtimemin` varchar(10) NOT NULL DEFAULT "50",
  `airtimemax` varchar(10) NOT NULL DEFAULT "500"
  
  
  
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



--
-- Table structure for table `contact`
--

CREATE TABLE `contact` (
  `msgId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `sId` int(100) NOT NULL,
  `name` varchar(100) NOT NULL,
  `contact` varchar(200) NOT NULL,
  `subject` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `dPosted` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `contact`
--

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

--
-- Table structure for table `dataplans`
--

CREATE TABLE `dataplans` (
  `pId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(255) NOT NULL,
  `price` varchar(255) NOT NULL,
  `userprice` varchar(255) NOT NULL,
  `agentprice` varchar(255) NOT NULL,
  `vendorprice` varchar(255) NOT NULL,
  `planid` varchar(255) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `datanetwork` tinyint(10) NOT NULL,
  `day` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


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

--
-- Table structure for table `dataplans`
--

CREATE TABLE `datapins` (
  `dpId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(255) NOT NULL,
  `price` varchar(255) NOT NULL,
  `userprice` varchar(255) NOT NULL,
  `agentprice` varchar(255) NOT NULL,
  `vendorprice` varchar(255) NOT NULL,
  `planid` varchar(255) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `datanetwork` tinyint(10) NOT NULL,
  `day` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `datapins`
--


--
-- Table structure for table `datatokens`
--

CREATE TABLE `datatokens` (
  `tId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `sId` int(100) NOT NULL,
  `tRef` varchar(255) NOT NULL,
  `business` varchar(30) NOT NULL,
  `network` varchar(10) DEFAULT NULL,
  `datasize` varchar(10) DEFAULT NULL,
  `loadpin` varchar(30) DEFAULT NULL,
  `checkbalance` varchar(30) DEFAULT NULL,
  `quantity` int(100) NOT NULL,
  `serial` text NOT NULL,
  `tokens` text NOT NULL,
  `date` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ALTER TABLE datatokens ADD loadpin varchar(30) DEFAULT NULL;
-- ALTER TABLE datatokens ADD checkbalance varchar(30) DEFAULT NULL;

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

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

--
-- Table structure for table `networkid`
--
 
CREATE TABLE `networkid` (
  `nId` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `networkid` varchar(10) NOT NULL,
  `smeId` varchar(10) NOT NULL,
  `giftingId` varchar(10) NOT NULL,
  `corporateId` varchar(10) NOT NULL,
  `vtuId` varchar(10) NOT NULL,
  `sharesellId` varchar(10) NOT NULL,
  `network` varchar(20) NOT NULL,
  `networkStatus` varchar(10) NOT NULL DEFAULT "Off",
  `vtuStatus` varchar(10) NOT NULL DEFAULT "Off",
  `sharesellStatus` varchar(10) NOT NULL DEFAULT "Off",
  `airtimepinStatus` varchar(10) NOT NULL DEFAULT "Off",
  `smeStatus` varchar(10) NOT NULL DEFAULT "Off",
  `giftingStatus` varchar(10) NOT NULL DEFAULT "Off",
  `corporateStatus` varchar(10) NOT NULL DEFAULT "Off",
  `datapinStatus` varchar(10) NOT NULL DEFAULT "Off"
);

-- ALTER TABLE networkid ADD `datapinStatus` varchar(10) NOT NULL DEFAULT "Off";
--
-- Dumping data for table `networkid`
--

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

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

CREATE TABLE `notifications` (
  `msgId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `msgfor` tinyint(4) NOT NULL,
  `subject` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `status` tinyint(3) NOT NULL DEFAULT 0,
  `dPosted` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


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

--
-- Table structure for table `subscribers`
--

CREATE TABLE `subscribers` (
  `sId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `sApiKey` varchar(200) NOT NULL UNIQUE KEY,
  `sFname` varchar(50) NOT NULL,
  `sLname` varchar(50) NOT NULL,
  `sEmail` varchar(50) DEFAULT NULL UNIQUE KEY,
  `sPhone` varchar(20) NOT NULL UNIQUE KEY,
  `sPass` varchar(150) NOT NULL,
  `sState` varchar(50) NOT NULL,
  `sPin` int(10) NOT NULL DEFAULT 1234,
  `sPinStatus` tinyint(3) NULL DEFAULT 0,
  `sType` tinyint(10) NOT NULL DEFAULT 1,
  `sWallet` float NOT NULL DEFAULT 0,
  `sRefWallet` float NOT NULL DEFAULT 0,
  `sBankNo` varchar(20) NULL,
  `sRolexBank` varchar(20) NULL,
  `sSterlingBank` varchar(20) NULL,
  `sFidelityBank` varchar(20) NULL,
  `sKudaBank` varchar(20) NULL,
  `sGtBank` varchar(20) NULL,
  `sBankName` varchar(30) NULL,
  `sRegStatus` tinyint(5) NOT NULL DEFAULT 3,
  `sVerCode` smallint(20) NOT NULL DEFAULT 0,
  `sRegDate` datetime NOT NULL DEFAULT current_timestamp(),
  `sLastActivity` datetime DEFAULT NULL,
  `sReferal` varchar(15) NULL
   
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



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

--
-- Table structure for table `sysusers`
--

CREATE TABLE `sysusers` (
  `sysId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `sysName` varchar(50) NOT NULL,
  `sysRole` tinyint(2) NOT NULL,
  `sysUsername` varchar(20) NOT NULL,
  `sysToken` varchar(30) NOT NULL,
  `sysStatus` tinyint(2) NOT NULL DEFAULT 0,
  `sysPinToken` varchar(30) NOT NULL DEFAULT '03d258c7ef',
  `sysPinStatus` tinyint(2) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


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

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

CREATE TABLE `transactions` (
  `tId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `sId` int(100) NOT NULL,
  `transref` varchar(255) NOT NULL UNIQUE KEY,
  `servicename` varchar(100) NOT NULL,
  `servicedesc` varchar(255) NOT NULL,
  `amount` varchar(100) NOT NULL,
  `status` tinyint(5) NOT NULL,
  `oldbal` varchar(100) NOT NULL,
  `newbal` varchar(100) NOT NULL,
  `profit` float NOT NULL DEFAULT 0,
  `date` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ALTER TABLE transactions ADD `profit` float NOT NULL DEFAULT 0;

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

--
-- Table structure for table `uservisits`
--

CREATE TABLE `uservisits` (
  `id` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user` int(100) NOT NULL,
  `state` varchar(10) NOT NULL,
  `visitTime` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Table structure for table `userlogin`
--

CREATE TABLE `userlogin` (
  `id` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `user` int(100) NOT NULL,
  `token` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Table structure for table `examid`
--

CREATE TABLE `examid` (
  `eId` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `examid` varchar(10),
  `provider` varchar(50) NOT NULL,
  `price` int(20) NOT NULL DEFAULT 0,
  `buying_price` int(20) NOT NULL DEFAULT 0,
  `providerStatus` varchar(10) NOT NULL DEFAULT "On"
);

-- ALTER TABLE examid ADD `buying_price` int(20) NOT NULL DEFAULT 0;

--
-- Dumping data for table `examid`
--

--
-- Table structure for table `electricityid`
--

CREATE TABLE `electricityid` (
  `eId` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `electricityid` varchar(50),
  `provider` varchar(50) NOT NULL,
  `abbreviation` varchar(5) NOT NULL,
  `providerStatus` varchar(10) NOT NULL DEFAULT "On"
);

-- ALTER TABLE electricityid ADD `abbreviation` varchar(5) NULL;

--
-- Dumping data for table `electricityid`
--


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

--
-- Table structure for table `cableid`
--

CREATE TABLE `cableid` (
  `cId` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `cableid` varchar(10),
  `provider` varchar(10) NOT NULL,
  `providerStatus` varchar(10) NOT NULL DEFAULT "On"
);

--
-- Dumping data for table `cableid`
--

--
-- Table structure for table `cableplans`
--

CREATE TABLE `cableplans` (
  `cpId` int(100) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(255) NOT NULL,
  `price` varchar(255) NOT NULL,
  `userprice` varchar(255) NOT NULL,
  `agentprice` varchar(255) NOT NULL,
  `vendorprice` varchar(255) NOT NULL,
  `planid` varchar(255) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `cableprovider` tinyint(10) NOT NULL,
  `day` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Dumping data for table `cableplans`
--


CREATE TABLE `alphatopupprice` (
  `alphaId` int(200) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `buyingPrice` int(100) NOT NULL,
  `sellingPrice` int(100) NOT NULL,
  `agent` int(100) NOT NULL,
  `vendor` int(100) NOT NULL,
  `dPosted` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `alphaTopupPrice`
--



/*!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 */;
