-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 05, 2022 at 12:56 AM
-- Server version: 5.7.14
-- PHP Version: 7.0.10

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

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `Id` int(11) NOT NULL,
  `Category_code` varchar(100) NOT NULL,
  `Category_name` text NOT NULL,
  `Time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`Id`, `Category_code`, `Category_name`, `Time`) VALUES
(53, 'JG-001', 'Fruits', '2022-01-03 13:21:04'),
(54, 'JG-002', 'Greens', '2022-01-03 13:21:47'),
(55, 'JG-003', 'Fresh Tubers', '2022-01-03 13:22:10');

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

--
-- Table structure for table `earnings`
--

CREATE TABLE `earnings` (
  `id` int(11) NOT NULL,
  `customer` varchar(100) NOT NULL,
  `phone` varchar(11) DEFAULT NULL,
  `amount` int(11) NOT NULL,
  `mode` varchar(100) NOT NULL,
  `cash` int(100) NOT NULL,
  `mpesa` int(100) NOT NULL,
  `balance` int(11) NOT NULL,
  `receipt_no` varchar(100) NOT NULL,
  `session` varchar(110) NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `items_received`
--

CREATE TABLE `items_received` (
  `id` int(11) NOT NULL,
  `customer` varchar(100) NOT NULL,
  `item` varchar(100) NOT NULL,
  `size` varchar(100) NOT NULL,
  `price` varchar(100) NOT NULL,
  `totalprice` int(11) NOT NULL,
  `quantity` int(11) NOT NULL,
  `quantity_1` int(11) NOT NULL,
  `receipt_no` varchar(100) NOT NULL,
  `session` varchar(100) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ordered_items`
--

CREATE TABLE `ordered_items` (
  `id` int(11) NOT NULL,
  `code` varchar(100) NOT NULL,
  `name` varchar(100) NOT NULL,
  `size` varchar(100) NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` int(11) NOT NULL,
  `total_price` int(11) NOT NULL,
  `receipt_no` varchar(100) NOT NULL,
  `released` int(11) NOT NULL DEFAULT '0',
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ordered_items`
--

INSERT INTO `ordered_items` (`id`, `code`, `name`, `size`, `quantity`, `price`, `total_price`, `receipt_no`, `released`, `time`) VALUES
(195, 'yp1YQsbJu9', 'potatoes', '1Kg', 5, 60, 300, 'Order-61d477f78ed77', 0, '2022-01-04 16:38:15'),
(194, '9tPsvnLdYE', 'South Africa Apples', '1Kg', 1, 120, 120, 'Order-61d2f220eeb2f', 0, '2022-01-03 12:54:56'),
(193, '9tPsvnLdYE', 'South Africa Apples', '1Kg', 5, 120, 600, 'Order-61d2ecc3b4876', 0, '2022-01-03 12:32:03');

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

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

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `customer` varchar(100) NOT NULL,
  `phone` int(11) NOT NULL,
  `residence` varchar(100) NOT NULL,
  `delivery_point` varchar(110) NOT NULL,
  `amount` int(11) NOT NULL,
  `mode` varchar(110) NOT NULL,
  `receipt_no` varchar(110) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  `released` int(11) NOT NULL DEFAULT '0',
  `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

INSERT INTO `orders` (`id`, `customer`, `phone`, `residence`, `delivery_point`, `amount`, `mode`, `receipt_no`, `status`, `released`, `time`) VALUES
(124, 'Jostechie', 797327555, 'Nairobi', 'Umoja Supermarket', 300, 'On Delivery', 'Order-61d477f78ed77', 1, 0, '2022-01-04 19:38:34'),
(123, 'stephen Kasolo', 797327555, 'Nairobi', 'Utawala Restaurants', 120, 'On Delivery', 'Order-61d2f220eeb2f', 0, 0, '2022-01-03 15:54:57'),
(122, 'Joseph Kinuthia', 708448164, 'Nairobi', 'Eastleigh', 600, 'On Delivery', 'Order-61d2ecc3b4876', 1, 0, '2022-01-03 15:41:07');

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

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

CREATE TABLE `products` (
  `id` int(100) NOT NULL,
  `code` varchar(11) NOT NULL,
  `image` varchar(100) NOT NULL,
  `category` varchar(100) NOT NULL,
  `name` varchar(100) NOT NULL,
  `size` varchar(100) NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` int(11) NOT NULL,
  `price_1` int(11) NOT NULL DEFAULT '0',
  `description` varchar(10000) NOT NULL,
  `session` text NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

INSERT INTO `products` (`id`, `code`, `image`, `category`, `name`, `size`, `quantity`, `price`, `price_1`, `description`, `session`, `time`) VALUES
(67, 'g37IiruG4O', 'sweet potatoes.jpg', 'Fresh Tubers', 'Sweat Potatoes', '1 Kg', 100, 145, 0, 'The best the policy \r\n\r\nLorem ipsum dolor sit amet, consectetur adipiscing elit.Maecenas sit , eget luctus quam orci in velit. Praesent elerisque tortor sed accumsan convallis', 'joskin', '2022-01-04 17:13:12'),
(66, 'TzdPy6L2AY', 'index.jpg', 'Fruits', 'Banana', '1 Kg', 100, 110, 0, 'The best onions in Town. You can\'t afford to  miss this one\r\n\r\nLorem ipsum dolor sit amet, consectetur adipiscing elit.Maecenas sit , eget luctus quam orci in velit. Praesent elerisque tortor sed accumsan convallis', 'joskin', '2022-01-04 17:00:20'),
(63, '9tPsvnLdYE', 'apple.jpg', 'Fruits', 'South Africa Apples', '1Kg', 30, 120, 0, 'The best fruits in Town. You can\'t afford to  miss this one\r\n\r\nLorem ipsum dolor sit amet, consectetur adipiscing elit.Maecenas sit , eget luctus quam orci in velit. Praesent elerisque tortor sed accumsan convallis', 'joskin', '2022-01-03 10:57:50'),
(64, 'yp1YQsbJu9', 'index-1.jpg', 'Fresh Tubers', 'potatoes', '1Kg', 100, 60, 0, 'the best ever quality\r\n', 'joskin', '2022-01-04 16:34:04'),
(65, 'PjmVhafse6', 'onions.jpg', 'Greens', 'Nigerian Onions', '1Kg', 300, 120, 0, 'The best onions in Town. You can\'t afford to  miss this one\r\n\r\nLorem ipsum dolor sit amet, consectetur adipiscing elit.Maecenas sit , eget luctus quam orci in velit. Praesent elerisque tortor sed accumsan convallis', 'joskin', '2022-01-04 16:35:50');

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

--
-- Table structure for table `products_add_logs`
--

CREATE TABLE `products_add_logs` (
  `id` int(100) NOT NULL,
  `code` varchar(1000) NOT NULL,
  `image` varchar(100) NOT NULL,
  `category` varchar(100) NOT NULL,
  `name` varchar(100) NOT NULL,
  `size` varchar(100) NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` int(11) NOT NULL,
  `session` text NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `product_sales`
--

CREATE TABLE `product_sales` (
  `id` int(11) NOT NULL,
  `customer` varchar(100) NOT NULL,
  `code` varchar(110) NOT NULL,
  `name` text NOT NULL,
  `size` varchar(100) NOT NULL,
  `quantity` int(100) NOT NULL,
  `price` int(100) NOT NULL,
  `unit_totalprice` int(11) NOT NULL,
  `receipt_no` varchar(100) NOT NULL,
  `session` text NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `Id` int(100) NOT NULL,
  `Role` text NOT NULL,
  `Branch` varchar(100) NOT NULL,
  `Fname` varchar(100) NOT NULL,
  `Lname` text NOT NULL,
  `Username` varchar(100) NOT NULL,
  `Phone1` int(100) NOT NULL,
  `Phone2` int(100) NOT NULL,
  `Email` varchar(100) NOT NULL,
  `Idno` int(100) NOT NULL,
  `Password` varchar(100) NOT NULL,
  `Time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`Id`, `Role`, `Branch`, `Fname`, `Lname`, `Username`, `Phone1`, `Phone2`, `Email`, `Idno`, `Password`, `Time`) VALUES
(1, 'Admin', 'OL-JORO-OROK', 'JOSEPH ', 'KINUTHIA', 'JOSKIN', 708448167, 797327555, 'KINUTHIAJOSE105@GMAIL.COM', 3657653, '123ae7b27e350955d4822a16cc76245d', '2021-11-24 23:02:25'),
(2, 'Admin', 'KANGUI', 'DAMON', 'SALVATORE', 'damon', 797327555, 708448164, 'DAMON105@GMAIL.COM', 36576522, '4bff54815756f856d3726a5c3e849f6a', '2021-11-21 08:19:50'),
(6, 'Staff', 'KANGUI', 'JOHN', 'KIMANI', 'JOKIM', 797327556, 708448165, 'JOKIM@GMAIL.COM', 26576533, '18b3030f301635f722f1c8caa1b3c1e0', '2021-12-07 10:47:50');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`Id`);

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

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

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

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

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`);

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

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`Id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;
--
-- AUTO_INCREMENT for table `earnings`
--
ALTER TABLE `earnings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=274;
--
-- AUTO_INCREMENT for table `items_received`
--
ALTER TABLE `items_received`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=90;
--
-- AUTO_INCREMENT for table `ordered_items`
--
ALTER TABLE `ordered_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=196;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=125;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;
--
-- AUTO_INCREMENT for table `products_add_logs`
--
ALTER TABLE `products_add_logs`
  MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;
--
-- AUTO_INCREMENT for table `product_sales`
--
ALTER TABLE `product_sales`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=600;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `Id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
/*!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 */;
