-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathviewbuyvehicles.php
100 lines (86 loc) · 2.68 KB
/
viewbuyvehicles.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
<?php
session_start();
include("header.php");
include("sidebar.php");
include("dbconnection.php");
$dt= date("Y-m-d");
if(isset($_GET["purchaseid"]))
{
mysql_query("UPDATE booking SET paymenttype='Delivered',deliverydate='$dt' where purchaseid='$_GET[purchaseid]'");
}
if(isset($_SESSION[custid]))
{
$result= mysql_query("select * from booking where custid='$_SESSION[custid]'");
}
else
{
$result= mysql_query("select * from booking");
}
?>
<div id="main">
<a name="TemplateInfo"></a>
<h1>View purchased Vehicles</h1>
<?php
if($ctins == 1)
{
echo "<center><b>Employees account created successfully...</b></center><br>";
echo "<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";
}
else
{
?>
<form id="form1" name="form1" method="post" action="">
<table width="754" border="1">
<tr>
<th width="81" scope="col">Purchase ID</th>
<th width="103" scope="col">Vehicle Name</th>
<th width="135" scope="col">Customer details</th>
<th width="92" scope="col">Date</th>
<th width="105" scope="col">Comments</th>
<th width="87" scope="col">Paid amount</th>
<th width="105" scope="col">Status</th>
</tr>
<?php
while($arrrec= mysql_fetch_array($result))
{
$result1= mysql_query("select * from vehiclestore where vehicleid='$arrrec[vehicleid]'");
$arrrec1= mysql_fetch_array($result1);
$result2= mysql_query("select * from customer where custid='$arrrec[custid]'");
$arrrec2= mysql_fetch_array($result2);
echo" <tr>
<td>$arrrec[purchaseid]</td>
<td><b>Vehicle ID:</b> $arrrec1[vehicleid]<br>
<b>Vehicle Name:</b> $arrrec1[vehname]<br>
<b>Vehicle Model:</b> $arrrec1[model]</td>
<td><b>Customer ID:</b> </b>$arrrec2[custid]<br>
<b>Name: </b>$arrrec2[fname] $arrrec2[lname]<br>
<b>Contact No.: </b><br>$arrrec2[contactno1]<br></td>
<td> Purchase date: <br> $arrrec[purchasedate] <hr>
Delivery date: <br> $arrrec[deliverydate]</td>
<td> $arrrec[comments]</td>
<td> $arrrec[paid]</td>
<td align='center'> $arrrec[paymenttype]";
if(isset($_SESSION[empid]))
{
if($arrrec[paymenttype]=="Pending")
{
echo "<br><a href='viewbuyvehicles.php?purchaseid=$arrrec[purchaseid]'><strong>Paid</strong></a>";
}
}
echo " </td>
</tr>";
}
?>
</table>
</form>
<?php
}
?>
<p> </p>
<br />
</div>
<!-- wrap ends here -->
</div>
<?php
include("footer.php");
?>