-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 29, 2021 at 05:13 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.3.28

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

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

--
-- Table structure for table `flats`
--

CREATE TABLE `flats` (
  `flat_id` int(11) NOT NULL,
  `block_door` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `flats`
--

INSERT INTO `flats` (`flat_id`, `block_door`) VALUES
(1, 'B1-1'),
(2, 'B1-2'),
(3, 'B1-3'),
(4, 'B1-4'),
(5, 'B2-1'),
(6, 'B2-2'),
(7, 'B2-3'),
(8, 'B2-4');

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

--
-- Table structure for table `flat_owners`
--

CREATE TABLE `flat_owners` (
  `flat_owner_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `flat_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `flat_owners`
--

INSERT INTO `flat_owners` (`flat_owner_id`, `user_id`, `flat_id`) VALUES
(1, 34, 3),
(2, 37, 1),
(3, 38, 8);

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

--
-- Table structure for table `parking`
--

CREATE TABLE `parking` (
  `parking_id` int(11) NOT NULL,
  `parking_slot` varchar(100) NOT NULL,
  `status` tinyint(3) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `parking`
--

INSERT INTO `parking` (`parking_id`, `parking_slot`, `status`) VALUES
(1, 'P-1', 0),
(2, 'P-2', 0),
(3, 'P-3', 0),
(4, 'P-4', 0),
(5, 'P-5', 0),
(6, 'P-6', 0);

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `setting_id` int(10) UNSIGNED NOT NULL,
  `type` varchar(80) DEFAULT NULL,
  `category` varchar(80) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `key` varchar(250) NOT NULL,
  `value` text DEFAULT NULL,
  `options` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` (`setting_id`, `type`, `category`, `description`, `user_id`, `key`, `value`, `options`) VALUES
(2, 'radio', 'Home', 'Display home page banner', 0, 'home-banner', 'yes', '[\"yes\", \"no\"]'),
(6, 'textarea', 'Home', 'Banner Text', 0, 'banner-text', '<h1>Advanced connectivity<br>\r\nand power solutions</h1>\r\n', ''),
(11, 'image', 'hide', 'Select site logo', 0, 'site-logo', 'logo.png', NULL),
(12, 'image', 'hide', 'Select home page banner', 0, 'site-banner-image', 'site-banner-image.jpg', NULL),
(13, 'image', 'hide', 'Select favicon', 0, 'site-favicon', 'site-favicon.png', NULL),
(14, 'text', 'General', 'Define site name', 0, 'site-name', 'Visitors Management', ''),
(15, 'text', 'General', 'Define admin email', 0, 'admin-email', 'admin@example.com', ''),
(16, 'textarea', 'General', 'Define Site Keywords', 0, 'site-keywords', 'Visitors Management', ''),
(17, 'textarea', 'General', 'Define Site Description', 0, 'site-description', 'Visitors Management', ''),
(18, 'radio', 'hide', 'No of jobs to display per page', 0, 'jobs-limit', '5', '[\"5\", \"10\", \"25\", \"50\"]'),
(24, 'heading', 'General', '', 0, '<a href=\"#\">Email Settings</a>', '', NULL),
(25, 'radio', 'General', 'Enable external smtp for emails (selecting no will use default hosting email settings e.g. sendmail)', 0, 'smtp', 'yes', '[\"yes\", \"no\"]'),
(26, 'text', 'General', 'Define smtp host.', 0, 'smtp-host', 'smtp.googlemail.com', ''),
(27, 'text', 'General', 'Define smtp port.', 0, 'smtp-port', '465', ''),
(28, 'text', 'General', 'Define smtp username.', 0, 'smtp-username', 'your-gmail@gmail.com', ''),
(29, 'password', 'General', 'Define smtp password.', 0, 'smtp-password', 'Abcd1234!', ''),
(30, 'heading', 'Apis', '', 0, '<a href=\"https://code.tutsplus.com/tutorials/create-a-google-login-page-in-php--cms-33214\" target=\"_blank\">Google Login</a>', '', NULL),
(31, 'radio', 'Apis', 'Enable google login.', 0, 'enable-google-login', 'yes', '[\"yes\", \"no\"]'),
(32, 'text', 'Apis', 'Define Google client id', 0, 'google-client-id', 'abcd1234', ''),
(33, 'text', 'Apis', 'Define Google client secret', 0, 'google-client-secret', 'abcd1234', ''),
(34, 'readonly', 'Apis', 'Paste this redirect uri in google app console.', 0, 'google-app-redirect', 'http://localhost/candidate-finder-smart-recruitment-system/the-script/google-redirect', ''),
(35, 'heading', 'Apis', '', 0, '<a href=\"https://www.linkedin.com/developers/login\" target=\"_blank\">Linkedin Login</a>', '', NULL),
(36, 'radio', 'Apis', 'Enable linkedin login.', 0, 'enable-linkedin-login', 'yes', '[\"yes\", \"no\"]'),
(37, 'text', 'Apis', 'Define linkedin App id', 0, 'linkedin-app-id', 'abcd1234', ''),
(38, 'text', 'Apis', 'Define linkedin App secret', 0, 'linkedin-app-secret', 'abcd1234', ''),
(39, 'readonly', 'Apis', 'Paste this redirect uri in linkedin app console.', 0, 'linkedin-app-redirect', 'http://localhost/candidate-finder-smart-recruitment-system/the-script/linkedin-redirect', ''),
(40, 'color', 'Colors', 'Select Banner text color', 0, 'banner-text-color', '#f4f4f4', NULL),
(41, 'color', 'Colors', 'Select background color for site content area (#f4f4f4)', 0, 'site-background', '#f4f4f4', NULL),
(42, 'color', 'Colors', 'Select colors for heading underline (#56c7ff)', 0, 'headings-underline-color', '#56c7ff', NULL),
(43, 'color', 'Colors', 'Select background color for footer (#1D3352)', 0, 'footer-background', '#1D3352', NULL),
(44, 'color', 'Colors', 'Select items color for footer (#FFFFFF)', 0, 'footer-items-color', '#FFFFFF', NULL),
(45, 'color', 'Colors', 'Define color for footer social icons (#56c7ff)', 0, 'footer-social-icons-color', '#56c7ff', NULL);

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

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

CREATE TABLE `users` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `first_name` varchar(100) NOT NULL,
  `last_name` varchar(100) NOT NULL,
  `username` varchar(100) NOT NULL,
  `email` varchar(150) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `password` varchar(150) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `token` varchar(100) NOT NULL,
  `user_type` varchar(30) NOT NULL DEFAULT 'admin',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `username`, `email`, `image`, `phone`, `password`, `status`, `token`, `user_type`, `created_at`, `updated_at`) VALUES
(1, 'Admin', 'User', 'admin', 'admin@gmail.com', 'admin-logopng-1618923898.png', '', '0192023a7bbd73250516f069df18b500f89c848fa', 1, 'admin@gmail.com-1627029498', 'admin', '2020-09-04 11:40:23', NULL),
(34, 'Ram', 'Nivas', 'ramnivas', 'r.ramnivass@gmail.com', NULL, '9944559360', '06eb863148b67da03d9caa82ba03c098f89c848fa', 1, '', 'Flat Owner', '2021-07-25 12:48:47', NULL),
(35, 'Security', 'Security', 'security', 'security1@gmail.com', NULL, '8899889999', '06eb863148b67da03d9caa82ba03c098f89c848fa', 1, '', 'Security', '2021-07-25 12:49:37', NULL),
(37, 'Rakesh', 'Kumar', 'rakesh', 'r.ramnivass1@gmail.com', NULL, '9944559360', '06eb863148b67da03d9caa82ba03c098f89c848fa', 1, '', 'Flat Owner', '2021-07-27 18:26:19', NULL),
(38, 'Lionel', 'Messi', 'messi', 'r.ramnivass1@ko.com', NULL, '8899889999', '06eb863148b67da03d9caa82ba03c098f89c848fa', 1, '', 'Flat Owner', '2021-07-27 18:44:15', NULL);

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

--
-- Table structure for table `visitentry`
--

CREATE TABLE `visitentry` (
  `visit_entry_id` int(11) NOT NULL,
  `visitor_id` int(11) NOT NULL,
  `parking_ticket` int(11) NOT NULL,
  `entry_time` datetime NOT NULL,
  `exit_time` datetime NOT NULL,
  `is_attended` tinyint(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `visitentry`
--

INSERT INTO `visitentry` (`visit_entry_id`, `visitor_id`, `parking_ticket`, `entry_time`, `exit_time`, `is_attended`) VALUES
(1, 1, 3, '2021-07-29 18:35:00', '2021-07-29 18:50:00', 2),
(3, 2, 2, '2021-07-29 14:30:00', '2021-07-29 16:30:00', 2),
(4, 3, 2, '2021-07-29 14:45:00', '2021-07-29 14:55:00', 2),
(5, 6, 1, '2021-07-26 09:25:00', '0000-00-00 00:00:00', 1),
(6, 5, 1, '2021-07-30 11:25:00', '2021-07-30 11:50:00', 2),
(7, 7, 3, '2021-07-30 11:45:00', '2021-07-30 17:10:00', 2),
(8, 9, 0, '2021-07-31 14:10:00', '2021-07-31 14:55:00', 2);

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

--
-- Table structure for table `visitors`
--

CREATE TABLE `visitors` (
  `visitor_id` int(11) NOT NULL,
  `visitor_name` varchar(255) NOT NULL,
  `mobile` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `visit_unit` int(11) NOT NULL,
  `no_of_members` varchar(255) NOT NULL,
  `purpose_of_visit` text NOT NULL,
  `visiting_date` datetime NOT NULL,
  `parking` varchar(10) NOT NULL,
  `duration` varchar(50) NOT NULL,
  `id_proof` varchar(255) NOT NULL,
  `is_visited` tinyint(3) NOT NULL,
  `added_by` int(11) NOT NULL,
  `last_edited_by` int(11) NOT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `visitors`
--

INSERT INTO `visitors` (`visitor_id`, `visitor_name`, `mobile`, `email`, `visit_unit`, `no_of_members`, `purpose_of_visit`, `visiting_date`, `parking`, `duration`, `id_proof`, `is_visited`, `added_by`, `last_edited_by`, `created_at`) VALUES
(1, 'Jack', '993242425', 'admin@gmail.com', 3, '2', 'test', '2021-07-29 18:45:00', 'Yes', '2 hours', 'art-color-colourful-207665jpg-1627210285.jpg', 1, 34, 0, '2021-07-25 12:51:25'),
(2, 'visitor 2', '886868787', 'r.ramnivass@gmail.com', 3, '2', 'Test', '2021-07-29 14:55:00', 'Yes', '2 hours', 'children-class-classroom-1720186jpg-1627212136.jpg', 1, 34, 0, '2021-07-25 13:22:16'),
(3, 'visitor3', '9944559360', 'r.ramnivass@gmail.com', 3, '2', 'Test', '2021-07-29 14:45:00', 'Yes', '2 hours', 'children-class-classroom-1720186jpg-1627290764.jpg', 1, 34, 0, '2021-07-26 11:12:44'),
(4, 'Ram', '9944559360', 'r.ramnivass@ko.com', 3, '2', 'Test', '2021-07-28 17:00:00', 'Yes', '2 hours', 'blackboard-board-chalk-236110jpg-1627322936.jpg', 0, 34, 0, '2021-07-26 20:08:56'),
(5, 'visitor 2', '9944559360', 'r.ramnivass@gmail.com', 2, '2', 'Test', '2021-07-30 10:50:00', 'Yes', '2 hours', 'blackboard-board-chalk-236110jpg-1627323320.jpg', 1, 34, 0, '2021-07-26 20:15:20'),
(6, 'teart', '9944559360', 'r.ramnivass@gmail.com', 1, '2', 'Test', '2021-07-28 18:50:00', 'Yes', '2 hours', 'blackboard-board-chalk-236110jpg-1627324103.jpg', 1, 35, 0, '2021-07-26 20:28:23'),
(7, 'Ronaldo', '9944559360', 'r.ramnivass@gmail.com', 3, '1', 'To play Fifa', '2021-07-31 06:05:00', 'Yes', '4', '', 1, 1, 0, '2021-07-28 11:56:03'),
(8, 'Mbappe', '9944559360', 'r.ramnivass@gmail.com', 3, '1', 'To play Fifa', '2021-08-01 06:05:00', 'Yes', '4', '1png-1627466267.png', 0, 1, 0, '2021-07-28 11:57:47'),
(9, 'Rashford', '9944559360', 'r.ramnivass@gmail.com', 4, '1', 'To play Fifa', '2021-07-31 14:10:00', 'No', '4', '', 1, 35, 0, '2021-07-29 08:41:47'),
(10, 'Messi', '9944559360', 'r.ramnivass@gmail.com', 3, '1', 'To play Fifa', '2021-08-01 06:00:00', 'Yes', '5 hours', '', 0, 34, 0, '2021-07-29 09:57:26'),
(11, 'Rahul Dravid', '9944559360', 'r.ramnivass@gmail.com', 3, '1', 'To Play Cricket', '2021-07-29 13:30:00', 'Yes', '1 hour', '', 0, 35, 0, '2021-07-29 09:59:12'),
(12, 'Sachin Tendulkar', '9344121368', 'r.ramnivass@gmail.com', 1, '1', 'To Play Cricket', '2021-07-29 14:00:00', 'Yes', '4', '', 0, 35, 0, '2021-07-29 10:11:10');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `flats`
--
ALTER TABLE `flats`
  ADD PRIMARY KEY (`flat_id`);

--
-- Indexes for table `flat_owners`
--
ALTER TABLE `flat_owners`
  ADD PRIMARY KEY (`flat_owner_id`);

--
-- Indexes for table `parking`
--
ALTER TABLE `parking`
  ADD PRIMARY KEY (`parking_id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`setting_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`user_id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `visitentry`
--
ALTER TABLE `visitentry`
  ADD PRIMARY KEY (`visit_entry_id`);

--
-- Indexes for table `visitors`
--
ALTER TABLE `visitors`
  ADD PRIMARY KEY (`visitor_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `flats`
--
ALTER TABLE `flats`
  MODIFY `flat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

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

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

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `setting_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- AUTO_INCREMENT for table `visitentry`
--
ALTER TABLE `visitentry`
  MODIFY `visit_entry_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `visitors`
--
ALTER TABLE `visitors`
  MODIFY `visitor_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
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 */;
