This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-profile.php
184 lines (144 loc) · 5.84 KB
/
my-profile.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
<?php
session_start();
$mysqli = new mysqli('localhost','letabox_letabox_sys','letabox_letabox_sys','letabox_letabox_sys');
//Output any connection error
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
require_once 'partials/config.php';
$header = array(
'page'=>'account',
'title'=>'Profile'
);
require_once 'partials/header.php';
?>
<link rel="stylesheet" type="text/css" href="partials/intlTelInput.css">
<section class="maincontent">
<div class="profile">
<div class="container">
<div class="col-md-12 kulwa">
<br>
<h2> My Profile</h2>
<br>
</div>
<div class="row">
<?php
$project_desc1 = $mysqli->query("SELECT * from lbs_customer WHERE lbs_bill_shipping_id=".$_SESSION['user_id'])or die('Error : ('. $mysqli->errno .') '. $mysqli->error);
$obj_ona1= $project_desc1->fetch_object();
?>
<!--<form action="cart_process.php" method="post">-->
<form class="billing_edit">
<input type="hidden" name="billing_edit"/>
<div class="col-md-6">
<p>
<label for="name">Full Name</label>
<input type="text" name="Fname" id="name" class="form-control" value="<?php print $obj_ona1->Fname ? $obj_ona1->Fname : ''; ?>" required>
</p>
<p>
<label for="name">Phone</label>
<input type="text" name="Phone" id="phonenumber" class="form-control" value="<?php print $obj_ona1->Phone ? $obj_ona1->Phone : ''; ?>" required>
</p>
<p>
<label for="email">Email Address</label>
<input type="text" name="Email" id="email" class="form-control" value="<?php print $obj_ona1->Email ? $obj_ona1->Email : ''; ?>" required>
</p>
<p>
<label for="email">Country:</label>
<select class="form-control" id="sel1" name="Country">
<option value="<?php print $obj_ona1->Country; ?>" selected="selected"><?php print $obj_ona1->Country; ?></option>
<?php
foreach($countries as $key => $value) {
?>
<option value="<?= $value ?>" title="<?= htmlspecialchars($value) ?>"><?= htmlspecialchars($value) ?></option>
<?php
}
?>
</select>
</p>
</div>
<div class="col-md-6">
<p>
<label for="email">Street Address</label>
<input type="text" name="Address1" class="form-control" value="<?php print $obj_ona1->Address1 ? $obj_ona1->Address1 : ''; ?>" placeholder="House number and street name" required/>
</p>
<p>
<label for="email">Town / City:</label>
<input type="text" name="City" class="form-control" value="<?php print $obj_ona1->City ? $obj_ona1->City : ''; ?>" required/>
</p>
<p>
<label for="email">Postcode / Zip:</label>
<input type="text" name="Zcode" class="form-control" value="<?php print $obj_ona1->Zcode ? $obj_ona1->Zcode : ''; ?>" required/>
</p>
<p class="submit">
<input type="submit" name="billing_edit" id="pro_edit" value="Save details">
</p>
</form>
</div>
<div id="billing_response" class="col-md-12"></div>
</div>
<div class="row">
<a href="my-account.php">Back to My Account</a>
</div>
</div>
</div>
</div>
</section>
<?php require_once 'partials/footer.php'; ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<script>
$.validate({
validateOnBlur : false, // disable validation when input looses focus
errorMessagePosition : 'top' // Instead of 'inline' which is default
scrollToTopOnError : false // Set this property to true on longer forms
});
</script>
<script>
$.validate({
modules : 'html5'
});
</script>
<script type="text/javascript" src="partials/intlTelInput.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
var telInput = $("#phonenumber");
var validateMsg = $("#validate-msg");
// initialise plugin
telInput.intlTelInput({
autoPlaceholder: false,
formatOnDisplay: true,
geoIpLookup: function(callback) {
jQuery.get('https://ipinfo.io', function() {}, "jsonp").always(function(resp) {
var countryCode = (resp && resp.country) ? resp.country : "";
callback(countryCode);
});
},
initialCountry: "auto",
nationalMode: false,
preferredCountries: ['ke', 'ug', 'tz'],
utilsScript: "js/utils.js"
});
var reset = function() {
telInput.removeClass("error");
validateMsg.addClass("hide");
};
// on blur: validate
telInput.blur(function() {
reset();
if ($.trim(telInput.val())) {
if (telInput.intlTelInput("isValidNumber")) {
validateMsg.addClass("hide");
} else {
validateMsg.removeClass("hide");
validateMsg.html( '<em id="phonenumber-error" class="error">Valid number is required.</em>' );
}
}
});
// on keyup / change flag: reset
telInput.on("keyup change", reset);
//added
/* $("#umya").click(function(){
var bla = $('#phonenumber').val();
alert(bla);
});*/
});
</script>