-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
my-profile.php
137 lines (110 loc) · 4.37 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
<!-- favicon -->
<link rel="shortcut icon" type="image/jpg" href="studentphoto\Stu_Reg.png"/>
<?php
session_start();
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['submit']))
{
$studentname=$_POST['studentname'];
$photo=$_FILES["photo"]["name"];
$cgpa=$_POST['cgpa'];
move_uploaded_file($_FILES["photo"]["tmp_name"],"studentphoto/".$_FILES["photo"]["name"]);
$ret=mysqli_query($bd, "update students set studentName='$studentname',studentPhoto='$photo',cgpa='$cgpa' where StudentRegno='".$_SESSION['login']."'");
if($ret)
{
$_SESSION['msg']="Student Record updated Successfully !!";
}
else
{
$_SESSION['msg']="Error : Student Record not update";
}
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Profile</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<link href="assets/css/style.css" rel="stylesheet" />
</head>
<body>
<?php include('includes/header.php');?>
<?php if($_SESSION['login']!="")
{
include('includes/menubar.php');
}
?>
<div class="content-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="page-head-line">Student Registration </h1>
</div>
</div>
<div class="row" >
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
Student Registration
</div>
<font color="green" align="center"><?php echo htmlentities($_SESSION['msg']);?><?php echo htmlentities($_SESSION['msg']="");?></font>
<?php $sql=mysqli_query($bd, "select * from students where StudentRegno='".$_SESSION['login']."'");
$cnt=1;
while($row=mysqli_fetch_array($sql))
{ ?>
<div class="panel-body">
<form name="dept" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="studentname">Student Name </label>
<input type="text" class="form-control" id="studentname" name="studentname" value="<?php echo htmlentities($row['studentName']);?>" />
</div>
<div class="form-group">
<label for="studentregno">Student Reg No </label>
<input type="text" class="form-control" id="studentregno" name="studentregno" value="<?php echo htmlentities($row['StudentRegno']);?>" placeholder="Student Reg no" readonly />
</div>
<div class="form-group">
<label for="Pincode">Pincode </label>
<input type="text" class="form-control" id="Pincode" name="Pincode" readonly value="<?php echo htmlentities($row['pincode']);?>" required />
</div>
<div class="form-group">
<label for="CGPA">CGPA </label>
<input type="text" class="form-control" id="cgpa" name="cgpa" value="<?php echo htmlentities($row['cgpa']);?>" required />
</div>
<div class="form-group">
<label for="Pincode">Student Photo </label>
<?php if($row['studentPhoto']==""){ ?>
<img src="studentphoto/noimage.png" width="200" height="200"><?php } else {?>
<img src="studentphoto/<?php echo htmlentities($row['studentPhoto']);?>" width="200" height="200">
<?php } ?>
</div>
<div class="form-group">
<label for="Pincode">Upload New Photo </label>
<input type="file" class="form-control" id="photo" name="photo" value="<?php echo htmlentities($row['studentPhoto']);?>" />
</div>
<?php } ?>
<button type="submit" name="submit" id="submit" class="btn btn-default">Update</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include('includes/footer.php');?>
<script src="assets/js/jquery-1.11.1.js"></script>
<script src="assets/js/bootstrap.js"></script>
</body>
</html>
<?php } ?>