-
Notifications
You must be signed in to change notification settings - Fork 0
/
uploaded.php
168 lines (88 loc) · 3.11 KB
/
uploaded.php
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
session_start();
if(!isset($_SESSION ["email"]))
{
header("Location:login.php");
}
else
{
$DBHOST = "localhost";
$DBUSER = "Vehiclemanagement";
$DBPWD = "Vehiclemanagement123";
$DBNAME = "vehiclemanagement";
$conn = new mysqli($DBHOST, $DBUSER, $DBPWD, $DBNAME);
if($conn->connect_error)
{
die("Connection failed!".$conn->connect_error);
}
echo "<img class = 'logo1' src = 'images/cover.png' width='125px'>";
echo "<a href='logout.php' onclick='myFunction()' class = 'logout button'><button>Sign out</button></a>";
echo "<b>Welcome, </b>" . $_SESSION['email'] ;
echo "<script>
function myFunction() {
alert('Thank you for Coming, see you again!');
}
</script>
";
echo"<div class='container'>";
echo" <div class = 'navbar'>";
echo" <nav>";
echo "<h2><center>Uploaded Vehicles</center><h2>";
echo "<a href='display_vehicles.php'><button>back</button></a>";
echo"</nav>";
echo"</div>";
echo" </div>";
echo "<br>";
echo "<br>";
$email = $_SESSION['email'];
$customer_id = $_SESSION['customer_id'];
$statement = "SELECT * FROM vehicle WHERE customer_id= $customer_id";
$result = $conn->query($statement);
while($row = $result->fetch_assoc())
{
$iid = $row["vehicle_id"];
$iname = $row["vehicle_type"];
$ipic = $row["vehicle_picture"];
$day_uploaded = $row["day_uploaded"];
$vehicle_category = $row["vehicle_category"];
$vehicle_price = $row["vehicle_price"];
$iimg = "images/";
$iimg = $iimg.$row["vehicle_picture"];
$i_desc = $row["vehicle_desc"];
$payment_method = $row["payment_method"];
$vehicle_seller = $row["vehicle_seller"];
$vehicle_number_plate = $row["vehicle_number_plate"];
$link = "vehicle_details.php?vehicle_id=";
$vehicle_details = $link.$iid;
echo "<div class = 'item'>";
echo "<div class = 'item_row'>Vehicle Id : $iid</div>";
echo "<br>";
echo "<div class = 'item_row'>Vehicle Type : $iname</div>";
echo "<img class = 'item_img' src = '$iimg' alt='image'>";
echo "<div class = 'item_row'><b><h3>Vehcle Plate : $vehicle_number_plate </h3></b></div>";
echo "<div class = 'item_row'><b><h3>Vehicle Price : $vehicle_price </h3></b></div>";
echo "<div class = 'item_row'> Payment Method : $payment_method</div>";
echo "<br>";
echo "<div class = 'item_row'> Vehicle Category : $vehicle_category</div>";
echo "<br>";
echo "<div class = 'item_row'> Seller details : $vehicle_seller</div>";
echo "<br>";
echo "<form action = '' method='POST'>";
echo "<input type = 'hidden' name='vehicle_id' value = '$iid' >";
echo "<input type = 'hidden' name = 'email' value = '$email'>";
echo "</form>";
echo "<div class = 'item_row'><a class = 'link' href='$vehicle_details'><button>Vehicle Details </button></a></div>";
echo "</div>";
}/* display all the items on screen*/
$conn->close();
}/* prevent direct access by the user*/
?>
</body>
</html>