-- Dynamic client section + footer (fizasie). Run once in phpMyAdmin.
USE fizasie;

-- Stats / counters for home client section
CREATE TABLE IF NOT EXISTS stats_counters (
    id INT AUTO_INCREMENT PRIMARY KEY,
    value VARCHAR(50) NOT NULL,
    label VARCHAR(200) NOT NULL,
    sort_order INT DEFAULT 0,
    is_active TINYINT(1) DEFAULT 1,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

INSERT INTO stats_counters (value, label, sort_order) VALUES
('6+', 'Year of Excellence', 1),
('50+', 'Employee', 2),
('1000+', 'Projects Done', 3),
('30+', 'Happy Customers', 4);

-- Footer columns (title + body; body can be HTML or plain text with links)
CREATE TABLE IF NOT EXISTS footer_columns (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(200) NOT NULL,
    body TEXT,
    sort_order INT DEFAULT 0,
    is_active TINYINT(1) DEFAULT 1,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

INSERT INTO footer_columns (title, body, sort_order) VALUES
('Quick links', 'Home|index.php\nAbout us|about.php\nProducts|products.php\nContact us|contact.php', 1),
('Contact', 'Crimson Uni Quepack Pvt. Ltd.\nPlot No: 117, Sector 6A, SIDCUL\nHaridwar- 249403\n\ncrimsonhwr@gmail.com', 2),
('Hours', 'Mon – Sat: 9:00 AM – 6:00 PM\nSunday: Closed', 3);

-- Client section text + optional image (path under uploads/)
INSERT INTO site_settings (setting_key, setting_value) VALUES
('client_section_headline', 'A ONE STOP SOLUTION FOR WORLD CLASS QUALITY PRINTED PACKAGING PRODUCTS'),
('client_section_subtext', 'We create value with our clients, deliver consistently with the single aim to reach higher by making smart investments in technology for smart innovations that push the envelope.'),
('client_section_image', ''),
('footer_bottom_html', '')
ON DUPLICATE KEY UPDATE setting_key = setting_key;
