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

START TRANSACTION;



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

--
-- Table structure for table `blog_categories`
--

CREATE TABLE `blog_categories` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `blog_categories`
--

INSERT INTO `blog_categories` (`id`, `name`, `slug`, `description`, `is_active`, `created_at`) VALUES
(1, 'Health Tips', 'health-tips', 'Health and wellness tips', 1, '2025-12-29 12:39:34'),
(2, 'Skincare Guide', 'skincare-guide', 'Skincare routines and guides', 1, '2025-12-29 12:39:34'),
(3, 'Product Reviews', 'product-reviews', 'Product reviews and recommendations', 1, '2025-12-29 12:39:34'),
(4, 'Nutrition', 'nutrition', 'Nutrition and diet information', 1, '2025-12-29 12:39:34');

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

--
-- Table structure for table `blog_posts`
--

CREATE TABLE `blog_posts` (
  `id` int(10) UNSIGNED NOT NULL,
  `category_id` int(10) UNSIGNED DEFAULT NULL,
  `author_id` int(10) UNSIGNED NOT NULL,
  `title` varchar(200) NOT NULL,
  `slug` varchar(200) NOT NULL DEFAULT '',
  `excerpt` text DEFAULT NULL,
  `content` longtext NOT NULL,
  `featured_image` varchar(255) DEFAULT NULL,
  `is_published` tinyint(1) DEFAULT 0,
  `published_at` datetime DEFAULT NULL,
  `meta_title` varchar(200) DEFAULT NULL,
  `meta_description` text DEFAULT NULL,
  `views` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `blog_posts`
--

INSERT INTO `blog_posts` (`id`, `category_id`, `author_id`, `title`, `slug`, `excerpt`, `content`, `featured_image`, `is_published`, `published_at`, `meta_title`, `meta_description`, `views`, `created_at`, `updated_at`) VALUES
(1, 4, 1, 'a', 'a', 'a', '<p>a</p>', 'gallery/gallery_69a87713877e2.png', 1, NULL, '0', 'a', 0, '2026-01-04 07:19:17', '2026-03-04 18:17:05');
INSERT INTO `blog_posts` (`id`, `category_id`, `author_id`, `title`, `slug`, `excerpt`, `content`, `featured_image`, `is_published`, `published_at`, `meta_title`, `meta_description`, `views`, `created_at`, `updated_at`) VALUES
(2, 1, 1, 'Best Supplements for Strong Bones', 'best-supplements-for-strong-bones', 'Best Supplements for Strong Bones\r\n\r\nAs we age, maintaining bone strength becomes increasingly important for an active and healthy life. Over time, the body’s natural ability to absorb and utilize essential minerals decreases, which may lead to weak bones, reduced mobility, and a higher risk of fractures. Poor dietary intake, limited sunlight exposure, and nutritional deficiencies can further affect bone health.\r\nThis is where bone-support supplements play an important role. Supplements containing', '<p><img src=\"data:image/jpeg;base64,[BLOB]\"></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Bones require a continuous supply of minerals and vitamins to remain dense and resilient. Without proper nutritional support, the body may pull calcium from bones to maintain normal blood calcium levels, gradually weakening bone tissue over time.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Bone supplements help:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Maintain bone mineral density</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Support healthy bone remodeling</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Improve mineral utilization</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Reduce nutritional deficiency risks</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Support joint movement and muscle function</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">The most effective bone-support formulas usually combine:</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Calcium Carbonate&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin D3&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin K&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">These nutrients work together rather than individually.</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">1. Calcium Carbonate 🦴</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Why Calcium Is Essential</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Calcium is the primary mineral found in bones and teeth. Nearly 99% of the body\'s calcium is stored in the skeleton.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Without sufficient calcium intake, the body removes calcium from bones to support:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Muscle contraction</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Heart rhythm</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Nerve transmission</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Blood clotting</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">This weakens bones over time.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">According to the National Institutes of Health, adults generally require:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> 1000 mg daily for most adults</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> 1200 mg daily for older adults</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Importance of Calcium Carbonate</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Calcium carbonate is widely used because:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> High elemental calcium content</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Supports bone mineralization</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Helps maintain skeletal hardness</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Cost-effective and widely available</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Additional Benefit</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">It also supports:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Muscle performance</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Daily movement</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Nerve stability</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">For people with low dairy intake or poor dietary calcium, supplementation may be particularly helpful.</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">2. Vitamin D3 ☀️</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Why Vitamin D3 Is Critical</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin D3 is essential because calcium cannot be properly absorbed without it.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Even if calcium intake is adequate, low vitamin D reduces calcium absorption significantly.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">According to National Institute of Arthritis and Musculoskeletal and Skin Diseases:</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin D helps:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Increase intestinal calcium absorption</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Maintain muscle strength</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Reduce risk of osteomalacia</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Support bone mineral balance</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Why Deficiency Is Common</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin D deficiency is common because:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Limited sunlight exposure</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Indoor lifestyle</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Aging skin produces less vitamin D</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Poor dietary intake</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Daily Importance</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Recommended daily intake:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> 600 IU for adults</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> 800 IU after age 70</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Additional Benefit</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin D3 also helps support balance and muscle coordination, which indirectly reduces fall risk.</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">3. Vitamin K 🧬</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Why Vitamin K Matters for Bones</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin K plays a major role in activating proteins that direct calcium into bones.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Without adequate vitamin K:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Calcium may not be efficiently incorporated into bone tissue</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Bone remodeling may be less effective</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Recent research published in PubMed shows vitamin K supports activation of osteocalcin, a protein directly involved in bone strength.&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Bone Functions of Vitamin K</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Supports calcium regulation</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Supports bone density maintenance</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Helps bone protein activation</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Supports long-term skeletal integrity</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Why It Works Well with Vitamin D3</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin D helps absorb calcium.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Vitamin K helps place calcium where it belongs.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">This synergy is one reason many modern bone supplements combine both nutrients.</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Additional Nutrients That Also Support Bone Health 🌿</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Strong bones need more than only calcium.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Other supportive nutrients include:</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Magnesium</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Helps convert vitamin D into its active form and supports bone matrix strength.</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Phosphorus</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Essential part of bone mineral structure.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Zinc</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Supports bone tissue repair.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Protein</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Bone is partly made of protein matrix, not only minerals.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Lifestyle Factors That Improve Bone Strength 🚶☀️</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Supplements work best when combined with healthy habits.</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Daily Bone-Support Habits</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Walking</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Strength training</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Sunlight exposure</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Adequate hydration</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Balanced protein intake</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Reduced smoking</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Limited soft drinks excess</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">According to the International Osteoporosis Foundation, exercise remains one of the strongest non-supplement methods to preserve bone density.&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Who Needs Bone Supplements Most? 💙</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Bone-support supplements may benefit:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Adults over 40</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Elderly individuals</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Women after menopause</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> People with low dairy intake</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Individuals with limited sunlight exposure</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Sedentary individuals</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> People with nutritional deficiencies</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Benefits of Bone Health Supplements ✨</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Enhance bone density</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Support mineral absorption</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Maintain skeletal strength</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Improve mobility</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Support muscle function</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Help reduce nutritional gaps</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Support long-term wellness</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Scientific Sources 📚</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Main references used:</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">NIAMS Bone Health Guidelines&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">NIH Calcium Fact Sheet&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">International Osteoporosis Foundation&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">PubMed Bone Nutrition Review 2024&nbsp;</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Conclusion 💙</span></p><p><br></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Strong bones require continuous nutritional support throughout life.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">The combination of:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Calcium</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Vitamin D3</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Vitamin K</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">provides one of the most effective nutritional foundations for maintaining bone density, supporting mobility, and preserving skeletal strength over time.</span></p><p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Supplements are most effective when combined with:</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Balanced diet</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Physical activity</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Sunlight exposure</span></p><p><span style=\"background-color: transparent; color: rgb(106, 168, 79);\">✔</span><span style=\"background-color: transparent; color: rgb(0, 0, 0);\"> Long term consistency</span></p><p><br></p>', 'gallery/gallery_69c635dcc1768.jpeg', 1, NULL, '0', 'Best Supplements for Strong Bones', 0, '2026-01-04 07:28:19', '2026-03-27 08:12:38');
INSERT INTO `blog_posts` (`id`, `category_id`, `author_id`, `title`, `slug`, `excerpt`, `content`, `featured_image`, `is_published`, `published_at`, `meta_title`, `meta_description`, `views`, `created_at`, `updated_at`) VALUES
(4, 1, 1, 'aaaaaaaaa', 'aaaaaaaaa', 'aaaaaaaaaaaaa', '<p>aaaaaaaaaaaaaaaaaaaaaaaaa</p>', 'gallery/gallery_69c635dcc1768.jpeg', 1, NULL, 'aaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 0, '2026-03-27 17:12:12', '2026-03-27 17:12:12'),
(5, 4, 1, 'aaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaa', '<p>qqqqqqqqqqqqq</p>', 'gallery/gallery_69c2a231f3d9f.png', 1, NULL, 'qqqqqqqqqqqqqqq', 'qqqqqqqqqqqqqq', 0, '2026-03-27 17:14:47', '2026-03-27 17:14:47');

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `tags` text NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'For subcategories',
  `display_order` int(11) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `tags`, `image`, `parent_id`, `display_order`, `is_active`, `created_at`, `updated_at`) VALUES
(21, 'Skin Care', 'skin-care', 'Skin Care', '', 'gallery/gallery_69a867475295d.png', NULL, 0, 1, '2026-03-06 19:05:52', '2026-03-16 07:40:12'),
(22, 'women\'s health', 'women-s-health', 'women\'s health', '', 'gallery/gallery_69a86747596e2.png', NULL, 0, 1, '2026-03-06 19:06:12', '2026-03-16 07:40:20'),
(26, 'Men\'s Health', 'men-s-health', 'Men\'s Health', '', 'gallery/gallery_69a8674754bea.png', NULL, 0, 1, '2026-03-06 19:12:52', '2026-03-16 07:39:18'),
(28, 'Multivitamin', 'multivitamin', 'Multivitamin', '', 'gallery/gallery_69a867475790c.png', NULL, 0, 1, '2026-03-06 19:16:41', '2026-03-16 07:39:55'),
(29, 'Bones & Joints', 'bones-joints', 'Bones & Joints', '', 'gallery/gallery_69a867474851c.png', NULL, 0, 1, '2026-03-06 19:17:13', '2026-03-16 07:38:53'),
(30, 'Immune Support', 'immune-support', 'Immune Support', '', 'gallery/gallery_69a867475295d.png', NULL, 0, 1, '2026-03-06 19:17:39', '2026-03-16 07:40:27');

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

--
-- Table structure for table `contact_messages`
--

CREATE TABLE `contact_messages` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `subject` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `status` enum('new','read','replied','archived') DEFAULT 'new',
  `replied_at` timestamp NULL DEFAULT NULL,
  `replied_by` int(11) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `coupons`
--

CREATE TABLE `coupons` (
  `id` int(11) NOT NULL,
  `code` varchar(50) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `discount_type` enum('percentage','fixed') NOT NULL DEFAULT 'percentage',
  `discount_value` decimal(10,2) NOT NULL,
  `min_order_amount` decimal(10,2) DEFAULT NULL,
  `max_discount_amount` decimal(10,2) DEFAULT NULL,
  `valid_from` datetime DEFAULT NULL,
  `valid_until` datetime DEFAULT NULL,
  `max_uses` int(11) DEFAULT NULL,
  `used_count` int(11) DEFAULT 0,
  `max_uses_per_user` int(11) DEFAULT 1,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `coupons`
--

INSERT INTO `coupons` (`id`, `code`, `description`, `discount_type`, `discount_value`, `min_order_amount`, `max_discount_amount`, `valid_from`, `valid_until`, `max_uses`, `used_count`, `max_uses_per_user`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'WELCOME10', 'Welcome discount for new customers', 'percentage', 10.00, 50.00, 20.00, '2025-01-01 00:00:00', '2025-12-31 23:59:59', 1000, 0, 1, 1, '2026-01-02 20:32:20', '2026-01-02 20:32:20'),
(2, 'SAVE20', 'Save 20% on orders over $100', 'percentage', 20.00, 100.00, 50.00, '2025-01-01 00:00:00', '2025-12-31 23:59:59', 500, 0, 3, 1, '2026-01-02 20:32:20', '2026-01-02 20:32:20'),
(3, 'FLAT15', 'Flat $15 off on orders over $75', 'fixed', 15.00, 75.00, NULL, '2025-01-01 00:00:00', '2025-12-31 23:59:59', NULL, 0, 5, 1, '2026-01-02 20:32:20', '2026-01-02 20:32:20'),
(4, 'NEWYEAR2025', 'New Year Special - 25% off', 'percentage', 25.00, 150.00, 100.00, '2025-01-01 00:00:00', '2025-01-15 23:59:59', 200, 0, 1, 1, '2026-01-02 20:32:20', '2026-01-02 20:32:20');

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

--
-- Table structure for table `gallery`
--

CREATE TABLE `gallery` (
  `id` int(11) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `original_name` varchar(255) NOT NULL,
  `file_size` int(11) NOT NULL,
  `mime_type` varchar(50) NOT NULL,
  `uploaded_by` int(10) UNSIGNED NOT NULL,
  `uploaded_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `gallery`
--

INSERT INTO `gallery` (`id`, `filename`, `original_name`, `file_size`, `mime_type`, `uploaded_by`, `uploaded_at`) VALUES
(5, 'gallery_69a867474851c.png', 'Multivitamins_100x_crop_center.png', 14587, 'image/png', 1, '2026-03-04 17:09:27'),
(6, 'gallery_69a867475295d.png', 'Nutrisports_100x_crop_center.png', 12690, 'image/png', 1, '2026-03-04 17:09:27'),
(7, 'gallery_69a8674754bea.png', 'men_health_icon_61d90a74-1cfe-45ce-8d59-04194a0b496f_100x_crop_center.png', 11793, 'image/png', 1, '2026-03-04 17:09:27'),
(8, 'gallery_69a867475790c.png', 'weight_management_icon_5d78fa5b-282f-4762-adf6-3a7abfd9abd5_100x_crop_center.png', 14238, 'image/png', 1, '2026-03-04 17:09:27'),
(9, 'gallery_69a86747596e2.png', 'woman_health_icon_2570e520-3fb7-404c-9786-fa2ddac60a9f_100x_crop_center.png', 10345, 'image/png', 1, '2026-03-04 17:09:27'),
(10, 'gallery_69a87670d2913.png', 'Folic-Acid_1_785x.png', 92129, 'image/png', 1, '2026-03-04 18:14:08'),
(11, 'gallery_69a87670f11de.png', 'B-50_5d5b077c-c7f6-4f13-80d3-2c5c434c8746_785x.png', 97181, 'image/png', 1, '2026-03-04 18:14:08'),
(12, 'gallery_69a876710429f.png', 'BZOLVEbox_785x.png', 94800, 'image/png', 1, '2026-03-04 18:14:09'),
(13, 'gallery_69a87713877e2.png', 'HALDI_21_960x600.png', 178510, 'image/png', 1, '2026-03-04 18:16:51'),
(14, 'gallery_69a8771394af3.png', 'cherries_960x600.png', 135895, 'image/png', 1, '2026-03-04 18:16:51'),
(44, 'gallery_69c2a1d724d26.png', '20260324_1831_Image_Generation_remix_01kmg0nxnxfmnv5sbr04tk4qyv (1).png', 436130, 'image/png', 1, '2026-03-24 14:38:15'),
(45, 'gallery_69c2a231f3d9f.png', 'WhatsApp_Image_2026_03_07_at_12_26_23_AM__1_.png', 424028, 'image/png', 1, '2026-03-24 14:39:45'),
(46, 'gallery_69c2a2a8d95aa.png', 'WhatsApp_Image_2026_03_24_at_6_27_27_PM.png', 456438, 'image/png', 1, '2026-03-24 14:41:44'),
(47, 'gallery_69c2a315dc8d9.png', 'WhatsApp_Image_2026_03_06_at_9_05_31_PM.png', 404428, 'image/png', 1, '2026-03-24 14:43:33'),
(48, 'gallery_69c2a36933691.png', 'WhatsApp_Image_2026_03_07_at_12_21_49_AM.png', 379134, 'image/png', 1, '2026-03-24 14:44:57'),
(49, 'gallery_69c2a3cb37bd1.png', 'WhatsApp_Image_2026_03_07_at_12_21_50_AM.png', 396434, 'image/png', 1, '2026-03-24 14:46:35'),
(51, 'gallery_69c2a6aef0684.png', 'WhatsApp_Image_2026_03_24_at_7_54_29_PM (1).png', 457192, 'image/png', 1, '2026-03-24 14:58:54'),
(52, 'gallery_69c2a8078e5b1.png', '20260324_2002_Image Generation_remix_01kmg5v79se99bkz33tv3meybe (2) (1).png', 474277, 'image/png', 1, '2026-03-24 15:04:39'),
(53, 'gallery_69c635dcc1768.jpeg', 'WhatsApp Image 2026-03-26 at 11.23.05 PM.jpeg', 408237, 'image/jpeg', 1, '2026-03-27 07:46:36');

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

--
-- Table structure for table `loyalty_transactions`
--

CREATE TABLE `loyalty_transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `order_id` int(10) UNSIGNED DEFAULT NULL,
  `type` enum('earn_pending','earn_release','expire','adjustment') NOT NULL,
  `coins` int(11) NOT NULL,
  `status` enum('pending','completed','cancelled','expired') NOT NULL DEFAULT 'pending',
  `note` varchar(255) DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `completed_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `newsletter_subscribers`
--

CREATE TABLE `newsletter_subscribers` (
  `id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `status` enum('active','unsubscribed') DEFAULT 'active',
  `subscribed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `unsubscribed_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(10) UNSIGNED NOT NULL,
  `order_number` varchar(50) NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `customer_name` varchar(100) NOT NULL,
  `customer_email` varchar(100) DEFAULT NULL,
  `customer_phone` varchar(20) NOT NULL,
  `shipping_address` text NOT NULL,
  `city` varchar(50) NOT NULL,
  `postal_code` varchar(10) DEFAULT NULL,
  `subtotal` decimal(10,2) NOT NULL,
  `shipping_fee` decimal(10,2) DEFAULT 0.00,
  `discount` decimal(10,2) DEFAULT 0.00,
  `total_amount` decimal(10,2) NOT NULL,
  `payment_method` enum('cod') DEFAULT 'cod',
  `order_status` enum('pending','confirmed','processing','delivered','cancelled') DEFAULT 'pending',
  `payment_status` enum('unpaid','paid') DEFAULT 'unpaid',
  `notes` text DEFAULT NULL,
  `admin_notes` text DEFAULT NULL,
  `whatsapp_sent` tinyint(1) DEFAULT 0,
  `email_sent` tinyint(1) DEFAULT 0,
  `email_sent_at` datetime DEFAULT NULL,
  `whatsapp_sent_at` datetime DEFAULT NULL,
  `confirmed_at` datetime DEFAULT NULL,
  `delivered_at` datetime DEFAULT NULL,
  `cancelled_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `order_number`, `user_id`, `customer_name`, `customer_email`, `customer_phone`, `shipping_address`, `city`, `postal_code`, `subtotal`, `shipping_fee`, `discount`, `total_amount`, `payment_method`, `order_status`, `payment_status`, `notes`, `admin_notes`, `whatsapp_sent`, `email_sent`, `email_sent_at`, `whatsapp_sent_at`, `confirmed_at`, `delivered_at`, `cancelled_at`, `created_at`, `updated_at`) VALUES
(6, '0', 6, 'John Smith', 'john@example.com', '+923082866729', '123 Main Street, Apt 101', 'New York', '1000112', 602.00, 0.00, 0.00, 602.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 1, '2026-01-04 13:27:51', NULL, NULL, NULL, NULL, '2026-01-04 08:27:51', '2026-01-04 08:27:51'),
(11, 'HP17675156399020', 6, 'John Smith', 'john@example.com', '+923082866729', '123 Main Street, Apt 101', 'New York', '1000112', 602.00, 0.00, 0.00, 602.00, 'cod', 'pending', 'unpaid', 'ssssssssssss', NULL, 0, 1, '2026-01-04 13:33:59', NULL, NULL, NULL, NULL, '2026-01-04 08:33:59', '2026-01-04 08:33:59'),
(12, 'HP17675159488054', 6, 'John Smith', 'john@example.com', '+923082866729', '123 Main Street, Apt 101', 'New York', '1000112', 600.00, 0.00, 0.00, 600.00, 'cod', 'pending', 'unpaid', 'wwwwwwwwwwwwwwwwwwwww', NULL, 0, 1, '2026-01-04 13:39:08', NULL, NULL, NULL, NULL, '2026-01-04 08:39:08', '2026-01-04 08:39:08'),
(13, 'HP17727859771831', NULL, 'abc abc', 'abc@gmail.com', '+10310000000', 'street# 6', 'abc', '60000', 0.00, 50.00, 0.00, 50.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-06 08:32:57', '2026-03-06 08:32:57'),
(14, 'HP17728135549388', NULL, 'abc abc', 'abc@gmail.com', '+922222223128888732', 'street# 6', 'abc', '60000', 0.00, 50.00, 0.00, 50.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-06 16:12:34', '2026-03-06 16:12:34'),
(15, 'HP17729030304573', NULL, 'abc abc', 'abc@gmail.com', '+923100000000', 'street# 6', 'abc', '60000', 5800.00, 0.00, 0.00, 5800.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-07 17:03:50', '2026-03-07 17:03:50'),
(16, 'HP17729086004029', NULL, 'adnan', 'adnan@gmail.com', '03007306299', 'Line 1', 'Multan', '66000', 3000.00, 0.00, 0.00, 3000.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-07 18:36:40', '2026-03-07 18:36:40'),
(17, 'HP17733984633386', NULL, 'iqra iqra javed', 'iqraansari9809@gmail.com', '+923128888732', 'street# 6', 'Multan', '60000', 1500.00, 0.00, 0.00, 1500.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-13 10:41:03', '2026-03-13 10:41:03'),
(18, 'HP17737243495616', NULL, 'iqra iqra javed', 'iqraansari9809@gmail.com', '+923128888732', 'street# 6', 'Multan', '60000', 1800.00, 0.00, 0.00, 1800.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-17 05:12:29', '2026-03-17 05:12:29'),
(19, 'HP17744500143670', NULL, 'iqra iqra javed', 'iqraansari9809@gmail.com', '+923128888732', 'street# 6', 'Multan', '60000', 1512.00, 0.00, 0.00, 1512.00, 'cod', 'pending', 'unpaid', '', NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, '2026-03-25 14:46:54', '2026-03-25 14:46:54');

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

--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `id` int(10) UNSIGNED NOT NULL,
  `order_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `product_name` varchar(200) NOT NULL,
  `product_image` varchar(255) DEFAULT NULL,
  `quantity` int(11) NOT NULL,
  `unit_price` decimal(10,2) NOT NULL,
  `total_price` decimal(10,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` (`id`, `order_id`, `product_id`, `product_name`, `product_image`, `quantity`, `unit_price`, `total_price`, `created_at`) VALUES
(11, 6, 5, 'Multivitamin Complex - Daily Health', 'gallery_695a090924c20.png', 1, 600.00, 600.00, '2026-01-04 08:27:51'),
(12, 6, 12, 'sss', 'gallery_695a090924c20.png', 1, 2.00, 2.00, '2026-01-04 08:27:51'),
(13, 11, 5, 'Multivitamin Complex - Daily Health', 'gallery_695a090924c20.png', 1, 600.00, 600.00, '2026-01-04 08:33:59'),
(14, 11, 12, 'sss', 'gallery_695a090924c20.png', 1, 2.00, 2.00, '2026-01-04 08:33:59'),
(15, 12, 5, 'Multivitamin Complex - Daily Health', 'gallery_695a090924c20.png', 1, 600.00, 600.00, '2026-01-04 08:39:08'),
(16, 13, 12, 'sss', 'gallery_69a87670f11de.png', 0, 2.00, 0.00, '2026-03-06 08:32:57'),
(17, 14, 12, 'sss', 'gallery_69a87670f11de.png', 0, 2.00, 0.00, '2026-03-06 16:12:34'),
(18, 15, 18, 'Lubovate Night Cream', 'gallery_69ab296e998df.jpeg', 4, 1450.00, 5800.00, '2026-03-07 17:03:50'),
(19, 16, 17, 'Top-X', 'gallery_69ab2d413eb2b.jpeg', 2, 1500.00, 3000.00, '2026-03-07 18:36:40'),
(20, 17, 17, 'Top-X', 'gallery_69ab2d413eb2b.jpeg', 1, 1500.00, 1500.00, '2026-03-13 10:41:03'),
(21, 18, 5, 'gestomed cough syrup', 'gallery_69b7b551ee712.png', 6, 300.00, 1800.00, '2026-03-17 05:12:29'),
(22, 19, 12, 'Jalariz Antacid Syrup', 'gallery_69c2a8078e5b1.png', 6, 252.00, 1512.00, '2026-03-25 14:46:54');

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

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

CREATE TABLE `payments` (
  `id` int(10) UNSIGNED NOT NULL,
  `order_id` int(10) UNSIGNED NOT NULL,
  `payment_method` enum('cod') DEFAULT 'cod',
  `amount` decimal(10,2) NOT NULL,
  `payment_status` enum('pending','completed','failed') DEFAULT 'pending',
  `transaction_id` varchar(100) DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `payments`
--

INSERT INTO `payments` (`id`, `order_id`, `payment_method`, `amount`, `payment_status`, `transaction_id`, `paid_at`, `created_at`, `updated_at`) VALUES
(3, 6, 'cod', 602.00, 'pending', NULL, NULL, '2026-01-04 08:27:51', '2026-01-04 08:27:51'),
(4, 11, 'cod', 602.00, 'pending', NULL, NULL, '2026-01-04 08:33:59', '2026-01-04 08:33:59'),
(5, 12, 'cod', 600.00, 'pending', NULL, NULL, '2026-01-04 08:39:08', '2026-01-04 08:39:08'),
(6, 13, 'cod', 50.00, 'pending', NULL, NULL, '2026-03-06 08:32:57', '2026-03-06 08:32:57'),
(7, 14, 'cod', 50.00, 'pending', NULL, NULL, '2026-03-06 16:12:34', '2026-03-06 16:12:34'),
(8, 15, 'cod', 5800.00, 'pending', NULL, NULL, '2026-03-07 17:03:50', '2026-03-07 17:03:50'),
(9, 16, 'cod', 3000.00, 'pending', NULL, NULL, '2026-03-07 18:36:40', '2026-03-07 18:36:40'),
(10, 17, 'cod', 1500.00, 'pending', NULL, NULL, '2026-03-13 10:41:03', '2026-03-13 10:41:03'),
(11, 18, 'cod', 1800.00, 'pending', NULL, NULL, '2026-03-17 05:12:29', '2026-03-17 05:12:29'),
(12, 19, 'cod', 1512.00, 'pending', NULL, NULL, '2026-03-25 14:46:54', '2026-03-25 14:46:54');

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

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

CREATE TABLE `products` (
  `id` int(10) UNSIGNED NOT NULL,
  `category_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(200) NOT NULL,
  `slug` varchar(200) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `short_description` varchar(500) DEFAULT NULL,
  `ingredients_html` mediumtext DEFAULT NULL,
  `instructions_html` mediumtext DEFAULT NULL,
  `show_tab_details` tinyint(1) NOT NULL DEFAULT 1,
  `show_tab_ingredients` tinyint(1) NOT NULL DEFAULT 1,
  `show_tab_faqs` tinyint(1) NOT NULL DEFAULT 0,
  `show_tab_reviews` tinyint(1) NOT NULL DEFAULT 1,
  `price` decimal(10,2) NOT NULL,
  `original_price` decimal(10,2) DEFAULT NULL,
  `sku` varchar(50) DEFAULT NULL,
  `stock_quantity` int(11) DEFAULT 0,
  `low_stock_alert` int(11) DEFAULT 10,
  `main_image` varchar(255) NOT NULL,
  `is_featured` tinyint(1) DEFAULT 0,
  `is_active` tinyint(1) DEFAULT 1,
  `meta_title` varchar(200) DEFAULT NULL,
  `meta_description` text DEFAULT NULL,
  `views` int(11) DEFAULT 0,
  `manual_avg_rating` decimal(3,2) DEFAULT NULL,
  `manual_review_count` int(11) NOT NULL DEFAULT 0,
  `wellness_coin_rate` decimal(10,2) NOT NULL DEFAULT 1.00,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `products` (`id`, `category_id`, `name`, `slug`, `description`, `short_description`, `ingredients_html`, `instructions_html`, `show_tab_details`, `show_tab_ingredients`, `show_tab_faqs`, `show_tab_reviews`, `price`, `original_price`, `sku`, `stock_quantity`, `low_stock_alert`, `main_image`, `is_featured`, `is_active`, `meta_title`, `meta_description`, `views`, `manual_avg_rating`, `manual_review_count`, `wellness_coin_rate`, `created_at`, `updated_at`) VALUES
(5, 30, 'gestomed cough syrup', 'gestomed-cough-syrup', '<h3>Product Description</h3>\r\n<p>Complete daily multivitamin with essential vitamins and minerals to support overall health and wellness.</p>\r\n<h4>Contains:</h4>\r\n<ul>\r\n<li>Vitamins A, C, D, E, K</li>\r\n<li>B-Complex vitamins</li>\r\n<li>Zinc, Magnesium, Calcium</li>\r\n<li>Essential trace minerals</li>\r\n</ul>', 'Complete multivitamin supplement with essential vitamins and minerals for daily health support.', '', '', 1, 1, 0, 1, 300.00, 300.00, 'SUP-LBV-001', 194, 10, 'gallery_69c2a6aef0684.png', 1, 1, 'Daily Multivitamin Complex - Complete Nutrition Support', 'Complete multivitamin with essential vitamins and minerals for daily health and wellness.', 99, 0.00, 0, 1.00, '2026-01-02 20:34:11', '2026-03-29 20:10:53'),
(12, 30, 'Jalariz Antacid Syrup', 'jalariz-antacid-syrup', '<p>sss</p>', 'ss', '', '', 1, 1, 0, 1, 280.00, 280.00, '100', 94, 10, 'gallery_69c2a8078e5b1.png', 1, 1, 'f', 'f', 180, 0.00, 0, 1.00, '2026-01-04 06:15:38', '2026-03-29 09:06:04'),
(13, 29, 'M-Scor Tab', 'm-scor-tab', '<p>Lubovate face wash</p>', 'M-Scor calcium vit D3 & k2 tab', '', '', 1, 1, 0, 1, 650.00, 650.00, 'SUP-SUP-002', 200, 10, 'gallery_69c2a2a8d95aa.png', 1, 1, 'M-Scor calcium vit D3 & k2 tab', 'M-Scor calcium vit D3 & k2 tab', 53, 0.00, 0, 1.00, '2026-03-06 19:29:35', '2026-03-30 03:49:35'),
(14, 22, 'cemolin plus', 'cemolin-plus', '<p>cemolin plus iron tab</p>', 'cemolin plus iron tab', '', '', 1, 1, 0, 1, 650.00, 650.00, 'SUP-TAB-001', 200, 10, 'gallery_69c2a315dc8d9.png', 1, 1, 'cemolin plus iron tab', 'cemolin plus iron tab', 49, 0.00, 0, 1.00, '2026-03-06 19:32:57', '2026-03-30 09:18:01'),
(15, 21, 'Lubovate face wash', 'lubovate-face-wash', '<p>M-Scor calcium vit D3 &amp; k2 tab</p>', 'Lubovate face wash', '', '', 1, 1, 0, 1, 1000.00, 1000.00, 'SUP-LUB-002', 200, 10, 'gallery_69c2a36933691.png', 1, 1, '', '', 43, 0.00, 0, 1.00, '2026-03-06 19:35:38', '2026-03-29 23:36:44'),
(16, 28, 'ginx plus', 'ginx-plus', '<p>ginx plus multivitamin tab</p>', 'ginx plus multivitamin tab', '', '', 1, 1, 0, 1, 1100.00, 1200.00, 'SUP-TAB-003', 200, 10, 'gallery_69c2a231f3d9f.png', 1, 1, 'ginx plus multivitamin tab', 'ginx plus multivitamin tab', 56, 0.00, 0, 1.00, '2026-03-06 19:37:39', '2026-03-30 06:47:11'),
(17, 26, 'Top-X', 'top-x', '<p>Top-X</p>', 'Top-X', '', '', 1, 1, 0, 1, 1500.00, 1500.00, 'SUP-TAB-004', 1997, 10, 'gallery_69c2a1d724d26.png', 1, 1, 'Top-X', 'Top-X', 92, 0.00, 0, 1.00, '2026-03-06 19:39:18', '2026-03-30 06:47:06'),
(18, 21, 'Lubovate Night Cream', 'lubovate-night-cream', '<p>Lubovate Night Cream</p>', 'Lubovate Night Cream', '<style>\r\n.ingredients-section {\r\n  background: #f7f7f7;\r\n  padding: 50px 20px;\r\n  font-family: \'Poppins\', sans-serif;\r\n}\r\n\r\n.container {\r\n  max-width: 900px;\r\n  margin: auto;\r\n}\r\n\r\n.section-title {\r\n  background: #d4a62a;\r\n  color: #fff;\r\n  text-align: center;\r\n  padding: 12px 20px;\r\n  border-radius: 30px;\r\n  font-size: 22px;\r\n  font-weight: 600;\r\n  margin-bottom: 30px;\r\n}\r\n\r\n.ingredient {\r\n  margin-bottom: 25px;\r\n  border-bottom: 1px solid #f0e4b8;\r\n}\r\n\r\n.ingredient h3 {\r\n  color: #c99700;\r\n  font-size: 20px;\r\n  font-weight: 600;\r\n  margin-bottom: 10px;\r\n  text-decoration: underline;\r\n}\r\n\r\n.ingredient ul {\r\n  padding-left: 20px;\r\n}\r\n\r\n.ingredient ul li {\r\n  margin-bottom: 6px;\r\n  color: #333;\r\n  font-size: 15px;\r\n  line-height: 1.6;\r\n}\r\n\r\n/* Responsive */\r\n@media (max-width: 768px) {\r\n  .section-title {\r\n    font-size: 18px;\r\n    padding: 10px;\r\n  }\r\n\r\n  .ingredient h3 {\r\n    font-size: 18px;\r\n  }\r\n\r\n  .ingredient ul li {\r\n    font-size: 14px;\r\n  }\r\n}\r\n</style> \r\n<section class=\"ingredients-section\">\r\n  <div class=\"container\">\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Glutathione (Reduced)</h3>\r\n      <ul>\r\n        <li>Powerful skin whitening antioxidant</li>\r\n        <li>Reduces melanin formation during night repair cycle</li>\r\n        <li>Detoxifies skin cells and improves complexion</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Niacinamide</h3>\r\n      <ul>\r\n        <li>Strengthens skin barrier overnight</li>\r\n        <li>Controls oil & reduces redness</li>\r\n        <li>Improves uneven tone and texture</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Vitamin E (Tocopheryl Acetate) – 1%</h3>\r\n      <ul>\r\n        <li>Repairs skin damage caused by pollution & UV exposure</li>\r\n        <li>Deep nourishment and moisture retention</li>\r\n        <li>Improves elasticity</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Hyaluronic Acid</h3>\r\n      <ul>\r\n        <li>Deep hydration throughout the night</li>\r\n        <li>Plumps skin and smooths fine lines</li>\r\n        <li>Prevents dryness caused by retinol</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Retinol (Encapsulated)</h3>\r\n      <ul>\r\n        <li>Stimulates collagen production at night</li>\r\n        <li>Accelerates cell renewal & skin regeneration</li>\r\n        <li>Reduces wrinkles, acne marks & pigmentation</li>\r\n        <li>Encapsulation minimizes irritation</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Vitamin C (Ascorbic Acid) – 0.2%</h3>\r\n      <ul>\r\n        <li>Enhances overnight glow</li>\r\n        <li>Supports collagen synthesis</li>\r\n        <li>Fights oxidative stress</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <div class=\"ingredient\">\r\n      <h3>Alpha Arbutin (1%)</h3>\r\n      <ul>\r\n        <li>Inhibits excess melanin production</li>\r\n        <li>Reduces dark spots, melasma & hyperpigmentation</li>\r\n        <li>Safe for nightly use</li>\r\n      </ul>\r\n    </div>\r\n\r\n  </div>\r\n</section>', '<style>\r\n.usage-section {\r\n  background: #f7f7f7;\r\n  padding: 40px 20px;\r\n  font-family: \'Poppins\', sans-serif;\r\n}\r\n\r\n.usage-wrapper {\r\n  display: flex;\r\n  gap: 40px;\r\n  max-width: 1000px;\r\n  margin: auto;\r\n  flex-wrap: wrap;\r\n}\r\n\r\n.usage-box {\r\n  flex: 1;\r\n  min-width: 280px;\r\n}\r\n\r\n/* SAME PILL STYLE */\r\n.pill-title {\r\n  display: inline-block;\r\n  border: 2px solid #c89b00;\r\n  border-radius: 30px;\r\n  padding: 8px 18px;\r\n  font-weight: 600;\r\n  margin-bottom: 20px;\r\n  background: #fff;\r\n}\r\n\r\n/* LIST STYLE */\r\n.usage-box ul {\r\n  list-style: none;\r\n  padding: 0;\r\n}\r\n\r\n.usage-box li {\r\n  font-size: 15px;\r\n  color: #333;\r\n  margin-bottom: 10px;\r\n  display: flex;\r\n  align-items: center;\r\n}\r\n\r\n/* GOLD BULLET */\r\n.usage-box li::before {\r\n  content: \"\";\r\n  width: 10px;\r\n  height: 10px;\r\n  background: #c89b00;\r\n  border-radius: 50%;\r\n  margin-right: 12px;\r\n  display: inline-block;\r\n}\r\n\r\n/* RESPONSIVE */\r\n@media (max-width: 768px) {\r\n  .usage-wrapper {\r\n    flex-direction: column;\r\n  }\r\n}\r\n</style>\r\n<section class=\"usage-section\">\r\n\r\n  <div class=\"usage-wrapper\">\r\n\r\n    <!-- HOW TO USE -->\r\n    <div class=\"usage-box\">\r\n      <h3 class=\"pill-title\">How to Use</h3>\r\n      <ul>\r\n        <li>Cleanse face thoroughly before bedtime</li>\r\n        <li>Apply a small amount evenly on face & neck</li>\r\n        <li>Massage gently until absorbed</li>\r\n        <li>Use once daily at night only</li>\r\n      </ul>\r\n    </div>\r\n\r\n    <!-- CAUTION -->\r\n    <div class=\"usage-box\">\r\n      <h3 class=\"pill-title\">Caution</h3>\r\n      <ul>\r\n        <li>For external use only</li>\r\n        <li>Avoid contact with eyes</li>\r\n        <li>Mild tingling may occur initially</li>\r\n        <li>Use sunscreen during daytime</li>\r\n        <li>Store below 30°C, away from sunlight</li>\r\n        <li>Perform a patch test before first use</li>\r\n        <li>Discontinue use if irritation occurs</li>\r\n        <li>Keep out of reach of children</li>\r\n      </ul>\r\n    </div>\r\n\r\n  </div>\r\n\r\n</section>', 0, 1, 1, 0, 1450.00, 1450.00, 'SUP-LBV-001', 996, 10, 'gallery_69c2a3cb37bd1.png', 1, 1, '<title>M-SCOR Tablets | Calcium, Vitamin D3 & K2 Bone Health Formula</title>', 'Lubovate Night Cream', 97, 0.00, 0, 1.00, '2026-03-06 19:43:21', '2026-03-30 08:18:57');

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

--
-- Table structure for table `product_deals`
--

CREATE TABLE `product_deals` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `min_quantity` int(11) NOT NULL,
  `discount_type` enum('percentage','fixed_amount','fixed_price') NOT NULL DEFAULT 'percentage',
  `discount_value` decimal(10,2) NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `end_at` datetime DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_deals`
--

INSERT INTO `product_deals` (`id`, `product_id`, `min_quantity`, `discount_type`, `discount_value`, `label`, `end_at`, `is_active`, `sort_order`, `created_at`, `updated_at`) VALUES
(23, 17, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-24 14:38:42', '2026-03-24 14:38:42'),
(24, 16, 2, 'percentage', 2.00, '', NULL, 1, 0, '2026-03-24 14:39:58', '2026-03-24 14:39:58'),
(25, 16, 5, 'percentage', 3.00, '', NULL, 1, 1, '2026-03-24 14:39:58', '2026-03-24 14:39:58'),
(26, 16, 10, 'percentage', 5.00, '', NULL, 1, 2, '2026-03-24 14:39:58', '2026-03-24 14:39:58'),
(28, 14, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-24 14:43:46', '2026-03-24 14:43:46'),
(32, 5, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-24 14:59:06', '2026-03-24 14:59:06'),
(33, 12, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-24 15:04:56', '2026-03-24 15:04:56'),
(35, 13, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-24 15:13:27', '2026-03-24 15:13:27'),
(36, 15, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-24 15:13:42', '2026-03-24 15:13:42'),
(44, 18, 2, 'percentage', 10.00, '', NULL, 1, 0, '2026-03-27 19:58:20', '2026-03-27 19:58:20');

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

--
-- Table structure for table `product_faqs`
--

CREATE TABLE `product_faqs` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `question` varchar(255) NOT NULL,
  `answer` text DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_faqs`
--

INSERT INTO `product_faqs` (`id`, `product_id`, `question`, `answer`, `sort_order`, `is_active`, `created_at`) VALUES
(6, 18, 'How should I store this product?', 'Store in a cool, dry place below 30°C and keep away from direct sunlight to maintain product effectiveness.', 0, 1, '2026-03-27 19:58:20'),
(7, 18, 'Can pregnant or breastfeeding women use this product?', 'It is recommended to consult a healthcare professional before use, especially due to the presence of active ingredients like Retinol.', 1, 1, '2026-03-27 19:58:20'),
(8, 18, 'How long does it take to see results?', 'Visible improvements can typically be seen within 5-6 weeks of consistent use. Results may vary depending on individual skin type and concerns.', 2, 1, '2026-03-27 19:58:20'),
(9, 18, 'What is this night repair cream used for?', 'This advanced night repair cream is designed to work while you sleep, helping to repair, brighten, and deeply hydrate the skin. It targets dark spots, pigmentation, fine lines, and dullness for a healthier, more radiant complexion.', 3, 1, '2026-03-27 19:58:20'),
(10, 18, 'Can I use this cream every day?', 'Yes, this cream is formulated for daily use. For best results, apply it once every night as part of your skincare routine.', 4, 1, '2026-03-27 19:58:20');

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

--
-- Table structure for table `product_images`
--

CREATE TABLE `product_images` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `image_path` varchar(255) NOT NULL,
  `display_order` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `rating` tinyint(1) NOT NULL,
  `title` varchar(200) DEFAULT NULL,
  `comment` text NOT NULL,
  `is_approved` tinyint(1) DEFAULT 0,
  `approved_by` int(10) UNSIGNED DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ;

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

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

CREATE TABLE `settings` (
  `id` int(10) UNSIGNED NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `setting_type` enum('text','textarea','number','boolean','json') DEFAULT 'text',
  `description` varchar(255) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `settings` (`id`, `setting_key`, `setting_value`, `setting_type`, `description`, `updated_at`) VALUES
(1, 'site_name', 'Hizen Pharma', 'text', 'Website name', '2025-12-29 12:39:34'),
(2, 'site_email', 'hizenpharma@gmail.com', 'text', 'Contact email', '2025-12-29 12:39:34'),
(3, 'site_phone', '+923082866729', 'text', 'Contact phone', '2025-12-29 12:39:34'),
(4, 'whatsapp_number', '+923082866729', 'text', 'WhatsApp contact number', '2025-12-29 12:39:34'),
(5, 'whatsapp_message', 'Hello! I want to confirm my order #{order_number}', 'textarea', 'WhatsApp message template', '2025-12-29 12:39:34'),
(6, 'shipping_fee', '50', 'number', 'Default shipping fee', '2025-12-29 12:39:34'),
(7, 'free_shipping_threshold', '500', 'number', 'Free shipping above this amount', '2025-12-29 12:39:34'),
(8, 'site_address', '123 Medical Street, City, Country', 'textarea', 'Business address', '2025-12-29 12:39:34'),
(9, 'google_maps_url', '', 'text', 'Google Maps embed URL', '2025-12-29 12:39:34'),
(10, 'low_stock_alert', '10', 'number', 'Low stock alert threshold', '2025-12-29 12:39:34'),
(11, 'currency_symbol', '$', 'text', 'Currency symbol', '2025-12-29 12:39:34'),
(12, 'enable_reviews', '1', 'boolean', 'Enable product reviews', '2025-12-29 12:39:34'),
(13, 'auto_approve_reviews', '0', 'boolean', 'Auto approve reviews', '2025-12-29 12:39:34'),
(27, 'email_enabled', '0', 'text', NULL, '2026-01-02 20:32:30'),
(28, 'email_smtp_host', 'smtp.gmail.com', 'text', NULL, '2026-01-02 20:32:30'),
(29, 'email_smtp_port', '587', 'text', NULL, '2026-01-02 20:32:30'),
(30, 'email_smtp_username', '', 'text', NULL, '2026-01-02 20:32:30'),
(31, 'email_smtp_password', '', 'text', NULL, '2026-01-02 20:32:30'),
(32, 'email_from_email', 'noreply@hizenpharma.com', 'text', NULL, '2026-01-02 20:32:30'),
(33, 'email_from_name', 'Hizen Pharma', 'text', NULL, '2026-01-02 20:32:30'),
(34, 'admin_email', 'admin@hizenpharma.com', 'text', NULL, '2026-01-02 20:32:30');

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

--
-- Table structure for table `user_loyalty_accounts`
--

CREATE TABLE `user_loyalty_accounts` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `available_coins` int(11) NOT NULL DEFAULT 0,
  `pending_coins` int(11) NOT NULL DEFAULT 0,
  `lifetime_coins` int(11) NOT NULL DEFAULT 0,
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `wishlist`
--

CREATE TABLE `wishlist` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `added_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for table `blog_categories`
--
ALTER TABLE `blog_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`);

--
-- Indexes for table `blog_posts`
--
ALTER TABLE `blog_posts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `author_id` (`author_id`),
  ADD KEY `is_published` (`is_published`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `parent_id` (`parent_id`),
  ADD KEY `is_active` (`is_active`);

--
-- Indexes for table `contact_messages`
--
ALTER TABLE `contact_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `status` (`status`),
  ADD KEY `created_at` (`created_at`),
  ADD KEY `email` (`email`);

--
-- Indexes for table `coupons`
--
ALTER TABLE `coupons`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `code` (`code`),
  ADD KEY `is_active` (`is_active`),
  ADD KEY `valid_until` (`valid_until`);

--
-- Indexes for table `gallery`
--
ALTER TABLE `gallery`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `filename` (`filename`),
  ADD KEY `uploaded_by` (`uploaded_by`),
  ADD KEY `idx_uploaded_at` (`uploaded_at`);

--
-- Indexes for table `loyalty_transactions`
--
ALTER TABLE `loyalty_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_loyalty_user` (`user_id`),
  ADD KEY `idx_loyalty_order` (`order_id`),
  ADD KEY `idx_loyalty_status` (`status`);

--
-- Indexes for table `newsletter_subscribers`
--
ALTER TABLE `newsletter_subscribers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `status` (`status`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `order_number` (`order_number`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `order_status` (`order_status`),
  ADD KEY `payment_status` (`payment_status`),
  ADD KEY `created_at` (`created_at`);

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_order_product` (`order_id`,`product_id`),
  ADD KEY `order_id` (`order_id`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`),
  ADD KEY `payment_status` (`payment_status`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `is_featured` (`is_featured`),
  ADD KEY `is_active` (`is_active`),
  ADD KEY `stock_quantity` (`stock_quantity`);

--
-- Indexes for table `product_deals`
--
ALTER TABLE `product_deals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_product_deals_product` (`product_id`),
  ADD KEY `idx_product_deals_active` (`is_active`,`end_at`);

--
-- Indexes for table `product_faqs`
--
ALTER TABLE `product_faqs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_product_faqs_product` (`product_id`),
  ADD KEY `idx_product_faqs_active` (`is_active`),
  ADD KEY `idx_product_faqs_sort` (`sort_order`);

--
-- Indexes for table `product_images`
--
ALTER TABLE `product_images`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_product_image_order` (`product_id`,`display_order`),
  ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uniq_review_user_product` (`user_id`,`product_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `is_approved` (`is_approved`),
  ADD KEY `rating` (`rating`),
  ADD KEY `approved_by` (`approved_by`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key` (`setting_key`);

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

--
-- Indexes for table `wishlist`
--
ALTER TABLE `wishlist`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `user_product` (`user_id`,`product_id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `product_id` (`product_id`);

--
-- AUTO_INCREMENT for table `blog_categories`
--
ALTER TABLE `blog_categories`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `blog_posts`
--
ALTER TABLE `blog_posts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

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

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

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

--
-- AUTO_INCREMENT for table `loyalty_transactions`
--
ALTER TABLE `loyalty_transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `order_items`
--
ALTER TABLE `order_items`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

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

--
-- AUTO_INCREMENT for table `product_deals`
--
ALTER TABLE `product_deals`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;

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

--
-- AUTO_INCREMENT for table `product_images`
--
ALTER TABLE `product_images`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `wishlist`
--
ALTER TABLE `wishlist`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `blog_posts`
--
ALTER TABLE `blog_posts`
  ADD CONSTRAINT `blog_posts_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `blog_categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `blog_posts_ibfk_2` FOREIGN KEY (`author_id`) REFERENCES `admins` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `categories`
--
ALTER TABLE `categories`
  ADD CONSTRAINT `categories_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `gallery`
--
ALTER TABLE `gallery`
  ADD CONSTRAINT `gallery_ibfk_1` FOREIGN KEY (`uploaded_by`) REFERENCES `admins` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `loyalty_transactions`
--
ALTER TABLE `loyalty_transactions`
  ADD CONSTRAINT `fk_loyalty_tx_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_loyalty_tx_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `order_items`
--
ALTER TABLE `order_items`
  ADD CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `payments`
--
ALTER TABLE `payments`
  ADD CONSTRAINT `payments_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `product_deals`
--
ALTER TABLE `product_deals`
  ADD CONSTRAINT `fk_product_deals_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `product_faqs`
--
ALTER TABLE `product_faqs`
  ADD CONSTRAINT `fk_product_faqs_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `product_images`
--
ALTER TABLE `product_images`
  ADD CONSTRAINT `product_images_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
  ADD CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `reviews_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `reviews_ibfk_3` FOREIGN KEY (`approved_by`) REFERENCES `admins` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `user_loyalty_accounts`
--
ALTER TABLE `user_loyalty_accounts`
  ADD CONSTRAINT `fk_loyalty_account_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `wishlist`
--
ALTER TABLE `wishlist`
  ADD CONSTRAINT `wishlist_product_fk` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `wishlist_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

