diff --git a/admin.php b/admin.php index 9ab7a86..ffea986 100644 --- a/admin.php +++ b/admin.php @@ -119,8 +119,8 @@ $recent_orders = $stmt->fetchAll(); - - + + @@ -166,4 +166,5 @@ function getPaymentStatusColor($status) { 'paid' => 'success', ][$status] ?? 'info'; } -require_once __DIR__ . '/includes/footer.php'; +require_once __DIR__ . '/includes/footer.php'; +?> \ No newline at end of file diff --git a/api/translate.php b/api/translate.php new file mode 100644 index 0000000..70cfa49 --- /dev/null +++ b/api/translate.php @@ -0,0 +1,42 @@ + false, 'error' => 'Unauthorized']); + exit; +} + +$text = $_POST['text'] ?? ''; +$direction = $_POST['direction'] ?? 'en-ar'; // en-ar or ar-en + +if (empty($text)) { + echo json_encode(['success' => false, 'error' => 'Text is empty']); + exit; +} + +$target_lang = $direction === 'en-ar' ? 'Arabic' : 'English'; +$source_lang = $direction === 'en-ar' ? 'English' : 'Arabic'; + +try { + $prompt = "Translate the following text from $source_lang to $target_lang. Provide ONLY the translated text, no explanation or extra characters.\n\nText: $text"; + + $response = LocalAIApi::createResponse([ + 'input' => [ + ['role' => 'system', 'content' => 'You are a professional translator specializing in business and laundry service terminology.'], + ['role' => 'user', 'content' => $prompt], + ], + ]); + + if (!empty($response['success'])) { + $translatedText = LocalAIApi::extractText($response); + echo json_encode(['success' => true, 'translation' => trim($translatedText)]); + } else { + echo json_encode(['success' => false, 'error' => $response['error'] ?? 'AI translation failed']); + } +} catch (Exception $e) { + echo json_encode(['success' => false, 'error' => $e->getMessage()]); +} + diff --git a/assets/css/custom.css b/assets/css/custom.css index e08c6ed..6fd4d93 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -49,6 +49,32 @@ body { padding: 0.5em 1em; } +/* Soft Badges */ +.badge-soft-success { + background-color: rgba(16, 185, 129, 0.15) !important; + color: #10b981 !important; +} +.badge-soft-danger { + background-color: rgba(239, 68, 68, 0.15) !important; + color: #ef4444 !important; +} +.badge-soft-warning { + background-color: rgba(245, 158, 11, 0.15) !important; + color: #f59e0b !important; +} +.badge-soft-primary { + background-color: rgba(59, 130, 246, 0.15) !important; + color: #3b82f6 !important; +} +.badge-soft-info { + background-color: rgba(6, 182, 212, 0.15) !important; + color: #06b6d4 !important; +} +.badge-soft-secondary { + background-color: rgba(107, 114, 128, 0.15) !important; + color: #6b7280 !important; +} + .table thead th { background-color: #f9fafb; text-transform: uppercase; @@ -81,4 +107,4 @@ body { .item-card:hover { transform: scale(1.02); -} +} \ No newline at end of file diff --git a/defined_keys.txt b/defined_keys.txt new file mode 100644 index 0000000..23e6bcf --- /dev/null +++ b/defined_keys.txt @@ -0,0 +1,280 @@ +en +dashboard +pos +orders +customers +items +services +branches +users +settings +logout +login +username +password +confirm_password +change_password +submit +save +save_changes +cancel +add_new +edit +delete +actions +search +total +status +date +phone +name +name_en +name_ar +price +quantity +subtotal +vat +vat_total +payment_status +received +processing +ready +delivered +cancelled +unpaid +partially_paid +paid +cash +card +transfer +new_order +order_details +customer_name +select_customer +add_item +edit_item +delete_item +select_item +select_service +checkout +back_to_pos +language +arabic +english +branch +all_branches +category +categories +add_category +edit_category +delete_category +categories_management +add_new_category +select_category +all +variant +variants +add_variant +select_variant +variant_name_en +variant_name_ar +default +vat_percent +image_url +items_management +variants_prices +no_items_found +pricing_management +are_you_sure +company_profile +user_profile +logo +favicon +email +address_en +address_ar +vat_number +profile_picture +full_name_en +full_name_ar +update_profile +success_update +error_update +print +print_invoice +thermal_receipt +order +customer +qty +close +payments +no_payments +update_status +update +remaining_amount +add_payment +payment_method +customer_details +order_date +method +amount +currency +ctr_no +vat_no +add_new_user +role +add_user +lab +outlet +view_items +initial_letters +from_date +to_date +order_no +all_status +all_payments +search_placeholder +previous +next +page +of +ar +dashboard +pos +orders +customers +items +services +branches +users +settings +logout +login +username +password +confirm_password +change_password +submit +save +save_changes +cancel +add_new +edit +delete +actions +search +total +status +date +phone +name +name_en +name_ar +price +quantity +subtotal +vat +vat_total +payment_status +received +processing +ready +delivered +cancelled +unpaid +partially_paid +paid +cash +card +transfer +new_order +order_details +customer_name +select_customer +add_item +edit_item +delete_item +select_item +select_service +checkout +back_to_pos +language +arabic +english +branch +all_branches +category +categories +add_category +edit_category +delete_category +categories_management +add_new_category +select_category +all +variant +variants +add_variant +select_variant +variant_name_en +variant_name_ar +default +vat_percent +image_url +items_management +variants_prices +no_items_found +pricing_management +are_you_sure +company_profile +user_profile +logo +favicon +email +address_en +address_ar +vat_number +profile_picture +full_name_en +full_name_ar +update_profile +success_update +error_update +print +print_invoice +thermal_receipt +order +customer +qty +close +payments +no_payments +update_status +update +remaining_amount +add_payment +payment_method +customer_details +order_date +method +amount +currency +ctr_no +vat_no +add_new_user +role +add_user +lab +outlet +view_items +initial_letters +from_date +to_date +order_no +all_status +all_payments +search_placeholder +previous +next +page +of diff --git a/includes/header.php b/includes/header.php index 935870d..28fa732 100644 --- a/includes/header.php +++ b/includes/header.php @@ -143,6 +143,12 @@ if ($current_user_id) { +