-
Notifications
You must be signed in to change notification settings - Fork 9
/
viewbuyspareparts.php
91 lines (78 loc) · 2.66 KB
/
viewbuyspareparts.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
<?php
session_start();
include("header.php");
include("sidebar.php");
include("dbconnection.php");
if(isset($_GET["ordid"]))
{
$dt= date("Y-m-d");
mysql_query("UPDATE sparepartsorder SET status='Delivered',deliverydate='$dt' where sporderid='$_GET[ordid]'");
}
if(isset($_SESSION[custid]))
{
$result= mysql_query("select * from sparepartsorder where custid='$_SESSION[custid]'");
}
else
{
$result= mysql_query("select * from sparepartsorder");
}
?>
<div id="main">
<a name="TemplateInfo"></a>
<h1>View purchased Vehicles</h1>
<form id="form1" name="form1" method="post" action="">
<table width="657" border="1">
<tr>
<th width="67" scope="col">Order ID</th>
<th width="221" scope="col">Spare Parts details</th>
<th width="138" scope="col">Customer<br />
details</th>
<th width="81" scope="col">Date</th>
<th width="45" scope="col">No. of Items</th>
<th width="46" 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 spareparts where spid='$arrrec[spid]'");
$arrrec2= mysql_fetch_array($result2);
$result3= mysql_query("select * from customer where custid='$arrrec[custid]'");
$arrrec3= mysql_fetch_array($result3);
echo" <tr>
<td> $arrrec[sporderid]</td>
<td><img src='upload/$arrrec2[image]' height='75' width='75' align='left'>
Name: <b>$arrrec2[name]</b><br>
Type: <b>$arrrec2[type]</b><br>
Cost: Dhs. <b>$arrrec2[cost]</b><br>
Spareparts No: <b>$arrrec2[sparepartno]</b><br>
</td>
<td> ";
echo "<strong>Name: </strong>".$arrrec3[fname]. " ". $arrrec3[lname]."<br>";
echo "<strong>Contact No.: </strong>". $arrrec3[contactno1];
echo " </td>
<td> <strong>Order date:</strong> <br> $arrrec[orderdate] <hr>
<strong>Delivered date:</strong> <br> $arrrec[deliverydate]</td>
<td> $arrrec[noofitems]</td>
<td> <strong>$arrrec[status]</strong><br>";
if(!isset($_SESSION[custid]))
{
if($arrrec[status] == "Pending")
{
echo "<a href='viewbuyspareparts.php?ordid=$arrrec[sporderid]'>Delivered</a>";
}
}
echo "</td></tr>";
}
?>
</table>
</form>
<p> </p>
<br />
</div>
<!-- wrap ends here -->
</div>
<?php
include("footer.php");
?>