diff --git a/admin/edit_product.php b/admin/edit_product.php index b2c1e37..890572d 100644 --- a/admin/edit_product.php +++ b/admin/edit_product.php @@ -3,6 +3,7 @@ session_start(); require_once __DIR__ . '/../includes/auth.php'; require_once __DIR__ . '/../includes/helpers.php'; require_role('admin'); +require_once __DIR__ . '/../includes/i18n.php'; $pdo = db(); @@ -329,9 +330,9 @@ $page_title = $product['id'] ? 'Edytuj produkt' : 'Dodaj produkt';
diff --git a/checkout.php b/checkout.php index 850cc15..82c775f 100644 --- a/checkout.php +++ b/checkout.php @@ -1,10 +1,6 @@ getMessage()); + die(t('db_error_generic') . $e->getMessage()); } } -$page_title = 'Podsumowanie zamówienia'; -$user_role = get_user_role(); +$page_title = t('checkout_title'); +require_once __DIR__ . '/includes/html_head.php'; +require_once __DIR__ . '/includes/header.php'; ?> - - - - - - <?php echo htmlspecialchars($page_title); ?> - ExtraB2B - - - - - - -
-

Podsumowanie zamówienia

+
+

-
-
-
-
Twoje zamówienie
-
- - +
+
+
+
+
+
+ + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - -
ProduktIlośćCena nettoCena bruttoSuma (brutto)
Suma (brutto):
-
-
-
-
-
-
Opcje dostawy i płatności
-
-
- Źródło dostawy: -
- -
- Dostępny kredyt kupiecki: -
- -
-
- - -
-
- - -
- - -
-
+ + + + + : + + + +
-
- -
-
-

© ExtraB2B. All Rights Reserved.

+
+
+
+
+
+ : +
+ +
+ : +
+ +
+
+ + +
+
+ + +
+ + +
+
+
-
- - - \ No newline at end of file +
+ + + diff --git a/includes/i18n.php b/includes/i18n.php index 19f9790..68b12a6 100644 --- a/includes/i18n.php +++ b/includes/i18n.php @@ -121,6 +121,57 @@ $translations = [ 'total_gross_label' => 'Razem (brutto):', 'proceed_to_checkout' => 'Przejdź do zamówienia', 'db_connection_error' => 'Błąd połączenia z bazą danych: ', + 'price_per' => 'Cena za', + 'price_per_unit' => 'Cena za j.m.', + 'db_error_generic' => 'Błąd bazy danych', + 'your_order' => 'Twoje zamówienie', + 'delivery_payment_options' => 'Dostawa i płatność', + 'delivery_source' => 'Źródło dostawy', + 'central_warehouse' => 'Magazyn centralny', + 'external_supplier' => 'Dostawca zewnętrzny', + 'available_trade_credit' => 'Dostępny kredyt kupiecki', + 'order_notes' => 'Uwagi do zamówienia', + 'confirm_order' => 'Potwierdź zamówienie', + 'unauthorized_order_view' => 'Nie masz uprawnień do przeglądania tego zamówienia.', + 'order_not_found_or_unauthorized' => 'Nie znaleziono zamówienia lub nie masz do niego dostępu.', + 'order_details_title' => 'Szczegóły zamówienia nr {order_id}', + 'order_details_fallback_title' => 'Szczegóły zamówienia', + 'back_to_orders' => 'Powrót do listy zamówień', + 'summary' => 'Podsumowanie', + 'notes' => 'Uwagi', + 'order_details' => 'Szczegóły zamówienia', + 'image' => 'Zdjęcie', + 'unit_price_net' => 'Cena jedn. netto', + 'unit_price_gross' => 'Cena jedn. brutto', + 'back_to_product_list' => 'Powrót do listy produktów', + 'product_thumbnail_alt' => 'Miniatura produktu', + 'quantity_label' => 'Ilość', + 'btn_add_to_cart' => 'Dodaj do koszyka', + 'description_tab' => 'Opis', + 'technical_data_tab' => 'Dane techniczne', + 'documents_tab' => 'Dokumenty', + 'related_products_tab' => 'Produkty powiązane', + 'no_technical_data' => 'Brak danych technicznych.', + 'no_documents' => 'Brak dokumentów.', + 'no_related_products' => 'Brak produktów powiązanych.', + 'error_client_id_not_found' => 'Nie znaleziono ID klienta w sesji.', + 'error_fetching_orders' => 'Błąd podczas pobierania zamówień.', + 'title_orders' => 'Zamówienia', + 'order_history' => 'Historia zamówień', + 'no_orders_yet' => 'Nie złożyłeś jeszcze żadnych zamówień.', + 'btn_view_details' => 'Zobacz szczegóły', + 'my_order_items' => 'Moje pozycje zamówień', + 'order_id' => 'ID Zamówienia', + 'last_updated' => 'Ostatnia aktualizacja', + 'action' => 'Akcja', + 'no_order_items_found' => 'Nie znaleziono żadnych pozycji zamówień.', + 'save' => 'Zapisz', + 'login_error' => 'Nieprawidłowy email lub hasło.', + 'payment_method' => 'Metoda płatności', + 'checkout_title' => 'Zamówienie', + 'szt' => 'sztuka', + 'mb' => 'metr bieżący', + 'm2' => 'metr kwadratowy', ], 'en' => [ 'login_header' => 'Login', @@ -239,6 +290,57 @@ $translations = [ 'total_gross_label' => 'Total (gross):', 'proceed_to_checkout' => 'Proceed to checkout', 'db_connection_error' => 'Database connection error: ', + 'price_per' => 'Price per', + 'price_per_unit' => 'Price per unit', + 'db_error_generic' => 'Database error', + 'your_order' => 'Your order', + 'delivery_payment_options' => 'Delivery and payment', + 'delivery_source' => 'Delivery source', + 'central_warehouse' => 'Central warehouse', + 'external_supplier' => 'External supplier', + 'available_trade_credit' => 'Available trade credit', + 'order_notes' => 'Order notes', + 'confirm_order' => 'Confirm order', + 'unauthorized_order_view' => 'You are not authorized to view this order.', + 'order_not_found_or_unauthorized' => 'Order not found or you are not authorized to view it.', + 'order_details_title' => 'Order details {order_id}', + 'order_details_fallback_title' => 'Order details', + 'back_to_orders' => 'Back to orders', + 'summary' => 'Summary', + 'notes' => 'Notes', + 'order_details' => 'Order details', + 'image' => 'Image', + 'unit_price_net' => 'Unit price net', + 'unit_price_gross' => 'Unit price gross', + 'back_to_product_list' => 'Back to product list', + 'product_thumbnail_alt' => 'Product thumbnail', + 'quantity_label' => 'Quantity', + 'btn_add_to_cart' => 'Add to cart', + 'description_tab' => 'Description', + 'technical_data_tab' => 'Technical data', + 'documents_tab' => 'Documents', + 'related_products_tab' => 'Related products', + 'no_technical_data' => 'No technical data available.', + 'no_documents' => 'No documents available.', + 'no_related_products' => 'No related products available.', + 'error_client_id_not_found' => 'Client ID not found in session.', + 'error_fetching_orders' => 'Error fetching orders.', + 'title_orders' => 'Orders', + 'order_history' => 'Order history', + 'no_orders_yet' => 'You have no orders yet.', + 'btn_view_details' => 'View details', + 'my_order_items' => 'My order items', + 'order_id' => 'Order ID', + 'last_updated' => 'Last updated', + 'action' => 'Action', + 'no_order_items_found' => 'No order items found.', + 'save' => 'Save', + 'login_error' => 'Invalid email or password.', + 'payment_method' => 'Payment method', + 'checkout_title' => 'Checkout', + 'szt' => 'piece', + 'mb' => 'linear meter', + 'm2' => 'square meter', ], ]; diff --git a/index.php b/index.php index 56e00d7..313eb5c 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ fetch(); if (!$order) { - $error_message = 'Nie znaleziono zamówienia lub nie masz do niego dostępu.'; + $error_message = t('order_not_found_or_unauthorized'); } else { $stmt = $pdo->prepare( 'SELECT oi.*, p.name as product_name FROM order_items oi JOIN products p ON oi.product_id = p.id WHERE oi.order_id = ?' @@ -59,95 +54,77 @@ if ($client_id === 0) { } } catch (PDOException $e) { - $error_message = 'Błąd bazy danych. Prosimy spróbować ponownie później.'; + $error_message = t('db_error_generic'); error_log($e->getMessage()); } } -$page_title = $order ? 'Szczegóły zamówienia #' . $order['id'] : 'Szczegóły zamówienia'; -$user_role = get_user_role(); +$page_title = $order ? str_replace('{order_id}', $order['id'], t('order_details_title')) : t('order_details_fallback_title'); +require_once __DIR__ . '/includes/html_head.php'; +require_once __DIR__ . '/includes/header.php'; ?> - - - - - - <?php echo htmlspecialchars($page_title); ?> - B2B Commerce - - - - - - -
- -
- +
+ +
+ +
+ + +

+ +
+
+
+

:

+

:

+

:

+

:

+

:

- Wróć do listy zamówień - -

+
-
-
Podsumowanie
-
-

Data zamówienia:

-

Status:

-

Metoda płatności:

-

Suma (brutto):

-

Uwagi:

-
-
- -
-
Szczegóły zamówienia
-
- - +
+
+
+
+ + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - -
ZdjęcieProduktCena jedn. nettoCena jedn. bruttoIlośćSuma (brutto)<?= htmlspecialchars($item['product_name']) ?>
<?php echo htmlspecialchars($item['product_name']); ?>
-
+ + +
+
-
- Wróć do listy zamówień -
- -
+
+ +
+ + - - - - \ No newline at end of file + diff --git a/product.php b/product.php index 1b972f7..5927140 100644 --- a/product.php +++ b/product.php @@ -94,14 +94,14 @@ $page_title = htmlspecialchars($product['name']);


- : + :
- +