--
-- Host: localhost    Database: jmdesign_tppldl
-- ------------------------------------------------------


--
-- Table structure for table `sub_distributor`
--

CREATE TABLE `sub_distributor` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `distributor_id` int(10) NOT NULL,
  `sub_distributor_id` int(10) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sub_distributor`
--

INSERT INTO `sub_distributor` (`id`, `distributor_id`, `sub_distributor_id`) VALUES (1,3,5),(2,3,6),(3,3,7),(4,3,8),(5,8,9),(6,3,10);

--
-- Table structure for table `tbl_corporates_scheme`
--

CREATE TABLE `tbl_corporates_scheme` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `corporate_id` int(20) NOT NULL,
  `SchemeId` int(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbl_corporates_scheme`
--

INSERT INTO `tbl_corporates_scheme` (`id`, `corporate_id`, `SchemeId`) VALUES (1,1,3),(2,2,2),(3,3,1);

--
-- Table structure for table `tbl_distributor`
--

CREATE TABLE `tbl_distributor` (
  `distributor_id` int(7) NOT NULL AUTO_INCREMENT,
  `corporate_id` int(7) NOT NULL,
  `unique_codes` varchar(16) DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `email` varchar(200) DEFAULT NULL,
  `mobile_number` varchar(150) NOT NULL,
  `address` varchar(350) DEFAULT NULL,
  `RewardPoints` int(10) DEFAULT NULL,
  `status` enum('A','D') NOT NULL DEFAULT 'A',
  `reg_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `level` int(3) NOT NULL DEFAULT 1,
  UNIQUE KEY `distributor_id` (`distributor_id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbl_distributor`
--

INSERT INTO `tbl_distributor` (`distributor_id`, `corporate_id`, `unique_codes`, `name`, `email`, `mobile_number`, `address`, `RewardPoints`, `status`, `reg_date`, `level`) VALUES (1,1,'488122624058563','Vikky','vik@gmail.com','9812121212','zxZZ',20000,'A','2018-09-12 09:00:14',1),(2,1,'245122624058563','Shashi','shashi@gmail.com','9812111111','zxZ ',10000,'A','2018-09-19 12:28:39',1),(3,1,'578013144024299','Harish','harish@gmail.com','9729615689','ZXZXz',15000,'A','2018-09-24 12:13:47',1),(4,1,'850122624058563','Harisheee','harasasaASr@gmail.com','9812109970','zxczxczx',2000,'A','2018-09-12 09:00:14',1),(5,1,'679013144024344','HARRYTEST',NULL,'9990105547',NULL,1000,'A','2018-09-12 13:26:07',2),(6,1,'387122624058563','Siddhant',NULL,'9999213477',NULL,6000,'A','2018-09-13 07:03:29',2),(7,1,'913122624058563','Sidd',NULL,'9999213478',NULL,6000,'A','2018-09-19 12:34:50',2),(8,1,'745013144024197','SHASHIKANT',NULL,'8383079930',NULL,1000,'A','2018-09-20 10:08:10',2),(9,1,'885013144024254','SHASHIKANT',NULL,'9871679061',NULL,500,'A','2018-09-20 10:14:06',3),(10,1,'265013144016617','VANSH',NULL,'9999911111',NULL,500,'A','2018-09-22 04:50:19',2);

--
-- Table structure for table `tbl_gifts`
--

CREATE TABLE `tbl_gifts` (
  `id` int(7) NOT NULL AUTO_INCREMENT,
  `corporate_id` int(10) NOT NULL,
  `scheme_id` int(10) NOT NULL,
  `gift_name` varchar(250) NOT NULL,
  `points` int(15) NOT NULL,
  `gift_image` varchar(250) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbl_gifts`
--

INSERT INTO `tbl_gifts` (`id`, `corporate_id`, `scheme_id`, `gift_name`, `points`, `gift_image`) VALUES (2,1,3,'Microwave oven',1000,'2631_Chrysanthemum.jpg'),(3,1,3,'Gas fireplace',2000,'34795_Hydrangeas.jpg'),(4,1,3,'Vacuum cleaner',1500,'8725_Koala.jpg'),(5,1,3,'abc',25000,'35693_Koala.jpg');

--
-- Table structure for table `tbl_points_calculation`
--

CREATE TABLE `tbl_points_calculation` (
  `id` int(7) NOT NULL AUTO_INCREMENT,
  `scheme_id` int(10) NOT NULL,
  `corporate_id` int(10) NOT NULL,
  `level` int(11) NOT NULL,
  `point` varchar(200) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbl_points_calculation`
--

INSERT INTO `tbl_points_calculation` (`id`, `scheme_id`, `corporate_id`, `level`, `point`) VALUES (2,2,2,3,'20'),(3,2,2,1,'10');

--
-- Table structure for table `tbl_scheme`
--

CREATE TABLE `tbl_scheme` (
  `SchemeId` int(11) NOT NULL AUTO_INCREMENT,
  `SchemeName` varchar(100) NOT NULL,
  `SchemeFrom` date NOT NULL,
  `SchemeTo` date NOT NULL,
  `RewardPoints` int(10) NOT NULL,
  `status` enum('A','D') NOT NULL DEFAULT 'A',
  `Message` text NOT NULL,
  `tc` text NOT NULL,
  `crop_id` int(7) NOT NULL,
  `BCCemail` varchar(200) NOT NULL,
  UNIQUE KEY `SchemeId` (`SchemeId`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbl_scheme`
--

INSERT INTO `tbl_scheme` (`SchemeId`, `SchemeName`, `SchemeFrom`, `SchemeTo`, `RewardPoints`, `status`, `Message`, `tc`, `crop_id`, `BCCemail`) VALUES (1,'Honda Win For Sure Offer','2018-09-03','2018-10-02',5000,'A','<p>tc</p>\r\n','<p>thh sks</p>\r\n',3,'codharry@gmail.com'),(2,'Supreme Assured Movie Offer','2018-09-05','2018-09-28',20000,'A','<p>xcxcz</p>\r\n','<p>cxc</p>\r\n',2,'sur@gmail.com'),(3,'Parle Scheme','2018-09-01','2018-09-30',50000,'A','<p>sds sssd sd</p>\r\n','<p>sds sds sds sd</p>\r\n',1,'parle@gmails.com'),(4,'jxz1','2018-03-22','2018-03-30',1231,'D','<p>klmklmkl1</p>\r\n','<p>mkmkl1</p>\r\n',3,'hyadav1@gmail.com');

--
-- Table structure for table `tbl_unique_codes`
--

CREATE TABLE `tbl_unique_codes` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `SchemeId` int(10) NOT NULL,
  `unique_codes` varchar(16) NOT NULL,
  `status` enum('n','u') NOT NULL DEFAULT 'n',
  `crop_id` int(5) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbl_unique_codes`
--

INSERT INTO `tbl_unique_codes` (`id`, `SchemeId`, `unique_codes`, `status`, `crop_id`) VALUES (1,3,'488122624058563','u',1),(2,3,'245122624058563','u',1),(3,3,'850122624058563','u',1),(4,3,'372122624058563','n',1),(5,3,'509122624058563','n',1),(6,3,'778122624058563','n',1),(7,3,'448122624058563','n',1),(8,3,'274122624058563','n',1),(9,3,'225122624058563','n',1),(10,3,'387122624058563','u',1),(11,3,'842122624058563','n',1),(12,3,'630122624058563','n',1),(13,3,'547122624058563','n',1),(14,3,'481122624058563','n',1),(15,3,'913122624058563','u',1),(16,2,'419122643068104','n',2),(17,2,'690122643068104','n',2),(18,2,'914122643068104','n',2),(19,2,'891122643068104','n',2),(20,2,'792122643068104','n',2),(21,2,'305122643068104','n',2),(22,2,'343122643068104','n',2),(23,2,'200122643068104','n',2),(24,2,'636122643068104','n',2),(25,2,'643122643068104','n',2),(26,2,'423122643068104','n',2),(27,2,'932122643068104','n',2),(28,2,'279122643068104','n',2),(29,2,'706122643068104','n',2),(30,2,'942122643068104','n',2),(31,1,'198122713018063','n',3),(32,1,'321122713018063','n',3),(33,1,'341122713018063','n',3),(34,1,'685122713018063','n',3),(35,1,'775122713018063','n',3),(36,1,'796122713018063','n',3),(37,1,'323122713018063','n',3),(38,1,'988122713018063','n',3),(39,1,'613122713018063','n',3),(40,1,'126122713018063','n',3),(41,1,'129122713018063','n',3),(42,1,'317122713018063','n',3),(43,1,'232122713018063','n',3),(44,1,'143122713018063','n',3),(45,1,'552122713018063','n',3),(46,3,'265013144016617','u',1),(47,3,'745013144024197','u',1),(48,3,'885013144024254','u',1),(49,3,'578013144024299','u',1),(50,3,'679013144024344','u',1);

--
-- Dumping events for database 'jmdesign_tppldl'
--

--
-- Dumping routines for database 'jmdesign_tppldl'
--


