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

START TRANSACTION;



--
-- Database: `appointment_system`
--

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

--
-- Table structure for table `appointments`
--

CREATE TABLE IF NOT EXISTS `appointments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `form_id` int(11) NOT NULL,
  `department_id` int(11) DEFAULT NULL,
  `form_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`form_data`)),
  `status` varchar(50) DEFAULT 'Pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `appointments`
--

INSERT INTO `appointments` (`id`, `form_id`, `department_id`, `form_data`, `status`, `created_at`) VALUES
(1, 3, 1, '{\"Full Name\":\"dsdfsdfs\"}', 'Pending', '2025-07-02 06:50:32'),
(2, 3, 1, '{\"Full Name\":\"fsdfsdfsdf\",\"Assumenda et dolore\":\"dsfsdfs\"}', 'Pending', '2025-07-02 06:53:08'),
(3, 3, 1, '{\"Full Name\":\"dfsdfsdfsdf\",\"Assumenda et dolore\":\"sdfsdfsdfsdfsdf\"}', 'Pending', '2025-07-02 07:05:47'),
(5, 3, 1, '{\"Full Name\":\"sgsdfgdfgdf\",\"Assumenda et dolore\":\"gdfgdfgdfgdfgdfg\"}', 'Cancelled', '2025-07-02 07:06:42'),
(6, 3, 2, '{\"Full Name\":\"Wayne Cooke\",\"Assumenda et dolore\":\"wurovala@mailinator.com\"}', 'Confirmed', '2025-07-02 07:10:22'),
(7, 3, 3, '{\"Full Name\":\"jkhgjgj\",\"jhgjghhjgj\":\"765756757\",\"Assumenda et dolore\":\"hgfhfhfh\"}', 'Pending', '2025-07-02 07:26:49');

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

--
-- Table structure for table `departments`
--

CREATE TABLE IF NOT EXISTS `departments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `departments`
--

INSERT INTO `departments` (`id`, `name`) VALUES
(1, 'Sales'),
(2, 'HR'),
(3, 'Tech Support'),
(4, 'Nextzen');

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

--
-- Table structure for table `forms`
--

CREATE TABLE IF NOT EXISTS `forms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `slug` varchar(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `slug` (`slug`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `forms`
--

INSERT INTO `forms` (`id`, `title`, `description`, `status`, `slug`, `created_at`) VALUES
(2, 'test form', 'sdfsdf', 1, NULL, '2025-07-02 05:10:29'),
(3, 'Interview Apointment', 'dsfsdfsdf', 1, NULL, '2025-07-02 06:35:42');

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

--
-- Table structure for table `form_fields`
--

CREATE TABLE IF NOT EXISTS `form_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `form_id` int(11) DEFAULT NULL,
  `label` varchar(255) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `options` text DEFAULT NULL,
  `required` tinyint(1) DEFAULT 1,
  `placeholder` varchar(255) DEFAULT NULL,
  `min_date` date DEFAULT NULL,
  `max_date` date DEFAULT NULL,
  `min_time` time DEFAULT NULL,
  `max_time` time DEFAULT NULL,
  `sort_order` int(11) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `form_fields`
--

INSERT INTO `form_fields` (`id`, `form_id`, `label`, `name`, `type`, `options`, `required`, `placeholder`, `min_date`, `max_date`, `min_time`, `max_time`, `sort_order`) VALUES
(1, 1, 'Modi dolore eum quis', 'DelilahRatliff', 'select', '[\"Dolor eius sit sunt\"]', 1, 'Architecto sint iru', NULL, NULL, NULL, NULL, 62),
(2, 1, 'dsfsdfsdf', 'sdfsdf', 'text', NULL, 1, 'dsfsdf', NULL, NULL, NULL, NULL, 0),
(3, 1, 'dsfsdfs', 'sdfsd', 'date', NULL, 1, '', '2025-07-01', '2025-07-09', NULL, NULL, 0),
(4, 1, 'sadasf', 'sfsdfsdf', 'text', NULL, 1, '', NULL, NULL, NULL, NULL, 0),
(5, 2, 'dsfsdf', 'sdfsdfsd', 'text', NULL, 1, '', NULL, NULL, NULL, NULL, 0),
(6, 2, 'hjghjghjghj', 'HectorRandolph', 'text', NULL, 0, 'Cupiditate minim nos', NULL, NULL, NULL, NULL, 94),
(7, 2, 'Laboris dolore maior', 'ZoeHolland', 'time', NULL, 1, 'Maxime voluptas quib', NULL, NULL, NULL, NULL, 66),
(8, 3, 'Full Name', 'full_name', 'text', NULL, 1, '', NULL, NULL, NULL, NULL, 0),
(9, 3, 'Email', 'Email', 'email', NULL, 0, '', NULL, NULL, NULL, NULL, 56),
(10, 3, 'Phone', 'Phone', 'phone', NULL, 1, '', NULL, NULL, NULL, NULL, 0),
(11, 3, 'Interview Date', 'inter_date', 'date', NULL, 1, 'Interview Date', NULL, NULL, NULL, NULL, 0),
(12, 3, 'Time', 'Time', 'time', NULL, 1, 'Time', NULL, NULL, NULL, NULL, 0);

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

--
-- Table structure for table `form_submissions`
--

CREATE TABLE IF NOT EXISTS `form_submissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `form_id` int(11) DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `form_submission_data`
--

CREATE TABLE IF NOT EXISTS `form_submission_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `submission_id` int(11) DEFAULT NULL,
  `field_name` varchar(100) DEFAULT NULL,
  `field_value` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
COMMIT;

