Wersja produkcyjna 1.0
This commit is contained in:
parent
b7781fccaa
commit
b56539d828
4
cart.php
4
cart.php
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/includes/header.php';
|
require_once __DIR__ . '/includes/init.php';
|
||||||
require_once __DIR__ . '/includes/currency.php';
|
|
||||||
require_once __DIR__ . '/includes/html_head.php';
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
|
require_once __DIR__ . '/includes/header.php';
|
||||||
require_login();
|
require_login();
|
||||||
|
|
||||||
$page_title = t('cart_header');
|
$page_title = t('cart_header');
|
||||||
|
|||||||
@ -69,7 +69,7 @@ $page_title = t('checkout_title');
|
|||||||
|
|
||||||
require_once __DIR__ . '/includes/html_head.php';
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
require_once __DIR__ . '/includes/header.php';
|
require_once __DIR__ . '/includes/header.php';
|
||||||
require_once __DIR__ . '/includes/currency.php';
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<main class="container my-5">
|
<main class="container my-5">
|
||||||
|
|||||||
1306
debug_price.log
1306
debug_price.log
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/init.php';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,15 @@ function get_status_translation(string $key): string {
|
|||||||
return $translated;
|
return $translated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_item_status_translation(string $key): string {
|
||||||
|
$translation_key = 'status_' . $key;
|
||||||
|
$translated = t($translation_key);
|
||||||
|
if ($translated === $translation_key) {
|
||||||
|
return ucfirst(str_replace('_', ' ', $key));
|
||||||
|
}
|
||||||
|
return $translated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function sanitize_filename($filename) {
|
function sanitize_filename($filename) {
|
||||||
// Keep the original extension
|
// Keep the original extension
|
||||||
@ -37,7 +46,7 @@ function sanitize_filename($filename) {
|
|||||||
$filename_without_ext = pathinfo($filename, PATHINFO_FILENAME);
|
$filename_without_ext = pathinfo($filename, PATHINFO_FILENAME);
|
||||||
|
|
||||||
// Replace spaces and special characters with underscores in the filename part
|
// Replace spaces and special characters with underscores in the filename part
|
||||||
$sanitized_filename = preg_replace('/[\s\\\/:*?"<>|.]+/', '_', $filename_without_ext);
|
$sanitized_filename = preg_replace('/[\s\/:*?"<>|.]+/', '_', $filename_without_ext);
|
||||||
|
|
||||||
// Remove any leading/trailing underscores
|
// Remove any leading/trailing underscores
|
||||||
$sanitized_filename = trim($sanitized_filename, '_');
|
$sanitized_filename = trim($sanitized_filename, '_');
|
||||||
|
|||||||
@ -5,6 +5,9 @@ if (session_status() === PHP_SESSION_NONE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/i18n.php';
|
require_once __DIR__ . '/i18n.php';
|
||||||
|
require_once __DIR__ . '/../db/config.php';
|
||||||
|
require_once __DIR__ . '/helpers.php';
|
||||||
|
require_once __DIR__ . '/currency.php';
|
||||||
|
|
||||||
if (isset($_GET['lang'])) {
|
if (isset($_GET['lang'])) {
|
||||||
set_lang($_GET['lang']);
|
set_lang($_GET['lang']);
|
||||||
@ -25,4 +28,3 @@ if (isset($_GET['lang'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/auth.php';
|
require_once __DIR__ . '/auth.php';
|
||||||
require_once __DIR__ . '/helpers.php';
|
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/includes/init.php';
|
require_once __DIR__ . '/includes/init.php';
|
||||||
require_once __DIR__ . '/includes/currency.php';
|
|
||||||
|
$page_title = t('catalog_title');
|
||||||
|
|
||||||
require_once __DIR__ . '/includes/html_head.php';
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
require_once __DIR__ . '/includes/header.php';
|
require_once __DIR__ . '/includes/header.php';
|
||||||
$page_title = t('catalog_title');
|
|
||||||
require_once 'includes/helpers.php';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$pdo = db();
|
$pdo = db();
|
||||||
|
|||||||
@ -1,14 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
require_once __DIR__ . '/includes/init.php';
|
||||||
require_once 'includes/auth.php';
|
require_login();
|
||||||
require_once 'db/config.php';
|
|
||||||
require_once 'includes/i18n.php';
|
|
||||||
require_once 'includes/helpers.php';
|
|
||||||
|
|
||||||
if (!is_logged_in()) {
|
|
||||||
header('Location: login.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$order_id = isset($_GET['order_id']) ? (int)$_GET['order_id'] : 0;
|
$order_id = isset($_GET['order_id']) ? (int)$_GET['order_id'] : 0;
|
||||||
|
|
||||||
@ -26,27 +18,19 @@ if (!$order) {
|
|||||||
header('Location: orders.php');
|
header('Location: orders.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$page_title = t('order_confirmation');
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
|
require_once __DIR__ . '/includes/header.php';
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<div class="container mt-5">
|
||||||
<html lang="<?= get_lang() ?>">
|
<div class="alert alert-success" role="alert">
|
||||||
<head>
|
<h4 class="alert-heading"><?= t('thank_you_for_your_order') ?></h4>
|
||||||
<meta charset="UTF-8">
|
<p><?= t('your_order_number') ?> <strong>#<?php echo $order['id']; ?></strong> <?= t('has_been_placed_successfully') ?></p>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<hr>
|
||||||
<title><?= t('order_confirmation') ?></title>
|
<p class="mb-0"><?= t('order_details_will_be_sent') ?> <a href="orders.php"><?= t('orders') ?></a>.</p>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link href="assets/css/custom.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php require_once 'includes/header.php'; ?>
|
|
||||||
<div class="container mt-5">
|
|
||||||
<div class="alert alert-success" role="alert">
|
|
||||||
<h4 class="alert-heading"><?= t('thank_you_for_your_order') ?></h4>
|
|
||||||
<p><?= t('your_order_number') ?> <strong>#<?php echo $order['id']; ?></strong> <?= t('has_been_placed_successfully') ?></p>
|
|
||||||
<hr>
|
|
||||||
<p class="mb-0"><?= t('order_details_will_be_sent') ?> <a href="orders.php"><?= t('orders') ?></a>.</p>
|
|
||||||
</div>
|
|
||||||
<a href="index.php" class="btn btn-primary"><?= t('continue_shopping') ?></a>
|
|
||||||
</div>
|
</div>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<a href="index.php" class="btn btn-primary"><?= t('continue_shopping') ?></a>
|
||||||
</body>
|
</div>
|
||||||
</html>
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
||||||
@ -63,7 +63,7 @@ $page_title = $order ? str_replace('{order_id}', $order['id'], t('order_details_
|
|||||||
|
|
||||||
require_once __DIR__ . '/includes/html_head.php';
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
require_once __DIR__ . '/includes/header.php';
|
require_once __DIR__ . '/includes/header.php';
|
||||||
require_once __DIR__ . '/includes/currency.php';
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<main class="container my-5">
|
<main class="container my-5">
|
||||||
|
|||||||
@ -22,9 +22,8 @@ if (!isset($_SESSION['client_id'])) {
|
|||||||
|
|
||||||
$page_title = t('title_orders');
|
$page_title = t('title_orders');
|
||||||
|
|
||||||
require_once 'includes/header.php';
|
|
||||||
require_once 'includes/currency.php';
|
|
||||||
require_once 'includes/html_head.php';
|
require_once 'includes/html_head.php';
|
||||||
|
require_once 'includes/header.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<main class="container my-5">
|
<main class="container my-5">
|
||||||
|
|||||||
29
product.php
29
product.php
@ -1,14 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
if (session_status() === PHP_SESSION_NONE) {
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
require_once 'includes/auth.php';
|
|
||||||
require_login();
|
|
||||||
require_once 'includes/helpers.php';
|
|
||||||
|
|
||||||
// This line is now required at the top of pages that use the header.
|
// This line is now required at the top of pages that use the header.
|
||||||
require_once 'includes/i18n.php';
|
require_once __DIR__ . '/includes/init.php';
|
||||||
require_once 'includes/currency.php';
|
require_login();
|
||||||
|
|
||||||
$product_id = $_GET['id'] ?? null;
|
$product_id = $_GET['id'] ?? null;
|
||||||
|
|
||||||
@ -43,19 +36,9 @@ try {
|
|||||||
|
|
||||||
$page_title = htmlspecialchars($product['name']);
|
$page_title = htmlspecialchars($product['name']);
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
|
require_once __DIR__ . '/includes/header.php';
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="<?= get_lang() ?>">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title><?php echo $page_title; ?> - ExtraB2B</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php require_once 'includes/header.php'; ?>
|
|
||||||
|
|
||||||
<main class="container my-5">
|
<main class="container my-5">
|
||||||
<a href="index.php" class="btn btn-outline-secondary mb-3">
|
<a href="index.php" class="btn btn-outline-secondary mb-3">
|
||||||
@ -211,7 +194,7 @@ $page_title = htmlspecialchars($product['name']);
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php require_once 'includes/footer.php'; ?>
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
@ -229,5 +212,3 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
35
profile.php
35
profile.php
@ -1,14 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
require_once __DIR__ . '/includes/init.php';
|
||||||
require_once 'includes/auth.php';
|
require_login();
|
||||||
require_once 'db/config.php';
|
|
||||||
require_once 'includes/i18n.php';
|
|
||||||
require_once 'includes/helpers.php';
|
|
||||||
|
|
||||||
if (!is_logged_in()) {
|
|
||||||
header('Location: login.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$user_id = $_SESSION['user_id'];
|
$user_id = $_SESSION['user_id'];
|
||||||
$db = db();
|
$db = db();
|
||||||
@ -25,19 +17,12 @@ if (!empty($user['client_id'])) {
|
|||||||
$stmt->execute([$user['client_id']]);
|
$stmt->execute([$user['client_id']]);
|
||||||
$client = $stmt->fetch(PDO::FETCH_ASSOC);
|
$client = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$page_title = t('profile_header');
|
||||||
|
|
||||||
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
|
require_once __DIR__ . '/includes/header.php';
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="<?= get_lang() ?>">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title><?= t('profile_user_profile') ?></title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
|
||||||
<link href="<?php echo BASE_URL; ?>assets/css/custom.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<?php require_once 'includes/header.php'; ?>
|
|
||||||
<div class="container mt-5">
|
<div class="container mt-5">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@ -74,6 +59,6 @@ if (!empty($user['client_id'])) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<?php
|
||||||
</body>
|
require_once __DIR__ . '/includes/footer.php';
|
||||||
</html>
|
?>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once __DIR__ . '/includes/header.php';
|
require_once __DIR__ . '/includes/init.php';
|
||||||
require_once __DIR__ . '/includes/currency.php';
|
|
||||||
require_once __DIR__ . '/includes/html_head.php';
|
require_once __DIR__ . '/includes/html_head.php';
|
||||||
|
require_once __DIR__ . '/includes/header.php';
|
||||||
require_login();
|
require_login();
|
||||||
|
|
||||||
$page_title = t('related_suggestions_title');
|
$page_title = t('related_suggestions_title');
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
session_start();
|
require_once __DIR__ . '/../includes/init.php';
|
||||||
require_once __DIR__ . '/../includes/lang.php';
|
|
||||||
require_once __DIR__ . '/../includes/auth.php';
|
|
||||||
require_role('supplier');
|
require_role('supplier');
|
||||||
require_once __DIR__ . '/../db/config.php';
|
|
||||||
require_once __DIR__ . '/../includes/helpers.php';
|
|
||||||
require_once __DIR__ . '/../includes/status_updater.php';
|
require_once __DIR__ . '/../includes/status_updater.php';
|
||||||
|
|
||||||
$supplier_id = $_SESSION['user_id']; // Assuming the supplier is a user and their ID is in the session
|
$supplier_id = $_SESSION['user_id']; // Assuming the supplier is a user and their ID is in the session
|
||||||
@ -53,7 +50,8 @@ $order_items = $stmt->fetchAll();
|
|||||||
$item_statuses = ['pending', 'in_progress', 'shipped'];
|
$item_statuses = ['pending', 'in_progress', 'shipped'];
|
||||||
|
|
||||||
$pageTitle = t('my_order_items');
|
$pageTitle = t('my_order_items');
|
||||||
include '../includes/header.php';
|
require_once __DIR__ . '/../includes/html_head.php';
|
||||||
|
require_once __DIR__ . '/../includes/header.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<main class="container mt-4">
|
<main class="container mt-4">
|
||||||
@ -110,4 +108,4 @@ include '../includes/header.php';
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php include '../includes/footer.php'; ?>
|
<?php require_once __DIR__ . '/../includes/footer.php'; ?>
|
||||||
Loading…
x
Reference in New Issue
Block a user