-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 03, 2026 at 10:11 AM
-- Server version: 8.0.45
-- PHP Version: 8.3.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `apptemplate_db`
--

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

--
-- Table structure for table `email_queue`
--

CREATE TABLE `email_queue` (
  `id` int NOT NULL,
  `recipient_email` varchar(255) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `body` longtext NOT NULL,
  `attachments` text,
  `status` enum('pending','sent','failed') NOT NULL DEFAULT 'pending',
  `error_message` text,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `sent_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

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

CREATE TABLE `settings` (
  `id` int NOT NULL,
  `setting_key` varchar(50) NOT NULL,
  `setting_value` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

INSERT INTO `settings` (`id`, `setting_key`, `setting_value`) VALUES
(1, 'app_name', 'Boilerplate Template'),
(2, 'seo_description', 'This is a full developer boilerplate for new projects.'),
(3, 'seo_keywords', 'boilerplate. christodev, developer, development'),
(4, 'logo_light', 'logo_light_1775028516.png'),
(5, 'logo_dark', 'logo_dark_1775028516.png'),
(6, 'favicon', 'favicon_1775028516.png'),
(7, 'theme_color', '#0260d3'),
(8, 'allow_registration', '1'),
(9, 'privacy_policy', '<p><em>Last Updated: March 2026</em></p>\r\n<h2>1. Introduction</h2>\r\n<p>We respect your privacy and are committed to protecting your personal data. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you visit our application or use our software services. This policy is designed to comply with the Protection of Personal Information Act (POPIA) of South Africa.</p>\r\n<h2>2. Information We Collect</h2>\r\n<p>We may collect personal identification information from you in a variety of ways, including, but not limited to, when you register on the site, log in, update your profile, and in connection with other activities, services, features, or resources we make available. The types of personal information we may collect include your name, email address, IP address, and system usage logs.</p>\r\n<h2>3. How We Use Your Information</h2>\r\n<p>We collect and use your personal information for the following purposes:</p>\r\n<ul>\r\n<li>To personalize user experience and deliver tailored software features.</li>\r\n<li>To improve our platform based on the information and feedback we receive.</li>\r\n<li>To send periodic emails regarding your account, updates, or related service information.</li>\r\n<li>To maintain an internal audit trail (system logs) to ensure the security and integrity of our systems.</li>\r\n</ul>\r\n<h2>4. Data Security and Protection</h2>\r\n<p>We adopt appropriate data collection, storage, and processing practices and security measures to protect against unauthorized access, alteration, disclosure, or destruction of your personal information, username, password, transaction information, and data stored on our application. All passwords are encrypted using secure hashing algorithms.</p>\r\n<h2>5. Sharing Your Personal Information</h2>\r\n<p>We do not sell, trade, or rent your personal identification information to others. We may share generic aggregated demographic information not linked to any personal identification information with our business partners and trusted affiliates for the purposes outlined above.</p>\r\n<h2>6. Your Rights</h2>\r\n<p>Under POPIA, you have the right to request access to the personal information we hold about you, to request that we correct or delete it, and to object to the processing of your personal information. You may update your basic information directly through your User Profile dashboard.</p>\r\n<h2>7. Contacting Us</h2>\r\n<p>If you have any questions about this Privacy Policy, the practices of this site, or your dealings with this platform, please contact us at:</p>\r\n<p><strong>Christo Lochenberg Developments</strong><br>Centurion, Gauteng, South Africa<br><strong>Email:</strong> <a href=\"mailto:info@christodev.co.za\">info@christodev.co.za</a><br><strong>Phone:</strong> +27 61 523 9126</p>'),
(10, 'terms_of_service', '<p><em>Last Updated: March 2026</em></p>\r\n<h2>1. Agreement to Terms</h2>\r\n<p>By accessing or using our application, you agree to be bound by these Terms of Service. If you disagree with any part of the terms, then you may not access the service. These terms apply to all visitors, users, and others who access or use the application.</p>\r\n<h2>2. User Accounts and Security</h2>\r\n<p>When you create an account with us, you must provide information that is accurate, complete, and current at all times. Failure to do so constitutes a breach of the Terms, which may result in immediate termination of your account. You are responsible for safeguarding the password that you use to access the service and for any activities or actions under your password.</p>\r\n<h2>3. Acceptable Use</h2>\r\n<p>You agree not to use the application in any way that causes, or may cause, damage to the application or impairment of the availability or accessibility of the application. You must not use our software in any way which is unlawful, illegal, fraudulent, or harmful, including any activity that violates South African law or IFRS accounting principles.</p>\r\n<h2>4. Intellectual Property</h2>\r\n<p>The application and its original content, features, and functionality are and will remain the exclusive property of Christo Lochenberg Developments and its licensors. Our software, custom logic, and templates may not be used in connection with any product or service without our prior written consent.</p>\r\n<h2>5. Limitation of Liability</h2>\r\n<p>In no event shall Christo Lochenberg Developments, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable for any indirect, incidental, special, consequential or punitive damages, including without limitation, loss of profits, data, use, goodwill, or other intangible losses, resulting from your access to or use of or inability to access or use the service.</p>\r\n<h2>6. Termination</h2>\r\n<p>Administrators reserve the right to terminate or suspend your account immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms. Upon termination, your right to use the Service will immediately cease.</p>\r\n<h2>7. Governing Law</h2>\r\n<p>These Terms shall be governed and construed in accordance with the laws of South Africa, without regard to its conflict of law provisions. Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights.</p>\r\n<h2>8. Contact Information</h2>\r\n<p>If you have any questions about these Terms, please contact us at:</p>\r\n<p><strong>Christo Lochenberg Developments</strong><br><strong>Email:</strong> <a href=\"mailto:info@christodev.co.za\">info@christodev.co.za</a><br><strong>Phone:</strong> +27 61 523 9126</p>'),
(11, 'contact_email', 'info@christodev.co.za'),
(24, 'smtp_host', 'mail.christodev.co.za'),
(25, 'smtp_port', '465'),
(26, 'smtp_user', 'info@christodev.co.za'),
(27, 'smtp_pass', 'Connor@2009'),
(28, 'smtp_from_name', 'Christo Lochenberg Developments'),
(29, 'smtp_from_email', 'noreply@christodev.co.za'),
(30, 'smtp_bcc_enable', '0'),
(31, 'smtp_bcc_email', ''),
(49, 'maintenance_mode', '0'),
(195, 'db_version', '0'),
(198, 'allow_developer_support', '0'),
(465, 'contact_address_street', '1 Cradock Ave'),
(466, 'contact_address_city', 'Centurion'),
(467, 'contact_address_state', 'Gauteng'),
(468, 'contact_address_zip', '0157'),
(469, 'contact_address_country', 'South Africa'),
(493, 'contact_address_suburb', 'Eldoraigne'),
(518, 'smtp_encryption', 'ssl'),
(520, 'contact_landline', '012 345 6789'),
(521, 'contact_mobile', '061 523 9126'),
(576, 'cron_token', 'xK9pM2vL5nQ8jH4bC7zR3wT6yJ1fF0dD');

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

--
-- Table structure for table `staff_roles`
--

CREATE TABLE `staff_roles` (
  `id` int NOT NULL,
  `role_name` varchar(100) NOT NULL,
  `description` text,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `support_tickets`
--

CREATE TABLE `support_tickets` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `ticket_number` varchar(20) NOT NULL,
  `ticket_type` varchar(100) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'Open',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `system_logs`
--

CREATE TABLE `system_logs` (
  `id` int NOT NULL,
  `user_id` int DEFAULT NULL,
  `action` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(20) NOT NULL DEFAULT 'client',
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `email_verified` tinyint(1) NOT NULL DEFAULT '1',
  `verification_token` varchar(255) DEFAULT NULL,
  `remember_token` varchar(255) DEFAULT NULL,
  `failed_attempts` int NOT NULL DEFAULT '0',
  `locked_until` datetime DEFAULT NULL,
  `totp_secret` varchar(255) DEFAULT NULL,
  `totp_enabled` tinyint(1) NOT NULL DEFAULT '0',
  `contact_number` varchar(50) DEFAULT NULL,
  `address_street` varchar(255) DEFAULT NULL,
  `address_suburb` varchar(255) DEFAULT NULL,
  `address_city` varchar(100) DEFAULT NULL,
  `address_state` varchar(100) DEFAULT NULL,
  `address_zip` varchar(20) DEFAULT NULL,
  `address_country` varchar(100) DEFAULT NULL,
  `staff_role_id` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `password`, `role`, `is_active`, `created_at`, `email_verified`, `verification_token`, `remember_token`, `failed_attempts`, `locked_until`, `totp_secret`, `totp_enabled`, `contact_number`, `address_street`, `address_suburb`, `address_city`, `address_state`, `address_zip`, `address_country`, `staff_role_id`) VALUES
(1, 'Christo Lochenberg', 'info@christodev.co.za', '$2y$10$TxHfVo95ULyFCslOLDpu3OGmiGURIaoGgeEgUs7o8rmxVV7JLvNOW', 'admin', 1, '2026-02-25 08:43:35', 1, NULL, '', 0, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `user_backup_codes`
--

CREATE TABLE `user_backup_codes` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `code_hash` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `used` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `used_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `email_queue`
--
ALTER TABLE `email_queue`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `email` (`email`);

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

--
-- Indexes for table `staff_roles`
--
ALTER TABLE `staff_roles`
  ADD PRIMARY KEY (`id`);

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

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_staff_role` (`staff_role_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `email_queue`
--
ALTER TABLE `email_queue`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=816;

--
-- AUTO_INCREMENT for table `staff_roles`
--
ALTER TABLE `staff_roles`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `support_tickets`
--
ALTER TABLE `support_tickets`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `system_logs`
--
ALTER TABLE `system_logs`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `user_backup_codes`
--
ALTER TABLE `user_backup_codes`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `fk_users_staff_role` FOREIGN KEY (`staff_role_id`) REFERENCES `staff_roles` (`id`) ON DELETE SET NULL;

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

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;