-
Notifications
You must be signed in to change notification settings - Fork 9
/
vehiclestorebookpaid.php
75 lines (66 loc) · 2.02 KB
/
vehiclestorebookpaid.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
<?php
include("header.php");
include("sidebar.php");
include("dbconnection.php");
$sql = mysql_query("select * from vehiclestore where vehicleid=$_POST[vahicleid]");
$row = mysql_fetch_array($sql);
?>
<?
if(isset($_POST['submit']))
{
//echo $_POST['comments'];
$sql = false;
$date = date("Y-m-d");
$sql ="insert into booking(vehicleid,custid,purchasedate,comments,paid,paymenttype) values('$_POST[vahicleid]','$_SESSION[custid]','$date','$_POST[comments]','$_POST[vehprice]','Pending')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$sql = mysql_query("update vehiclestore set status='Sold' where vehicleid='$_POST[vahicleid]'");
//if (!mysql_query($sql,$con))
if($sql !== true)
{
die('Error: ' . mysql_error());
echo "not working";
}
}
$sql = mysql_query("select * from vehiclestore where vehicleid='$_POST[vahicleid]'");
$row = mysql_fetch_array($sql);
?>
<div id="main">
<h3>Vehicle store</h3>
<table width="538" border="1">
<tr>
<td height="45" colspan="2"><h2>Vehicle booked successfully...</h2></td>
</tr>
<tr>
<td width="268">
<p><img src="upload/<?= $row['images']; ?>" width="208" height="130" align="left" /><br />
<br />
</p></td>
<td width="246"><p><strong>Vehicle Name:</strong><?= $row['vehname']; ?><br />
<strong>Model:</strong> <?= $row['model']; ?> <br />
<strong> Brand:</strong> <?= $row['brand']; ?><br />
<br />
<br />
</p></td>
</tr>
<tr>
<td>Other Information</td>
<td><p><?= $row['description']; ?></p><br />
</td>
</tr>
<tr>
<td colspan="2"><strong>Estimated price: Rs.<?= $row['estprice']; ?></strong></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<!-- wrap ends here -->
</div>
<?php
include("footer.php");
?>