DROP DATABASE main_crm;
CREATE DATABASE main_crm;
use main_crm;
-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `c`
--

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

--
-- Table structure for table `assign_enquiries`
--

CREATE TABLE `assign_enquiries` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `enquiry_id` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0,
  `date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `assign_enquiries`
--

INSERT INTO `assign_enquiries` (`id`, `user_id`, `enquiry_id`, `status`, `date`) VALUES
(1, 29, 1, 0, '2024-10-04 06:30:04'),
(2, 30, 1, 1, '2024-10-04 06:35:29'),
(3, 31, 2, 1, '2024-10-04 06:45:58'),
(4, 33, 3, 1, '2024-10-04 08:56:42'),
(5, 33, 4, 1, '2024-10-04 09:07:28'),
(6, 33, 5, 1, '2024-10-04 12:02:26'),
(7, 29, 6, 0, '2024-10-04 13:12:41'),
(8, 30, 7, 1, '2024-10-04 13:12:59'),
(9, 31, 8, 0, '2024-10-04 13:13:15'),
(10, 33, 9, 1, '2024-10-04 13:13:27'),
(11, 29, 10, 0, '2024-10-04 14:05:31'),
(12, 30, 11, 1, '2024-10-04 14:05:58'),
(13, 31, 12, 1, '2024-10-04 14:06:19'),
(14, 33, 13, 1, '2024-10-04 14:06:34'),
(15, 29, 14, 1, '2024-10-04 14:33:01'),
(16, 30, 15, 1, '2024-10-04 14:33:19'),
(17, 31, 16, 1, '2024-10-04 14:33:39'),
(18, 33, 17, 1, '2024-10-04 14:33:55'),
(19, 30, 8, 1, '2024-10-04 15:43:39'),
(20, 33, 18, 1, '2024-10-05 11:33:55'),
(21, 30, 6, 0, '2024-11-08 12:08:32'),
(22, 31, 10, 1, '2024-11-08 13:14:10'),
(23, 31, 6, 0, '2024-11-11 18:17:30'),
(24, 33, 6, 1, '2024-11-11 18:49:22');

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

--
-- Table structure for table `category_level_four`
--

CREATE TABLE `category_level_four` (
  `id` int(11) NOT NULL,
  `category_level_three_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `category_level_four`
--

INSERT INTO `category_level_four` (`id`, `category_level_three_id`, `name`) VALUES
(15, 14, 'October 2024'),
(19, 19, 'December 2024'),
(20, 20, 'November 2024'),
(21, 21, 'October 2024'),
(22, 22, 'October 2024'),
(23, 23, 'September 2024'),
(24, 24, 'September 2024'),
(25, 25, 'December 2024'),
(26, 26, 'December 2024'),
(27, 27, 'December 2024'),
(28, 28, 'November 2024'),
(29, 29, 'November 2024');

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

--
-- Table structure for table `category_level_one`
--

CREATE TABLE `category_level_one` (
  `id` int(11) NOT NULL,
  `office_id` int(11) DEFAULT NULL,
  `organization_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `category_level_one`
--

INSERT INTO `category_level_one` (`id`, `office_id`, `organization_id`, `name`) VALUES
(21, 18, NULL, 'QUALIFI'),
(27, 20, NULL, 'OTHM'),
(29, 21, NULL, 'Language Cert');

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

--
-- Table structure for table `category_level_three`
--

CREATE TABLE `category_level_three` (
  `id` int(11) NOT NULL,
  `category_level_two_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `category_level_three`
--

INSERT INTO `category_level_three` (`id`, `category_level_two_id`, `name`) VALUES
(14, 17, 'Level 3 Diploma in Accounting and Finance'),
(19, 22, 'Level 7 Diploma in Business Management'),
(20, 23, 'Level 5 Diploma in Health and Social Care Management'),
(21, 24, 'Level 7 Diploma in Information Technology'),
(22, 25, 'Level 5 Diploma in Law'),
(23, 26, 'Level 8 Diploma in Strategic Management and Leadership'),
(24, 28, 'Level 7 Diploma in Leadership'),
(25, 29, 'Level 3 Diploma Foundation in Social Care'),
(26, 30, 'CEFR Levles B1'),
(27, 30, 'CEFR Levles B2'),
(28, 30, 'CEFR Levles C1'),
(29, 30, 'CEFR Levles C2');

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

--
-- Table structure for table `category_level_two`
--

CREATE TABLE `category_level_two` (
  `id` int(11) NOT NULL,
  `category_level_one_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `category_level_two`
--

INSERT INTO `category_level_two` (`id`, `category_level_one_id`, `name`) VALUES
(17, 21, 'Accounting and Finance'),
(22, 27, 'Business Management'),
(23, 27, 'Health and Social Care'),
(24, 21, 'Information Systems'),
(25, 21, 'Legal Studies'),
(26, 21, 'Business Studies'),
(28, 27, 'Leadership Studies'),
(29, 27, 'Social Care'),
(30, 29, 'International ESOL');

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

--
-- Table structure for table `complaint_bd`
--

CREATE TABLE `complaint_bd` (
  `id` int(11) NOT NULL,
  `enquiry_id` int(11) DEFAULT NULL,
  `to_user` varchar(255) DEFAULT NULL,
  `email_subject` varchar(255) DEFAULT NULL,
  `email_body` text DEFAULT NULL,
  `type_of` varchar(255) DEFAULT NULL,
  `status_request` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `enquiries`
--

CREATE TABLE `enquiries` (
  `id` int(11) NOT NULL,
  `enquiry_by` text DEFAULT NULL,
  `enquiry_entered_by` text DEFAULT NULL,
  `income_range` text DEFAULT NULL,
  `enquiry_date` text DEFAULT NULL,
  `username` text DEFAULT NULL,
  `cnic` text DEFAULT NULL,
  `date_of_birth` text DEFAULT NULL,
  `email` text DEFAULT NULL,
  `father_name` text DEFAULT NULL,
  `gender` text DEFAULT NULL,
  `city` text DEFAULT NULL,
  `present_address` text DEFAULT NULL,
  `permanent_address` text DEFAULT NULL,
  `mobile_no_one` text DEFAULT NULL,
  `mobile_no_two` text DEFAULT NULL,
  `landline` text DEFAULT NULL,
  `project` text DEFAULT NULL,
  `product` text DEFAULT NULL,
  `developer` text DEFAULT NULL,
  `price_offered` text DEFAULT NULL,
  `property_address` text DEFAULT NULL,
  `image` text DEFAULT NULL,
  `source_of_information` text DEFAULT NULL,
  `status` text DEFAULT NULL,
  `enquiry_status` text DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `field_one` text DEFAULT NULL,
  `field_two` text DEFAULT NULL,
  `field_three` text DEFAULT NULL,
  `field_four` text DEFAULT NULL,
  `field_five` text DEFAULT NULL,
  `field_six` text DEFAULT NULL,
  `field_seven` text DEFAULT NULL,
  `field_eight` text DEFAULT NULL,
  `field_nine` text DEFAULT NULL,
  `field_ten` text DEFAULT NULL,
  `field_eleven` text DEFAULT NULL,
  `field_twelve` text DEFAULT NULL,
  `field_thirteen` text DEFAULT NULL,
  `field_fourteen` text DEFAULT NULL,
  `field_fifteen` text DEFAULT NULL,
  `field_sixteen` text DEFAULT NULL,
  `field_seventeen` text DEFAULT NULL,
  `field_eighteen` text DEFAULT NULL,
  `field_nineteen` text DEFAULT NULL,
  `field_twenty` text DEFAULT NULL,
  `office_id` int(11) DEFAULT NULL,
  `matured` text DEFAULT NULL,
  `cat_one_id` int(11) DEFAULT NULL,
  `cat_two_id` int(11) DEFAULT NULL,
  `cat_three_id` int(11) DEFAULT NULL,
  `cat_four_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `enquiry_status_steps` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `enquiries`
--

INSERT INTO `enquiries` (`id`, `enquiry_by`, `enquiry_entered_by`, `income_range`, `enquiry_date`, `username`, `cnic`, `date_of_birth`, `email`, `father_name`, `gender`, `city`, `present_address`, `permanent_address`, `mobile_no_one`, `mobile_no_two`, `landline`, `project`, `product`, `developer`, `price_offered`, `property_address`, `image`, `source_of_information`, `status`, `enquiry_status`, `remarks`, `field_one`, `field_two`, `field_three`, `field_four`, `field_five`, `field_six`, `field_seven`, `field_eight`, `field_nine`, `field_ten`, `field_eleven`, `field_twelve`, `field_thirteen`, `field_fourteen`, `field_fifteen`, `field_sixteen`, `field_seventeen`, `field_eighteen`, `field_nineteen`, `field_twenty`, `office_id`, `matured`, `cat_one_id`, `cat_two_id`, `cat_three_id`, `cat_four_id`, `created_at`, `enquiry_status_steps`) VALUES
(6, 'John', 'John', '10,000 - 20,000', NULL, 'Nolan', NULL, '2000-10-10', 'nolan@gmail.com', 'Cameron', 'Male', 'London', '51 Boar Lane', '51 Boar Lane', '02012345678', '02087654321', '0206598977', NULL, NULL, NULL, '5000', NULL, NULL, 'Social Media', 'Follow-up Required', 'Follow-up Required', 'He will inform later', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 18, '0', 21, 17, 14, 15, '2024-10-04 12:05:39', 'Lead Matured'),
(7, 'admin', 'admin', '20,000 - 30,000', NULL, 'Isaac', NULL, '2002-12-15', 'isaac@gmail.com', 'Dylaan', 'Male', 'London', '52 Boar Lane', '52 Boar Lane', '02085214698', '02032587001', '020069596897', NULL, NULL, NULL, '7000', NULL, NULL, 'Friend & Family Members', 'Lead Matured', 'Follow-up Required', 'He will contact soon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 18, '0', 21, 24, 21, 21, '2024-10-04 12:07:48', 'Lead Matured'),
(8, 'zubair', 'zubair', '30,000 - 40,000', NULL, 'Anthony', NULL, '2001-10-15', 'carter@gmail.com', 'Carter', 'Male', 'Manchester', '55 Boar Lane', '55 Boar Lane', '02065478125', '02025887168', '02021488540', NULL, NULL, NULL, '9000', NULL, NULL, 'Social Media', NULL, 'Follow-up Required', 'Call next week', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, '0', 27, 22, 19, 19, '2024-10-04 12:09:14', 'Lead Matured'),
(9, 'Jacob', 'Jacob', '20,000 - 30,000', NULL, 'Axel', NULL, '2003-08-10', 'axel@gmail.com', 'Walker', 'Male', 'Manchester', ' 57 Boar Lane', '57 Boar Lane', '020365657841', '02032144478', '02022577895', NULL, NULL, NULL, '10000', NULL, NULL, 'Friend & Family Members', 'Lead Matured', 'Follow-up Required', 'Not sure now', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, '0', 27, 23, 20, 20, '2024-10-04 12:11:25', 'Negotiation'),
(10, 'admin', 'admin', '10,000 - 20,000', NULL, 'Easton', NULL, '1999-06-15', 'easton@gmail.com', 'Bennett', 'Male', 'London', '58 Boar Lane', '58 Boar Lane', '02055989778', '02054778156', '02079460000', NULL, NULL, NULL, '11000', NULL, NULL, 'Friend & Family Members', 'Call Disconnected', 'Follow-up Required', 'Not sure now', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 18, '0', 21, 25, 22, 22, '2024-10-04 12:50:36', 'Lead Capturing'),
(11, 'admin', 'admin', '20,000 - 30,000', NULL, 'Jose', NULL, '2003-12-10', 'jose@gmail.com', 'Colton', 'Male', 'London', '59 Boar Lane', '59 Boar Lane', '02054447820', '02065477102', '020795654180', NULL, NULL, NULL, '12000', NULL, NULL, 'Social Media', 'Dropped', 'Follow-up Required', 'Call next week', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 18, '0', 21, 26, 23, 23, '2024-10-04 12:52:33', 'Dropped'),
(12, 'zubair', 'zubair', '30,000 - 40,000', NULL, 'River', NULL, '2002-10-10', 'river@gmail.com', 'Austin', 'Male', 'Manchester', '60 Boar Lane', '60 Boar Lane', '02054790257', '02035774109', '02098715205', NULL, NULL, NULL, '13000', NULL, NULL, 'Friend & Family Members', NULL, 'Follow-up Required', 'He will inform later', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, '0', 27, 28, 24, 24, '2024-10-04 13:00:16', 'Lead Qualification'),
(13, 'Jacob', 'Jacob', '20,000 - 30,000', NULL, 'Jasper', NULL, '2004-12-12', 'Jasper', 'Bryson', 'Male', 'Manchester', '61 Boar Lane', '61 Boar Lane', '02031255781', '02032589410', '02036485201', NULL, NULL, NULL, '15000', NULL, NULL, 'Social Media', 'Wrong Number', 'Follow-up Required', 'He will contact soon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 20, '0', 27, 29, 25, 25, '2024-10-04 13:02:15', 'Proposal/ Quotation'),
(14, 'John', 'John', '30,000 - 40,000', NULL, 'George', NULL, '1999-12-10', 'george@gmail.com', 'Carlos', 'Male', 'Birmingham', '63 Boar Lane', '63 Boar Lane', '02054778540', '02065871068', '02035871024', NULL, NULL, NULL, '12000', NULL, NULL, 'Social Media', 'Phone Not Picked', 'Follow-up Required', 'He will inform later', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 21, '0', 29, 30, 26, 26, '2024-10-04 13:21:51', 'Lead Nurturing'),
(15, 'Atif', 'Atif', '20,000 - 30,000', NULL, 'Tyler', NULL, '2005-02-05', 'tyler@gmail.com', 'Finn', 'Male', 'Birmingham', '64 Boar Lane', '64 Boar Lane', '02051028750', '02062875620', '02065587492', NULL, NULL, NULL, '8000', NULL, NULL, 'Friend & Family Members', NULL, 'Follow-up Required', 'Not sure now', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 21, '0', 29, 30, 27, 27, '2024-10-04 13:28:26', 'Lead Qualification'),
(16, 'zubair', 'zubair', '30,000 - 40,000', NULL, 'Justin', NULL, '2005-05-04', 'justin@gmail.com', 'Kevin', 'Male', 'Birmingham', '65 Boar Lane', '65 Boar Lane', '02054875207', '02059820468', '02068874250', NULL, NULL, NULL, '10000', NULL, NULL, 'Social Media', NULL, 'Follow-up Required', 'He will contact soon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 21, '0', 29, 30, 28, 28, '2024-10-04 13:30:30', 'Negotiation'),
(17, 'Jacob', 'Jacob', '30,000 - 40,000', NULL, 'Gavin', NULL, '2002-09-05', 'gavin@gmail.com', 'Brody', 'Male', 'Birmingham', '66 Boar Lane', '66 Boar Lane', '0205476024', '02024581024', '02036587450', NULL, NULL, NULL, '11000', NULL, NULL, 'Friend & Family Members', 'Follow-up Required', 'Follow-up Required', 'He will inform later', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 21, '0', 29, 30, 29, 29, '2024-10-04 13:32:36', 'Negotiation'),
(22, 'lsbc', 'lsbc', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', '16', 'undefined', 'undefined', 'undefined', NULL, 'undefined', NULL, 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 18, '1', 21, 17, 14, 15, '2024-11-14 08:35:29', 'Initial Application Review');

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

--
-- Table structure for table `enquiry_fields`
--

CREATE TABLE `enquiry_fields` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `field_name` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `type` varchar(11) DEFAULT NULL,
  `show_field` tinyint(1) NOT NULL DEFAULT 0,
  `report_show` tinyint(4) NOT NULL DEFAULT 0,
  `order_no` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `enquiry_fields`
--

INSERT INTO `enquiry_fields` (`id`, `title`, `field_name`, `status`, `type`, `show_field`, `report_show`, `order_no`) VALUES
(1, 'Lead Entered By', 'enquiry_by', 1, 'Drop Down', 1, 0, 20),
(2, 'Lead Handled By', 'enquiry_entered_by', 1, 'Drop Down', 1, 0, 10),
(4, 'Income Range (GBP)', 'income_range', 1, 'Drop Down', 1, 0, 130),
(5, 'Visa Status', 'enquiry_date', 1, 'Drop Down', 1, 1, 1000),
(6, 'First Name', 'username', 1, 'Text', 1, 1, 30),
(7, 'Middle Name', 'cnic', 1, 'Text', 1, 0, 1100),
(8, 'Date of Birth', 'date_of_birth', 1, 'Date', 1, 0, 140),
(9, 'Email', 'email', 1, 'Text', 1, 0, 90),
(10, 'Last Name', 'father_name', 1, 'Text', 1, 1, 40),
(11, 'Gender', 'gender', 1, 'Drop Down', 1, 0, 50),
(12, 'City', 'city', 1, 'Text', 1, 0, 120),
(13, 'Present Address', 'present_address', 1, 'Text', 1, 0, 110),
(14, 'Permanent Address', 'permanent_address', 1, 'Text', 1, 0, 100),
(15, 'Mobile No. ', 'mobile_no_one', 1, 'Number', 1, 1, 60),
(16, 'Mobile No. (secondary)', 'mobile_no_two', 1, 'Number', 1, 0, 70),
(17, 'Landline', 'landline', 1, 'Number', 1, 0, 80),
(18, 'Birth Country', 'project', 1, 'Drop Down', 1, 0, 1300),
(19, 'Nationality', 'product', 1, 'Drop Down', 1, 0, 1400),
(20, 'Ethnic Origin', 'developer', 1, 'Drop Down', 1, 0, 1500),
(21, 'Course Fee (GBP)', 'price_offered', 1, 'Number', 1, 0, 150),
(22, 'Religion', 'property_address', 1, 'Drop Down', 1, 0, 1600),
(23, 'Sexual Orientation', 'image \r\n', 1, 'Drop Down', 1, 0, 1700),
(24, 'Hear About us', 'source_of_information', 1, 'Drop Down', 1, 0, 160),
(25, 'Passport Issue', 'enquiry_status', 1, 'Date', 1, 0, 2800),
(26, 'Criminal Conviction', 'remarks', 1, 'Drop Down', 1, 1, 170),
(27, 'Course Title', 'field_one', 1, 'Drop Down', 1, 0, 1800),
(28, 'Intake', 'field_two', 1, 'Drop Down', 1, 0, 1900),
(29, 'Year', 'field_three', 1, 'Drop Down', 1, 0, 2000),
(30, 'Course Start Date', 'field_four', 1, 'Date', 0, 1, 2100),
(31, 'Course End Date', 'field_five', 1, 'Date', 1, 0, 2200),
(32, 'Place of Study/Campus', 'field_six', 1, 'Drop Down', 1, 0, 2300),
(33, 'Visa Required', 'field_seven', 1, 'Drop Down', 1, 0, 2400),
(34, 'Visa Valid From', 'field_eight', 1, 'Date', 1, 0, 2500),
(35, 'Visa Expiry', 'field_nine', 1, 'Date', 1, 0, 2600),
(36, 'Passport No.', 'field_ten', 1, 'Text', 1, 0, 2700),
(37, 'field_eleven', 'field_eleven', 1, 'Text', 1, 0, 2800),
(38, 'field_twelve', 'field_twelve', 1, 'Text', 1, 0, 2900),
(39, 'field_thirteen', 'field_thirteen', 1, 'Text', 1, 0, 3000),
(40, 'field_fourteen', 'field_fourteen', 1, 'Text', 1, 0, 3100),
(41, 'field_fifteen', 'field_fifteen', 1, 'Text', 1, 0, 3200),
(42, 'field_sixteen', 'field_sixteen', 1, 'Text', 1, 0, 3300),
(43, 'field_seventeen', 'field_seventeen', 1, 'Text', 1, 0, 3400),
(44, 'field_eighteen', 'field_eighteen', 1, 'Text', 1, 0, 3500),
(45, 'field_eighteen', 'field_eighteen', 1, 'Text', 1, 0, 3600),
(46, 'field_twenty', 'field_twenty', 1, 'Text', 1, 0, 3700);

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

--
-- Table structure for table `enquiry_fields_dropdown`
--

CREATE TABLE `enquiry_fields_dropdown` (
  `id` int(11) NOT NULL,
  `dropdown` varchar(255) DEFAULT NULL,
  `field_name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `enquiry_fields_dropdown`
--

INSERT INTO `enquiry_fields_dropdown` (`id`, `dropdown`, `field_name`) VALUES
(12, 'Admission Officer', 'enquiry_by'),
(13, 'LAP Centre', 'enquiry_by'),
(14, 'Data Entry operator 1', 'enquiry_entered_by'),
(15, 'Data Entry operator 2', 'enquiry_entered_by'),
(20, '10,000 - 20,000', 'income_range'),
(21, '20,000 - 30,000', 'income_range'),
(22, '30,000 - 40,000', 'income_range'),
(25, 'Social Media', 'source_of_information'),
(26, 'Friend & Family Members', 'source_of_information'),
(30, 'Matured', 'enquiry_status'),
(31, 'Dropped', 'enquiry_status'),
(32, 'Follow-up Required', 'enquiry_status'),
(35, 'Male', 'gender'),
(36, 'Female', 'gender'),
(37, 'Prefer not to say', 'gender'),
(38, 'Pakistan', 'project'),
(39, 'Pakistan', 'product'),
(40, 'Yes', 'field_seven'),
(41, 'No', 'field_seven'),
(42, 'Granted', 'enquiry_date'),
(43, 'Rejected', 'enquiry_date'),
(44, 'Pending', 'enquiry_date');

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

--
-- Table structure for table `enquiry_products`
--

CREATE TABLE `enquiry_products` (
  `id` int(11) NOT NULL,
  `enquiry_id` int(11) DEFAULT NULL,
  `product_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `enquiry_products`
--

INSERT INTO `enquiry_products` (`id`, `enquiry_id`, `product_id`, `created_at`) VALUES
(3, 2, 1, '2024-08-08 13:12:03'),
(4, 2, 2, '2024-08-08 13:12:03'),
(5, 1, 1, '2024-08-09 12:17:41'),
(6, 1, 3, '2024-08-09 12:17:41'),
(8, 7, 9, '2024-09-12 09:56:52'),
(9, 8, 10, '2024-09-24 06:56:07'),
(10, 9, 11, '2024-09-24 11:40:20'),
(12, 10, 10, '2024-09-27 13:51:12'),
(14, 15, 13, '2024-10-02 06:45:57'),
(15, 15, 14, '2024-10-02 06:45:57'),
(18, 3, 16, '2024-10-04 07:54:30'),
(20, 4, 16, '2024-10-04 08:06:45');

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

--
-- Table structure for table `follow_up`
--

CREATE TABLE `follow_up` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `enquiry_id` int(11) DEFAULT NULL,
  `called_by` varchar(255) DEFAULT NULL,
  `called_type` varchar(255) DEFAULT NULL,
  `called_status` varchar(255) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `price_offered` varchar(255) DEFAULT NULL,
  `followup_date` date DEFAULT NULL,
  `next_followup_date` date DEFAULT NULL,
  `created_at` varchar(255) DEFAULT NULL,
  `follow_up_products` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `follow_up`
--

INSERT INTO `follow_up` (`id`, `user_id`, `enquiry_id`, `called_by`, `called_type`, `called_status`, `remarks`, `price_offered`, `followup_date`, `next_followup_date`, `created_at`, `follow_up_products`) VALUES
(1, 29, 10, '', '2', 'Call Disconnected', NULL, NULL, '2024-10-04', '2024-10-06', NULL, NULL),
(2, 29, 14, '', '2', 'Phone Not Picked', NULL, NULL, '2024-10-04', '2024-10-07', NULL, NULL),
(3, 33, 13, '', '1', 'Wrong Number', NULL, NULL, '2024-10-03', '2024-10-06', NULL, NULL),
(4, 33, 17, '', '3', 'Follow-up Required', NULL, NULL, '2024-10-02', '2024-10-08', NULL, NULL),
(5, 30, 7, '', '4', 'Lead Matured', 'gggg', '900', '2024-11-08', '2024-11-08', NULL, NULL),
(6, 30, 6, '', '3', 'Follow-up Required', NULL, '5000', '2024-11-08', '2024-11-08', NULL, NULL),
(7, 30, 6, '', '3', 'Lead Matured', NULL, '4500', '2024-11-08', '2024-11-08', NULL, NULL),
(8, 30, 6, '', '5', 'Follow-up Required', NULL, '4000', '2024-11-07', '2024-11-10', NULL, NULL);

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

--
-- Table structure for table `follow_up_products`
--

CREATE TABLE `follow_up_products` (
  `id` int(11) NOT NULL,
  `product_id` int(11) DEFAULT NULL,
  `follow_up_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `follow_up_products`
--

INSERT INTO `follow_up_products` (`id`, `product_id`, `follow_up_id`, `created_at`) VALUES
(15, 16, 6, '2024-10-04 09:13:39'),
(16, 16, 7, '2024-10-04 09:32:36');

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

--
-- Table structure for table `organization`
--

CREATE TABLE `organization` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `currency` varchar(255) NOT NULL DEFAULT 'PKR'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `organization`
--

INSERT INTO `organization` (`id`, `name`, `currency`) VALUES
(21, 'Lords', 'GBP');

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

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int(11) NOT NULL,
  `role_id` int(11) DEFAULT NULL,
  `user_tab` tinyint(4) DEFAULT 0,
  `user_add` tinyint(1) DEFAULT NULL,
  `user_view` tinyint(1) DEFAULT NULL,
  `user_delete` tinyint(1) DEFAULT NULL,
  `user_edit` tinyint(1) DEFAULT NULL,
  `role_tab` tinyint(1) DEFAULT NULL,
  `role_add` tinyint(1) DEFAULT NULL,
  `role_delete` tinyint(1) DEFAULT NULL,
  `organization_tab` tinyint(1) DEFAULT NULL,
  `organization_add` tinyint(1) DEFAULT NULL,
  `organization_delete` tinyint(1) DEFAULT NULL,
  `office_tab` tinyint(1) DEFAULT NULL,
  `office_add` tinyint(1) DEFAULT NULL,
  `office_delete` tinyint(1) DEFAULT NULL,
  `cat_level_one_tab` tinyint(1) DEFAULT NULL,
  `cat_level_one_add` tinyint(1) DEFAULT NULL,
  `cat_level_one_delete` tinyint(1) DEFAULT NULL,
  `cat_level_two_tab` tinyint(1) DEFAULT NULL,
  `cat_level_two_add` tinyint(1) DEFAULT NULL,
  `cat_level_two_delete` tinyint(1) DEFAULT NULL,
  `cat_level_three_tab` tinyint(1) DEFAULT NULL,
  `cat_level_three_add` tinyint(1) DEFAULT NULL,
  `cat_level_three_delete` tinyint(1) DEFAULT NULL,
  `cat_level_four_tab` tinyint(1) DEFAULT NULL,
  `cat_level_four_add` tinyint(1) DEFAULT NULL,
  `cat_level_four_delete` tinyint(1) DEFAULT NULL,
  `enquiry_field_tab` tinyint(1) DEFAULT NULL,
  `enquiries_tab` tinyint(1) DEFAULT NULL,
  `enquiries_add` tinyint(1) DEFAULT NULL,
  `enquiries_delete` tinyint(1) DEFAULT NULL,
  `enquiries_edit` tinyint(1) DEFAULT NULL,
  `enquiries_view` tinyint(1) DEFAULT NULL,
  `enquiries_assign` tinyint(1) DEFAULT NULL,
  `follow_up_tab` tinyint(1) DEFAULT NULL,
  `follow_up_add` tinyint(1) DEFAULT NULL,
  `follow_up_view` tinyint(1) DEFAULT NULL,
  `customer_tab` tinyint(1) DEFAULT 0,
  `followup_report` tinyint(4) NOT NULL DEFAULT 0,
  `enquiry_report` tinyint(4) NOT NULL DEFAULT 0,
  `products_tab` tinyint(4) NOT NULL DEFAULT 0,
  `products_add` tinyint(4) NOT NULL DEFAULT 0,
  `products_edit` tinyint(4) NOT NULL DEFAULT 0,
  `products_delete` tinyint(4) NOT NULL DEFAULT 0,
  `cat_level_four_update` tinyint(4) NOT NULL DEFAULT 0,
  `cat_level_three_update` tinyint(4) NOT NULL DEFAULT 0,
  `cat_level_one_update` tinyint(4) NOT NULL DEFAULT 0,
  `cat_level_two_update` tinyint(4) NOT NULL DEFAULT 0,
  `organization_update` tinyint(4) NOT NULL DEFAULT 0,
  `permissionscol` tinyint(4) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `role_id`, `user_tab`, `user_add`, `user_view`, `user_delete`, `user_edit`, `role_tab`, `role_add`, `role_delete`, `organization_tab`, `organization_add`, `organization_delete`, `office_tab`, `office_add`, `office_delete`, `cat_level_one_tab`, `cat_level_one_add`, `cat_level_one_delete`, `cat_level_two_tab`, `cat_level_two_add`, `cat_level_two_delete`, `cat_level_three_tab`, `cat_level_three_add`, `cat_level_three_delete`, `cat_level_four_tab`, `cat_level_four_add`, `cat_level_four_delete`, `enquiry_field_tab`, `enquiries_tab`, `enquiries_add`, `enquiries_delete`, `enquiries_edit`, `enquiries_view`, `enquiries_assign`, `follow_up_tab`, `follow_up_add`, `follow_up_view`, `customer_tab`, `followup_report`, `enquiry_report`, `products_tab`, `products_add`, `products_edit`, `products_delete`, `cat_level_four_update`, `cat_level_three_update`, `cat_level_one_update`, `cat_level_two_update`, `organization_update`, `permissionscol`) VALUES
(51, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0),
(52, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0),
(53, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(57, 16, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0),
(58, 17, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(59, 18, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(60, 19, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(61, 20, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

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

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

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `product_name` varchar(255) NOT NULL,
  `details` text NOT NULL,
  `type_of_product` varchar(50) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `price` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `products` (`id`, `product_name`, `details`, `type_of_product`, `created_at`, `price`) VALUES
(16, 'Smart Folder', 'Smart Folder is an innovative solution designed to simplify and enhance the processes. With a user-friendly interface and powerful features, Smart Folder enables seamless records.', 'Product', '2024-10-04 07:30:34', 3000);

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(11) NOT NULL,
  `role` varchar(255) NOT NULL,
  `self_inquiries` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `role`, `self_inquiries`) VALUES
(10, 'Admin', 0),
(12, 'Admission Manager', 0),
(18, 'Inquiry Officer', 1),
(19, 'Admission Assistant', 1),
(20, 'Recruitment Agent', 1);

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `category_level_four`
--
ALTER TABLE `category_level_four`
  ADD PRIMARY KEY (`id`),
  ADD KEY `category_level_three_id` (`category_level_three_id`);

--
-- Indexes for table `category_level_one`
--
ALTER TABLE `category_level_one`
  ADD PRIMARY KEY (`id`),
  ADD KEY `organization_id` (`organization_id`),
  ADD KEY `office_id` (`office_id`);

--
-- Indexes for table `category_level_three`
--
ALTER TABLE `category_level_three`
  ADD PRIMARY KEY (`id`),
  ADD KEY `category_level_two_id` (`category_level_two_id`);

--
-- Indexes for table `category_level_two`
--
ALTER TABLE `category_level_two`
  ADD PRIMARY KEY (`id`),
  ADD KEY `category_level_one_id` (`category_level_one_id`);

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

--
-- Indexes for table `enquiries`
--
ALTER TABLE `enquiries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `office_id` (`office_id`),
  ADD KEY `cat_one_id` (`cat_one_id`),
  ADD KEY `cat_two_id` (`cat_two_id`),
  ADD KEY `cat_three_id` (`cat_three_id`),
  ADD KEY `cat_four_id` (`cat_four_id`);

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

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

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

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

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

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

--
-- Indexes for table `permissions`

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `assign_enquiries`
--
ALTER TABLE `assign_enquiries`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `category_level_four`
--
ALTER TABLE `category_level_four`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `category_level_one`
--
ALTER TABLE `category_level_one`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `category_level_three`
--
ALTER TABLE `category_level_three`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `category_level_two`
--
ALTER TABLE `category_level_two`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `complaint_bd`
--
ALTER TABLE `complaint_bd`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `enquiries`
--
ALTER TABLE `enquiries`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `enquiry_fields`
--
ALTER TABLE `enquiry_fields`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `enquiry_fields_dropdown`
--
ALTER TABLE `enquiry_fields_dropdown`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;

--
-- AUTO_INCREMENT for table `enquiry_products`
--
ALTER TABLE `enquiry_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

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

--
-- AUTO_INCREMENT for table `follow_up_products`
--
ALTER TABLE `follow_up_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `organization`
--
ALTER TABLE `organization`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `permissions`
--
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `category_level_four`
--
ALTER TABLE `category_level_four`
  ADD CONSTRAINT `category_level_four_ibfk_1` FOREIGN KEY (`category_level_three_id`) REFERENCES `category_level_three` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `category_level_one`
--
ALTER TABLE `category_level_one`
  ADD CONSTRAINT `category_level_one_ibfk_1` FOREIGN KEY (`organization_id`) REFERENCES `organization` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `category_level_one_ibfk_2` FOREIGN KEY (`office_id`) REFERENCES `office` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `category_level_three`
--
ALTER TABLE `category_level_three`
  ADD CONSTRAINT `category_level_three_ibfk_1` FOREIGN KEY (`category_level_two_id`) REFERENCES `category_level_two` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `category_level_two`
--
ALTER TABLE `category_level_two`
  ADD CONSTRAINT `category_level_two_ibfk_1` FOREIGN KEY (`category_level_one_id`) REFERENCES `category_level_one` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `enquiries`
--
ALTER TABLE `enquiries`
  ADD CONSTRAINT `enquiries_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `office` (`id`),
  ADD CONSTRAINT `enquiries_ibfk_2` FOREIGN KEY (`cat_one_id`) REFERENCES `category_level_one` (`id`),
  ADD CONSTRAINT `enquiries_ibfk_3` FOREIGN KEY (`cat_two_id`) REFERENCES `category_level_two` (`id`),
  ADD CONSTRAINT `enquiries_ibfk_4` FOREIGN KEY (`cat_three_id`) REFERENCES `category_level_three` (`id`),
  ADD CONSTRAINT `enquiries_ibfk_5` FOREIGN KEY (`cat_four_id`) REFERENCES `category_level_four` (`id`);

--
-- Constraints for table `permissions`


