-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvehicle_data.php
More file actions
188 lines (182 loc) · 7.28 KB
/
vehicle_data.php
File metadata and controls
188 lines (182 loc) · 7.28 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
// Include the database connection file
include 'db_connect.php';
if (isset($_GET['model_id']) && isset($_GET['version_name'])) {
// Prepare and bind
$stmt = $conn->prepare("SELECT * FROM vehicle_data WHERE model_id = ? AND version_name = ?");
if ($stmt === false) {
die("Error preparing statement: " . $conn->error);
}
$stmt->bind_param("is", $_GET['model_id'], $_GET['version_name']);
// Execute the statement
if ($stmt->execute()) {
// Fetch data and display it
$result = $stmt->get_result();
if ($row = $result->fetch_assoc()) {
?>
<!DOCTYPE html>
<html>
<head>
<title>Vehicle Data</title>
<style>
body {
font-family: sans-serif;
margin: 0;
text-align: center;
}
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
header {
background: #333;
color: #fff;
padding-top: 30px;
min-height: 70px;
border-bottom: #77aaff 3px solid;
}
header a {
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
}
.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;
}
.left-aligned-image {
float: left;
margin-right: 10px;
}
/* Add more styles as needed */
</style>
</head>
<body>
<div class="menu">
<a href="index.php">Home</a>
<a href="obd_code_lookup.php">Obd code</a>
<a href="ecu_model_info.php">Ecu PIN</a>
<a href="pinout_airbag.php">Airbag PIN</a>
<a href="https://www.youtube.com" target="_blank">YouTube</a>
<a href="https://wa.me" target="_blank">WhatsApp</a>
</div>
<div class="container">
<header>
<h1>Vehicle Data</h1>
</header>
<div class="content">
<?php
// Display car image
if (!empty($row['carimage'])) {
echo "<img src='" . $row['carimage'] . "' alt='Car Image' class='left-aligned-image'><br>";
}
// Display engine code with styles
echo "<p style='color: #FF5733; font-weight: bold;'>Engine Code: " . $row['engine_code'] . "</p>";
// Display engine size with styles
echo "<p style='color: #33FF57; font-style: italic;'>Engine Size: " . $row['engine_size'] . "</p>";
// Display power with styles
echo "<p style='color: #3357FF; text-decoration: underline;'>Power: " . $row['power'] . "</p>";
// Display torque with styles
echo "<p style='color: #FF33A1; font-family: Arial, sans-serif;'>Torque: " . $row['torque'] . "</p>";
// Display ECU image
// Display car parts and images
$car_parts = explode(',', $row['car_parts']);
$car_parts_images = explode(',', $row['car_parts_images']);
if (count($car_parts) == count($car_parts_images)) {
for ($i = 0; $i < count($car_parts); $i++) {
echo "<p>--: " . $car_parts[$i] . "</p>";
echo "<img src='" . $car_parts_images[$i] . "' alt='Part Image'><br>";
}
}
// Display electrical schema image
if (!empty($row['electrical_schema_img'])) {
echo "<img src='" . $row['electrical_schema_img'] . "' alt='Electrical Schema Image'><br>";
}
// Embed HTML page
if (!empty($row['html_page_path'])) {
echo "<iframe src='" . $row['html_page_path'] . "' width='100%' height='600px'></iframe>";
}
?>
</div>
</div>
</body>
</html>
<?php
} else {
echo "No data found for the specified model ID and version name.";
}
} else {
echo "Error executing query.";
}
$stmt->close();
$conn->close();
} else {
?>
<!DOCTYPE html>
<html>
<head>
<title>Vehicle Data</title>
<style>
body {
font-family: sans-serif;
margin: 0;
text-align: center;
}
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
header {
background: #333;
color: #fff;
padding-top: 30px;
min-height: 70px;
border-bottom: #77aaff 3px solid;
}
header a {
color: #fff;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
}
/* Add more styles as needed */
</style>
</head>
<body>
<div class="container">
<header>
<h1>Vehicle Data</h1>
</header>
<div class="content">
<p>Invalid model ID or version name.</p>
</div>
</div>
</body>
</html>
<?php
}
?>