-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyears.php
More file actions
136 lines (130 loc) · 4.45 KB
/
years.php
File metadata and controls
136 lines (130 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php include 'db_connect.php'; ?>
<!DOCTYPE html>
<html>
<head>
<title>Years</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff; /* Light blue background */
color: #333;
margin: 0;
padding: 20px;
}
h1 {
color: #1e90ff; /* Dodger blue */
text-align: center;
}
ul {
list-style-type: none;
padding: 0;
max-width: 600px;
margin: 0 auto;
}
li {
background-color: #ffffff;
border: 1px solid #1e90ff;
border-radius: 5px;
margin-bottom: 10px;
padding: 10px;
display: flex;
align-items: center;
transition: background-color 0.3s;
}
li:hover {
background-color: #e0f7ff; /* Light blue on hover */
}
a {
text-decoration: none;
color: #1e90ff;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
.logout-button {
background-color: #ff4c4c;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
display: block;
margin: 20px auto;
text-align: center;
}
.logout-button:hover {
background-color: #ff1c1c;
}
.menu {
display: flex;
justify-content: space-between; /* changed to space-between for a more balanced layout */
gap: 20px;
margin-bottom: 20px;
padding: 10px; /* added some padding for a bit of breathing room */
background-color: #f7f7f7; /* added a light gray background color */
border-bottom: 1px solid #ddd; /* added a subtle border at the bottom */
}
.menu a {
text-decoration: none;
color: #1e90ff;
font-weight: bold;
transition: color 0.2s ease; /* added a smooth transition effect on hover */
}
.menu a:hover {
text-decoration: underline;
color: #007bff; /* changed the hover color to a slightly darker blue */
}
.credits {
text-align: center;
margin-top: 20px;
font-size: 0.9em;
color: #666;
}
</style>
</head>
<body>
<div class="menu">
<a href="index.php">Home</a>
<a href="obd_code_lookup.php">Obd code</a>
<a href="pinout_airbag.php">Airbag PIN</a>
<a href="ecu_model_info.php">Ecu PIN</a>
<a href="https://www.youtube.com" target="_blank">YouTube</a>
<a href="https://wa.me" target="_blank">WhatsApp</a>
</div>
<h1>Years</h1>
<?php if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true): ?>
<form action="logout.php" method="post">
<input type="submit" value="Logout" class="logout-button">
</form>
<?php endif; ?>
<ul>
<?php
if (isset($_GET['model_id']) && is_numeric($_GET['model_id'])) {
$model_id = intval($_GET['model_id']);
$stmt = $conn->prepare("SELECT DISTINCT year FROM years WHERE text = ?");
if ($stmt) { // Check if prepare was successful
$stmt->bind_param("s", $model_id);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "<li><a href='model_versions.php?model_id=" . htmlspecialchars($model_id) . "&year=" . htmlspecialchars($row['year']) . "'>" . htmlspecialchars($row['year']) . "</a></li>";
}
} else {
echo "<li>No years found for this model.</li>";
}
$stmt->close();
} else {
echo "<li>Error preparing statement.</li>";
}
} else {
echo "<li>Invalid model ID.</li>";
}
?>
</ul>
<div class="credits">
© 2025 Your Company. All rights reserved.
</div>
</body>
</html>