diff --git a/includes/lang.php b/includes/lang.php new file mode 100644 index 0000000..61aad0e --- /dev/null +++ b/includes/lang.php @@ -0,0 +1,153 @@ + [ + 'dashboard' => 'Dashboard', + 'inventory' => 'Inventory', + 'items' => 'Items', + 'categories' => 'Categories', + 'units' => 'Units', + 'crm' => 'CRM', + 'customers' => 'Customers', + 'suppliers' => 'Suppliers', + 'sales' => 'Sales', + 'pos' => 'POS', + 'sales_returns' => 'Sales Returns', + 'purchases' => 'Purchases', + 'purchase_returns' => 'Purchase Returns', + 'quotations' => 'Quotations', + 'expenses' => 'Expenses', + 'expense_categories' => 'Expense Categories', + 'accounting' => 'Accounting', + 'trial_balance' => 'Trial Balance', + 'profit_loss' => 'Profit & Loss', + 'balance_sheet' => 'Balance Sheet', + 'vat_report' => 'VAT Report', + 'hr' => 'Human Resources', + 'departments' => 'Departments', + 'employees' => 'Employees', + 'attendance' => 'Attendance', + 'payroll' => 'Payroll', + 'reports' => 'Reports', + 'customer_statement' => 'Customer Statement', + 'supplier_statement' => 'Supplier Statement', + 'cashflow_report' => 'Cashflow Report', + 'expiry_report' => 'Expiry Report', + 'low_stock_report' => 'Low Stock Report', + 'loyalty_history' => 'Loyalty History', + 'management' => 'Management', + 'payment_methods' => 'Payment Methods', + 'devices' => 'Devices', + 'settings' => 'Settings', + 'admin' => 'Administration', + 'role_groups' => 'Role Groups', + 'users' => 'Users', + 'cash_registers' => 'Cash Registers', + 'register_sessions' => 'Register Sessions', + 'scale_devices' => 'Scale Devices', + 'customer_display' => 'Customer Display', + 'backups' => 'Backups', + 'logout' => 'Logout', + 'welcome_back' => 'Welcome Back', + 'sign_in' => 'Sign In', + 'username' => 'Username', + 'password' => 'Password', + 'activate_product' => 'Activate Product', + 'serial_key' => 'Serial Key', + 'activate_now' => 'Activate Now', + 'search' => 'Search', + 'add_new' => 'Add New', + 'actions' => 'Actions', + 'edit' => 'Edit', + 'delete' => 'Delete', + 'save' => 'Save', + 'cancel' => 'Cancel', + 'total_sales' => 'Total Sales', + 'total_received' => 'Total Received', + 'customer_due' => 'Customer Due', + 'total_purchases' => 'Total Purchases', + 'total_paid' => 'Total Paid', + 'supplier_due' => 'Supplier Due', + 'total_customers' => 'Total Customers', + 'low_stock_items' => 'Low Stock Items', + 'expired_items' => 'Expired Items', + 'near_expiry_items' => 'Near Expiry Items', + ], + 'ar' => [ + 'dashboard' => 'لوحة القيادة', + 'inventory' => 'المخزون', + 'items' => 'الأصناف', + 'categories' => 'الفئات', + 'units' => 'الوحدات', + 'crm' => 'العملاء والموردين', + 'customers' => 'العملاء', + 'suppliers' => 'الموردين', + 'sales' => 'المبيعات', + 'pos' => 'نقطة البيع', + 'sales_returns' => 'مرتجعات المبيعات', + 'purchases' => 'المشتريات', + 'purchase_returns' => 'مرتجعات المشتريات', + 'quotations' => 'عروض الأسعار', + 'expenses' => 'المصاريف', + 'expense_categories' => 'فئات المصاريف', + 'accounting' => 'المحاسبة', + 'trial_balance' => 'ميزان المراجعة', + 'profit_loss' => 'الأرباح والخسائر', + 'balance_sheet' => 'الميزانية العمومية', + 'vat_report' => 'تقرير ضريبة القيمة المضافة', + 'hr' => 'الموارد البشرية', + 'departments' => 'الأقسام', + 'employees' => 'الموظفين', + 'attendance' => 'الحضور', + 'payroll' => 'الرواتب', + 'reports' => 'التقارير', + 'customer_statement' => 'كشف حساب عميل', + 'supplier_statement' => 'كشف حساب مورد', + 'cashflow_report' => 'تقرير التدفق النقدي', + 'expiry_report' => 'تقرير الصلاحية', + 'low_stock_report' => 'تقرير انخفاض المخزون', + 'loyalty_history' => 'سجل الولاء', + 'management' => 'الإدارة', + 'payment_methods' => 'طرق الدفع', + 'devices' => 'الأجهزة', + 'settings' => 'الإعدادات', + 'admin' => 'الإدارة العامة', + 'role_groups' => 'مجموعات الأدوار', + 'users' => 'المستخدمين', + 'cash_registers' => 'صناديق الكاشير', + 'register_sessions' => 'جلسات الكاشير', + 'scale_devices' => 'أجهزة الميزان', + 'customer_display' => 'شاشة العميل', + 'backups' => 'النسخ الاحتياطي', + 'logout' => 'تسجيل الخروج', + 'welcome_back' => 'مرحباً بعودتك', + 'sign_in' => 'تسجيل الدخول', + 'username' => 'اسم المستخدم', + 'password' => 'كلمة المرور', + 'activate_product' => 'تنشيط المنتج', + 'serial_key' => 'مفتاح التسلسل', + 'activate_now' => 'تنشيط الآن', + 'search' => 'بحث', + 'add_new' => 'إضافة جديد', + 'actions' => 'إجراءات', + 'edit' => 'تعديل', + 'delete' => 'حذف', + 'save' => 'حفظ', + 'cancel' => 'إلغاء', + 'total_sales' => 'إجمالي المبيعات', + 'total_received' => 'إجمالي المحصل', + 'customer_due' => 'مستحقات العملاء', + 'total_purchases' => 'إجمالي المشتريات', + 'total_paid' => 'إجمالي المدفوع', + 'supplier_due' => 'مستحقات الموردين', + 'total_customers' => 'إجمالي العملاء', + 'low_stock_items' => 'نواقص المخزون', + 'expired_items' => 'أصناف منتهية الصلاحية', + 'near_expiry_items' => 'أصناف قريبة الانتهاء', + ] +]; + +function __($key) { + global $translations; + $lang = $_SESSION['lang'] ?? 'ar'; + return $translations[$lang][$key] ?? $translations['en'][$key] ?? $key; +} diff --git a/index.php b/index.php index be639c7..247c8c4 100644 --- a/index.php +++ b/index.php @@ -24,6 +24,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } require_once 'db/config.php'; require_once 'lib/LicenseService.php'; +require_once 'includes/lang.php'; + +// Language Setup +if (isset($_GET['lang'])) { + $_SESSION['lang'] = in_array($_GET['lang'], ['en', 'ar']) ? $_GET['lang'] : 'ar'; +} +if (!isset($_SESSION['lang'])) { + $_SESSION['lang'] = 'ar'; // Default to Arabic as requested +} +$lang = $_SESSION['lang']; +$dir = ($lang === 'ar') ? 'rtl' : 'ltr'; // Licensing Middleware $is_activated = LicenseService::isActivated(); @@ -49,22 +60,34 @@ if ($page === 'activate') { } ?> - + - Product Activation + <?= __('activate_product') ?>
-

Activate Product

-

Please enter your serial key to continue using the application.

+
+

+ +
+

@@ -75,20 +98,17 @@ if ($page === 'activate') {
- + -
Example: FLAT-8822-1192-3301
- +
- +
-
-

Need a key? Contact Support

-
+ - + - Login - Admin Panel + <?= __('sign_in') ?> - Admin Panel
+
+ + + +
-

Welcome Back

-

Please enter your details to sign in

+

+

- +
- +
- -
Default user: admin / admin
+ +
+ - + - Accounting System + <?= __('accounting') ?> - Admin Panel @@ -1756,107 +1783,120 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System'; .sidebar, .topbar, .d-print-none, .no-print { display: none !important; } .main-content { margin: 0 !important; padding: 0 !important; } } + [dir="rtl"] { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
- + + +
@@ -2165,7 +2166,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Total Sales
+
OMR
@@ -2178,7 +2179,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Total Received
+
OMR
@@ -2191,7 +2192,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Customer Due
+
OMR
@@ -2204,7 +2205,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Total Purchases
+
OMR
@@ -2220,7 +2221,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Total Paid
+
OMR
@@ -2233,7 +2234,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Supplier Due
+
OMR
@@ -2246,7 +2247,7 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
-
Total Customers
+
diff --git a/post_debug.log b/post_debug.log index 612293c..3c127db 100644 --- a/post_debug.log +++ b/post_debug.log @@ -46,3 +46,6 @@ 2026-02-19 05:18:39 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"} 2026-02-19 05:18:51 - POST: {"open_register":"1","register_id":"1","opening_balance":"0"} 2026-02-19 05:47:55 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"} +2026-02-19 05:59:46 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"} +2026-02-19 06:00:05 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"} +2026-02-19 06:00:51 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"}