mirror of
https://codeberg.org/ThisIsMiseryy/techstore
synced 2026-05-14 14:52:04 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
29e5b4dcb2
|
|||
|
f68297e1b4
|
|||
|
3afe958740
|
|||
|
d4b19bf71a
|
+7
-2
@@ -19,6 +19,11 @@ if ($result === false) {
|
||||
<title>Il mio account - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<script src="assets/js/cart.js"></script>
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -29,7 +34,7 @@ if ($result === false) {
|
||||
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
@@ -49,7 +54,7 @@ if ($result === false) {
|
||||
<h1>Account di <?php echo htmlspecialchars($_SESSION['name']); ?><?php if ($_SESSION['role'] == 'admin') { echo ' (Admin)'; } ?></h1>
|
||||
<p><strong>Nome completo:</strong> <?php echo htmlspecialchars($_SESSION['name']) . ' ' . htmlspecialchars($_SESSION['surname']); ?></p>
|
||||
<br>
|
||||
<a href="account/passwordChange.php" style="padding: 8px 16px; background-color: #17a2b8; color: white; border: none; border-radius: 4px; text-decoration: none; cursor: pointer;">Modifica password</a>
|
||||
<a href="account/passwordChange.php" style="padding: 8px 16px; background-color: #117281; color: white; border: none; border-radius: 4px; text-decoration: none; cursor: pointer;">Modifica password</a>
|
||||
<a href="account/delete.php" style="padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; text-decoration: none; cursor: pointer;">Elimina account</a>
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
+6
-1
@@ -58,6 +58,11 @@ if ($result_total_products) {
|
||||
<title>Dashboard amministratore - TechStore</title>
|
||||
<link rel="stylesheet" href="/assets/style.css">
|
||||
<script src="/assets/js/cart.js"></script>
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -68,7 +73,7 @@ if ($result_total_products) {
|
||||
<a href="/logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -88,7 +88,7 @@ if ($result === false) {
|
||||
<a href="/logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -147,7 +147,7 @@ $stmt_prod->close();
|
||||
<a href="/logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -93,7 +93,7 @@ if ($result === false) {
|
||||
<a href="/logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="/login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+11
-11
@@ -190,7 +190,7 @@ header span {
|
||||
}
|
||||
.product-card button {
|
||||
padding: 8px 16px;
|
||||
background-color: #007bff;
|
||||
background-color: #1c71d8;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
@@ -360,7 +360,7 @@ form button:hover {
|
||||
}
|
||||
.checkout-btn {
|
||||
padding: 10px 20px;
|
||||
background-color: #28a745;
|
||||
background-color: #1d8033;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
@@ -401,7 +401,7 @@ form button:hover {
|
||||
}
|
||||
|
||||
.my-sidebar a {
|
||||
color: #007bff;
|
||||
color: #1c71d8;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ form button:hover {
|
||||
|
||||
.toggle-button {
|
||||
padding: 10px 16px;
|
||||
background-color: #17a2b8;
|
||||
background-color: #117281;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
@@ -517,7 +517,7 @@ form button:hover {
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background-color: #007bff;
|
||||
background-color: #1c71d8;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -594,7 +594,7 @@ form button:hover {
|
||||
}
|
||||
|
||||
.admin-stat-products {
|
||||
border-color: #17a2b8;
|
||||
border-color: #117281;
|
||||
background-color: #e9f7fb;
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ form button:hover {
|
||||
}
|
||||
|
||||
.status-completed {
|
||||
background-color: #28a745;
|
||||
background-color: #1d8033;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ form button:hover {
|
||||
|
||||
/* Stili per btn-reset */
|
||||
.btn-reset {
|
||||
background-color: #17a2b8;
|
||||
background-color: #117281;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
@@ -1068,7 +1068,7 @@ header button {
|
||||
margin-left: 0 !important;
|
||||
margin-right: 5px !important;
|
||||
padding: 8px 12px !important;
|
||||
background-color: #007bff !important;
|
||||
background-color: #1c71d8 !important;
|
||||
color: white !important;
|
||||
border: none !important;
|
||||
border-radius: 4px !important;
|
||||
@@ -1082,8 +1082,8 @@ header a:has(button[style*="#dc3545"]) button {
|
||||
}
|
||||
|
||||
header a[href*="login"] button,
|
||||
header a:has(button[style*="#28a745"]) button {
|
||||
background-color: #28a745 !important;
|
||||
header a:has(button[style*="#1d8033"]) button {
|
||||
background-color: #1d8033 !important;
|
||||
}
|
||||
|
||||
header button:hover {
|
||||
|
||||
+6
-1
@@ -10,6 +10,11 @@ session_start();
|
||||
<title>Carrello - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<script src="assets/js/cart.js"></script>
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -20,7 +25,7 @@ session_start();
|
||||
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
|
||||
<?php else: ?>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+9
-4
@@ -119,6 +119,11 @@ $conn->close();
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo $success ? 'Ordine confermato' : 'Errore ordine'; ?> - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -129,22 +134,22 @@ $conn->close();
|
||||
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
|
||||
<?php else: ?>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div style="max-width: 600px; margin: 50px auto; padding: 20px; text-align: center; border: 1px solid #ddd; border-radius: 8px; background-color: #fff;">
|
||||
<?php if ($success): ?>
|
||||
<h1 style="color: #28a745;">Ordine confermato!</h1>
|
||||
<h1 style="color: #1d8033;">Ordine confermato!</h1>
|
||||
<p>Il tuo ordine è stato elaborato con successo.</p>
|
||||
<p><strong>Numero ordine:</strong> #<?php echo $order_id; ?></p>
|
||||
<p><strong>Totale:</strong> €<?php echo number_format($order_total, 2, ',', '.'); ?></p>
|
||||
<a href="index.php"><button style="padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 20px;">Torna alla home</button></a>
|
||||
<a href="index.php"><button style="padding: 10px 20px; background-color: #1c71d8; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 20px;">Torna alla home</button></a>
|
||||
<?php else: ?>
|
||||
<h1 style="color: #dc3545;">Errore nell'ordine</h1>
|
||||
<p><?php echo htmlspecialchars($error); ?></p>
|
||||
<a href="cart.php"><button style="padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 20px;">Torna al carrello</button></a>
|
||||
<a href="cart.php"><button style="padding: 10px 20px; background-color: #1c71d8; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 20px;">Torna al carrello</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+7
-2
@@ -19,6 +19,11 @@ if ($result === false) {
|
||||
<title>TechStore - Prodotti</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<script src="assets/js/cart.js"></script>
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -29,7 +34,7 @@ if ($result === false) {
|
||||
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
|
||||
<?php else: ?>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
@@ -38,7 +43,7 @@ if ($result === false) {
|
||||
<div class="products-grid">
|
||||
<?php while ($row = $result->fetch_assoc()): ?>
|
||||
<div class="product-card">
|
||||
<a href="product.php?id=<?php echo $row['ProductID']; ?>"><div class="img-square"><img src="img/<?php echo htmlspecialchars($row['ImagePath']); ?>" alt="Immagine prodotto"></div></a>
|
||||
<a href="product.php?id=<?php echo $row['ProductID']; ?>"><div class="img-square"><img src="img/<?php echo htmlspecialchars($row['ImagePath']); ?>" alt="Immagine di <?php echo htmlspecialchars($row['ProductName']); ?>"></div></a>
|
||||
<h3><?php echo "<a href='product.php?id=" . $row['ProductID'] . "'>" . htmlspecialchars($row['ProductName']) . "</a>"; ?></h3>
|
||||
<p><?php echo htmlspecialchars($row['Price']); ?>€</p>
|
||||
<?php if ($row['StockQuantity'] > 0): ?>
|
||||
|
||||
@@ -48,6 +48,11 @@ $conn->close();
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<form action="" method="POST">
|
||||
|
||||
+6
-1
@@ -35,6 +35,11 @@ if (!$result) {
|
||||
<title>Il mio account - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<script src="assets/js/cart.js"></script>
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -45,7 +50,7 @@ if (!$result) {
|
||||
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
|
||||
<?php else: ?>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+7
-2
@@ -30,6 +30,11 @@ if ($stmt = $conn->prepare($sql)) {
|
||||
<?php endif; ?>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<script src="assets/js/cart.js"></script>
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;">
|
||||
@@ -40,7 +45,7 @@ if ($stmt = $conn->prepare($sql)) {
|
||||
<a href="logout.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">Logout</button></a>
|
||||
<span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
|
||||
<?php else: ?>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<a href="login.php"><button style="margin-left: 10px; padding: 8px 16px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Accesso</button></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
@@ -55,7 +60,7 @@ if ($stmt = $conn->prepare($sql)) {
|
||||
<p><strong>Prezzo:</strong> €<?php echo htmlspecialchars($product['Price']); ?></p>
|
||||
<p><strong>Quantità disponibile:</strong> <?php echo htmlspecialchars($product['StockQuantity']); ?></p>
|
||||
<?php if ($product['StockQuantity'] > 0): ?>
|
||||
<button onclick="addToCart(<?php echo $product['ProductID']; ?>, '<?php echo htmlspecialchars($product['ProductName']); ?>', <?php echo $product['Price']; ?>)" style="padding: 10px 20px; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">Aggiungi al carrello</button>
|
||||
<button onclick="addToCart(<?php echo $product['ProductID']; ?>, '<?php echo htmlspecialchars($product['ProductName']); ?>', <?php echo $product['Price']; ?>)" style="padding: 10px 20px; background-color: #1d8033; color: white; border: none; border-radius: 4px; cursor: pointer;">Aggiungi al carrello</button>
|
||||
<?php else: ?>
|
||||
<button disabled style="padding: 10px 20px; background-color: #ccc; color: white; border: none; border-radius: 4px; cursor: not-allowed;">Esaurito</button>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Registrazione - TechStore</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
<?php
|
||||
if(getenv('ITSTRACKER_KEY')){
|
||||
echo "<script src=\"https://projectits.altervista.org/tracker.js?key=" . getenv('ITSTRACKER_KEY') . "\"></script>";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user