-
Notifications
You must be signed in to change notification settings - Fork 5
/
bill-ship-addresses.php
271 lines (225 loc) · 10.4 KB
/
bill-ship-addresses.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?php
session_start();
//error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:.php');
}
else{
// code for billing address updation
if(isset($_POST['update']))
{
$baddress=$_POST['billingaddress'];
$bstate=$_POST['bilingstate'];
$bcity=$_POST['billingcity'];
$bpincode=$_POST['billingpincode'];
$query=mysqli_query($con,"update users set billingAddress='$baddress',billingState='$bstate',billingCity='$bcity',billingPincode='$bpincode' where id='".$_SESSION['id']."'");
if($query)
{
echo "<script>alert('Billing Address has been updated');</script>";
}
}
// code for Shipping address updation
if(isset($_POST['shipupdate']))
{
$saddress=$_POST['shippingaddress'];
$sstate=$_POST['shippingstate'];
$scity=$_POST['shippingcity'];
$spincode=$_POST['shippingpincode'];
$query=mysqli_query($con,"update users set shippingAddress='$saddress',shippingState='$sstate',shippingCity='$scity',shippingPincode='$spincode' where id='".$_SESSION['id']."'");
if($query)
{
echo "<script>alert('Shipping Address has been updated');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="MediaCenter, Template, eCommerce">
<meta name="robots" content="all">
<title>My Account</title>
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<!-- Customizable CSS -->
<link rel="stylesheet" href="assets/css/main.css">
<link rel="stylesheet" href="assets/css/green.css">
<link rel="stylesheet" href="assets/css/owl.carousel.css">
<link rel="stylesheet" href="assets/css/owl.transitions.css">
<!--<link rel="stylesheet" href="assets/css/owl.theme.css">-->
<link href="assets/css/lightbox.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/animate.min.css">
<link rel="stylesheet" href="assets/css/rateit.css">
<link rel="stylesheet" href="assets/css/bootstrap-select.min.css">
<!-- Demo Purpose Only. Should be removed in production -->
<link rel="stylesheet" href="assets/css/config.css">
<link href="assets/css/green.css" rel="alternate stylesheet" title="Green color">
<link href="assets/css/blue.css" rel="alternate stylesheet" title="Blue color">
<link href="assets/css/red.css" rel="alternate stylesheet" title="Red color">
<link href="assets/css/orange.css" rel="alternate stylesheet" title="Orange color">
<link href="assets/css/dark-green.css" rel="alternate stylesheet" title="Darkgreen color">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link href='http://fonts.googleapis.com/css?family=Roboto:300,400,500,700' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="assets/images/favicon.ico">
</head>
<body class="cnt-home">
<header class="header-style-1">
<!-- ============================================== TOP MENU ============================================== -->
<?php include('includes/top-header.php');?>
<!-- ============================================== TOP MENU : END ============================================== -->
<?php include('includes/main-header.php');?>
<!-- ============================================== NAVBAR ============================================== -->
<?php include('includes/menu-bar.php');?>
<!-- ============================================== NAVBAR : END ============================================== -->
</header>
<!-- ============================================== HEADER : END ============================================== -->
<div class="breadcrumb">
<div class="container">
<div class="breadcrumb-inner">
<ul class="list-inline list-unstyled">
<li><a href="#">Home</a></li>
<li class='active'>Checkout</li>
</ul>
</div><!-- /.breadcrumb-inner -->
</div><!-- /.container -->
</div><!-- /.breadcrumb -->
<div class="body-content outer-top-bd">
<div class="container">
<div class="checkout-box inner-bottom-sm">
<div class="row">
<div class="col-md-8">
<div class="panel-group checkout-steps" id="accordion">
<!-- checkout-step-01 -->
<div class="panel panel-default checkout-step-01">
<!-- panel-heading -->
<div class="panel-heading">
<h4 class="unicase-checkout-title">
<a data-toggle="collapse" class="" data-parent="#accordion" href="#collapseOne">
<span>1</span>Billing Address
</a>
</h4>
</div>
<!-- panel-heading -->
<div id="collapseOne" class="panel-collapse collapse in">
<!-- panel-body -->
<div class="panel-body">
<div class="row">
<div class="col-md-12 col-sm-12 already-registered-login">
<?php
$query=mysqli_query($con,"select * from users where id='".$_SESSION['id']."'");
while($row=mysqli_fetch_array($query))
{
?>
<form class="register-form" role="form" method="post">
<div class="form-group">
<label class="info-title" for="Billing Address">Billing Address<span>*</span></label>
<textarea class="form-control unicase-form-control text-input" name="billingaddress" required="required"><?php echo $row['billingAddress'];?></textarea>
</div>
<div class="form-group">
<label class="info-title" for="Billing State ">Billing State <span>*</span></label>
<input type="text" class="form-control unicase-form-control text-input" id="bilingstate" name="bilingstate" value="<?php echo $row['billingState'];?>" required>
</div>
<div class="form-group">
<label class="info-title" for="Billing City">Billing City <span>*</span></label>
<input type="text" class="form-control unicase-form-control text-input" id="billingcity" name="billingcity" required="required" value="<?php echo $row['billingCity'];?>" >
</div>
<div class="form-group">
<label class="info-title" for="Billing Pincode">Billing Pincode <span>*</span></label>
<input type="text" class="form-control unicase-form-control text-input" id="billingpincode" name="billingpincode" required="required" value="<?php echo $row['billingPincode'];?>" >
</div>
<button type="submit" name="update" class="btn-upper btn btn-primary checkout-page-button">Update</button>
</form>
<?php } ?>
</div>
<!-- already-registered-login -->
</div>
</div>
<!-- panel-body -->
</div><!-- row -->
</div>
<!-- checkout-step-01 -->
<!-- checkout-step-02 -->
<div class="panel panel-default checkout-step-02">
<div class="panel-heading">
<h4 class="unicase-checkout-title">
<a data-toggle="collapse" class="collapsed" data-parent="#accordion" href="#collapseTwo">
<span>2</span>Shipping Address
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<?php
$query=mysqli_query($con,"select * from users where id='".$_SESSION['id']."'");
while($row=mysqli_fetch_array($query))
{
?>
<form class="register-form" role="form" method="post">
<div class="form-group">
<label class="info-title" for="Shipping Address">Shipping Address<span>*</span></label>
<textarea class="form-control unicase-form-control text-input" " name="shippingaddress" required="required"><?php echo $row['shippingAddress'];?></textarea>
</div>
<div class="form-group">
<label class="info-title" for="Billing State ">Shipping State <span>*</span></label>
<input type="text" class="form-control unicase-form-control text-input" id="shippingstate" name="shippingstate" value="<?php echo $row['shippingState'];?>" required>
</div>
<div class="form-group">
<label class="info-title" for="Billing City">Shipping City <span>*</span></label>
<input type="text" class="form-control unicase-form-control text-input" id="shippingcity" name="shippingcity" required="required" value="<?php echo $row['shippingCity'];?>" >
</div>
<div class="form-group">
<label class="info-title" for="Billing Pincode">Shipping Pincode <span>*</span></label>
<input type="text" class="form-control unicase-form-control text-input" id="shippingpincode" name="shippingpincode" required="required" value="<?php echo $row['shippingPincode'];?>" >
</div>
<button type="submit" name="shipupdate" class="btn-upper btn btn-primary checkout-page-button">Update</button>
</form>
<?php } ?>
</div>
</div>
</div>
<!-- checkout-step-02 -->
</div><!-- /.checkout-steps -->
</div>
<?php include('includes/myaccount-sidebar.php');?>
</div><!-- /.row -->
</div><!-- /.checkout-box -->
<?php include('includes/brands-slider.php');?>
</div>
</div>
<?php include('includes/footer.php');?>
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/bootstrap-hover-dropdown.min.js"></script>
<script src="assets/js/owl.carousel.min.js"></script>
<script src="assets/js/echo.min.js"></script>
<script src="assets/js/jquery.easing-1.3.min.js"></script>
<script src="assets/js/bootstrap-slider.min.js"></script>
<script src="assets/js/jquery.rateit.min.js"></script>
<script type="text/javascript" src="assets/js/lightbox.min.js"></script>
<script src="assets/js/bootstrap-select.min.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/scripts.js"></script>
<!-- For demo purposes – can be removed on production -->
<script src="switchstylesheet/switchstylesheet.js"></script>
<script>
$(document).ready(function(){
$(".changecolor").switchstylesheet( { seperator:"color"} );
$('.show-theme-options').click(function(){
$(this).parent().toggleClass('open');
return false;
});
});
$(window).bind("load", function() {
$('.show-theme-options').delay(2000).trigger('click');
});
</script>
</body>
</html>
<?php } ?>