-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
45 lines (43 loc) · 1.16 KB
/
test.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
<?php
session_start();
$company=$_GET['company'] ;
$type=$_GET['type'] ;
$model=$_GET['model'] ;
$true="true";
$temp=0;
$con=mysqli_connect("localhost","root","","car_rental");
$display_data = mysqli_query($con,"SELECT * FROM inventory where car_id in (SELECT car_id FROM car where company='$company' and car_type='$type'and model='$model')");
while ($row = mysqli_fetch_array($display_data))
{
$num=$row['number_plate'];
if($temp==0){
echo "<tr><th>car_id</th>";
echo "<th>company</th>";
echo "<th>type</th>";
echo "<th>model</th>";
echo "<th>number_plate</th>";
echo "<th>color</th>";
echo "<th>availability</th>";
echo "<th>price</th>";
echo "<th>select</th></tr>" ;
}$temp=1;
if($row['availability'])
{
$row['availability']='true';
}
else
{
$row['availability']='false';
}
echo "<tr><td>".$row['car_id']."</td>";
echo "<td>".$company."</td>";
echo "<td>".$type."</td>";
echo "<td>".$model."</td>";
echo "<td>".$row['number_plate']."</td>";
echo "<td>".$row['color']."</td>";
echo "<td>".$row['availability']."</td>";
echo "<td>".$row['price']."</td>";
echo "<td><input type='radio' name='select' value='".$num."'></td></tr>" ;
}
mysqli_close($con);
?>