-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.php
183 lines (109 loc) · 4.58 KB
/
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
<?php
session_start();
$user_id= $_SESSION['userId'];
require ('inc/head.php');
//(reservations.date > NOW() OR reservations.date = NOW())
require("admin/handlers/db.php");
$sql2="SELECT * From users where id=$user_id";
$query2=mysqli_query($conn,$sql2);
$information=mysqli_fetch_all($query2,MYSQLI_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<body>
<?php require ('inc/preloader_area.php');
require ('inc/top_Bar.php');
?>
<?php
if(isset($_SESSION['userId'])){
$userid=$_SESSION['userId'];
require ('inc/LoginHeader.php');
}else{
require ('inc/Header.php');
}
?>
<!-- ========== Breadcumb start============= -->
<div class="breadcrumb-section-wedding">
<div class="container">
<div class="row d-flex justify-content-center align-items-center text-center">
<div class="col-lg-8">
<h2 class="breadcrumb-title wow fadeInLeft" data-wow-duration="1.5s" data-wow-delay=".2s">My Profile</h2>
<nav aria-label="breadcrumb">
<ol class="breadcrumb d-flex justify-content-center">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">My Profile</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
<!-- ========== Breadcumb end============= -->
<!-- ========== Room & Suits start============= -->
<div class="contact-page mb-120 overflow-hidden">
<div class="container-fluid px-0">
</div>
<div class="container">
<br>
<br>
<h2>My Profile</h2>
<br>
<br>
<?php if(isset( $_SESSION['errors3'])){
foreach($_SESSION['errors3'] as $error){?>
<div class="alert alert-danger" role="alert"> <?php echo $error;?> </div>
<?php }
unset($_SESSION['errors3']);
}?>
<?php if(isset( $_SESSION['success3'])){
?>
<div class="alert alert-success" role="alert"> <?php echo $_SESSION['success3'];?> </div>
<?php
unset($_SESSION['success3']);
}?>
<form action="admin/handlers/update-profile.php" method="POST">
<div class="form-inner">
<label for="name"> Name</label>
<br>
<input type="text" class="form-control" name="name" id="name" value="<?= $information[0]['name'];?>">
<input type="hidden" name="userId" value="<?= $information[0]['id'];?>" >
</div>
<br>
<div class="form-inner">
<label for="name">Email</label>
<br>
<input type="text" name="email" class="form-control" id="email" value="<?= $information[0]['email'];?>" placeholder="Enter Address">
</div>
<br>
<div class="form-inner">
<label for="name">Password</label>
<br>
<input type="password" name="newpassword" class="form-control" id="newpassword" placeholder="Enter New Password">
<input type="hidden" name="oldpassword" value="<?= $information[0]['password'];?>" >
</div>
<br>
<div class="form-inner">
<button class="btn btn-outline-secondary" type="submit" >Submit</button>
</div>
</form>
<label for="my-box"><strong> Deactivate account or delete it!</strong></label>
<br>
<br>
<div id="my-box" style="display: none;">
<button class="btn btn-outline-secondary"><a href="admin/handlers/deactivate.php?userId=<?= $information[0]['id'];?>">Deactivate</a></button>
<button class="btn btn-outline-secondary"><a href="admin/handlers/delete-profile.php?userId=<?= $information[0]['id'];?>">Delete</a></button>
</div>
<script>
const label = document.querySelector('label[for="my-box"]');
const box = document.querySelector('#my-box');
label.addEventListener('click', function() {
box.style.display = box.style.display === 'none' ? 'block' : 'none';
});
</script>
</div>
</div>
<!-- ========== Room & Suits end============= -->
<?php require ('inc/footer.php');
require('inc/js_file_link.php'); ?>
</body>
</html>