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

START TRANSACTION;



--
-- Database: `candidate_management`
--

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

--
-- Table structure for table `activity_log`
--

CREATE TABLE IF NOT EXISTS `activity_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action` varchar(255) DEFAULT NULL,
  `table_name` varchar(50) DEFAULT NULL,
  `record_id` int DEFAULT NULL,
  `details` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `activity_log`
--

INSERT INTO `activity_log` (`id`, `user_id`, `action`, `table_name`, `record_id`, `details`, `created_at`) VALUES
(1, 1, 'User logged in', NULL, NULL, NULL, '2026-01-09 21:47:37'),
(2, 1, 'User logged out', NULL, NULL, NULL, '2026-01-09 21:48:57'),
(3, 2, 'User logged in', NULL, NULL, NULL, '2026-01-09 21:49:07'),
(4, 2, 'Added new lead: raju', NULL, NULL, NULL, '2026-01-09 21:51:13'),
(5, 2, 'User logged in', NULL, NULL, NULL, '2026-01-09 21:52:13');

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

--
-- Table structure for table `candidates`
--

CREATE TABLE IF NOT EXISTS `candidates` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(150) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `whatsapp` varchar(20) DEFAULT NULL,
  `prometric_course` enum('PROMETRIC','COURSE','DIPLOMA','') DEFAULT NULL,
  `specify` varchar(100) DEFAULT NULL,
  `current_qualification` varchar(150) DEFAULT NULL,
  `certificate` varchar(200) DEFAULT NULL,
  `dream_date` varchar(50) DEFAULT NULL,
  `contact_date` varchar(50) DEFAULT NULL,
  `follow_up_date` varchar(50) DEFAULT NULL,
  `status` enum('HOT','WARM','COLD','EXAM PASS','DATAFLOW IN PROCESS','COACHING IN PROCESS','DEMO DONE','ONGOING','COMPLETED') DEFAULT 'COLD',
  `sreeshma` varchar(100) DEFAULT NULL,
  `reason` text,
  `demo` enum('DONE','WAIT','SCHEDULED','NOT DONE') DEFAULT 'NOT DONE',
  `upsell` enum('YES','NO','PENDING') DEFAULT 'PENDING',
  `suggestion_m` text,
  `marketing_source` varchar(100) DEFAULT NULL,
  `assigned_to` int DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `assigned_to` (`assigned_to`),
  KEY `created_by` (`created_by`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `candidates`
--

INSERT INTO `candidates` (`id`, `name`, `phone`, `whatsapp`, `prometric_course`, `specify`, `current_qualification`, `certificate`, `dream_date`, `contact_date`, `follow_up_date`, `status`, `sreeshma`, `reason`, `demo`, `upsell`, `suggestion_m`, `marketing_source`, `assigned_to`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'raju', '23234234', '24234234', 'PROMETRIC', 'dha', 'csdf', 'sdf', 'sdf', '23', '23', 'COLD', '', '', 'NOT DONE', 'PENDING', 'sdf', 'sdf', 2, 2, '2026-01-09 21:51:13', '2026-01-09 21:51:13');

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

--
-- Table structure for table `course_info`
--

CREATE TABLE IF NOT EXISTS `course_info` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `course_name` varchar(150) DEFAULT NULL,
  `course_details` text,
  `start_date` varchar(50) DEFAULT NULL,
  `end_date` varchar(50) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `created_by` (`created_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `dataflow`
--

CREATE TABLE IF NOT EXISTS `dataflow` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `submitted_date` varchar(50) DEFAULT NULL,
  `completed_date` varchar(50) DEFAULT NULL,
  `notes` text,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `created_by` (`created_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `documentation`
--

CREATE TABLE IF NOT EXISTS `documentation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `document_type` varchar(100) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `submitted_date` varchar(50) DEFAULT NULL,
  `verified_date` varchar(50) DEFAULT NULL,
  `notes` text,
  `updated_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `updated_by` (`updated_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `edit_requests`
--

CREATE TABLE IF NOT EXISTS `edit_requests` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `old_value` text,
  `new_value` text,
  `requested_by` int DEFAULT NULL,
  `requested_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `approved_by` int DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `comments` text,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `requested_by` (`requested_by`),
  KEY `approved_by` (`approved_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `exam_registration`
--

CREATE TABLE IF NOT EXISTS `exam_registration` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `exam_type` varchar(100) DEFAULT NULL,
  `exam_date` varchar(50) DEFAULT NULL,
  `registration_date` varchar(50) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `notes` text,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `created_by` (`created_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `licensing`
--

CREATE TABLE IF NOT EXISTS `licensing` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `license_type` varchar(100) DEFAULT NULL,
  `application_date` varchar(50) DEFAULT NULL,
  `status` varchar(50) DEFAULT NULL,
  `issued_date` varchar(50) DEFAULT NULL,
  `notes` text,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `created_by` (`created_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `payments`
--

CREATE TABLE IF NOT EXISTS `payments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `candidate_id` int DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `payment_date` date DEFAULT NULL,
  `payment_type` varchar(50) DEFAULT NULL,
  `description` text,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `candidate_id` (`candidate_id`),
  KEY `created_by` (`created_by`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
COMMIT;

