-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin-profile.php
137 lines (122 loc) · 6.57 KB
/
admin-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
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['jpaid']==0)) {
header('location:logout.php');
} else{
if(isset($_POST['submit']))
{
$adminid=$_SESSION['jpaid'];
$AName=$_POST['adminname'];
$mobno=$_POST['mobilenumber'];
$email=$_POST['email'];
$sql="update tbladmin set AdminName=:adminname,MobileNumber=:mobilenumber,Email=:email where ID=:aid";
$query = $dbh->prepare($sql);
$query->bindParam(':adminname',$AName,PDO::PARAM_STR);
$query->bindParam(':email',$email,PDO::PARAM_STR);
$query->bindParam(':mobilenumber',$mobno,PDO::PARAM_STR);
$query->bindParam(':aid',$adminid,PDO::PARAM_STR);
$query->execute();
echo '<script>alert("Profile has been updated")</script>';
}
?>
<!doctype html>
<html lang="en" class="no-focus"> <!--<![endif]-->
<head>
<title>Job Portal - Admin Profile</title>
<link rel="stylesheet" id="css-main" href="assets/css/codebase.min.css">
</head>
<body>
<div id="page-container" class="sidebar-o sidebar-inverse side-scroll page-header-fixed main-content-narrow">
<?php include_once('includes/sidebar.php');?>
<?php include_once('includes/header.php');?>
<!-- Main Container -->
<main id="main-container">
<!-- Page Content -->
<div class="content">
<!-- Register Forms -->
<h2 class="content-heading">Admin Profile</h2>
<div class="row">
<div class="col-md-12">
<!-- Bootstrap Register -->
<div class="block block-themed">
<div class="block-header bg-gd-emerald">
<h3 class="block-title">Admin Profile</h3>
</div>
<div class="block-content">
<?php
$sql="SELECT * from tbladmin";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{ ?>
<form method="post">
<div class="form-group row">
<label class="col-12" for="register1-username">Admin Name:</label>
<div class="col-12">
<input type="text" class="form-control" name="adminname" value="<?php echo $row->AdminName;?>" required='true'>
</div>
</div>
<div class="form-group row">
<label class="col-12" for="register1-email">User Name:</label>
<div class="col-12">
<input type="text" class="form-control" name="username" value="<?php echo $row->UserName;?>" readonly="true">
</div>
</div>
<div class="form-group row">
<label class="col-12" for="register1-password">Email:</label>
<div class="col-12">
<input type="email" class="form-control" name="email" value="<?php echo $row->Email;?>" required='true'>
</div>
</div>
<div class="form-group row">
<label class="col-12" for="register1-password">Contact Number:</label>
<div class="col-12">
<input type="text" class="form-control" name="mobilenumber" value="<?php echo $row->MobileNumber;?>" required='true' maxlength='10'>
</div>
</div>
<div class="form-group row">
<label class="col-12" for="register1-password">Admin Registration Date:</label>
<div class="col-12">
<input type="text" class="form-control" id="email2" name="" value="<?php echo $row->AdminRegdate;?>" readonly="true">
</div>
</div>
<?php $cnt=$cnt+1;}} ?>
<div class="form-group row">
<div class="col-12">
<button type="submit" class="btn btn-alt-success" name="submit">
<i class="fa fa-plus mr-5"></i> Update
</button>
</div>
</div>
</form>
</div>
</div>
<!-- END Bootstrap Register -->
</div>
</div>
</div>
<!-- END Page Content -->
</main>
<!-- END Main Container -->
<?php include_once('includes/footer.php');?>
</div>
<!-- END Page Container -->
<!-- Codebase Core JS -->
<script src="assets/js/core/jquery.min.js"></script>
<script src="assets/js/core/popper.min.js"></script>
<script src="assets/js/core/bootstrap.min.js"></script>
<script src="assets/js/core/jquery.slimscroll.min.js"></script>
<script src="assets/js/core/jquery.scrollLock.min.js"></script>
<script src="assets/js/core/jquery.appear.min.js"></script>
<script src="assets/js/core/jquery.countTo.min.js"></script>
<script src="assets/js/core/js.cookie.min.js"></script>
<script src="assets/js/codebase.js"></script>
</body>
</html>
<?php } ?>