3 Commits

13 changed files with 72 additions and 27 deletions
+7 -2
View File
@@ -19,6 +19,11 @@ if ($result === false) {
<title>Il mio account - TechStore</title> <title>Il mio account - TechStore</title>
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<script src="assets/js/cart.js"></script> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
@@ -49,7 +54,7 @@ if ($result === false) {
<h1>Account di <?php echo htmlspecialchars($_SESSION['name']); ?><?php if ($_SESSION['role'] == 'admin') { echo ' (Admin)'; } ?></h1> <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> <p><strong>Nome completo:</strong> <?php echo htmlspecialchars($_SESSION['name']) . ' ' . htmlspecialchars($_SESSION['surname']); ?></p>
<br> <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> <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> <br><br>
</div> </div>
+6 -1
View File
@@ -58,6 +58,11 @@ if ($result_total_products) {
<title>Dashboard amministratore - TechStore</title> <title>Dashboard amministratore - TechStore</title>
<link rel="stylesheet" href="/assets/style.css"> <link rel="stylesheet" href="/assets/style.css">
<script src="/assets/js/cart.js"></script> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
+1 -1
View File
@@ -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> <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> <span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
+1 -1
View File
@@ -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> <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> <span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
+1 -1
View File
@@ -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> <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> <span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
+11 -11
View File
@@ -190,7 +190,7 @@ header span {
} }
.product-card button { .product-card button {
padding: 8px 16px; padding: 8px 16px;
background-color: #007bff; background-color: #1c71d8;
color: white; color: white;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
@@ -360,7 +360,7 @@ form button:hover {
} }
.checkout-btn { .checkout-btn {
padding: 10px 20px; padding: 10px 20px;
background-color: #28a745; background-color: #1d8033;
color: white; color: white;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
@@ -401,7 +401,7 @@ form button:hover {
} }
.my-sidebar a { .my-sidebar a {
color: #007bff; color: #1c71d8;
text-decoration: none; text-decoration: none;
} }
@@ -472,7 +472,7 @@ form button:hover {
.toggle-button { .toggle-button {
padding: 10px 16px; padding: 10px 16px;
background-color: #17a2b8; background-color: #117281;
color: #fff; color: #fff;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
@@ -517,7 +517,7 @@ form button:hover {
height: 32px; height: 32px;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
background-color: #007bff; background-color: #1c71d8;
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
} }
@@ -594,7 +594,7 @@ form button:hover {
} }
.admin-stat-products { .admin-stat-products {
border-color: #17a2b8; border-color: #117281;
background-color: #e9f7fb; background-color: #e9f7fb;
} }
@@ -649,7 +649,7 @@ form button:hover {
} }
.status-completed { .status-completed {
background-color: #28a745; background-color: #1d8033;
color: white; color: white;
} }
@@ -748,7 +748,7 @@ form button:hover {
/* Stili per btn-reset */ /* Stili per btn-reset */
.btn-reset { .btn-reset {
background-color: #17a2b8; background-color: #117281;
color: white; color: white;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
@@ -1068,7 +1068,7 @@ header button {
margin-left: 0 !important; margin-left: 0 !important;
margin-right: 5px !important; margin-right: 5px !important;
padding: 8px 12px !important; padding: 8px 12px !important;
background-color: #007bff !important; background-color: #1c71d8 !important;
color: white !important; color: white !important;
border: none !important; border: none !important;
border-radius: 4px !important; border-radius: 4px !important;
@@ -1082,8 +1082,8 @@ header a:has(button[style*="#dc3545"]) button {
} }
header a[href*="login"] button, header a[href*="login"] button,
header a:has(button[style*="#28a745"]) button { header a:has(button[style*="#1d8033"]) button {
background-color: #28a745 !important; background-color: #1d8033 !important;
} }
header button:hover { header button:hover {
+6 -1
View File
@@ -10,6 +10,11 @@ session_start();
<title>Carrello - TechStore</title> <title>Carrello - TechStore</title>
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<script src="assets/js/cart.js"></script> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
+9 -4
View File
@@ -119,6 +119,11 @@ $conn->close();
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $success ? 'Ordine confermato' : 'Errore ordine'; ?> - TechStore</title> <title><?php echo $success ? 'Ordine confermato' : 'Errore ordine'; ?> - TechStore</title>
<link rel="stylesheet" href="assets/style.css"> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
<div style="max-width: 600px; margin: 50px auto; padding: 20px; text-align: center; border: 1px solid #ddd; border-radius: 8px; background-color: #fff;"> <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): ?> <?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>Il tuo ordine è stato elaborato con successo.</p>
<p><strong>Numero ordine:</strong> #<?php echo $order_id; ?></p> <p><strong>Numero ordine:</strong> #<?php echo $order_id; ?></p>
<p><strong>Totale:</strong> €<?php echo number_format($order_total, 2, ',', '.'); ?></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: ?> <?php else: ?>
<h1 style="color: #dc3545;">Errore nell'ordine</h1> <h1 style="color: #dc3545;">Errore nell'ordine</h1>
<p><?php echo htmlspecialchars($error); ?></p> <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; ?> <?php endif; ?>
</div> </div>
</body> </body>
+7 -2
View File
@@ -19,6 +19,11 @@ if ($result === false) {
<title>TechStore - Prodotti</title> <title>TechStore - Prodotti</title>
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<script src="assets/js/cart.js"></script> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
@@ -38,7 +43,7 @@ if ($result === false) {
<div class="products-grid"> <div class="products-grid">
<?php while ($row = $result->fetch_assoc()): ?> <?php while ($row = $result->fetch_assoc()): ?>
<div class="product-card"> <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> <h3><?php echo "<a href='product.php?id=" . $row['ProductID'] . "'>" . htmlspecialchars($row['ProductName']) . "</a>"; ?></h3>
<p><?php echo htmlspecialchars($row['Price']); ?>€</p> <p><?php echo htmlspecialchars($row['Price']); ?>€</p>
<?php if ($row['StockQuantity'] > 0): ?> <?php if ($row['StockQuantity'] > 0): ?>
+5
View File
@@ -48,6 +48,11 @@ $conn->close();
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - TechStore</title> <title>Login - TechStore</title>
<link rel="stylesheet" href="assets/style.css"> <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> </head>
<body> <body>
<form action="" method="POST"> <form action="" method="POST">
+6 -1
View File
@@ -35,6 +35,11 @@ if (!$result) {
<title>Il mio account - TechStore</title> <title>Il mio account - TechStore</title>
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<script src="assets/js/cart.js"></script> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <?php echo htmlspecialchars($_SESSION['name']); ?></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
+7 -2
View File
@@ -30,6 +30,11 @@ if ($stmt = $conn->prepare($sql)) {
<?php endif; ?> <?php endif; ?>
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<script src="assets/js/cart.js"></script> <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> </head>
<body> <body>
<header style="display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f2f2f2; border-bottom: 1px solid #ddd;"> <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> <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> <span style="margin-left: 10px;">Benvenuto, <a href="account.php"><?php echo htmlspecialchars($_SESSION['name']); ?></a></span>
<?php else: ?> <?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; ?> <?php endif; ?>
</div> </div>
</header> </header>
@@ -55,7 +60,7 @@ if ($stmt = $conn->prepare($sql)) {
<p><strong>Prezzo:</strong> €<?php echo htmlspecialchars($product['Price']); ?></p> <p><strong>Prezzo:</strong> €<?php echo htmlspecialchars($product['Price']); ?></p>
<p><strong>Quantità disponibile:</strong> <?php echo htmlspecialchars($product['StockQuantity']); ?></p> <p><strong>Quantità disponibile:</strong> <?php echo htmlspecialchars($product['StockQuantity']); ?></p>
<?php if ($product['StockQuantity'] > 0): ?> <?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: ?> <?php else: ?>
<button disabled style="padding: 10px 20px; background-color: #ccc; color: white; border: none; border-radius: 4px; cursor: not-allowed;">Esaurito</button> <button disabled style="padding: 10px 20px; background-color: #ccc; color: white; border: none; border-radius: 4px; cursor: not-allowed;">Esaurito</button>
<?php endif; ?> <?php endif; ?>
+5
View File
@@ -9,6 +9,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registrazione - TechStore</title> <title>Registrazione - TechStore</title>
<link rel="stylesheet" href="assets/style.css"> <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> </head>
<body> <body>
<?php <?php