-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
153 lines (131 loc) · 6.35 KB
/
checkout.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
session_start();
$connect = mysqli_connect("127.0.0.1:3325", "root", "", "bling_gems");
if(isset($_POST["bill"])){
$query = "INSERT INTO checkout values( '',' $_POST[username]','$_POST[emailaddress]','$_POST[address]','$_POST[city]','$_POST[postcode]','$_POST[contactnumber]')";
mysqli_query($connect, $query);
echo'<script>alert("Billing address has been saved!")</script>';
echo '<script>window.location="checkout.php"</script>';
}
?>
<!DOCTYPE html>
<html>
<head>
<!--the meta tags-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="author" content="Kabwe Oluchi Akujiobi">
<title>Checkout | Bling Gems</title>
<!--linking the external css-->
<link rel ="stylesheet" href ="css/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<header>
<div class = "container">
<div id = "branding">
<img src="images/logo/blingGemsBlack.png"/>
</div>
<nav>
<ul>
<li><a href ="home.php">HOME</a></li>
<li><a href = "services.php">SERVICES</a></li>
<li><a href = "about.php">ABOUT</a></li>
<li><a href = "contact.php">CONTACT</a></li>
</ul>
</nav>
<div id = "icons">
<img src="images/icons/cart.png"><a href ="cart.php">CART
<?php
if(isset($_SESSION["cart"])){
$count = count($_SESSION["cart"]);
echo"<span>($count)</span>";
}
else{
echo"<span>0</span>";
}
?>
</a> </img>
</div>
</div>
</header>
<!--the proucts link-->
<section id = "products">
<div class = "categories">
<ul>
<li><a href ="products/bracelets.php">BRACELETS</a></li>
<li><a href ="products/earrings.php">EARRINGS</a></li>
<li><a href ="products/gemstones.php">GEM STONES</a></li>
<li><a href ="products/necklaces.php">NECKLACES</a></li>
<li><a href ="products/ring.php">RINGS</a></li>
</ul>
</div>
</section>
<section id ="checkout">
<form name="bill" action=" " method="post">
<h2>Billing Address: </h2>
<input type="text" name="username" placeholder="Your name..." required><br><br/>
<input type="email" name="emailaddress" placeholder="Your Email..." required><br><br>
<input type="text" name="address" placeholder="Your address..." required><br><br>
<input type="text" name="city" placeholder="Your city..." required><br><br>
<input type="text" name="postcode" placeholder="Your postcode..." required><br><br>
<input type="text" name="contactnumber" placeholder="078xxxxxxx" required><br><br>
<button type="submit" name="bill" >Save</button><br><br/>
</form>
<div class="but">
<a href="https://www.sandbox.paypal.com/"><button type="submit" > Next </button></a>
</div>
</section>
<footer class="footer_area clearfix">
<div class="container">
<div class="row align-items-center">
<!-- Single Widget Area -->
<div class="col-12 col-lg-4">
<div class="single_widget_area">
<!-- Logo -->
<div class="footer-logo mr-50">
<a href="home.php"><img src="images/logo/blingGemsBlack.png" alt=""></a>
</div>
<!-- Copywrite Text -->
<p class="copywrite">
Copyright © All rights reserved | Bling Gems
</p>
</div>
</div>
<!-- Single Widget Area -->
<div class="col-12 col-lg-8">
<div class="single_widget_area">
<!-- Footer Menu -->
<div class="footer_menu">
<nav class="navbar navbar-expand-lg justify-content-end">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#footerNavContent" aria-controls="footerNavContent" aria-expanded="false" aria-label="Toggle navigation"><i class="fa fa-bars"></i></button>
<div class="collapse navbar-collapse" id="footerNavContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="home.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services.php">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.php">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="checkout.php">Checkout</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
</div>
</footer>
</body>
</html>