Password change. Mails utf-8 encoding fix

This commit is contained in:
Flatlogic Bot 2025-12-29 19:13:43 +00:00
parent e4dc201ed3
commit 595f1a1c17
11 changed files with 697 additions and 15 deletions

View File

@ -6,14 +6,22 @@ require_admin();
$db = db();
$rate = 0.23; // Default
$bank_name = '';
$bank_account_number = '';
$message = '';
// Fetch current rate
$stmt = $db->prepare("SELECT value FROM settings WHERE `key` = 'pln_to_eur_rate'");
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if ($result) {
$rate = (float)$result['value'];
// Fetch current settings
$stmt = $db->query("SELECT `key`, `value` FROM settings");
$settings = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
if (isset($settings['pln_to_eur_rate'])) {
$rate = (float)$settings['pln_to_eur_rate'];
}
if (isset($settings['bank_name'])) {
$bank_name = $settings['bank_name'];
}
if (isset($settings['bank_account_number'])) {
$bank_account_number = $settings['bank_account_number'];
}
// Handle form submission
@ -30,10 +38,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} else {
$message = 'Wprowadź poprawną wartość kursu (liczba większa od 0).';
}
} elseif (isset($_POST['bank_name']) || isset($_POST['bank_account_number'])) {
$new_bank_name = filter_input(INPUT_POST, 'bank_name', FILTER_SANITIZE_STRING);
$new_bank_account_number = filter_input(INPUT_POST, 'bank_account_number', FILTER_SANITIZE_STRING);
$stmt = $db->prepare("INSERT INTO settings (`key`, value) VALUES (:key, :value) ON DUPLICATE KEY UPDATE value = :value");
$stmt->execute([':key' => 'bank_name', ':value' => $new_bank_name]);
$bank_name = $new_bank_name;
$stmt->execute([':key' => 'bank_account_number', ':value' => $new_bank_account_number]);
$bank_account_number = $new_bank_account_number;
$message = 'Dane do przelewu zostały zaktualizowane.';
}
}
$page_title = 'Ustawienia Walut';
$page_title = 'Ustawienia';
?>
@ -48,7 +69,7 @@ $page_title = 'Ustawienia Walut';
<h1 class="h2"><?= $page_title ?></h1>
</div>
<div class="card">
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title">Kurs Wymiany Walut</h5>
<p class="card-text">Ustaw kurs wymiany PLN na EUR. Ten kurs będzie używany do wyświetlania cen w EUR dla klientów używających angielskiej wersji strony.</p>
@ -68,6 +89,25 @@ $page_title = 'Ustawienia Walut';
</form>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Dane do przelewu</h5>
<p class="card-text">Ustaw dane do przelewu, które będą wyświetlane w mailach i na stronie po złożeniu zamówienia.</p>
<form method="POST" action="settings.php">
<div class="mb-3">
<label for="bank_name" class="form-label">Nazwa banku</label>
<input type="text" class="form-control" id="bank_name" name="bank_name" value="<?= htmlspecialchars($bank_name) ?>">
</div>
<div class="mb-3">
<label for="bank_account_number" class="form-label">Numer konta bankowego</label>
<input type="text" class="form-control" id="bank_account_number" name="bank_account_number" value="<?= htmlspecialchars($bank_account_number) ?>">
</div>
<button type="submit" class="btn btn-primary">Zapisz</button>
</form>
</div>
</div>
</main>
<?php require_once __DIR__ . '/../includes/footer.php'; ?>

View File

@ -0,0 +1,5 @@
Request method: GET
Array
(
)

View File

@ -11543,3 +11543,559 @@ Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client 1
Client price query executed. Found: {"price_net":"837.40","price_gross":"1030.00"}
Found client price. Net: 837.4, Gross: 1030
FINAL: Returning Net: 837.4, Gross: 1030
---
---
START getEffectivePrice for product 2, client 1
Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"}
Found client price. Net: 1056.91, Gross: 1300
FINAL: Returning Net: 1056.91, Gross: 1300
---
---
START getEffectivePrice for product 3, client 1
Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"}
Found client price. Net: 32.52, Gross: 40
FINAL: Returning Net: 32.52, Gross: 40
---
---
START getEffectivePrice for product 4, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client 1
Client price query executed. Found: {"price_net":"837.40","price_gross":"1030.00"}
Found client price. Net: 837.4, Gross: 1030
FINAL: Returning Net: 837.4, Gross: 1030
---
---
START getEffectivePrice for product 1, client 1
Client price query executed. Found: {"price_net":"837.40","price_gross":"1030.00"}
Found client price. Net: 837.4, Gross: 1030
FINAL: Returning Net: 837.4, Gross: 1030
---
---
START getEffectivePrice for product 2, client 1
Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"}
Found client price. Net: 1056.91, Gross: 1300
FINAL: Returning Net: 1056.91, Gross: 1300
---
---
START getEffectivePrice for product 3, client 1
Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"}
Found client price. Net: 32.52, Gross: 40
FINAL: Returning Net: 32.52, Gross: 40
---
---
START getEffectivePrice for product 4, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 2, client 1
Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"}
Found client price. Net: 1056.91, Gross: 1300
FINAL: Returning Net: 1056.91, Gross: 1300
---
---
START getEffectivePrice for product 1, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"}
Found product price. Net: 1111, Gross: 1366.53
FINAL: Returning Net: 1111, Gross: 1366.53
---
---
START getEffectivePrice for product 2, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"}
Found product price. Net: 1318.05, Gross: 1621.2
FINAL: Returning Net: 1318.05, Gross: 1621.2
---
---
START getEffectivePrice for product 3, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 4, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"}
Found product price. Net: 1111, Gross: 1366.53
FINAL: Returning Net: 1111, Gross: 1366.53
---
---
START getEffectivePrice for product 2, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"}
Found product price. Net: 1318.05, Gross: 1621.2
FINAL: Returning Net: 1318.05, Gross: 1621.2
---
---
START getEffectivePrice for product 3, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 4, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"}
Found product price. Net: 1111, Gross: 1366.53
FINAL: Returning Net: 1111, Gross: 1366.53
---
---
START getEffectivePrice for product 2, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"}
Found product price. Net: 1318.05, Gross: 1621.2
FINAL: Returning Net: 1318.05, Gross: 1621.2
---
---
START getEffectivePrice for product 3, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 4, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client 1
Client price query executed. Found: {"price_net":"837.40","price_gross":"1030.00"}
Found client price. Net: 837.4, Gross: 1030
FINAL: Returning Net: 837.4, Gross: 1030
---
---
START getEffectivePrice for product 2, client 1
Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"}
Found client price. Net: 1056.91, Gross: 1300
FINAL: Returning Net: 1056.91, Gross: 1300
---
---
START getEffectivePrice for product 3, client 1
Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"}
Found client price. Net: 32.52, Gross: 40
FINAL: Returning Net: 32.52, Gross: 40
---
---
START getEffectivePrice for product 4, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client 1
Client price query executed. Found: {"price_net":"837.40","price_gross":"1030.00"}
Found client price. Net: 837.4, Gross: 1030
FINAL: Returning Net: 837.4, Gross: 1030
---
---
START getEffectivePrice for product 2, client 1
Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"}
Found client price. Net: 1056.91, Gross: 1300
FINAL: Returning Net: 1056.91, Gross: 1300
---
---
START getEffectivePrice for product 3, client 1
Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"}
Found client price. Net: 32.52, Gross: 40
FINAL: Returning Net: 32.52, Gross: 40
---
---
START getEffectivePrice for product 4, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"}
Found product price. Net: 1111, Gross: 1366.53
FINAL: Returning Net: 1111, Gross: 1366.53
---
---
START getEffectivePrice for product 2, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"}
Found product price. Net: 1318.05, Gross: 1621.2
FINAL: Returning Net: 1318.05, Gross: 1621.2
---
---
START getEffectivePrice for product 3, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 4, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"}
Found product price. Net: 1111, Gross: 1366.53
FINAL: Returning Net: 1111, Gross: 1366.53
---
---
START getEffectivePrice for product 2, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"}
Found product price. Net: 1318.05, Gross: 1621.2
FINAL: Returning Net: 1318.05, Gross: 1621.2
---
---
START getEffectivePrice for product 3, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 4, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client 1
Client price query executed. Found: {"price_net":"837.40","price_gross":"1030.00"}
Found client price. Net: 837.4, Gross: 1030
FINAL: Returning Net: 837.4, Gross: 1030
---
---
START getEffectivePrice for product 2, client 1
Client price query executed. Found: {"price_net":"1056.91","price_gross":"1300.00"}
Found client price. Net: 1056.91, Gross: 1300
FINAL: Returning Net: 1056.91, Gross: 1300
---
---
START getEffectivePrice for product 3, client 1
Client price query executed. Found: {"price_net":"32.52","price_gross":"40.00"}
Found client price. Net: 32.52, Gross: 40
FINAL: Returning Net: 32.52, Gross: 40
---
---
START getEffectivePrice for product 4, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client 1
Client price query executed. Found: No
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---
---
START getEffectivePrice for product 1, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1111.00","price_gross":"1366.53"}
Found product price. Net: 1111, Gross: 1366.53
FINAL: Returning Net: 1111, Gross: 1366.53
---
---
START getEffectivePrice for product 2, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"1318.05","price_gross":"1621.20"}
Found product price. Net: 1318.05, Gross: 1621.2
FINAL: Returning Net: 1318.05, Gross: 1621.2
---
---
START getEffectivePrice for product 3, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 4, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"9.95","price_gross":"12.24"}
Found product price. Net: 9.95, Gross: 12.24
FINAL: Returning Net: 9.95, Gross: 12.24
---
---
START getEffectivePrice for product 5, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"68.00","price_gross":"83.64"}
Found product price. Net: 68, Gross: 83.64
FINAL: Returning Net: 68, Gross: 83.64
---
---
START getEffectivePrice for product 6, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"171.60","price_gross":"211.07"}
Found product price. Net: 171.6, Gross: 211.07
FINAL: Returning Net: 171.6, Gross: 211.07
---
---
START getEffectivePrice for product 7, client
Client price not found or not set, falling back to product price.
Product price query executed. Found: {"price_net":"233.20","price_gross":"286.84"}
Found product price. Net: 233.2, Gross: 286.84
FINAL: Returning Net: 233.2, Gross: 286.84
---

View File

@ -185,6 +185,14 @@ $translations = [
'chat_hello' => 'Cześć! W czym mogę dzisiaj pomóc?',
'chat_placeholder' => 'Wpisz swoją wiadomość...',
'chat_send_button' => 'Wyślij',
'change_password' => 'Zmiana hasła',
'current_password' => 'Aktualne hasło',
'new_password' => 'Nowe hasło',
'confirm_new_password' => 'Potwierdź nowe hasło',
'change_password_btn' => 'Zmień hasło',
'password_changed_successfully' => 'Hasło zostało zmienione pomyślnie.',
'passwords_do_not_match' => 'Nowe hasła nie są zgodne.',
'incorrect_current_password' => 'Nieprawidłowe aktualne hasło.',
],
'en' => [
'login_header' => 'Login',
@ -367,9 +375,22 @@ $translations = [
'chat_hello' => 'Hello! How can I help you today?',
'chat_placeholder' => 'Type your message...',
'chat_send_button' => 'Send',
'change_password' => 'Change Password',
'current_password' => 'Current Password',
'new_password' => 'New Password',
'confirm_new_password' => 'Confirm New Password',
'change_password_btn' => 'Change Password',
'password_changed_successfully' => 'Password changed successfully.',
'passwords_do_not_match' => 'New passwords do not match.',
'incorrect_current_password' => 'Incorrect current password.',
],
];
function get_primary_language() {
global $supported_languages;
return $supported_languages[0] ?? 'en';
}
function get_lang() {
global $default_language;
return $_SESSION['lang'] ?? $default_language;
@ -388,8 +409,9 @@ function t(string $key): string {
if (isset($translations[$lang][$key])) {
return $translations[$lang][$key];
}
if (isset($translations['pl'][$key])) {
return $translations['pl'][$key];
$primary_lang = get_primary_language();
if (isset($translations[$primary_lang][$key])) {
return $translations[$primary_lang][$key];
}
return "[missing:$key]";
}

View File

@ -9,7 +9,7 @@ require_once __DIR__ . '/../db/config.php';
require_once __DIR__ . '/helpers.php';
require_once __DIR__ . '/currency.php';
if (isset($_GET['lang'])) {
if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['lang'])) {
set_lang($_GET['lang']);
$uri = $_SERVER['REQUEST_URI'];
$url_parts = parse_url($uri);

View File

@ -88,6 +88,7 @@ class MailService
$mail = new PHPMailer\PHPMailer\PHPMailer(true);
try {
$mail->CharSet = 'UTF-8';
$mail->isSMTP();
$mail->Host = $cfg['smtp_host'] ?? '';
$mail->Port = (int)($cfg['smtp_port'] ?? 587);
@ -203,6 +204,7 @@ class MailService
{
$mail = new PHPMailer\PHPMailer\PHPMailer(true);
try {
$mail->CharSet = 'UTF-8';
$mail->isSMTP();
$mail->Host = $cfg['smtp_host'] ?? '';
$mail->Port = (int)($cfg['smtp_port'] ?? 587);
@ -211,6 +213,7 @@ class MailService
if ($secure === 'ssl') $mail->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_SMTPS;
elseif ($secure === 'tls') $mail->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS;
$mail->SMTPSecure = false;
$mail->SMTPAuth = true;
$mail->Username = $cfg['smtp_user'] ?? '';
$mail->Password = $cfg['smtp_pass'] ?? '';

View File

@ -213,8 +213,14 @@ try {
// 3. Client - Payment Instructions (Bank Transfer)
if ($_POST['payment_method'] === 'bank_transfer') {
// TODO: Fetch bank details from a settings table or config
$bank_account_details = "Bank: Example Bank\nAccount Number: 123456789";
// Fetch bank details from the settings table
$stmt = $pdo->query("SELECT `key`, `value` FROM settings WHERE `key` IN ('bank_name', 'bank_account_number')");
$settings = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
$bank_name = $settings['bank_name'] ?? '';
$bank_account_number = $settings['bank_account_number'] ?? '';
$bank_account_details = "Bank: " . $bank_name . "\nAccount Number: " . $bank_account_number;
$transfer_title = "Order #{$order_id}";
$payment_deadline = date('Y-m-d', strtotime('+7 days'));

View File

@ -5,6 +5,32 @@ require_login();
$user_id = $_SESSION['user_id'];
$db = db();
$success_message = '';
$error_message = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
$current_password = $_POST['current_password'];
$new_password = $_POST['new_password'];
$confirm_password = $_POST['confirm_password'];
$stmt = $db->prepare("SELECT password_hash FROM users WHERE id = ?");
$stmt->execute([$user_id]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
if ($user && password_verify($current_password, $user['password_hash'])) {
if ($new_password === $confirm_password) {
$hashed_password = password_hash($new_password, PASSWORD_DEFAULT);
$stmt = $db->prepare("UPDATE users SET password_hash = ? WHERE id = ?");
$stmt->execute([$hashed_password, $user_id]);
$success_message = t('password_changed_successfully');
} else {
$error_message = t('passwords_do_not_match');
}
} else {
$error_message = t('incorrect_current_password');
}
}
// Fetch user data
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$user_id]);
@ -29,6 +55,12 @@ require_once __DIR__ . '/includes/header.php';
<h3><?= t('profile_user_profile') ?></h3>
</div>
<div class="card-body">
<?php if ($success_message): ?>
<div class="alert alert-success"><?= $success_message ?></div>
<?php endif; ?>
<?php if ($error_message): ?>
<div class="alert alert-danger"><?= $error_message ?></div>
<?php endif; ?>
<?php if ($user): ?>
<div class="row">
<div class="col-md-6">
@ -47,8 +79,22 @@ require_once __DIR__ . '/includes/header.php';
</ul>
</div>
<div class="col-md-6">
<h4><?= t('profile_password_management') ?></h4>
<p><?= t('profile_feature_in_preparation') ?></p>
<h4><?= t('change_password') ?></h4>
<form method="post">
<div class="mb-3">
<label for="current_password" class="form-label"><?= t('current_password') ?></label>
<input type="password" class="form-control" id="current_password" name="current_password" required>
</div>
<div class="mb-3">
<label for="new_password" class="form-label"><?= t('new_password') ?></label>
<input type="password" class="form-control" id="new_password" name="new_password" required>
</div>
<div class="mb-3">
<label for="confirm_password" class="form-label"><?= t('confirm_new_password') ?></label>
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
</div>
<button type="submit" name="change_password" class="btn btn-primary"><?= t('change_password_btn') ?></button>
</form>
</div>
</div>
<?php else: ?>

1
test.log Normal file
View File

@ -0,0 +1 @@
Hello from test.php

3
test.php Normal file
View File

@ -0,0 +1,3 @@
<?php
file_put_contents('/home/ubuntu/executor/workspace/test.log', 'Hello from test.php');
echo 'Hello from test.php';

0
test_permissons.log Normal file
View File