-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
171 lines (141 loc) · 5.16 KB
/
profile.php
File metadata and controls
171 lines (141 loc) · 5.16 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
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
<?php
session_start();
//error_reporting(0);
include('includes/config.php');
if (strlen($_SESSION['aid']==0)) {
header('location:logout.php');
} else{
// Add company Code
if(isset($_POST['update']))
{
$adminid=$_SESSION['aid'];
//Getting Post Values
$adminname=$_POST['adminname'];
$emailid=$_POST['emailid'];
$mobileno=$_POST['mobilenumber'];
$query=mysqli_query($con,"update tbladmin set AdminName='$adminname',MobileNumber='$mobileno',Email='$emailid' where id='$adminid'");
if($query){
echo "<script>alert('Admin details updated successfully.');</script>";
echo "<script>window.location.href='profile.php'</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Admin profile</title>
<link href="vendors/jquery-toggles/css/toggles.css" rel="stylesheet" type="text/css">
<link href="vendors/jquery-toggles/css/themes/toggles-light.css" rel="stylesheet" type="text/css">
<link href="dist/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- HK Wrapper -->
<div class="hk-wrapper hk-vertical-nav">
<!-- Top Navbar -->
<?php include_once('includes/navbar.php');
include_once('includes/sidebar.php');
?>
<div id="hk_nav_backdrop" class="hk-nav-backdrop"></div>
<!-- /Vertical Nav -->
<!-- Main Content -->
<div class="hk-pg-wrapper">
<!-- Breadcrumb -->
<nav class="hk-breadcrumb" aria-label="breadcrumb">
<ol class="breadcrumb breadcrumb-light bg-transparent">
<li class="breadcrumb-item"><a href="#">Profile</a></li>
<li class="breadcrumb-item active" aria-current="page">Admin</li>
</ol>
</nav>
<!-- /Breadcrumb -->
<!-- Container -->
<div class="container">
<!-- Title -->
<div class="hk-pg-header">
<h4 class="hk-pg-title"><span class="pg-title-icon"><span class="feather-icon"><i data-feather="external-link"></i></span></span>Update Admin Profile</h4>
</div>
<!-- /Title -->
<!-- Row -->
<div class="row">
<div class="col-xl-12">
<section class="hk-sec-wrapper">
<div class="row">
<div class="col-sm">
<form class="needs-validation" method="post" novalidate>
<?php
//Getting admin name
$adminid=$_SESSION['aid'];
$query=mysqli_query($con,"select * from tbladmin where id='$adminid'");
while($row=mysqli_fetch_array($query)){
?>
<div class="form-row">
<div class="col-md-6 mb-10">
<label for="validationCustom03"> Reg. Date</label>
<?php echo $row['AdminRegdate'];?>
</div>
</div>
<?php if($row['UpdationDate']!=""){?>
<div class="form-row">
<div class="col-md-6 mb-10">
<label for="validationCustom03"> Last Updation Date</label>
<?php echo $row['UpdationDate'];?>
</div>
</div>
<?php } ?>
<div class="form-row">
<div class="col-md-6 mb-10">
<label for="validationCustom03"> Name</label>
<input type="text" class="form-control" id="validationCustom03" value="<?php echo $row['AdminName'];?>" name="adminname" required>
<div class="invalid-feedback">Please provide a valid name.</div>
</div>
</div>
<div class="form-row">
<div class="col-md-6 mb-10">
<label for="validationCustom03"> Username</label>
<input type="text" class="form-control" id="validationCustom03" value="<?php echo $row['UserName'];?>" name="username" readonly>
</div>
</div>
<div class="form-row">
<div class="col-md-6 mb-10">
<label for="validationCustom03">Email id</label>
<input type="text" class="form-control" id="validationCustom03" value="<?php echo $row['Email'];?>" name="emailid" required>
<div class="invalid-feedback">Please provide a valid Email id.</div>
</div>
</div>
<div class="form-row">
<div class="col-md-6 mb-10">
<label for="validationCustom03"> Mobile Number</label>
<input type="text" class="form-control" id="validationCustom03" value="<?php echo $row['MobileNumber'];?>" name="mobilenumber" required>
<div class="invalid-feedback">Please provide a valid mobile number.</div>
</div>
</div>
<?php } ?>
<button class="btn btn-primary" type="submit" name="update">Update</button>
</form>
</div>
</div>
</section>
</div>
</div>
</div>
<!-- Footer -->
<?php include_once('includes/footer.php');?>
<!-- /Footer -->
</div>
<!-- /Main Content -->
</div>
<script src="vendors/jquery/dist/jquery.min.js"></script>
<script src="vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="vendors/jasny-bootstrap/dist/js/jasny-bootstrap.min.js"></script>
<script src="dist/js/jquery.slimscroll.js"></script>
<script src="dist/js/dropdown-bootstrap-extended.js"></script>
<script src="dist/js/feather.min.js"></script>
<script src="vendors/jquery-toggles/toggles.min.js"></script>
<script src="dist/js/toggle-data.js"></script>
<script src="dist/js/init.js"></script>
<script src="dist/js/validation-data.js"></script>
</body>
</html>
<?php } ?>