-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbooking.php
More file actions
140 lines (118 loc) · 3.62 KB
/
booking.php
File metadata and controls
140 lines (118 loc) · 3.62 KB
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
<?php
session_start();
include "dbconfigure.php";
if(verifyuser())
{
$emailid = $_SESSION['semail'];
$query = "select * from siteuser where emailid='$emailid'";
$rs = my_select($query);
if($row=mysqli_fetch_array($rs))
{
$username = $row[0];
$city = $row[2];
$address = $row[3];
$contact = $row[5];
}
//product info
$id = $_GET['id'];
$query = "select * from product where id=$id";
$rs = my_select($query);
if($row = mysqli_fetch_array($rs))
{
$productname = $row[1];
$price = $row[4];
}
}
else
{
header("location:index.php");
}
?>
<html>
<head>
<?php include "header.php"; ?>
<style>
.blinking{
animation:blinkingText 1.2s infinite;
}
@keyframes blinkingText{
0%{ color: #000; }
49%{ color: #000; }
60%{ color: transparent; }
99%{ color:transparent; }
100%{ color: #000; }
}
</style>
<script>
function calc()
{
var quantity1 = document.getElementById("quantity").value;
var price1 = document.getElementById("price").value;
var totalprice = parseInt(quantity1)*parseInt(price1);
document.getElementById("total").value = totalprice;
}
</script>
</head>
<body>
<?php include "nav2.php";
echo "<br>Welcome <b style = 'text-transform : capitalize ; color : blue'>$username</b>";
?>
<div class="container" style = "margin-top:50px">
<h2 class="text-center" style = "font-family : Monotype Corsiva ; color : red">Product Booking Page</h2>
<center><span class="blinking">Delivery will be processed within 24 hours</span></center>
<div class="form-group">
<form method="POST">
<label><b>Customer Name</b></label>
<input type = text name = username value = "<?php echo $username;?>" class="form-control" readonly>
<label><b>EmailID</b></label>
<input type = text name = emailid value = "<?php echo $emailid;?>" class="form-control" readonly>
<label><b>Contact</b></label>
<input type = text name = contact value = "<?php echo $contact;?>" class="form-control">
<label><b>City</b></label>
<input type = text name = city value = "<?php echo $city;?>" class="form-control">
<label><b>Address</b></label>
<input type = text name = address value = "<?php echo $address;?>" class="form-control">
<label><b>Product Name</b></label>
<input type = text name = productname value = "<?php echo $productname;?>" class="form-control" readonly>
<label><b>Price</b></label>
<input type = text name = price id = price value = "<?php echo $price;?>" class="form-control" readonly>
<label><b>Quantity</b></label>
<input type = number name = quantity id = quantity min="1" onkeyup = calc() class="form-control">
<label><b>Total</b></label>
<input type = text name = total id = total class="form-control" readonly>
<input type = hidden name = bookingdate value='<?=date("d-m-y")?>' class="form-control">
<br>
<input type = submit name = submit value = "Submit" class="btn btn-primary form-control" >
</form>
</div>
</div>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$emailid = $_POST['emailid'];
$contact = $_POST['contact'];
$city = $_POST['city'];
$address = $_POST['address'];
$productname = $_POST['productname'];
$price = $_POST['price'];
$quantity = $_POST['quantity'];
$total = $_POST['total'];
$customername = $_POST['username'];
$query = "insert into booking1(emailid,contact,city,address,productname,price,quantity,total,customername) values('$emailid','$contact','$city','$address','$productname','$price','$quantity','$total','$customername')";
//print_r($query);die;
$n = my_iud($query);
if($n==1)
{
echo '<script>;
window.location="payment.php";
</script>';
}
else
{
echo '<script>alert("Something went wrong,Try Again");
</script>';
}
}
?>