-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 24, 2020 at 08:30 PM
-- Server version: 5.7.31-0ubuntu0.18.04.1
-- PHP Version: 7.3.22-1+ubuntu18.04.1+deb.sury.org+1

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

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

--
-- Table structure for table `admins`
--

CREATE TABLE `admins` (
  `user_id` int(11) UNSIGNED NOT NULL,
  `name` varchar(200) NOT NULL,
  `email` varchar(200) NOT NULL,
  `contact` varchar(100) DEFAULT NULL,
  `password` varchar(100) NOT NULL,
  `image` varchar(250) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `admins`
--

INSERT INTO `admins` (`user_id`, `name`, `email`, `contact`, `password`, `image`, `added_date`) VALUES
(9, 'Zentech Admin', 'admin@admin.com', '+233550080890', '$2y$10$Qsqy/.9GSV6hJrExyp4kEONjsss.jtPjCRJ0tDSS9q.RtubmWPGz.', '', '2020-09-08 21:17:08'),
(10, 'Nafiu Lawal', 'lawal@zentechgh.com', '+233550080890', '$2y$10$LJfyzGqGsfWBUti5KXRcROy0pU025xqcU2ABbbK85iZAWbinqCr1S', '', '2020-09-10 12:20:18'),
(11, 'Testing User', 'test@gmail.com', '+233244574544', '$2y$10$D.XL2Nx5M7NRzVvVx7T2x.w4ocgTRdIC3YtPzobwD9Oa4wPeuI4Li', '', '2020-09-10 15:49:33');

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

--
-- Table structure for table `bills`
--

CREATE TABLE `bills` (
  `bill_id` int(11) NOT NULL,
  `bill_type` varchar(200) NOT NULL,
  `bill_date` varchar(200) NOT NULL,
  `bill_month` int(11) NOT NULL,
  `bill_year` int(11) NOT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `deposit_bank_name` varchar(200) NOT NULL,
  `bill_details` varchar(200) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bills`
--

INSERT INTO `bills` (`bill_id`, `bill_type`, `bill_date`, `bill_month`, `bill_year`, `total_amount`, `deposit_bank_name`, `bill_details`, `branch_id`, `added_date`) VALUES
(14, '4', '27/08/2019', 8, 11, '5000.00', 'DBBL', 'purfect', 8, '2019-08-27 04:37:27'),
(15, '3', '21/08/2020', 6, 12, '180.00', 'Allied', 'Alied', 8, '2020-08-21 18:07:30');

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

--
-- Table structure for table `bill_types`
--

CREATE TABLE `bill_types` (
  `bt_id` int(11) NOT NULL,
  `bill_type` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bill_types`
--

INSERT INTO `bill_types` (`bt_id`, `bill_type`, `added_date`) VALUES
(3, 'Water', '2016-05-05 09:50:39'),
(4, 'Electric', '2016-05-05 09:50:51');

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

--
-- Table structure for table `blocks`
--

CREATE TABLE `blocks` (
  `bid` int(11) NOT NULL,
  `b_name` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `blocks`
--

INSERT INTO `blocks` (`bid`, `b_name`, `added_date`) VALUES
(12, 'Block A', '2019-08-26 18:56:32'),
(13, 'Block B', '2019-08-27 04:06:26'),
(14, 'Block C', '2020-09-10 16:04:02');

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

--
-- Table structure for table `complaints`
--

CREATE TABLE `complaints` (
  `complain_id` int(11) NOT NULL,
  `c_title` varchar(200) NOT NULL,
  `c_description` varchar(1000) NOT NULL,
  `c_date` varchar(200) NOT NULL,
  `c_month` varchar(50) NOT NULL,
  `c_year` varchar(50) NOT NULL,
  `c_userid` int(11) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `job_status` int(1) NOT NULL DEFAULT '0',
  `assign_employee_id` int(11) DEFAULT '0',
  `solution` varchar(500) NOT NULL,
  `complain_by` varchar(100) DEFAULT NULL,
  `person_name` varchar(250) DEFAULT NULL,
  `person_email` varchar(100) DEFAULT NULL,
  `person_contact` varchar(50) DEFAULT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `complaints`
--

INSERT INTO `complaints` (`complain_id`, `c_title`, `c_description`, `c_date`, `c_month`, `c_year`, `c_userid`, `branch_id`, `job_status`, `assign_employee_id`, `solution`, `complain_by`, `person_name`, `person_email`, `person_contact`, `added_date`) VALUES
(35, 'Water Problem', 'We need to solve water issue soon.', '27/08/2019', '8', '2019', 0, 8, 0, 12, '', NULL, NULL, NULL, NULL, '2019-08-27 04:38:09'),
(36, 'Flat color issue', 'How flat color condition is really bad kindly solve it.', '28/08/2019', '8', '2019', 20, 8, 0, 0, '', 'tenant', 'Jim Cary', 'jimcary@yahoo.com', '+8801679110711', '2019-08-27 19:29:06');

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

--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `cid` int(11) NOT NULL,
  `symbol` varchar(5) NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `currencies`
--

INSERT INTO `currencies` (`cid`, `symbol`, `name`) VALUES
(1, 'Â£', 'Pound'),
(2, '$', 'Dollar'),
(3, 'â‚¨', 'Rupee'),
(5, 'â‚¦', 'Naira'),
(6, 'â‚¬', 'Euro'),
(11, 'Â¥', 'Yuan'),
(14, 'GHâ‚µ', 'Cedi');

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

--
-- Stand-in structure for view `current_tenants_view`
-- (See below for the actual view)
--
CREATE TABLE `current_tenants_view` (
`tid` int(11)
,`r_name` varchar(200)
,`r_email` varchar(200)
,`r_contact` varchar(20)
,`r_address` varchar(200)
,`business_name` varchar(255)
,`business_phone` varchar(20)
,`nature_of_business` varchar(100)
,`image` varchar(255)
,`r_date` varchar(200)
,`r_gone_date` varchar(200)
,`added_date` timestamp
);

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

--
-- Table structure for table `maintenance`
--

CREATE TABLE `maintenance` (
  `mcid` int(11) NOT NULL,
  `m_title` varchar(200) NOT NULL,
  `bid` smallint(5) UNSIGNED DEFAULT NULL,
  `uid` mediumint(8) UNSIGNED DEFAULT NULL,
  `maintenance_type` varchar(20) DEFAULT NULL,
  `m_date` varchar(200) NOT NULL,
  `m_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `m_details` varchar(200) NOT NULL,
  `xmonth` varchar(2) NOT NULL,
  `xyear` int(11) NOT NULL DEFAULT '0',
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `maintenance`
--

INSERT INTO `maintenance` (`mcid`, `m_title`, `bid`, `uid`, `maintenance_type`, `m_date`, `m_amount`, `m_details`, `xmonth`, `xyear`, `added_date`) VALUES
(11, 'Roofing Sheets ', 13, 0, 'specific', '2020-07-15', '550.00', 'Roofing Sheets Repair', '7', 2020, '2020-09-16 18:55:32'),
(12, 'Painting', 0, 0, 'general', '2020-03-12', '2000.00', 'New Painting of Building', '3', 2020, '2020-09-16 19:06:02'),
(15, 'Roofing Sheets ', 12, 0, 'specific', '2020-09-17', '500.00', 'Roofing sheets minor repairs', '9', 2020, '2020-09-17 18:27:13');

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

--
-- Table structure for table `main_account`
--

CREATE TABLE `main_account` (
  `id` int(10) UNSIGNED NOT NULL,
  `rent_id` int(10) UNSIGNED DEFAULT NULL,
  `maintenance_id` int(10) UNSIGNED DEFAULT NULL,
  `fiscal_year` year(4) NOT NULL,
  `trans_type` varchar(20) NOT NULL,
  `amount` decimal(8,3) NOT NULL,
  `description` varchar(500) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `added_by` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `main_account`
--

INSERT INTO `main_account` (`id`, `rent_id`, `maintenance_id`, `fiscal_year`, `trans_type`, `amount`, `description`, `created_at`, `added_by`) VALUES
(74, 37, NULL, 2020, 'debit', '3500.000', 'Rent Processed on Shop No. A for 7 months for part of rent period in 2020', '2020-09-17 20:46:18', 2),
(75, 37, NULL, 2020, 'credit', '525.000', 'Tax on Rent Processed on Shop No. A for 7 months for part of rent period in 2020', '2020-09-17 20:46:18', 2),
(76, 37, NULL, 2021, 'debit', '6000.000', 'Rent Processed on Shop No. A for 12 months for part of rent period in 2021', '2020-09-17 20:46:18', 2),
(77, 37, NULL, 2021, 'credit', '900.000', 'Tax on Rent Processed on Shop No. A for 12 months for part of rent period in 2021', '2020-09-17 20:46:18', 2),
(78, 37, NULL, 2022, 'debit', '2500.000', 'Rent Processed on Shop No. A for 5 months for part of rent period in 2022', '2020-09-17 20:46:18', 2),
(79, 37, NULL, 2022, 'credit', '375.000', 'Tax on Rent Processed on Shop No. A for 5 months for part of rent period in 2022', '2020-09-17 20:46:18', 2),
(80, 38, NULL, 2020, 'debit', '7200.000', 'Rent Processed on Shop No. B for 9 months for part of rent period in 2020', '2020-09-17 20:46:37', 2),
(81, 38, NULL, 2020, 'credit', '1080.000', 'Tax on Rent Processed on Shop No. B for 9 months for part of rent period in 2020', '2020-09-17 20:46:37', 2),
(82, 38, NULL, 2021, 'debit', '9600.000', 'Rent Processed on Shop No. B for 12 months for part of rent period in 2021', '2020-09-17 20:46:37', 2),
(83, 38, NULL, 2021, 'credit', '1440.000', 'Tax on Rent Processed on Shop No. B for 12 months for part of rent period in 2021', '2020-09-17 20:46:37', 2),
(84, 38, NULL, 2022, 'debit', '1600.000', 'Rent Processed on Shop No. B for 2 months for part of rent period in 2022', '2020-09-17 20:46:37', 2),
(85, 38, NULL, 2022, 'credit', '240.000', 'Tax on Rent Processed on Shop No. B for 2 months for part of rent period in 2022', '2020-09-17 20:46:37', 2);

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

--
-- Table structure for table `meetings`
--

CREATE TABLE `meetings` (
  `meeting_id` int(11) NOT NULL,
  `meeting_title` varchar(300) NOT NULL,
  `meeting_description` text NOT NULL,
  `issue_date` date NOT NULL,
  `branch_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `meetings`
--

INSERT INTO `meetings` (`meeting_id`, `meeting_title`, `meeting_description`, `issue_date`, `branch_id`) VALUES
(6, 'Water Problem', '<p><strong>We need to solve water problem soon.</strong></p>\r\n', '2019-08-27', 8);

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

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

CREATE TABLE `messages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `channel` varchar(100) NOT NULL,
  `receiver` varchar(100) NOT NULL,
  `receiver_email` varchar(100) NOT NULL,
  `receiver_phone` varchar(20) NOT NULL,
  `status` varchar(15) NOT NULL DEFAULT 'pending',
  `time_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `time_delivered` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `messages` (`id`, `subject`, `message`, `channel`, `receiver`, `receiver_email`, `receiver_phone`, `status`, `time_created`, `time_delivered`) VALUES
(15, 'End of Rent Remainder', 'This is a notification of your end of rent period which will end on 12th September, 2020.\r\nPlease let us know if you wish to continue renting the space or please pay the rent before 28th of this month.', 'email', 'Nafiu Lawal', 'nafiudanlawal@gmail.com', '+233550080890', 'delivered', '2020-09-23 21:24:10', '2020-09-23 21:58:11'),
(16, 'End of Rent Remainder', 'This is a notification of your end of rent period which will end on 12th September, 2020.\r\nPlease let us know if you wish to continue renting the space or please pay the rent before 28th of this month.', 'email', 'Nafiu Lawal', 'nafiudanlawal@gmail.com', '+233550080890', 'delivered', '2020-09-23 21:25:31', '2020-09-24 16:15:03'),
(17, 'End of Rent Remainder', 'This is a notification of your end of rent period which will end on 12th September, 2020.\r\nPlease let us know if you wish to continue renting the space or please pay the rent before 28th of this month.', 'email', 'John Mensah', 'nafiudanlawal@gmail.com', '+233550080890', 'delivered', '2020-09-23 21:26:11', '2020-09-24 16:14:04'),
(18, 'End of Rent Remainder', 'This is a notification of your end of rent period which will end on 12th September, 2020.\r\nPlease let us know if you wish to continue renting the space or please pay the rent before 28th of this month.', 'email', 'Nafiu Lawal', 'nafiu1994@gmail.com', '+233550080890', 'delivered', '2020-09-23 21:30:37', '2020-09-23 22:03:23'),
(19, 'End of Rent Reminder', '<p>This email is to notify you of the end of your rent on {end_date}.</p>\r\n\r\n<p>Please talk to management about .......</p>\r\n', 'email', 'Nafiu Lawal', 'rollingphish@gmail.com', '+233266399063', 'delivered', '2020-09-24 20:22:34', NULL),
(20, 'End of Rent Reminder', '<p>This email is to notify you of the end of your rent on {end_date}.</p>\r\n\r\n<p>Please talk to management about .......</p>\r\n', 'email', 'Nafiu Lawal', 'rollingphish@gmail.com', '+233266399063', 'delivered', '2020-09-24 20:25:03', NULL);

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

--
-- Table structure for table `message_templates`
--

CREATE TABLE `message_templates` (
  `name` varchar(100) NOT NULL,
  `subject` varchar(500) NOT NULL,
  `message` text NOT NULL,
  `last_edited_by` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `message_templates`
--

INSERT INTO `message_templates` (`name`, `subject`, `message`, `last_edited_by`) VALUES
('end_of_rent', 'End of Rent Reminder', '<p>This email is to notify you of the end of your rent on {end_date}.</p>\r\n\r\n<p>Please talk to management about .......</p>\r\n', 2),
('eviction_notice', 'Eviction Notice', '<p>This email is to notify you of your eviction from the property {unit_no}</p>\r\n', 2),
('maintenance_notification', 'Maintenance Activity Notice', '<p>There will be some maintenance on {block}</p>\r\n', 2),
('payment_reminder', 'Payment of Rent Due', '<p>You have some pending rent payment you have to do.<br />\r\n<br />\r\nBalance to be paid is {balance}.</p>\r\n', 2),
('welcome', 'Welcome to Tesano Commercial Plaza', '<p>Welcome to our plaza. You are now part of the Tesano Commercial Plaza family.</p>\r\n\r\n<p>We are happy to have you here.</p>\r\n', 2);

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

--
-- Stand-in structure for view `occupied_units_view`
-- (See below for the actual view)
--
CREATE TABLE `occupied_units_view` (
`uid` int(11)
,`bid` smallint(5) unsigned
,`unit_no` varchar(200)
,`floor` varchar(100)
,`rate` decimal(8,3) unsigned
,`b_name` varchar(200)
,`status` int(1)
,`unit_added_date` timestamp
,`date_assigned` timestamp
,`assignment_id` int(10) unsigned
,`date_removed` timestamp
,`tenant_id` int(10) unsigned
);

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

--
-- Table structure for table `rent`
--

CREATE TABLE `rent` (
  `id` int(11) UNSIGNED NOT NULL,
  `uid` smallint(10) UNSIGNED NOT NULL,
  `tid` mediumint(8) UNSIGNED NOT NULL,
  `rate` decimal(8,2) UNSIGNED NOT NULL,
  `rent_yearly` decimal(15,2) UNSIGNED NOT NULL,
  `period` tinyint(3) UNSIGNED NOT NULL,
  `amt_paid` decimal(12,2) UNSIGNED NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `water_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `electric_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `gas_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `security_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `utility_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `other_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `total_rent` decimal(15,2) NOT NULL DEFAULT '0.00',
  `issue_date` varchar(200) NOT NULL,
  `paid_date` varchar(25) DEFAULT NULL,
  `bill_status` tinyint(1) NOT NULL DEFAULT '0',
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `added_by` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `rent`
--

INSERT INTO `rent` (`id`, `uid`, `tid`, `rate`, `rent_yearly`, `period`, `amt_paid`, `start_date`, `end_date`, `water_bill`, `electric_bill`, `gas_bill`, `security_bill`, `utility_bill`, `other_bill`, `total_rent`, `issue_date`, `paid_date`, `bill_status`, `added_date`, `added_by`) VALUES
(37, 30, 26, '500.00', '6000.00', 2, '8000.00', '2020-06-01', '2022-05-28', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '12000.00', '2020-09-17', NULL, 0, '2020-09-17 20:46:18', 2),
(38, 32, 27, '800.00', '9600.00', 2, '10000.00', '2020-04-01', '2022-03-02', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '19200.00', '2020-06-17', NULL, 0, '2020-09-17 20:46:37', 2),
(39, 33, 27, '800.00', '9600.00', 2, '10000.00', '2020-04-01', '2020-09-30', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '19200.00', '2020-06-17', NULL, 0, '2020-09-17 20:46:37', 2);

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

--
-- Table structure for table `rent_payment_updates`
--

CREATE TABLE `rent_payment_updates` (
  `id` int(10) UNSIGNED NOT NULL,
  `rent_id` int(11) NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `amount` decimal(8,3) NOT NULL,
  `added_by` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `rent_payment_updates`
--

INSERT INTO `rent_payment_updates` (`id`, `rent_id`, `date`, `amount`, `added_by`) VALUES
(13, 37, '2020-09-17 20:46:18', '5000.000', 2),
(14, 38, '2020-09-17 20:46:37', '10000.000', 2),
(15, 37, '2020-09-17 20:50:39', '1000.000', 2),
(16, 37, '2020-09-17 20:52:45', '2000.000', 2);

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

--
-- Stand-in structure for view `rent_tenant_unit_view`
-- (See below for the actual view)
--
CREATE TABLE `rent_tenant_unit_view` (
`id` int(11) unsigned
,`uid` smallint(10) unsigned
,`tid` mediumint(8) unsigned
,`rate` decimal(8,2) unsigned
,`rent_yearly` decimal(15,2) unsigned
,`period` tinyint(3) unsigned
,`amt_paid` decimal(12,2) unsigned
,`start_date` date
,`end_date` date
,`water_bill` decimal(15,2)
,`electric_bill` decimal(15,2)
,`gas_bill` decimal(15,2)
,`security_bill` decimal(15,2)
,`utility_bill` decimal(15,2)
,`other_bill` decimal(15,2)
,`total_rent` decimal(15,2)
,`issue_date` varchar(200)
,`paid_date` varchar(25)
,`bill_status` tinyint(1)
,`added_date` timestamp
,`added_by` smallint(5) unsigned
,`r_name` varchar(200)
,`r_email` varchar(200)
,`r_contact` varchar(20)
,`business_name` varchar(255)
,`image` varchar(255)
,`unit_no` varchar(200)
,`bid` smallint(5) unsigned
,`floor` varchar(100)
,`b_name` varchar(200)
);

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

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

CREATE TABLE `settings` (
  `lang_code` varchar(100) CHARACTER SET utf8 NOT NULL,
  `currency` varchar(20) CHARACTER SET utf8 NOT NULL,
  `rent_reminder_days` tinyint(3) UNSIGNED NOT NULL DEFAULT '15',
  `rent_alert_types` varchar(100) NOT NULL DEFAULT '{"email", "sms"}',
  `currency_seperator` varchar(5) CHARACTER SET utf8 NOT NULL,
  `currency_position` varchar(10) CHARACTER SET utf8 NOT NULL,
  `currency_decimal` int(11) NOT NULL DEFAULT '2',
  `tax_rate` decimal(5,2) UNSIGNED NOT NULL DEFAULT '15.00',
  `mail_protocol` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT 'mail',
  `super_admin_image` varchar(350) CHARACTER SET utf8 NOT NULL,
  `date_format` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
  `smtp_sender` varchar(100) NOT NULL,
  `smtp_company_name` varchar(150) NOT NULL,
  `smtp_hostname` varchar(250) DEFAULT NULL,
  `smtp_username` varchar(250) DEFAULT NULL,
  `smtp_password` varchar(250) DEFAULT NULL,
  `smtp_port` varchar(10) DEFAULT NULL,
  `smtp_secure` varchar(10) DEFAULT NULL,
  `cat_username` varchar(50) DEFAULT NULL,
  `cat_password` varchar(100) DEFAULT NULL,
  `cat_apikey` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

INSERT INTO `settings` (`lang_code`, `currency`, `rent_reminder_days`, `rent_alert_types`, `currency_seperator`, `currency_position`, `currency_decimal`, `tax_rate`, `mail_protocol`, `super_admin_image`, `date_format`, `smtp_sender`, `smtp_company_name`, `smtp_hostname`, `smtp_username`, `smtp_password`, `smtp_port`, `smtp_secure`, `cat_username`, `cat_password`, `cat_apikey`) VALUES
('English', 'GHâ‚µ', 15, '[\"email\",\"sms\"]', '.', 'left', 2, '15.00', 'smtp', 'A820251E-DEDD-68F7-7519-D041BEE9099B.jpg', NULL, 'lawal@zentechgh.com', 'Tesano Commercial', 'smtp.sendgrid.net', 'apikey', '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', '465', 'ssl', '', '', '');

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

--
-- Table structure for table `tblbranch`
--

CREATE TABLE `tblbranch` (
  `branch_id` int(11) NOT NULL,
  `branch_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `b_email` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `b_contact_no` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `b_address` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `security_guard_mobile` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `secrataty_mobile` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `moderator_mobile` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `building_make_year` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `building_image` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `b_status` tinyint(4) NOT NULL DEFAULT '1',
  `builder_company_name` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `builder_company_phone` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `builder_company_address` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
  `building_rule` text COLLATE utf8_unicode_ci,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tblbranch`
--

INSERT INTO `tblbranch` (`branch_id`, `branch_name`, `b_email`, `b_contact_no`, `b_address`, `security_guard_mobile`, `secrataty_mobile`, `moderator_mobile`, `building_make_year`, `building_image`, `b_status`, `builder_company_name`, `builder_company_phone`, `builder_company_address`, `building_rule`, `created_date`) VALUES
(8, 'Tesano Commercial Plaza', 'tesanocomercial@gmail.com', '0550080890', 'Abeka Rd, Tesano Commercial Plaza, Accra', '', '', '', '9', '1EE0F359-BF10-59AF-6791-272105C9C6CA.png', 1, 'Tesano Commercial', '0550080890', 'Abeka Rd, Tesano Commercial Plaza, Accra', '<p style=\"text-align:center\">&nbsp;</p>\r\n\r\n<blockquote>\r\n<p><strong><span style=\"color:#16a085\"><span style=\"font-size:20px\">1) Gate Close 10 PM.</span></span></strong></p>\r\n</blockquote>\r\n\r\n<blockquote>\r\n<p><strong><span style=\"color:#16a085\"><span style=\"font-size:20px\">2) New commer must be introduced to guard.</span></span></strong></p>\r\n</blockquote>\r\n', '2016-06-22 10:23:45');

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

--
-- Table structure for table `tblsuper_admin`
--

CREATE TABLE `tblsuper_admin` (
  `user_id` int(11) NOT NULL,
  `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
  `contact` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
  `password` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `tblsuper_admin`
--

INSERT INTO `tblsuper_admin` (`user_id`, `name`, `email`, `contact`, `password`, `added_date`) VALUES
(1, 'Nafiu Lawal', 'devsolver@gmail.com', '+8801679110711', '$2y$10$lWDNPHp1fri6kX.EoFH8rO3XBnee94uGUq.c5CBzTR4ELvld80qgO', '2020-06-29 06:15:29'),
(2, 'Nafiu Lawal', 'lawal@zentechgh.com', '+233550080890', '$2y$10$0VT8u9TtqP7xQ/zr27CBTupwuhLbXaq/hz3B0EzYUSz4f9LDyB1Ry', '2020-06-16 06:15:29');

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

--
-- Table structure for table `tbl_add_builder_info`
--

CREATE TABLE `tbl_add_builder_info` (
  `bldrid` int(11) NOT NULL,
  `name` varchar(200) NOT NULL,
  `address` varchar(200) NOT NULL,
  `phone` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_add_building_info`
--

CREATE TABLE `tbl_add_building_info` (
  `bldid` int(11) NOT NULL,
  `name` varchar(200) NOT NULL,
  `address` varchar(200) NOT NULL,
  `security_guard_mobile` varchar(200) NOT NULL,
  `secrataty_mobile` varchar(200) NOT NULL,
  `moderator_mobile` varchar(200) NOT NULL,
  `building_make_year` varchar(200) NOT NULL,
  `b_name` varchar(200) NOT NULL,
  `b_address` varchar(200) NOT NULL,
  `b_phone` varchar(200) NOT NULL,
  `building_image` varchar(200) NOT NULL,
  `building_rules` text NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_add_employee`
--

CREATE TABLE `tbl_add_employee` (
  `eid` int(11) NOT NULL,
  `e_name` varchar(200) NOT NULL,
  `e_email` varchar(200) NOT NULL,
  `e_contact` varchar(200) NOT NULL,
  `e_pre_address` varchar(200) NOT NULL,
  `e_per_address` varchar(200) NOT NULL,
  `e_nid` varchar(200) NOT NULL,
  `e_designation` int(11) NOT NULL,
  `e_date` varchar(200) NOT NULL,
  `ending_date` varchar(200) NOT NULL,
  `e_status` int(1) NOT NULL DEFAULT '0',
  `e_password` varchar(100) NOT NULL,
  `image` varchar(200) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `salary` decimal(15,2) NOT NULL DEFAULT '0.00',
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_employee`
--

INSERT INTO `tbl_add_employee` (`eid`, `e_name`, `e_email`, `e_contact`, `e_pre_address`, `e_per_address`, `e_nid`, `e_designation`, `e_date`, `ending_date`, `e_status`, `e_password`, `image`, `branch_id`, `salary`, `added_date`) VALUES
(12, 'John Sina', 'johnsina@gmail.com', '+8801679110711', '799 Princess Drive\r\nNorwood, MA 02062', '799 Princess Drive\r\nNorwood, MA 02062', '343434-909090-1212121', 5, '01/09/2019', '', 1, 'MTIzNDU2', '82F6AE8B-7DF6-E937-6095-101FC0BB66A3.jpg', 8, '8000.00', '2019-08-26 19:35:52');

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

--
-- Table structure for table `tbl_add_employee_salary_setup`
--

CREATE TABLE `tbl_add_employee_salary_setup` (
  `emp_id` int(11) NOT NULL,
  `emp_name` varchar(200) NOT NULL,
  `designation` varchar(200) NOT NULL,
  `month_id` int(11) NOT NULL,
  `xyear` int(11) NOT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `issue_date` varchar(200) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_employee_salary_setup`
--

INSERT INTO `tbl_add_employee_salary_setup` (`emp_id`, `emp_name`, `designation`, `month_id`, `xyear`, `amount`, `issue_date`, `branch_id`, `added_date`) VALUES
(19, '12', 'Security Gard', 8, 11, '8000.00', '05/09/2019', 8, '2019-08-26 19:36:26');

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

--
-- Table structure for table `tbl_add_fund`
--

CREATE TABLE `tbl_add_fund` (
  `fund_id` int(11) NOT NULL,
  `owner_id` int(11) NOT NULL,
  `month_id` int(11) NOT NULL,
  `xyear` varchar(200) NOT NULL,
  `f_date` varchar(200) NOT NULL,
  `total_amount` decimal(15,2) NOT NULL DEFAULT '0.00',
  `purpose` varchar(400) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_fund`
--

INSERT INTO `tbl_add_fund` (`fund_id`, `owner_id`, `month_id`, `xyear`, `f_date`, `total_amount`, `purpose`, `branch_id`, `added_date`) VALUES
(13, 19, 8, '11', '27/08/2019', '200.00', 'Monthly Fund', 8, '2019-08-27 04:34:37');

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

--
-- Table structure for table `tbl_add_management_committee`
--

CREATE TABLE `tbl_add_management_committee` (
  `mc_id` int(11) NOT NULL,
  `mc_name` varchar(200) NOT NULL,
  `mc_email` varchar(200) NOT NULL,
  `mc_contact` varchar(200) NOT NULL,
  `mc_pre_address` varchar(500) NOT NULL,
  `mc_per_address` varchar(500) NOT NULL,
  `mc_nid` varchar(200) NOT NULL,
  `member_type` varchar(200) NOT NULL,
  `mc_joining_date` varchar(200) NOT NULL,
  `mc_ending_date` varchar(200) NOT NULL,
  `mc_status` int(1) NOT NULL DEFAULT '0',
  `image` varchar(200) NOT NULL,
  `mc_password` varchar(200) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_management_committee`
--

INSERT INTO `tbl_add_management_committee` (`mc_id`, `mc_name`, `mc_email`, `mc_contact`, `mc_pre_address`, `mc_per_address`, `mc_nid`, `member_type`, `mc_joining_date`, `mc_ending_date`, `mc_status`, `image`, `mc_password`, `branch_id`, `added_date`) VALUES
(9, 'Peter Anderson', 'peter@gmail.com', '121212121', '63 Creek St.\r\nEastpointe, MI 48021', '799 Princess Drive\r\nNorwood, MA 02062', '121212-56565-121212-565656', '1', '27/08/2019', '', 1, '4CF8FD9E-9916-0820-1049-6CD5C211B460.jpg', '123456', 8, '2019-08-27 04:36:10');

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

--
-- Table structure for table `tbl_add_member_type`
--

CREATE TABLE `tbl_add_member_type` (
  `member_id` int(11) NOT NULL,
  `member_type` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_member_type`
--

INSERT INTO `tbl_add_member_type` (`member_id`, `member_type`, `added_date`) VALUES
(2, 'Secretary General', '2016-04-10 11:59:10'),
(5, 'Security Gard', '2016-04-10 11:59:41');

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

--
-- Table structure for table `tbl_add_month_setup`
--

CREATE TABLE `tbl_add_month_setup` (
  `m_id` int(11) NOT NULL,
  `month_name` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_month_setup`
--

INSERT INTO `tbl_add_month_setup` (`m_id`, `month_name`, `added_date`) VALUES
(1, 'January', '2016-04-11 12:16:15'),
(2, 'February', '2016-04-11 12:16:25'),
(3, 'March', '2016-04-11 12:16:30'),
(4, 'April', '2016-04-11 12:16:36'),
(5, 'May', '2016-04-11 12:16:41'),
(6, 'June', '2016-04-11 12:16:48'),
(7, 'July', '2016-04-11 12:16:53'),
(8, 'August', '2016-04-11 12:16:59'),
(9, 'September', '2016-04-11 12:17:06'),
(10, 'Octobor', '2016-04-11 12:17:14'),
(11, 'November', '2016-04-11 12:17:24'),
(12, 'December', '2016-04-11 12:17:30');

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

--
-- Table structure for table `tbl_add_owner`
--

CREATE TABLE `tbl_add_owner` (
  `ownid` int(11) NOT NULL,
  `o_name` varchar(200) NOT NULL,
  `o_email` varchar(200) NOT NULL,
  `o_contact` varchar(200) NOT NULL,
  `o_pre_address` varchar(500) NOT NULL,
  `o_per_address` varchar(500) NOT NULL,
  `o_nid` varchar(200) NOT NULL,
  `o_password` varchar(100) NOT NULL,
  `image` varchar(200) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_add_owner_unit_relation`
--

CREATE TABLE `tbl_add_owner_unit_relation` (
  `owner_id` int(11) NOT NULL,
  `unit_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_add_owner_utility`
--

CREATE TABLE `tbl_add_owner_utility` (
  `owner_utility_id` int(11) NOT NULL,
  `floor_no` int(11) NOT NULL,
  `unit_no` int(11) NOT NULL,
  `month_id` int(11) NOT NULL,
  `rent` decimal(15,2) NOT NULL DEFAULT '0.00',
  `water_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `electric_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `gas_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `security_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `utility_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `other_bill` decimal(15,2) NOT NULL DEFAULT '0.00',
  `total_rent` decimal(15,2) NOT NULL DEFAULT '0.00',
  `issue_date` varchar(200) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_add_utility_bill`
--

CREATE TABLE `tbl_add_utility_bill` (
  `utility_id` int(11) NOT NULL,
  `branch_id` int(11) NOT NULL DEFAULT '0',
  `gas_bill` varchar(200) NOT NULL,
  `security_bill` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_utility_bill`
--

INSERT INTO `tbl_add_utility_bill` (`utility_id`, `branch_id`, `gas_bill`, `security_bill`, `added_date`) VALUES
(5, 7, '850', '800', '2018-05-14 06:31:40'),
(8, 8, '0', '0', '2020-08-21 17:45:55');

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

--
-- Table structure for table `tbl_add_year_setup`
--

CREATE TABLE `tbl_add_year_setup` (
  `y_id` int(11) NOT NULL,
  `xyear` varchar(200) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_add_year_setup`
--

INSERT INTO `tbl_add_year_setup` (`y_id`, `xyear`, `added_date`) VALUES
(11, '2019', '2016-04-13 14:03:12'),
(12, '2020', '2016-04-13 14:03:17'),
(13, '2021', '2018-04-20 06:12:54');

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

--
-- Table structure for table `tbl_employee_leave_request`
--

CREATE TABLE `tbl_employee_leave_request` (
  `leave_id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `from` date NOT NULL,
  `to` date NOT NULL,
  `leave_text` varchar(5000) NOT NULL,
  `request_status` varchar(50) NOT NULL DEFAULT 'Pending',
  `request_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_employee_notice`
--

CREATE TABLE `tbl_employee_notice` (
  `notice_id` int(11) NOT NULL,
  `notice_title` varchar(500) NOT NULL,
  `notice_description` text NOT NULL,
  `notice_status` tinyint(4) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `created_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_max_power`
--

CREATE TABLE `tbl_max_power` (
  `purchase_code` varchar(150) DEFAULT NULL,
  `website_url` varchar(150) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `installed_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_check_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_max_power`
--

INSERT INTO `tbl_max_power` (`purchase_code`, `website_url`, `email`, `installed_date`, `last_check_date`) VALUES
('e7d679c2-5135-459e-a57e-4f9b6108bb99', 'http://localhost/property/', 'nafiudanlawal@gmail.com', '2020-08-20 20:20:48', '2020-08-20 20:20:48');

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

--
-- Table structure for table `tbl_notice_board`
--

CREATE TABLE `tbl_notice_board` (
  `notice_id` int(11) NOT NULL,
  `notice_title` varchar(500) NOT NULL,
  `notice_description` text NOT NULL,
  `notice_status` tinyint(1) NOT NULL DEFAULT '1',
  `branch_id` int(11) NOT NULL,
  `created_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_notice_board`
--

INSERT INTO `tbl_notice_board` (`notice_id`, `notice_title`, `notice_description`, `notice_status`, `branch_id`, `created_date`) VALUES
(7, 'Building In and Out', '<p>asasas</p>\r\n', 1, 8, '2019-08-27');

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

--
-- Table structure for table `tbl_notification_alert`
--

CREATE TABLE `tbl_notification_alert` (
  `notification_Id` int(11) NOT NULL,
  `subject` varchar(250) NOT NULL,
  `message` varchar(5000) NOT NULL,
  `type` int(11) DEFAULT NULL COMMENT '1=sms,2=email,3=both',
  `receivers` varchar(5000) NOT NULL,
  `sent_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tbl_notification_alert`
--

INSERT INTO `tbl_notification_alert` (`notification_Id`, `subject`, `message`, `type`, `receivers`, `sent_date`) VALUES
(21, 'Customer Service', 'Testing EMail', 2, '[\"Nafiu Lawal\"]', '2020-09-18 13:55:30'),
(22, 'Customer Service', 'Testing EMail', 2, '[\"Nafiu Lawal\"]', '2020-09-18 13:57:49');

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

--
-- Table structure for table `tbl_owner_notice_board`
--

CREATE TABLE `tbl_owner_notice_board` (
  `notice_id` int(11) NOT NULL,
  `notice_title` varchar(500) NOT NULL,
  `notice_description` text NOT NULL,
  `notice_status` tinyint(1) NOT NULL DEFAULT '1',
  `branch_id` int(11) NOT NULL,
  `created_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `tbl_tenant`
--

CREATE TABLE `tbl_tenant` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `email` varchar(150) NOT NULL,
  `business_name` varchar(255) NOT NULL,
  `business_phone` varchar(20) NOT NULL,
  `nature_of_business` varchar(100) NOT NULL,
  `address` varchar(255) NOT NULL,
  `image` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `tbl_visitor`
--

CREATE TABLE `tbl_visitor` (
  `vid` int(11) NOT NULL,
  `issue_date` varchar(100) CHARACTER SET utf8 NOT NULL,
  `name` varchar(200) CHARACTER SET utf8 NOT NULL,
  `mobile` varchar(100) CHARACTER SET utf8 NOT NULL,
  `address` varchar(500) CHARACTER SET utf8 NOT NULL,
  `floor_id` int(11) NOT NULL,
  `unit_id` int(11) NOT NULL,
  `intime` varchar(50) CHARACTER SET utf8 NOT NULL,
  `outtime` varchar(50) CHARACTER SET utf8 NOT NULL,
  `xmonth` varchar(50) CHARACTER SET utf8 NOT NULL,
  `xyear` varchar(50) CHARACTER SET utf8 NOT NULL,
  `branch_id` int(11) NOT NULL,
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `tenants`
--

CREATE TABLE `tenants` (
  `tid` int(11) NOT NULL,
  `r_name` varchar(200) NOT NULL,
  `r_email` varchar(200) NOT NULL,
  `r_contact` varchar(20) NOT NULL,
  `r_address` varchar(200) NOT NULL,
  `r_nid` varchar(200) NOT NULL,
  `r_unit_no` varchar(200) NOT NULL,
  `business_name` varchar(255) NOT NULL,
  `business_phone` varchar(20) NOT NULL,
  `nature_of_business` varchar(100) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `r_date` varchar(200) DEFAULT NULL,
  `r_gone_date` varchar(200) DEFAULT NULL,
  `r_status` int(1) DEFAULT '1',
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `tenants`
--

INSERT INTO `tenants` (`tid`, `r_name`, `r_email`, `r_contact`, `r_address`, `r_nid`, `r_unit_no`, `business_name`, `business_phone`, `nature_of_business`, `image`, `r_date`, `r_gone_date`, `r_status`, `added_date`) VALUES
(26, 'Nafiu Lawal', 'nafiudanlawal@gmail.com', '+233550080890', 'Fanmilk, Ga West Municipal Assemble', '', '', 'Micro Laundry Services', '+233550080890', 'Service', '4B29AC5F-16E7-3CD1-C08C-083D03B3CC2A.jpg', NULL, NULL, 1, '2020-09-10 15:54:32'),
(27, 'Nafiu Lawal', 'rollingphish@gmail.com', '+233266399063', '2345, 20 Rue de Commerce', '', '', 'Fast Lane Fashion', '+233266399063', 'Fashion', '6EF650EA-0FB5-5EE5-F4AD-7D0DF3483F5E.jpg', NULL, NULL, 1, '2020-09-10 16:08:40'),
(28, 'Johnny English', 'rollingphish@gmail.com', '+233558844555', 'Fanmilk, Ga West Municipal Assemble', '', '', 'Internation', '+23355078788', 'Wholesale', '', NULL, NULL, 1, '2020-09-16 20:39:38');

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

--
-- Table structure for table `tenant_accounts`
--

CREATE TABLE `tenant_accounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `tid` int(10) UNSIGNED NOT NULL,
  `rid` int(10) UNSIGNED NOT NULL,
  `trans_type` varchar(10) NOT NULL,
  `description` varchar(1000) NOT NULL,
  `transaction_amt` decimal(10,3) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `added_by` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tenant_accounts`
--

INSERT INTO `tenant_accounts` (`id`, `tid`, `rid`, `trans_type`, `description`, `transaction_amt`, `created_at`, `added_by`) VALUES
(6, 26, 0, 'debit', 'Rent Payment From Tenant', '4500.000', '2020-09-15 20:35:25', 2),
(58, 26, 37, 'credit', 'Rent Processed on Shop No. A for 2 year(s)', '12000.000', '2020-09-17 20:46:18', 2),
(59, 26, 37, 'debit', 'Rent Payment From Tenant', '5000.000', '2020-09-17 20:46:18', 2),
(60, 27, 38, 'credit', 'Rent Processed on Shop No. B for 2 year(s)', '19200.000', '2020-09-17 20:46:37', 2),
(61, 27, 38, 'debit', 'Rent Payment From Tenant', '10000.000', '2020-09-17 20:46:37', 2),
(62, 26, 37, 'debit', 'Rent Payment From Tenant', '1000.000', '2020-09-17 20:50:39', 2),
(63, 26, 37, 'debit', 'Rent Payment From Tenant', '2000.000', '2020-09-17 20:52:45', 2);

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

--
-- Stand-in structure for view `tenant_assigned_units_view`
-- (See below for the actual view)
--
CREATE TABLE `tenant_assigned_units_view` (
`tid` int(11)
,`r_name` varchar(200)
,`r_email` varchar(200)
,`r_contact` varchar(20)
,`r_address` varchar(200)
,`r_nid` varchar(200)
,`r_unit_no` varchar(200)
,`business_name` varchar(255)
,`business_phone` varchar(20)
,`nature_of_business` varchar(100)
,`image` varchar(255)
,`r_date` varchar(200)
,`r_gone_date` varchar(200)
,`r_status` int(1)
,`added_date` timestamp
,`uid` int(11)
,`bid` smallint(5) unsigned
,`unit_no` varchar(200)
,`b_name` varchar(200)
,`floor` varchar(100)
,`rate` decimal(8,3) unsigned
,`status` int(1)
,`assignment_id` int(10) unsigned
,`unit_added_date` timestamp
,`date_assigned` timestamp
,`date_removed` timestamp
,`tenant_id` int(10) unsigned
);

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

--
-- Table structure for table `tenant_unit`
--

CREATE TABLE `tenant_unit` (
  `id` int(10) UNSIGNED NOT NULL,
  `tid` int(10) UNSIGNED DEFAULT NULL,
  `uid` int(10) UNSIGNED DEFAULT NULL,
  `date_assigned` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_removed` timestamp NULL DEFAULT NULL,
  `last_action_by` smallint(5) UNSIGNED NOT NULL,
  `past_assignment` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tenant_unit`
--

INSERT INTO `tenant_unit` (`id`, `tid`, `uid`, `date_assigned`, `date_removed`, `last_action_by`, `past_assignment`) VALUES
(21, 26, 30, '2020-09-10 16:08:48', '2020-09-11 19:54:50', 10, 1),
(22, 27, 32, '2020-09-10 16:09:03', NULL, 2, 0),
(23, 26, 31, '2020-09-11 18:55:01', '2020-09-11 19:55:23', 10, 1),
(24, 26, 30, '2020-09-11 19:49:20', NULL, 10, 0);

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

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `uid` int(11) NOT NULL,
  `bid` smallint(5) UNSIGNED NOT NULL,
  `unit_no` varchar(200) NOT NULL,
  `floor` varchar(100) DEFAULT NULL,
  `rate` decimal(8,3) UNSIGNED NOT NULL,
  `status` int(1) NOT NULL DEFAULT '0',
  `added_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`uid`, `bid`, `unit_no`, `floor`, `rate`, `status`, `added_date`) VALUES
(30, 12, 'Shop No. A', 'First Floor', '500.000', 0, '2019-08-26 18:56:56'),
(31, 12, 'Shop No. C', 'Ground Floor', '500.000', 0, '2019-08-26 18:57:09'),
(32, 13, 'Shop No. B', 'First Floor', '800.000', 0, '2019-08-27 04:07:08'),
(33, 13, 'Shop No. D', 'Ground Floor', '800.000', 0, '2019-08-27 04:07:35');

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

--
-- Stand-in structure for view `units_block_view`
-- (See below for the actual view)
--
CREATE TABLE `units_block_view` (
`uid` int(11)
,`bid` smallint(5) unsigned
,`unit_no` varchar(200)
,`floor` varchar(100)
,`rate` decimal(8,3) unsigned
,`status` int(1)
,`added_date` timestamp
,`b_name` varchar(200)
);

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

--
-- Stand-in structure for view `unoccupied_units_view`
-- (See below for the actual view)
--
CREATE TABLE `unoccupied_units_view` (
`uid` int(11)
,`bid` smallint(5) unsigned
,`unit_no` varchar(200)
,`floor` varchar(100)
,`rate` decimal(8,3) unsigned
,`b_name` varchar(200)
,`status` int(1)
,`added_date` timestamp
,`date_removed` timestamp
,`assignment_id` int(10) unsigned
,`past_assignment` tinyint(1)
,`date_assigned` timestamp
);

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

--
-- Structure for view `current_tenants_view`
--
DROP TABLE IF EXISTS `current_tenants_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`lawal`@`localhost` SQL SECURITY DEFINER VIEW `current_tenants_view`  AS  select `tenants`.`tid` AS `tid`,`tenants`.`r_name` AS `r_name`,`tenants`.`r_email` AS `r_email`,`tenants`.`r_contact` AS `r_contact`,`tenants`.`r_address` AS `r_address`,`tenants`.`business_name` AS `business_name`,`tenants`.`business_phone` AS `business_phone`,`tenants`.`nature_of_business` AS `nature_of_business`,`tenants`.`image` AS `image`,`tenants`.`r_date` AS `r_date`,`tenants`.`r_gone_date` AS `r_gone_date`,`tenants`.`added_date` AS `added_date` from `tenants` where `tenants`.`tid` in (select `occupied_units_view`.`tenant_id` AS `tid` from `occupied_units_view` group by `occupied_units_view`.`tenant_id`) ;

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

--
-- Structure for view `occupied_units_view`
--
DROP TABLE IF EXISTS `occupied_units_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`lawal`@`localhost` SQL SECURITY DEFINER VIEW `occupied_units_view`  AS  select `units_block_view`.`uid` AS `uid`,`units_block_view`.`bid` AS `bid`,`units_block_view`.`unit_no` AS `unit_no`,`units_block_view`.`floor` AS `floor`,`units_block_view`.`rate` AS `rate`,`units_block_view`.`b_name` AS `b_name`,`units_block_view`.`status` AS `status`,`units_block_view`.`added_date` AS `unit_added_date`,`tenant_unit`.`date_assigned` AS `date_assigned`,`tenant_unit`.`id` AS `assignment_id`,`tenant_unit`.`date_removed` AS `date_removed`,`tenant_unit`.`tid` AS `tenant_id` from (`tenant_unit` left join `units_block_view` on((`units_block_view`.`uid` = `tenant_unit`.`uid`))) where isnull(`tenant_unit`.`date_removed`) ;

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

--
-- Structure for view `rent_tenant_unit_view`
--
DROP TABLE IF EXISTS `rent_tenant_unit_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`lawal`@`localhost` SQL SECURITY DEFINER VIEW `rent_tenant_unit_view`  AS  select `rent`.`id` AS `id`,`rent`.`uid` AS `uid`,`rent`.`tid` AS `tid`,`rent`.`rate` AS `rate`,`rent`.`rent_yearly` AS `rent_yearly`,`rent`.`period` AS `period`,`rent`.`amt_paid` AS `amt_paid`,`rent`.`start_date` AS `start_date`,`rent`.`end_date` AS `end_date`,`rent`.`water_bill` AS `water_bill`,`rent`.`electric_bill` AS `electric_bill`,`rent`.`gas_bill` AS `gas_bill`,`rent`.`security_bill` AS `security_bill`,`rent`.`utility_bill` AS `utility_bill`,`rent`.`other_bill` AS `other_bill`,`rent`.`total_rent` AS `total_rent`,`rent`.`issue_date` AS `issue_date`,`rent`.`paid_date` AS `paid_date`,`rent`.`bill_status` AS `bill_status`,`rent`.`added_date` AS `added_date`,`rent`.`added_by` AS `added_by`,`tenants`.`r_name` AS `r_name`,`tenants`.`r_email` AS `r_email`,`tenants`.`r_contact` AS `r_contact`,`tenants`.`business_name` AS `business_name`,`tenants`.`image` AS `image`,`units_block_view`.`unit_no` AS `unit_no`,`units_block_view`.`bid` AS `bid`,`units_block_view`.`floor` AS `floor`,`units_block_view`.`b_name` AS `b_name` from ((`rent` left join `units_block_view` on((`rent`.`uid` = `units_block_view`.`uid`))) left join `tenants` on((`rent`.`tid` = `tenants`.`tid`))) ;

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

--
-- Structure for view `tenant_assigned_units_view`
--
DROP TABLE IF EXISTS `tenant_assigned_units_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`lawal`@`localhost` SQL SECURITY DEFINER VIEW `tenant_assigned_units_view`  AS  select `tenants`.`tid` AS `tid`,`tenants`.`r_name` AS `r_name`,`tenants`.`r_email` AS `r_email`,`tenants`.`r_contact` AS `r_contact`,`tenants`.`r_address` AS `r_address`,`tenants`.`r_nid` AS `r_nid`,`tenants`.`r_unit_no` AS `r_unit_no`,`tenants`.`business_name` AS `business_name`,`tenants`.`business_phone` AS `business_phone`,`tenants`.`nature_of_business` AS `nature_of_business`,`tenants`.`image` AS `image`,`tenants`.`r_date` AS `r_date`,`tenants`.`r_gone_date` AS `r_gone_date`,`tenants`.`r_status` AS `r_status`,`tenants`.`added_date` AS `added_date`,`occupied_units_view`.`uid` AS `uid`,`occupied_units_view`.`bid` AS `bid`,`occupied_units_view`.`unit_no` AS `unit_no`,`occupied_units_view`.`b_name` AS `b_name`,`occupied_units_view`.`floor` AS `floor`,`occupied_units_view`.`rate` AS `rate`,`occupied_units_view`.`status` AS `status`,`occupied_units_view`.`assignment_id` AS `assignment_id`,`occupied_units_view`.`unit_added_date` AS `unit_added_date`,`occupied_units_view`.`date_assigned` AS `date_assigned`,`occupied_units_view`.`date_removed` AS `date_removed`,`occupied_units_view`.`tenant_id` AS `tenant_id` from (`tenants` left join `occupied_units_view` on((`occupied_units_view`.`tenant_id` = `tenants`.`tid`))) ;

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

--
-- Structure for view `units_block_view`
--
DROP TABLE IF EXISTS `units_block_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`lawal`@`localhost` SQL SECURITY DEFINER VIEW `units_block_view`  AS  select `units`.`uid` AS `uid`,`units`.`bid` AS `bid`,`units`.`unit_no` AS `unit_no`,`units`.`floor` AS `floor`,`units`.`rate` AS `rate`,`units`.`status` AS `status`,`units`.`added_date` AS `added_date`,`blocks`.`b_name` AS `b_name` from (`units` left join `blocks` on((`units`.`bid` = `blocks`.`bid`))) ;

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

--
-- Structure for view `unoccupied_units_view`
--
DROP TABLE IF EXISTS `unoccupied_units_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`lawal`@`localhost` SQL SECURITY DEFINER VIEW `unoccupied_units_view`  AS  select `units_block_view`.`uid` AS `uid`,`units_block_view`.`bid` AS `bid`,`units_block_view`.`unit_no` AS `unit_no`,`units_block_view`.`floor` AS `floor`,`units_block_view`.`rate` AS `rate`,`units_block_view`.`b_name` AS `b_name`,`units_block_view`.`status` AS `status`,`units_block_view`.`added_date` AS `added_date`,`tenant_unit`.`date_removed` AS `date_removed`,`tenant_unit`.`id` AS `assignment_id`,`tenant_unit`.`past_assignment` AS `past_assignment`,`tenant_unit`.`date_assigned` AS `date_assigned` from (`units_block_view` left join `tenant_unit` on((`tenant_unit`.`uid` = `units_block_view`.`uid`))) where (not(`units_block_view`.`uid` in (select `occupied_units_view`.`uid` from `occupied_units_view`))) group by `units_block_view`.`uid` ;

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `bills`
--
ALTER TABLE `bills`
  ADD PRIMARY KEY (`bill_id`);

--
-- Indexes for table `blocks`
--
ALTER TABLE `blocks`
  ADD PRIMARY KEY (`bid`);

--
-- Indexes for table `maintenance`
--
ALTER TABLE `maintenance`
  ADD PRIMARY KEY (`mcid`);

--
-- Indexes for table `meetings`
--
ALTER TABLE `meetings`
  ADD PRIMARY KEY (`meeting_id`);

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

--
-- Indexes for table `message_templates`
--
ALTER TABLE `message_templates`
  ADD PRIMARY KEY (`name`);

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

--
-- Indexes for table `tblbranch`
--
ALTER TABLE `tblbranch`
  ADD PRIMARY KEY (`branch_id`);

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

--
-- Indexes for table `tenants`
--
ALTER TABLE `tenants`
  ADD PRIMARY KEY (`tid`);

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

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

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`uid`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
  MODIFY `user_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `bills`
--
ALTER TABLE `bills`
  MODIFY `bill_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `blocks`
--
ALTER TABLE `blocks`
  MODIFY `bid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `maintenance`
--
ALTER TABLE `maintenance`
  MODIFY `mcid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `meetings`
--
ALTER TABLE `meetings`
  MODIFY `meeting_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `messages`
--
ALTER TABLE `messages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `rent`
--
ALTER TABLE `rent`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT for table `tblbranch`
--
ALTER TABLE `tblbranch`
  MODIFY `branch_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `tblsuper_admin`
--
ALTER TABLE `tblsuper_admin`
  MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tenants`
--
ALTER TABLE `tenants`
  MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT for table `tenant_accounts`
--
ALTER TABLE `tenant_accounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64;
--
-- AUTO_INCREMENT for table `tenant_unit`
--
ALTER TABLE `tenant_unit`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
  MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
/*!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 */;
