diff --git a/admin_profile.php b/admin_profile.php
index 14e7a6d..004f501 100644
--- a/admin_profile.php
+++ b/admin_profile.php
@@ -40,7 +40,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['name'])) {
$telephone_no = $_POST['telephone_no'] ?? '';
$email_id = $_POST['email_id'] ?? '';
- $stmt = db()->prepare("UPDATE platform_profile SET name = :name, description = :description, logo_path = :logo, favicon_path = :favicon, ctr_no = :ctr_no, telephone_no = :telephone_no, email_id = :email_id WHERE id = 1");
+ $terms = $_POST['terms'] ?? '';
+ $privacy_policy = $_POST['privacy_policy'] ?? '';
+
+ $stmt = db()->prepare("UPDATE platform_profile SET name = :name, description = :description, logo_path = :logo, favicon_path = :favicon, ctr_no = :ctr_no, telephone_no = :telephone_no, email_id = :email_id, terms = :terms, privacy_policy = :privacy_policy WHERE id = 1");
$stmt->execute([
'name' => $name,
'description' => $description,
@@ -48,7 +51,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['name'])) {
'favicon' => $favicon_path,
'ctr_no' => $ctr_no,
'telephone_no' => $telephone_no,
- 'email_id' => $email_id
+ 'email_id' => $email_id,
+ 'terms' => $terms,
+ 'privacy_policy' => $privacy_policy
]);
header('Location: ' . app_url('admin.php', ['page' => 'profile', 'saved' => 1]));
@@ -112,7 +117,19 @@ $prof = get_platform_profile();
+
+
= h(t('Terms of Conditions', 'الشروط والأحكام'))?>
+
+ = h(t('Terms of Conditions', 'الشروط والأحكام'))?>
+
+
+
+ = h(t('Privacy Policy', 'سياسة الخصوصية'))?>
+
+
+
+
= h(t('Save Changes', 'حفظ التغييرات')) ?>
diff --git a/checkout.php b/checkout.php
index 6423723..22bf1da 100644
--- a/checkout.php
+++ b/checkout.php
@@ -177,7 +177,7 @@ render_nav('pricing.php');
= h(t('Checkout flow', 'مسار الدفع')) ?>
= h(t('Create a subscription and unlock the student dashboard', 'أنشئ اشتراكاً وافتح لوحة الطالب')) ?>
-
= h(t('This first slice records a real subscription row locally, reserves a Thawani reference, and prepares Wablas reminders.', 'تسجل هذه الشريحة الأولى صف اشتراك حقيقياً محلياً وتحجز مرجع Thawani وتجهز تذكيرات Wablas.')) ?>
+
= h(t('This first slice records a real subscription row locally, reserves a Thawani reference, and prepares WhatsApp reminders.', 'تسجل هذه الشريحة الأولى صف اشتراك حقيقياً محلياً وتحجز مرجع Thawani وتجهز تذكيرات واتساب.')) ?>
@@ -270,9 +270,6 @@ render_nav('pricing.php');
= h(price_label($plan, $cycle)) ?>
- = h(t('Gateway', 'البوابة')) ?> Thawani
- = h(t('Notifications', 'الإشعارات')) ?> Wablas
- = h(t('Live rooms', 'الغرف المباشرة')) ?> Google Meet
diff --git a/db/migrations/migrate_policy.php b/db/migrations/migrate_policy.php
new file mode 100644
index 0000000..4024e3e
--- /dev/null
+++ b/db/migrations/migrate_policy.php
@@ -0,0 +1,9 @@
+exec("ALTER TABLE `platform_profile` ADD COLUMN `terms` TEXT DEFAULT NULL, ADD COLUMN `privacy_policy` TEXT DEFAULT NULL");
+ echo "Migration successful\n";
+} catch (Exception $e) {
+ echo "Migration error: " . $e->getMessage() . "\n";
+}
+
diff --git a/db/migrations/schema.sql b/db/migrations/schema.sql
index 85bf8c7..5729231 100644
--- a/db/migrations/schema.sql
+++ b/db/migrations/schema.sql
@@ -1,7 +1,7 @@
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64)
--
--- Host: 127.0.0.1 Database: app_39496
+-- Host: localhost Database: app_39496
-- ------------------------------------------------------
-- Server version 10.11.14-MariaDB-0+deb12u2
@@ -32,7 +32,7 @@ CREATE TABLE `classes` (
`created_at` timestamp NULL DEFAULT current_timestamp(),
`status` enum('active','inactive') NOT NULL DEFAULT 'active',
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -53,7 +53,7 @@ CREATE TABLE `course_activities` (
PRIMARY KEY (`id`),
KEY `course_id` (`course_id`),
CONSTRAINT `course_activities_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -73,7 +73,7 @@ CREATE TABLE `course_live_lessons` (
`meet_url` varchar(500) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -115,7 +115,7 @@ CREATE TABLE `courses` (
`max_students` int(11) DEFAULT NULL,
`registration_open` tinyint(1) DEFAULT 1,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -170,7 +170,7 @@ CREATE TABLE `plans` (
`features_ar` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`features_ar`)),
PRIMARY KEY (`id`),
UNIQUE KEY `plan_key` (`plan_key`)
-) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -202,6 +202,46 @@ CREATE TABLE `platform_profile` (
`smtp_pass` varchar(255) DEFAULT NULL,
`smtp_from_email` varchar(255) DEFAULT NULL,
`smtp_from_name` varchar(255) DEFAULT NULL,
+ `terms` text DEFAULT NULL,
+ `privacy_policy` text DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `role_permissions`
+--
+
+DROP TABLE IF EXISTS `role_permissions`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8mb4 */;
+CREATE TABLE `role_permissions` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `role_id` int(11) NOT NULL,
+ `page` varchar(50) NOT NULL,
+ `can_view` tinyint(1) DEFAULT 0,
+ `can_add` tinyint(1) DEFAULT 0,
+ `can_edit` tinyint(1) DEFAULT 0,
+ `can_delete` tinyint(1) DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `role_page` (`role_id`,`page`),
+ CONSTRAINT `role_permissions_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `roles`
+--
+
+DROP TABLE IF EXISTS `roles`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8mb4 */;
+CREATE TABLE `roles` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(255) NOT NULL,
+ `description` text DEFAULT NULL,
+ `is_system` tinyint(1) DEFAULT 0,
+ `created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -225,7 +265,7 @@ CREATE TABLE `student_assessments` (
KEY `student_id` (`student_id`),
CONSTRAINT `student_assessments_ibfk_1` FOREIGN KEY (`activity_id`) REFERENCES `course_activities` (`id`) ON DELETE CASCADE,
CONSTRAINT `student_assessments_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `student_subscriptions` (`id`) ON DELETE CASCADE
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -255,7 +295,7 @@ CREATE TABLE `student_subscriptions` (
`picture` varchar(255) DEFAULT NULL,
`civil_id` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -288,7 +328,7 @@ CREATE TABLE `subjects` (
`status` enum('active','inactive') NOT NULL DEFAULT 'active',
PRIMARY KEY (`id`),
UNIQUE KEY `slug` (`slug`)
-) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -306,7 +346,7 @@ CREATE TABLE `teacher_assignments` (
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `unique_assignment` (`teacher_id`,`class_id`,`subject_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -327,7 +367,7 @@ CREATE TABLE `teachers` (
`password` varchar(255) DEFAULT NULL,
`status` enum('active','inactive') NOT NULL DEFAULT 'active',
PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -345,13 +385,15 @@ CREATE TABLE `users` (
`reset_token` varchar(255) DEFAULT NULL,
`reset_expires` datetime DEFAULT NULL,
`role` enum('admin','user') DEFAULT 'admin',
- `role_id` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`phone` varchar(50) DEFAULT NULL,
`profile_picture` varchar(255) DEFAULT NULL,
+ `role_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
- UNIQUE KEY `email` (`email`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+ UNIQUE KEY `email` (`email`),
+ KEY `fk_user_role` (`role_id`),
+ CONSTRAINT `fk_user_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -363,39 +405,4 @@ CREATE TABLE `users` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
-
---
--- Table structure for table `roles`
---
-
-DROP TABLE IF EXISTS `roles`;
-CREATE TABLE `roles` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(255) NOT NULL,
- `description` text DEFAULT NULL,
- `is_system` tinyint(1) DEFAULT 0,
- `created_at` timestamp NULL DEFAULT current_timestamp(),
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
---
--- Table structure for table `role_permissions`
---
-
-DROP TABLE IF EXISTS `role_permissions`;
-CREATE TABLE `role_permissions` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `role_id` int(11) NOT NULL,
- `page` varchar(50) NOT NULL,
- `can_view` tinyint(1) DEFAULT 0,
- `can_add` tinyint(1) DEFAULT 0,
- `can_edit` tinyint(1) DEFAULT 0,
- `can_delete` tinyint(1) DEFAULT 0,
- PRIMARY KEY (`id`),
- UNIQUE KEY `role_page` (`role_id`,`page`),
- KEY `role_id` (`role_id`),
- CONSTRAINT `role_permissions_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
--- Dump completed on 2026-04-07 13:32:08
+-- Dump completed on 2026-04-11 15:49:39
diff --git a/includes/app.php b/includes/app.php
index d285399..bdf9f0d 100644
--- a/includes/app.php
+++ b/includes/app.php
@@ -39,7 +39,7 @@ function app_name(): string
function project_description(): string
{
- return (string) ($_SERVER['PROJECT_DESCRIPTION'] ?? 'Modern multilingual e-learning classrooms with subscriptions, teachers, students, Google Meet live sessions, Thawani billing, and Wablas notifications.');
+ return (string) ($_SERVER['PROJECT_DESCRIPTION'] ?? 'Modern multilingual e-learning classrooms with subscriptions, teachers, students, Google Meet live sessions, Thawani billing, and WhatsApp notifications.');
}
@@ -209,8 +209,8 @@ function plans_catalog_static(): array
'price_monthly' => 59,
'price_yearly' => 590,
'subjects_limit' => 4,
- 'features_en' => ['All subjects', 'Unlimited live rooms', 'Teacher Q&A', 'Wablas reminders'],
- 'features_ar' => ['جميع المواد', 'غرف مباشرة غير محدودة', 'أسئلة وأجوبة مع المعلم', 'تذكيرات عبر وابلاس'],
+ 'features_en' => ['All subjects', 'Unlimited live rooms', 'Teacher Q&A', 'WhatsApp reminders'],
+ 'features_ar' => ['جميع المواد', 'غرف مباشرة غير محدودة', 'أسئلة وأجوبة مع المعلم', 'تذكيرات عبر واتساب'],
],
'pro' => [
'key' => 'pro',
@@ -715,13 +715,15 @@ function render_footer(): void
= h(app_name()) ?>
-
= h(t('Subscription-based classrooms in English and Arabic with Google Meet, Thawani, and Wablas workflows.', 'فصول باشتراكات بالإنجليزية والعربية مع تدفقات عمل Google Meet وThawani وWablas.')) ?>
+
= h(t('Subscription-based classrooms in English and Arabic with Google Meet, Thawani, and WhatsApp workflows.', 'فصول باشتراكات بالإنجليزية والعربية مع تدفقات عمل Google Meet وThawani وواتساب.')) ?>
diff --git a/index.php b/index.php
index 0c5ef8b..b01b07a 100644
--- a/index.php
+++ b/index.php
@@ -18,7 +18,7 @@ $metrics = ['subjects' => count($subjects), 'teachers' => db()->query("SELECT CO
= h(landing_setting('hero_eyebrow', 'Single platform LMS', 'منصة تعليم موحدة')) ?>
= h(landing_setting('hero_title', 'Subscriptions, multilingual classrooms, and live Google Meet learning in one precise workspace.', 'الاشتراكات والفصول متعددة اللغات والتعلم المباشر عبر Google Meet في مساحة واحدة دقيقة.')) ?>
-
= h(landing_setting('hero_desc', 'Launch a polished e-learning experience for students, teachers, and admins with English/Arabic support, Thawani billing flows, and Wablas-ready WhatsApp notifications.', 'أطلق تجربة تعليم إلكتروني مصقولة للطلاب والمعلمين والإدارة مع دعم الإنجليزية والعربية وتدفقات دفع ثواني وإشعارات واتساب جاهزة عبر وابلاس.')) ?>
+
= h(landing_setting('hero_desc', 'Launch a polished e-learning experience for students, teachers, and admins with English/Arabic support, Thawani billing flows, and WhatsApp notifications.', 'أطلق تجربة تعليم إلكتروني مصقولة للطلاب والمعلمين والإدارة مع دعم الإنجليزية والعربية وتدفقات دفع ثواني وإشعارات واتساب.')) ?>
= h(t('Start subscription flow', 'ابدأ مسار الاشتراك')) ?>
= h(t('Browse subjects', 'تصفح المواد')) ?>
diff --git a/policy.php b/policy.php
new file mode 100644
index 0000000..ab8e1b1
--- /dev/null
+++ b/policy.php
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
= h(t('Privacy Policy', 'سياسة الخصوصية')) ?>
+
+
+ = h(t('No privacy policy provided yet.', 'لم يتم توفير سياسة الخصوصية بعد.')) ?>
+
+ = h($policy_content) ?>
+
+
+
+
+
+
+
+
+
diff --git a/subscription.php b/subscription.php
index a5bf799..400bbba 100644
--- a/subscription.php
+++ b/subscription.php
@@ -74,7 +74,7 @@ render_nav('dashboard.php');
= h(t('Payment channel', 'قناة الدفع')) ?>: = h($subscription['payment_gateway']) ?>
-
= h(t('Reminder channel', 'قناة التذكير')) ?>: = h((int) $subscription['wablas_opt_in'] === 1 ? t('Enabled via Wablas', 'مفعلة عبر وابلاس') : t('Not enabled', 'غير مفعلة')) ?>
+
= h(t('Reminder channel', 'قناة التذكير')) ?>: = h((int) $subscription['wablas_opt_in'] === 1 ? t('Enabled', 'مفعلة') : t('Not enabled', 'غير مفعلة')) ?>
= h(t('Live classroom', 'الفصل المباشر')) ?>: Google Meet
diff --git a/terms.php b/terms.php
new file mode 100644
index 0000000..274dc3c
--- /dev/null
+++ b/terms.php
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
= h(t('Terms of Conditions', 'الشروط والأحكام')) ?>
+
+
+ = h(t('No terms of conditions provided yet.', 'لم يتم توفير الشروط والأحكام بعد.')) ?>
+
+ = h($terms_content) ?>
+
+
+
+
+
+
+
+
+