-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2020 at 08:34 PM
-- Server version: 10.1.40-MariaDB
-- PHP Version: 7.1.29

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

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

--
-- Table structure for table `admin_wallet_details`
--

CREATE OR REPLACE TABLE `admin_wallet_details` (
  `admin_wallet_id` int(11) NOT NULL,
  `wallet_user_id` varchar(500) NOT NULL,
  `receiver_amount` varchar(1000) NOT NULL,
  `cr_dr` varchar(100) NOT NULL,
  `closer_amount` varchar(1000) NOT NULL,
  `wallet_transaction_id` varchar(1000) NOT NULL,
  `wallet_remarks` varchar(1000) NOT NULL,
  `wallet_date` varchar(500) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `affiliate`
--

CREATE OR REPLACE TABLE `affiliate` (
  `id` int(11) NOT NULL,
  `user_id` varchar(50) NOT NULL,
  `product_name` varchar(100) DEFAULT NULL COMMENT 'affiliate product name',
  `order_id` varchar(100) DEFAULT NULL COMMENT 'product order id',
  `remarks` varchar(100) DEFAULT NULL,
  `status` int(5) NOT NULL DEFAULT '2' COMMENT '1= approved or paid, 2= pending, 3=declined',
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `bank_details`
--

CREATE OR REPLACE TABLE `bank_details` (
  `bank_details_id` int(11) NOT NULL,
  `user_unique_id` varchar(200) NOT NULL,
  `ac` varchar(100) NOT NULL,
  `adhar` varchar(200) NOT NULL,
  `pan` varchar(200) NOT NULL,
  `holder_name` varchar(200) NOT NULL,
  `ifsc` varchar(200) NOT NULL,
  `nominee` varchar(200) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


INSERT INTO `bank_details` (`bank_details_id`, `user_unique_id`, `ac`, `adhar`, `pan`, `holder_name`, `ifsc`, `nominee`) VALUES
(1, 'B00001', '', '', '', '', '', '');
-- --------------------------------------------------------

--
-- Table structure for table `commission_master`
--

CREATE OR REPLACE TABLE `commission_master` (
  `id` int(11) NOT NULL,
  `commission_type` varchar(255) NOT NULL,
  `direct_comm_amount` varchar(255) DEFAULT NULL,
  `stipulated_day` varchar(255) DEFAULT NULL,
  `stipulated_comm_amount` varchar(255) DEFAULT NULL,
  `negated_comm_amount` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `commission_master`
--

INSERT INTO `commission_master` (`id`, `commission_type`, `direct_comm_amount`, `stipulated_day`, `stipulated_comm_amount`, `negated_comm_amount`, `created_at`) VALUES
(1, 'joining', '10', NULL, NULL, NULL, '2020-06-09 13:51:02'),
(2, 'pairing', NULL, '15', '30', '20', '2020-06-09 13:51:30'),
(3, 'regular', '10', NULL, NULL, NULL, '2020-06-09 13:51:02');

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

--
-- Table structure for table `company_details`
--

CREATE OR REPLACE TABLE `company_details` (
  `details_incr_id` int(11) NOT NULL,
  `default_admin_id` varchar(100) NOT NULL,
  `company_name` varchar(100) NOT NULL,
  `business_name` varchar(100) NOT NULL,
  `website_link` varchar(100) NOT NULL,
  `gst_number` varchar(100) NOT NULL,
  `registration_number` varchar(100) NOT NULL,
  `company_email` varchar(100) NOT NULL,
  `company_phone` varchar(100) NOT NULL,
  `company_address` varchar(200) NOT NULL,
  `details_crt_date` varchar(100) NOT NULL,
  `details_mdf_date` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `company_details`
--

INSERT INTO `company_details` (`details_incr_id`, `default_admin_id`, `company_name`, `business_name`, `website_link`, `gst_number`, `registration_number`, `company_email`, `company_phone`, `company_address`, `details_crt_date`, `details_mdf_date`) VALUES
(1, 'B00001', 'Ebase It Solutions', 'MLM system', 'www.ebaseitsolutions.com', 'gst12345', 'reg2019', 'info@ebaseitsolutions.com', '7894561230000', 'College More, Sector-v <br>\r\nKolkata, West Bengal', '2019-05-02 12:55', '2020-07-02 23:49');

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

--
-- Table structure for table `payout`
--

CREATE OR REPLACE TABLE `payout` (
  `payout_id` int(11) NOT NULL,
  `payout_type` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `payout`
--

INSERT INTO `payout` (`payout_id`, `payout_type`) VALUES
(1, 'bank');

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

--
-- Table structure for table `payout_details`
--

CREATE OR REPLACE TABLE `payout_details` (
  `payout_details_id` int(11) NOT NULL,
  `payout_user_id` varchar(100) NOT NULL,
  `payout_details_type` varchar(100) NOT NULL,
  `payout_amount` double NOT NULL DEFAULT '0',
  `fee_amount` double NOT NULL DEFAULT '0',
  `payout_request_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `payout_accept_date` varchar(100) DEFAULT NULL,
  `payout_accept_status` int(10) NOT NULL DEFAULT '2' COMMENT '1= Accept, 2= Pending, 3=Declined',
  `payout_decline_msg` varchar(100) DEFAULT NULL,
  `payout_transaction_id` varchar(1000) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `product`
--

CREATE OR REPLACE TABLE `product` (
  `product_id` int(11) NOT NULL,
  `product_name` varchar(200) NOT NULL,
  `product_price` varchar(200) NOT NULL,
  `product_bv` varchar(200) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `product`
--

INSERT INTO `product` (`product_id`, `product_name`, `product_price`, `product_bv`) VALUES
(1, 'Bisuness package', '1000', '200');

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

--
-- Table structure for table `product_purchase`
--

CREATE OR REPLACE TABLE `product_purchase` (
  `purchase_id` int(11) NOT NULL,
  `purchase_user_id` varchar(200) NOT NULL,
  `purchase_product_id` varchar(200) NOT NULL,
  `purchase_product_price` varchar(200) NOT NULL,
  `tax_amount` varchar(1000) NOT NULL,
  `purchase_product_bv` varchar(50) DEFAULT NULL,
  `purchase_unique_id` varchar(200) NOT NULL,
  `mailing_address` mediumtext COMMENT 'json format store all details',
  `status` enum('1','2','3') DEFAULT '2' COMMENT '2= purchase, 1 =dispatched, 3=cancel',
  `purchase_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `dispatch_date` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `registration`
--

CREATE OR REPLACE TABLE `registration` (
  `user_id` int(11) NOT NULL,
  `unique_user_id` varchar(300) NOT NULL,
  `user_name` varchar(100) NOT NULL,
  `user_address` varchar(200) NOT NULL,
  `user_email` varchar(100) NOT NULL,
  `user_mobile` varchar(100) NOT NULL,
  `gender` varchar(100) NOT NULL,
  `dob` varchar(100) NOT NULL,
  `user_pwd` varchar(200) NOT NULL,
  `position` varchar(100) NOT NULL,
  `position_count` int(11) NOT NULL DEFAULT '0',
  `position_count_desc` varchar(30) DEFAULT NULL,
  `refferance_id` varchar(200) NOT NULL,
  `position_id` varchar(200) NOT NULL,
  `login_session` varchar(200) NOT NULL,
  `transaction_pwd` varchar(200) NOT NULL,
  `type` varchar(50) NOT NULL,
  `rank` varchar(200) NOT NULL,
  `images` varchar(10000) NOT NULL,
  `active_deactive` varchar(100) NOT NULL DEFAULT '2' COMMENT '1= purchased product, 2= not purchased',
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `modified_date` datetime DEFAULT NULL,
  `is_kyc_accepted` int(5) NOT NULL DEFAULT '2' COMMENT '1= kyc accepted, 2 = not accepted',
  `active_status` varchar(100) NOT NULL COMMENT 'Accout is active or not. if account is deactive then user cannot do anything'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


INSERT INTO `registration` (`user_id`, `unique_user_id`, `user_name`, `user_address`, `user_email`, `user_mobile`, `gender`, `dob`, `user_pwd`, `position`, `refferance_id`, `position_id`, `login_session`, `transaction_pwd`, `type`, `rank`, `images`, `active_deactive`, `created_date`, `modified_date`, `is_kyc_accepted`, `active_status`) VALUES
(1, 'B00001', 'Admin', '', 'info@fairyindia.com', '', '', '', 'MTIzNDU2', '', '', '', '2176526153e3993e7ad7cb697c7c934a', '123456', 'admin', 'Admin', '', '1', '2020-08-09 04:18:34', '2020-08-09 04:18:34', 1, 'Active');

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

--
-- Table structure for table `rewards`
--

CREATE OR REPLACE TABLE `rewards` (
  `id` int(11) NOT NULL,
  `user_id` varchar(50) NOT NULL COMMENT 'who got rewards',
  `reward` varchar(100) DEFAULT NULL COMMENT 'reward name',
  `reward_desc` varchar(200) DEFAULT NULL COMMENT 'explain about reward',
  `respective_user` varchar(50) NOT NULL COMMENT 'User for whose behalf reward got',
  `status` int(5) NOT NULL COMMENT '1= received, 2= Pending, 3= Expired',
  `reward_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reward_expire_date` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `tax`
--

CREATE OR REPLACE TABLE `tax` (
  `tax_id` int(11) NOT NULL,
  `tax_amount` varchar(1000) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tax`
--

INSERT INTO `tax` (`tax_id`, `tax_amount`) VALUES
(1, '3');

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

--
-- Table structure for table `transaction_fee`
--

CREATE OR REPLACE TABLE `transaction_fee` (
  `transaction_fee_id` int(11) NOT NULL,
  `fee` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `transaction_fee`
--

INSERT INTO `transaction_fee` (`transaction_fee_id`, `fee`) VALUES
(1, '4');

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

--
-- Table structure for table `tree_data`
--

CREATE OR REPLACE TABLE `tree_data` (
  `tree_data_id` int(11) NOT NULL,
  `position_id` varchar(100) NOT NULL,
  `position_left` varchar(100) NOT NULL,
  `position_right` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `tree_data` (`tree_data_id`, `position_id`, `position_left`, `position_right`) VALUES
(1, 'B00001', '', '');
-- --------------------------------------------------------

--
-- Table structure for table `wallet_balance`
--

CREATE OR REPLACE TABLE `wallet_balance` (
  `wallet_blns_id` int(11) NOT NULL,
  `balance_user_id` varchar(100) NOT NULL,
  `total_balance` double NOT NULL DEFAULT '0',
  `bv_balance` int(225) NOT NULL DEFAULT '0',
  `pv_balance` int(225) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `wallet_balance` (`wallet_blns_id`, `balance_user_id`, `total_balance`, `bv_balance`, `pv_balance`) VALUES
(1, 'B00001', 900000, 0, 0);
-- --------------------------------------------------------

--
-- Table structure for table `wallet_new`
--

CREATE OR REPLACE TABLE `wallet_new` (
  `id` int(11) NOT NULL,
  `sender_id` varchar(50) DEFAULT NULL,
  `receiver_id` varchar(50) DEFAULT NULL,
  `amount` double NOT NULL DEFAULT '0',
  `respective_user` varchar(50) DEFAULT NULL COMMENT 'User for whose behalf amount has been credited',
  `transaction_type` int(11) NOT NULL COMMENT '1= Transffer, 2= product_purchase, 3= Payout, 4= Purchasing commission',
  `remarks` varchar(200) DEFAULT NULL COMMENT 'explain about transaction',
  `status` int(11) NOT NULL DEFAULT '0' COMMENT '1= Successful, 2= Pending, 3 = Failed',
  `affiliate_id` int(11) DEFAULT NULL,
  `transaction_id` varchar(100) NOT NULL,
  `transaction_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admin_wallet_details`
--
ALTER TABLE `admin_wallet_details`
  ADD PRIMARY KEY (`admin_wallet_id`);

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

--
-- Indexes for table `bank_details`
--
ALTER TABLE `bank_details`
  ADD PRIMARY KEY (`bank_details_id`);

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

--
-- Indexes for table `company_details`
--
ALTER TABLE `company_details`
  ADD PRIMARY KEY (`details_incr_id`);


--
-- Indexes for table `payout`
--
ALTER TABLE `payout`
  ADD PRIMARY KEY (`payout_id`);

--
-- Indexes for table `payout_details`
--
ALTER TABLE `payout_details`
  ADD PRIMARY KEY (`payout_details_id`);

--
-- Indexes for table `product`
--
ALTER TABLE `product`
  ADD PRIMARY KEY (`product_id`);

--
-- Indexes for table `product_purchase`
--
ALTER TABLE `product_purchase`
  ADD PRIMARY KEY (`purchase_id`);

--
-- Indexes for table `registration`
--
ALTER TABLE `registration`
  ADD PRIMARY KEY (`user_id`);

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

--
-- Indexes for table `tax`
--
ALTER TABLE `tax`
  ADD PRIMARY KEY (`tax_id`);

--
-- Indexes for table `transaction_fee`
--
ALTER TABLE `transaction_fee`
  ADD PRIMARY KEY (`transaction_fee_id`);

--
-- Indexes for table `tree_data`
--
ALTER TABLE `tree_data`
  ADD PRIMARY KEY (`tree_data_id`);


--
-- Indexes for table `wallet_balance`
--
ALTER TABLE `wallet_balance`
  ADD PRIMARY KEY (`wallet_blns_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin_wallet_details`
--
ALTER TABLE `admin_wallet_details`
  MODIFY `admin_wallet_id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `bank_details`
--
ALTER TABLE `bank_details`
  MODIFY `bank_details_id` int(11) NOT NULL AUTO_INCREMENT;

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

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


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

--
-- AUTO_INCREMENT for table `payout_details`
--
ALTER TABLE `payout_details`
  MODIFY `payout_details_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product`
--
ALTER TABLE `product`
  MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `product_purchase`
--
ALTER TABLE `product_purchase`
  MODIFY `purchase_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `registration`
--
ALTER TABLE `registration`
  MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;

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

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

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

--
-- AUTO_INCREMENT for table `tree_data`
--
ALTER TABLE `tree_data`
  MODIFY `tree_data_id` int(11) NOT NULL AUTO_INCREMENT;


--
-- AUTO_INCREMENT for table `wallet_balance`
--
ALTER TABLE `wallet_balance`
  MODIFY `wallet_blns_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `wallet_new`
--
ALTER TABLE `wallet_new`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
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 */;
