-- https://www.phpmyadmin.net/
--

START TRANSACTION;



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

--
-- Table structure for table `account_types`
--

CREATE TABLE `account_types` (
  `ACC_TYPE_ID` int(11) NOT NULL,
  `ACC_TYPE_NAME` varchar(255) NOT NULL,
  `USE_ACC` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `account_types`
--

INSERT INTO `account_types` (`ACC_TYPE_ID`, `ACC_TYPE_NAME`, `USE_ACC`) VALUES
(1, 'farmer', 1),
(2, 'trader', 1);

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

--
-- Table structure for table `category`
--

CREATE TABLE `category` (
  `cat_id` int(11) NOT NULL,
  `cat_icon_image` varchar(300) NOT NULL,
  `en_cat_name` varchar(255) NOT NULL,
  `lug_cat_name` varchar(255) NOT NULL,
  `kis_cat_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `category`
--

INSERT INTO `category` (`cat_id`, `cat_icon_image`, `en_cat_name`, `lug_cat_name`, `kis_cat_name`) VALUES
(1, 'fa-envira', 'Vegetables', 'Vegetables', 'Vegetables'),
(2, 'fa-money', 'Cash Crops', 'Cash Crops', 'Cash Crops'),
(3, ' fa-bomb', 'Fruits', 'Ebibala', 'Fruits'),
(4, 'fa-coffee', 'Food crops', 'Food crops', 'Food crops'),
(5, ' fa-rebel', 'Poultry', 'Poultry', 'Poultry'),
(6, ' fa-qq', 'LiveStock', 'Ebisolo', 'LiveStock');

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

--
-- Table structure for table `languages`
--

CREATE TABLE `languages` (
  `lang_id` int(11) NOT NULL,
  `lang_iso_code` varchar(255) NOT NULL,
  `lang_name` varchar(255) NOT NULL,
  `use_lang` tinyint(1) NOT NULL,
  `isDefault` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `languages`
--

INSERT INTO `languages` (`lang_id`, `lang_iso_code`, `lang_name`, `use_lang`, `isDefault`) VALUES
(1, 'en', 'English', 1, 1),
(2, 'lug', 'Luganda', 1, 0),
(3, 'sw', 'Kiswahili', 1, 0);

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

--
-- Table structure for table `language_config`
--

CREATE TABLE `language_config` (
  `config_id` int(11) NOT NULL,
  `acc_id` int(11) NOT NULL,
  `user_ip` varchar(255) NOT NULL,
  `lang_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `msgid` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `user1` int(20) NOT NULL,
  `user2` int(20) NOT NULL,
  `message` varchar(5000) NOT NULL,
  `msg_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `msg_read` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` (`msgid`, `order_id`, `user1`, `user2`, `message`, `msg_datetime`, `msg_read`) VALUES
(10, 11, 9, 1, 'hi\n', '2020-11-06 13:53:51', 0),
(11, 11, 1, 9, 'Hello, customer how are you', '2020-11-06 13:54:11', 0),
(12, 11, 9, 1, 'am alright', '2020-11-06 13:54:31', 0),
(13, 11, 1, 9, 'So how may i help you', '2020-11-06 13:54:50', 0),
(14, 11, 9, 1, 'i need 10 bags of water melon ASAP!\n', '2020-11-06 13:59:38', 0),
(15, 11, 1, 9, 'okay, we have all your order sir', '2020-11-06 14:00:19', 0),
(16, 11, 9, 1, 'can it be delivered in ntugamo', '2020-11-06 14:00:52', 0),
(17, 11, 1, 9, 'off course, in 2 hours we will be there, you can pay chash on delivery', '2020-11-06 14:01:37', 0),
(18, 2, 1, 9, 'good morning', '2020-11-06 17:44:30', 0);

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `order_id` int(11) NOT NULL,
  `farmer_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `stock_units_required` int(255) NOT NULL,
  `order_description` varchar(500) NOT NULL,
  `trader_id` int(11) NOT NULL,
  `seen` tinyint(1) NOT NULL,
  `order_date_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `confirmed` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`order_id`, `farmer_id`, `product_id`, `stock_units_required`, `order_description`, `trader_id`, `seen`, `order_date_time`, `confirmed`) VALUES
(2, 1, 3, 10, 'I need 10 of yor product', 9, 1, '2020-11-02 23:19:25', 1),
(11, 1, 4, 10, 'good wat', 9, 0, '2020-11-05 12:38:27', 1);

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `product_id` int(11) NOT NULL,
  `product_no` varchar(255) NOT NULL,
  `ACC_ID` int(11) NOT NULL,
  `en_product_name` varchar(3000) NOT NULL,
  `lug_product_name` varchar(3000) NOT NULL,
  `sw_product_name` varchar(3000) NOT NULL,
  `cat_id` int(11) NOT NULL,
  `sold_in_units_id` int(11) NOT NULL,
  `stock_units` int(100) NOT NULL,
  `price_per_unit` int(255) NOT NULL,
  `min_unit_order` int(255) NOT NULL,
  `currency_id` int(11) NOT NULL,
  `en_product_description` varchar(5000) NOT NULL,
  `lug_product_description` varchar(5000) NOT NULL,
  `sw_product_description` varchar(5000) NOT NULL,
  `product_thumbnail` varchar(3000) NOT NULL,
  `creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_modification_date` datetime NOT NULL,
  `show_product` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`product_id`, `product_no`, `ACC_ID`, `en_product_name`, `lug_product_name`, `sw_product_name`, `cat_id`, `sold_in_units_id`, `stock_units`, `price_per_unit`, `min_unit_order`, `currency_id`, `en_product_description`, `lug_product_description`, `sw_product_description`, `product_thumbnail`, `creation_date`, `last_modification_date`, `show_product`) VALUES
(3, 'PR-707176', 1, 'tomatoes', '', '', 1, 1, 100, 200000, 1, 1, 'Fruity fresh tomatoes', '', '', 'tomatoes_helios4eos_gettyimages-edit_346d0ada432ead07f4aa89322f2ae339_1b81b825438e12ca862e80a44c89c7e8.jpeg', '2020-11-01 07:37:05', '2020-11-01 07:37:05', 1),
(4, 'PR-949922', 1, 'Watermelon', '', '', 3, 3, 500, 10000, 10, 1, 'Good looking pineapples', '', '', 'FD002329-56a6d3133df78cf772906f1d_cff1f27823cccd5e3e42ba96b21d5a30_9e3b89df1b993e2d8cd32b84aa9a5c4e.jpg', '2020-11-01 07:44:43', '2020-11-01 07:44:43', 1),
(5, 'PR-261715', 1, 'Passion fruits', '', '', 3, 3, 100, 300000, 10, 1, 'Fresh passion fruits', '', '', 'passion_fruit_2_20597490683e8c86ae067aa17bf2b69b_a72c6651780a156d4f79b3975508d09a.jpg', '2020-11-01 07:48:21', '2020-11-01 07:48:21', 1),
(6, 'PR-9330', 1, 'Irish potatoes', '', '', 4, 1, 400, 400000, 5, 1, 'productivity irish potatoes', '', '', 'potato-farming-in-Kenya-768x759_361be1c64b13a5ff73bc316379bf46e9_627a9aade78f031d921139c71e450168.jpg', '2020-11-01 07:54:56', '2020-11-01 07:54:56', 1),
(7, 'PR-620414', 1, 'Sweet potatoes', '', '', 4, 1, 5000, 150000, 100, 3, 'good looking maize', '', '', 'Sweet-potatoes-GettyImages-592411298-58bc9a215f9b58af5cc1ae4f_76b8fdc1f385c13f19b14f51791e2e94.jpg', '2020-11-01 08:10:27', '2020-11-01 08:10:27', 1),
(8, 'PR-697974', 1, 'Pineapple', '', '', 3, 1, 100, 200000, 10, 1, 'This is good', '', '', 'pineapple_53f52d26980bae606c37ce213ce34764.jpg', '2020-11-01 08:49:43', '2020-11-01 08:49:43', 1),
(9, 'PR-934734', 1, 'jersey cattle', '', '', 6, 3, 200, 2000000, 1, 3, 'good cows in good condition', '', '', 'cattle_f981f6b85d2fe7049cfc097a9d9622b8.jpg', '2020-11-01 09:17:43', '2020-11-01 09:17:43', 1),
(10, 'PR-239489', 1, 'Arabic coffee', '', '', 2, 1, 1000, 800000, 5, 4, 'Quality araboic coffee with good seeds', '', '', 'coffee_drying_kenya_9270d2b541d8757adfd4229e84027666.jpg', '2020-11-01 10:49:16', '2020-11-01 10:49:16', 1),
(11, 'PR-82395', 1, 'Maize', '', '', 4, 1, 80, 600000, 2, 1, 'This is good maize', '', '', 'maize_28265f1c2b4edc3d68163ef658452d05.jpg', '2020-11-01 11:35:29', '2020-11-01 11:35:29', 1);

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

--
-- Table structure for table `product_details`
--

CREATE TABLE `product_details` (
  `product_detail_id` int(11) NOT NULL,
  `product_no` varchar(255) NOT NULL,
  `en_product_details` mediumtext NOT NULL,
  `lug_product_details` mediumtext NOT NULL,
  `sw_product_details` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `product_details`
--

INSERT INTO `product_details` (`product_detail_id`, `product_no`, `en_product_details`, `lug_product_details`, `sw_product_details`) VALUES
(1, 'PR-61989', 'casssav cassava', '', ''),
(2, 'PR-201200', 'Each piece is l00kg sack', '', ''),
(3, 'PR-707176', '1 box is worthy UGX.200000', '', ''),
(4, 'PR-949922', 'This is a good pineapple', '', ''),
(5, 'PR-261715', 'Good passion fruits', '', ''),
(6, 'PR-9330', 'good irish potatoes', '', ''),
(7, 'PR-620414', 'this is nice', '', ''),
(8, 'PR-697974', 'this is the good', '', ''),
(9, 'PR-934734', 'good cows is is very good', '', ''),
(10, 'PR-239489', '1 Tone is 100kg', '', ''),
(11, 'PR-82395', 'It is a maize', '', '');

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

--
-- Table structure for table `product_images`
--

CREATE TABLE `product_images` (
  `image_id` int(11) NOT NULL,
  `product_no` varchar(255) NOT NULL,
  `image_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `product_images`
--

INSERT INTO `product_images` (`image_id`, `product_no`, `image_name`) VALUES
(1, 'PR-61989', '2-1Q022163545F2_270c2e02dc4b92ad90d399983e57d814.jpg'),
(2, 'PR-201200', 'eggplant_c58087202266aa0217d12ede19544410.jpg'),
(3, 'PR-707176', 'tomatoes_helios4eos_gettyimages-edit_346d0ada432ead07f4aa89322f2ae339_1b81b825438e12ca862e80a44c89c7e8.jpeg'),
(4, 'PR-949922', 'FD002329-56a6d3133df78cf772906f1d_cff1f27823cccd5e3e42ba96b21d5a30_9e3b89df1b993e2d8cd32b84aa9a5c4e.jpg'),
(5, 'PR-261715', 'passion_fruit_2_20597490683e8c86ae067aa17bf2b69b_a72c6651780a156d4f79b3975508d09a.jpg'),
(6, 'PR-9330', 'potato-farming-in-Kenya-768x759_361be1c64b13a5ff73bc316379bf46e9_627a9aade78f031d921139c71e450168.jpg'),
(7, 'PR-620414', 'Sweet-potatoes-GettyImages-592411298-58bc9a215f9b58af5cc1ae4f_76b8fdc1f385c13f19b14f51791e2e94.jpg'),
(8, 'PR-697974', 'pineapple_53f52d26980bae606c37ce213ce34764.jpg'),
(9, 'PR-934734', 'cattle_f981f6b85d2fe7049cfc097a9d9622b8.jpg'),
(10, 'PR-239489', 'coffee_drying_kenya_9270d2b541d8757adfd4229e84027666.jpg'),
(11, 'PR-239489', 'Kona-King-Coffee-Farm_680a10b46444b34d55412c92fe35e032.jpg'),
(12, 'PR-82395', 'maize_28265f1c2b4edc3d68163ef658452d05.jpg');

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

--
-- Table structure for table `product_units`
--

CREATE TABLE `product_units` (
  `unit_id` int(11) NOT NULL,
  `en_unit_name` varchar(255) NOT NULL,
  `lug_unit_name` varchar(255) NOT NULL,
  `sw_unit_name` varchar(255) NOT NULL,
  `unit_symbol` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `product_units`
--

INSERT INTO `product_units` (`unit_id`, `en_unit_name`, `lug_unit_name`, `sw_unit_name`, `unit_symbol`) VALUES
(1, 'Tone(s)', 'Tani', 'Tone(s)', 'Tone'),
(2, 'Kilogram(s)', 'Kilo', 'Kilogram(s)', 'kg'),
(3, 'piece(s)', 'piece(s)', 'piece(s)', 'piece');

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

--
-- Table structure for table `sliderads`
--

CREATE TABLE `sliderads` (
  `AD_ID` int(11) NOT NULL,
  `SMALL_HEADING` varchar(500) NOT NULL,
  `BIG_HEADING` varchar(500) NOT NULL,
  `AD_BODY_TEXT` varchar(3000) NOT NULL,
  `AD_IMAGE` varchar(500) NOT NULL,
  `BTN_LINK` varchar(600) NOT NULL,
  `SHOW_AD` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `supported_countries`
--

CREATE TABLE `supported_countries` (
  `country_id` int(11) NOT NULL,
  `country_name` varchar(255) NOT NULL,
  `country_iso_code` varchar(255) NOT NULL,
  `used_currency_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `supported_countries`
--

INSERT INTO `supported_countries` (`country_id`, `country_name`, `country_iso_code`, `used_currency_id`) VALUES
(1, 'Uganda', 'UG', 1),
(2, 'Kenya', 'KE', 4),
(3, 'Tanzania', 'TZ', 3);

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

--
-- Table structure for table `supported_currency`
--

CREATE TABLE `supported_currency` (
  `currency_id` int(11) NOT NULL,
  `currency_iso_code` varchar(255) NOT NULL,
  `currency_symbol` varchar(255) NOT NULL,
  `inUse` tinyint(1) NOT NULL,
  `prefixed` tinyint(1) NOT NULL,
  `indented` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `supported_currency`
--

INSERT INTO `supported_currency` (`currency_id`, `currency_iso_code`, `currency_symbol`, `inUse`, `prefixed`, `indented`) VALUES
(1, 'UGX', 'Ush', 1, 0, 0),
(2, 'USD', '$', 1, 0, 0),
(3, 'TSH', 'Tsh', 1, 1, 0),
(4, 'KSH', 'Ksh', 1, 1, 0);

--
-- Indexes for table `account_types`
--
ALTER TABLE `account_types`
  ADD PRIMARY KEY (`ACC_TYPE_ID`);

--
-- Indexes for table `category`
--
ALTER TABLE `category`
  ADD PRIMARY KEY (`cat_id`);

--
-- Indexes for table `languages`
--
ALTER TABLE `languages`
  ADD PRIMARY KEY (`lang_id`);

--
-- Indexes for table `language_config`
--
ALTER TABLE `language_config`
  ADD PRIMARY KEY (`config_id`);

--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`msgid`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`order_id`);

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

--
-- Indexes for table `product_details`
--
ALTER TABLE `product_details`
  ADD PRIMARY KEY (`product_detail_id`);

--
-- Indexes for table `product_images`
--
ALTER TABLE `product_images`
  ADD PRIMARY KEY (`image_id`);

--
-- Indexes for table `product_units`
--
ALTER TABLE `product_units`
  ADD PRIMARY KEY (`unit_id`);

--
-- Indexes for table `sliderads`
--
ALTER TABLE `sliderads`
  ADD PRIMARY KEY (`AD_ID`);

--
-- Indexes for table `supported_countries`
--
ALTER TABLE `supported_countries`
  ADD PRIMARY KEY (`country_id`);

--
-- Indexes for table `supported_currency`
--
ALTER TABLE `supported_currency`
  ADD PRIMARY KEY (`currency_id`);

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

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

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

--
-- AUTO_INCREMENT for table `language_config`
--
ALTER TABLE `language_config`
  MODIFY `config_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `messages`
--
ALTER TABLE `messages`
  MODIFY `msgid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

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

--
-- AUTO_INCREMENT for table `product_details`
--
ALTER TABLE `product_details`
  MODIFY `product_detail_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `product_images`
--
ALTER TABLE `product_images`
  MODIFY `image_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

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

--
-- AUTO_INCREMENT for table `sliderads`
--
ALTER TABLE `sliderads`
  MODIFY `AD_ID` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `supported_currency`
--
ALTER TABLE `supported_currency`
  MODIFY `currency_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;

