-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfirmRenting.php
170 lines (142 loc) · 9.32 KB
/
ConfirmRenting.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
<!DOCTYPE html>
<html>
<head>
<title>Confirm Renting Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT"
crossorigin="anonymous"></script>
<!--Fontawesome CDN-->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<!--Custom styles-->
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="ConfirmRenting.js"></script>
</head>
<body>
<div class="container">
<div class="d-flex justify-content-center h-100">
<div class="card" style="width: 60rem;height: 28rem;">
<div class="card-header">
<h3>Rent your car</h3>
</div>
<div class="card-body">
<form action="ConfirmRenting.php" method="POST">
<!-- car Information-->
<div class="row">
<!-- car Information Col-->
<div class="col">
<div class="card-header">
<h3>car Information</h3>
</div>
<!-- Information-->
<div class="card text-white bg-primary mb-3"
style="width: 33rem;height: 15rem;overflow: auto;">
<div class="card-body text-white">
<div class="container-fluid">
<?php
// function console_log($output, $with_script_tags = true)
// {
// $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . ');';
// if ($with_script_tags) {
// $js_code = '<script>' . $js_code . '</script>';
// }
// echo $js_code;
// }
session_start();
// console_log($_SESSION);
$PickupDate = $_SESSION['PickupDate'];
$ReturnDate = $_SESSION['ReturnDate'];
$carId = $_SESSION['carId'];
// $PickupDate = "22/4/2022";
// $ReturnDate = "24/4/2022";
// $carId = "mm111";
$connection = mysqli_connect('localhost', 'root', '', 'car_rental_system');
$query = mysqli_query($connection, "SELECT * FROM car NATURAL JOIN office WHERE car_id='" . $carId . "'");
$num_rows = mysqli_num_rows($query); // echo "<div class="mt-2 remember"><label style="font-size: 22px">Year:</label> <label id="year" style="font-size: 22px">Y</label></div>";
$row = mysqli_fetch_assoc($query);
echo "<div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">CAR ID:</label>
<label id=\"carId\" style=\"font-size: 22px\">" . $carId . "</label>
</div>";
// if($num_rows!=0)
echo "<div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">Model:</label>
<label id=\"model\" style=\"font-size: 22px\">" . $row['model'] . "</label>
</div>";
echo "<div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">Year:</label>
<label id=\"year\" style=\"font-size: 22px\">" . $row['year'] . "</label></div>";
echo "<div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">price/day:</label>
<label id=\"price_day\" style=\"font-size: 22px\">" . $row['price_per_day'] . "</label></div>";
echo "<div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">Color:</label>
<label id=\"color\" style=\"font-size: 22px\">" . $row['color'] . "</label></div>";
echo "<div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">Office name:</label>
<label id=\"office_name\" style=\"font-size: 22px\">" . $row['name'] . "</label></div>";
echo " <div class=\"mt-2 remember\">
<label style=\"font-size: 22px\">Office Location:</label>
<label id=\"Office_location\" style=\"font-size: 22px\">" . $row['country'] . "</label></div>";
?>
</div>
</div>
</div>
</div>
<!-- Additional needed Data Col-->
<div class="col-sm-5">
<div class="input-group form-group">
<div class="form-group">
<div class="card-header">
<h3>Payment details</h3>
</div>
<div class="mt-2 remember">
<label style="font-size: 22px">Pickup Date:</label>
<?php
$PickupDate = $_SESSION['PickupDate'];
echo "<label id=\"pickupDate\" style=\"font-size: 22px\">" .$PickupDate. "</label>";
?>
</div>
<div class="mt-2 input-group form-group">
<!-- to do put the pickup and return -->
<label style="font-size: 22px">Return Date:</label>
<?php
$returnDate = $_SESSION['ReturnDate'];
echo "<label id=\"returnDate\" style=\"font-size: 22px\">" .$ReturnDate. "</label>";
?>
</div>
<div class="mt-2 remember">
<label style="font-size: 22px">Pay Date:</label>
<label id="Pay_Date"
style="font-size: 22px">Pay
Date:</label>
</div>
<div class="mt-2 remember">
<label style="font-size: 22px">Total
Price:</label><label id="Total_Price" style="font-size: 22px">Total
Price:</label>
</div>
</div>
</div>
<div class="mt-2 form-group">
<input id="confirm" type="submit" value="Confirm and Check out" style="width: 250px"
class="btn float-right login_btn">
</div>
</div>
</div>
</div>
</form>
<div class="card-footer">
<div class="d-flex justify-content-left links">
<a href="homepage.html">Sign Out</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>