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

START TRANSACTION;



--
-- Database: `wasaabra_jj`
--

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

--
-- Table structure for table `field_options`
--

CREATE TABLE `field_options` (
  `id` int(11) NOT NULL,
  `field_id` int(11) NOT NULL,
  `option_value` varchar(255) NOT NULL,
  `option_label` varchar(255) DEFAULT NULL,
  `image_path` varchar(500) DEFAULT NULL,
  `sort_order` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `field_options`
--

INSERT INTO `field_options` (`id`, `field_id`, `option_value`, `option_label`, `image_path`, `sort_order`, `created_at`) VALUES
(1, 66, 'YYA101', 'YYA101', '/whatsapp-form-builder/uploads/field_images/69b4c0c594fcf_1773453509.jpeg', 0, '2026-03-14 01:58:29'),
(2, 66, 'YYA102', 'YYA102', '/whatsapp-form-builder/uploads/field_images/69b4c0c595778_1773453509.jpeg', 1, '2026-03-14 01:58:29'),
(3, 67, 'f', 'f', '/whatsapp-form-builder/uploads/field_images/69b4c17373d4d_1773453683.jpeg', 0, '2026-03-14 02:01:23'),
(4, 67, 'g', 'g', '/whatsapp-form-builder/uploads/field_images/69b4c17374092_1773453683.jpeg', 1, '2026-03-14 02:01:23'),
(5, 69, 't', 't', '/whatsapp-form-builder/uploads/field_images/69b4c4a135340_1773454497.jpeg', 0, '2026-03-14 02:14:57'),
(6, 69, 'b', 'b', '/whatsapp-form-builder/uploads/field_images/69b4c4a135636_1773454497.jpeg', 1, '2026-03-14 02:14:57'),
(7, 71, 'dds', 'ds', '/whatsapp-form-builder/uploads/field_images/69b4cd8a152f6_1773456778.jpg', 0, '2026-03-14 02:52:58'),
(8, 71, 'cc', 'cc', '/whatsapp-form-builder/uploads/field_images/69b4cd8a16e67_1773456778.jpeg', 1, '2026-03-14 02:52:58');

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

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

CREATE TABLE `forms` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `title` varchar(200) NOT NULL,
  `description` text DEFAULT NULL,
  `whatsapp_number` varchar(20) NOT NULL,
  `message_template` text NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `forms` (`id`, `user_id`, `title`, `description`, `whatsapp_number`, `message_template`, `created_at`) VALUES
(1, 2, 'beli brownies dengan kad terima kasih', 'beli brownies', '601111476679', 'New Order', '2026-03-12 08:28:15'),
(2, 2, 'demo2', 'demo borang', '601111476679', 'New Order\r\nNama Penuh      :{Nama}\r\nPhone Number :{Phone}\r\nUcapan : {Massage}\r\n\r\nMalumat Product\r\n\r\n', '2026-03-13 03:42:51'),
(3, 2, 'dfr', 'tuiii', '601111476679', 'Borang  Pendaftaran.\r\nNama Penuh :{Nama}\r\nNo Phone :{Nombor Telephone}\r\n', '2026-03-13 03:56:00'),
(4, 2, 'ss', 'ss', '601111476679', 'new order', '2026-03-13 04:07:56'),
(5, 2, 'ddadadada', 'dadsadadadadada', '601111476679', 'new\r\n{Nama}\r\n{Phone}\r\n{Massage}', '2026-03-13 04:32:59'),
(6, 2, 'Borang  Tempahan', 'Cetakan Yassin Hotstamping', '601111476679', 'Maklumat Cetakan\r\nNAMA:  {Nama Anda}\r\nPILIHAN KOD : {Pilihan Kod Yassin}\r\nWORDING : {Wording}\r\nDATE MAJLIS :{Tarikh Diperlukan}\r\n', '2026-03-13 04:52:28'),
(7, 2, 'demo', 'demo order', '601111476679', 'New Order\r\n\r\nNAMA: {NAMA PENUH}\r\nEMAIL : {EMAIL}\r\nPILIHAN YASSIN : {PILIHAN YASSIN}\r\nAYAT CETAKAN : {WORDING}', '2026-03-13 07:07:03'),
(8, 2, 'boleh cuba', 'boleh cuba', '601111476679', 'new order\r\nNAMA :{Nama}\r\nPhone :{Phone}\r\nCetakan : {WORDING}\r\nPilihan Yassin : {pilihan yassin}', '2026-03-14 01:38:08'),
(9, 2, 'kkk', 'cccc', '601111476679', 'ccccc\r\n\r\n{ddddddd}', '2026-03-14 02:01:23'),
(10, 2, 'toot', 'top', '601111476679', 'new order\r\n\r\n', '2026-03-14 02:14:57'),
(11, 2, 'pil', 'pilv', '601111476679', 'dd', '2026-03-14 02:52:58');

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

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

CREATE TABLE `form_fields` (
  `id` int(11) NOT NULL,
  `form_id` int(11) NOT NULL,
  `field_label` varchar(200) NOT NULL,
  `field_type` enum('text','textarea','email','phone','number','dropdown','checkbox','products') NOT NULL,
  `field_options` text DEFAULT NULL,
  `is_required` tinyint(1) DEFAULT 0,
  `sort_order` int(11) DEFAULT 0,
  `has_images` tinyint(1) DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `form_fields` (`id`, `form_id`, `field_label`, `field_type`, `field_options`, `is_required`, `sort_order`, `has_images`) VALUES
(65, 8, 'Tarikh Diperlukan', 'text', '', 0, 3, 0),
(12, 1, 'Ucapan Kotak', 'textarea', '', 0, 2, 0),
(10, 1, 'Nama', 'text', '', 0, 0, 0),
(11, 1, 'Nombor Telephone', 'phone', '', 0, 1, 0),
(64, 8, 'WORDING', 'text', '', 0, 2, 0),
(28, 2, 'Massage', 'textarea', '', 0, 2, 0),
(27, 2, 'Phone', 'number', '', 0, 1, 0),
(26, 2, 'Nama', 'text', '', 0, 0, 0),
(25, 3, 'Nombor Telephone', 'text', '', 0, 1, 0),
(24, 3, 'Nama', 'text', '', 0, 0, 0),
(63, 8, 'Phone', 'text', '', 0, 1, 0),
(32, 5, 'Nama', 'text', '', 0, 0, 0),
(33, 5, 'Phone', 'text', '', 0, 1, 0),
(34, 5, 'Massage', 'text', '', 0, 2, 0),
(40, 6, 'Wording', 'textarea', '', 0, 2, 0),
(39, 6, 'Pilihan Kod Yassin', 'checkbox', 'YYA001\r\nYYA002\r\nYYA003', 0, 1, 0),
(38, 6, 'Nama Anda', 'text', '', 0, 0, 0),
(41, 6, 'Tarikh Diperlukan', 'text', '', 0, 3, 0),
(57, 7, 'WORDING', 'textarea', '', 0, 3, 0),
(56, 7, 'PILIHAN YASSIN', 'checkbox', '', 0, 2, 1),
(55, 7, 'EMAIL ', 'email', '', 0, 1, 0),
(54, 7, 'NAMA PENUH', 'text', '', 0, 0, 0),
(62, 8, 'Nama', 'text', '', 0, 0, 0),
(66, 8, 'pilihan yassin', 'checkbox', '', 0, 4, 1),
(68, 9, 'ddddddd', 'dropdown', '', 0, 0, 1),
(69, 10, 'Nama Anda', 'dropdown', '', 0, 0, 1),
(70, 11, 'Nama', 'text', '', 0, 0, 0),
(71, 11, 'Pilihan Kod Yassin', 'dropdown', '', 0, 1, 1);

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

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

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `form_id` int(11) NOT NULL,
  `name` varchar(200) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

INSERT INTO `products` (`id`, `form_id`, `name`, `price`, `created_at`) VALUES
(4, 1, 'Bronies', 5.00, '2026-03-13 03:22:08'),
(5, 1, 'unta', 55.00, '2026-03-13 03:22:08'),
(9, 5, 'Bronies', 5.00, '2026-03-13 04:32:59');

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

--
-- Table structure for table `product_orders`
--

CREATE TABLE `product_orders` (
  `id` int(11) NOT NULL,
  `submission_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `quantity` int(11) DEFAULT 1,
  `price` decimal(10,2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `product_orders`
--

INSERT INTO `product_orders` (`id`, `submission_id`, `product_id`, `quantity`, `price`) VALUES
(1, 1, 1, 50, 10.00),
(2, 2, 4, 5, 5.00),
(3, 2, 5, 10, 55.00),
(4, 4, 7, 10, 1.50),
(5, 5, 7, 50, 1.50),
(6, 9, 9, 50, 5.00);

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

--
-- Table structure for table `submissions`
--

CREATE TABLE `submissions` (
  `id` int(11) NOT NULL,
  `form_id` int(11) NOT NULL,
  `submitted_at` timestamp NULL DEFAULT current_timestamp(),
  `total_price` decimal(10,2) DEFAULT 0.00
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `submissions`
--

INSERT INTO `submissions` (`id`, `form_id`, `submitted_at`, `total_price`) VALUES
(1, 1, '2026-03-12 08:30:55', 500.00),
(2, 1, '2026-03-13 03:22:53', 575.00),
(3, 2, '2026-03-13 03:51:31', 0.00),
(4, 2, '2026-03-13 03:51:55', 15.00),
(5, 2, '2026-03-13 03:53:05', 75.00),
(6, 3, '2026-03-13 03:56:34', 0.00),
(7, 2, '2026-03-13 04:06:50', 0.00),
(8, 2, '2026-03-13 04:31:15', 0.00),
(9, 5, '2026-03-13 04:33:26', 250.00),
(10, 5, '2026-03-13 04:35:25', 0.00),
(11, 5, '2026-03-13 04:42:35', 0.00),
(12, 7, '2026-03-13 08:05:19', 0.00),
(13, 7, '2026-03-13 08:09:16', 0.00),
(14, 10, '2026-03-14 02:15:13', 0.00);

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

--
-- Table structure for table `submission_answers`
--

CREATE TABLE `submission_answers` (
  `id` int(11) NOT NULL,
  `submission_id` int(11) NOT NULL,
  `field_id` int(11) NOT NULL,
  `answer_value` text DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `submission_answers`
--

INSERT INTO `submission_answers` (`id`, `submission_id`, `field_id`, `answer_value`) VALUES
(1, 1, 1, 'Untw'),
(2, 1, 2, '601147667912'),
(3, 1, 3, 'Hello semua'),
(4, 2, 10, 'sdadad'),
(5, 2, 11, 'dasdad'),
(6, 2, 12, 'sadada'),
(7, 3, 16, ''),
(8, 3, 17, ''),
(9, 3, 18, ''),
(10, 3, 19, ''),
(11, 3, 20, ''),
(12, 3, 21, ''),
(13, 4, 16, 'asa'),
(14, 4, 17, '364644'),
(15, 4, 18, 'demomomomom'),
(16, 4, 19, ''),
(17, 4, 20, ''),
(18, 4, 21, ''),
(19, 5, 16, 'Unn'),
(20, 5, 17, '0123456789'),
(21, 5, 18, 'Demo'),
(22, 5, 19, ''),
(23, 5, 20, ''),
(24, 5, 21, ''),
(25, 6, 22, 'Wildan'),
(26, 6, 23, '01111472279'),
(27, 7, 26, 'zcz'),
(28, 7, 27, ''),
(29, 7, 28, 'czczxcz'),
(30, 7, 29, 'zcz'),
(31, 7, 30, ''),
(32, 7, 31, 'zczc'),
(33, 8, 26, 'gfh'),
(34, 8, 27, '0125486'),
(35, 8, 28, 'dgdgd'),
(36, 8, 29, ''),
(37, 8, 30, ''),
(38, 8, 31, ''),
(39, 9, 32, 'aaa'),
(40, 9, 33, '012345678'),
(41, 9, 34, 'hello nak beli brownies ie'),
(42, 10, 32, 'Nns'),
(43, 10, 33, '0111147667'),
(44, 10, 34, 'Opopoopoop0'),
(45, 11, 32, 'Ariff Amri'),
(46, 11, 33, '0133712881'),
(47, 11, 34, 'Ahmad n Lona'),
(48, 12, 50, ''),
(49, 12, 51, ''),
(50, 12, 52, '1'),
(51, 12, 52, '1'),
(52, 13, 54, 'DE'),
(53, 13, 55, 'ED@ED.COM'),
(54, 13, 56, '2, 1'),
(55, 13, 56, '2, 1'),
(56, 14, 69, 't');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `field_options`
--
ALTER TABLE `field_options`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_field_options_field_id` (`field_id`);

--
-- Indexes for table `forms`
--
ALTER TABLE `forms`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `form_fields`
--
ALTER TABLE `form_fields`
  ADD PRIMARY KEY (`id`),
  ADD KEY `form_id` (`form_id`);

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

--
-- Indexes for table `product_orders`
--
ALTER TABLE `product_orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `submission_id` (`submission_id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `submissions`
--
ALTER TABLE `submissions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `form_id` (`form_id`);

--
-- Indexes for table `submission_answers`
--
ALTER TABLE `submission_answers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `submission_id` (`submission_id`),
  ADD KEY `field_id` (`field_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `submission_answers`
--
ALTER TABLE `submission_answers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57;
COMMIT;

