-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_edit.php
143 lines (141 loc) · 6.6 KB
/
admin_edit.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
<?php
session_start();
$regno=isset($_POST['regno_e'])?htmlspecialchars($_POST['regno_e']):0;
if(isset($_SESSION['alogin']) && htmlspecialchars($_SESSION['alogin'])=='You are logged in,Check Requests'){
require 'connection.php';
}
else{
echo '<h1 class="title">You need to Login Again !</h1>';
die();
}
?>
<!DOCTYPE html>
<!--Sayan Pandey 15/IT/21-->
<html lang='en'>
<head>
<title>Administrators' Portal</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="admin.css">
<script src="jquery3.3.1.js"></script>
</head>
<body>
<!--Edit Profile-->
<div id="basic">
<h1 class="title" style="font-size: 3em"> Student Profile of : <?php echo $regno;?></h1>
<br>
<h1 class="title" style="font-size: 1.5em"> Basic Profile</h1>
<!--Profile Picture-->
<img class=content src='<?PHP
$path1 = "img/std_img/".$regno.".jpg";
$path2 = "img/student.png";
echo file_exists($path1) ? $path1 : $path2;
?>' style="max-width:40vw;float:right"/>
<!--Basic details-->
<?php
$sql="SELECT * from students where regno=".$regno;
$result=$conn->query($sql);
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo '<a class=nav id="name">'.$row['name'].'</a>';
echo '<div class="content" style="max-width:56vw;">
<img class="design" src="img/back2.png">
<h1> Fill up the details:</h1>
<form method="POST" action=reg.php>
<h3 class="heading">Registration<br> Number: <a class=detail>'.$row['regno'].'</a></h3>
<h3 class="heading">Branch: <a class=detail>'.$row['branch'].'</a></h3>
<h3 class="heading">Roll <br>Number: <a class=detail>'.$row['rollno'].'</a></h3>
<h3 class="heading">Name: <a class=detail>'.$row['name'].'</a></h3>
<h3 class="heading">Phone: <a class=detail>'.$row['phone'].'</a></h3>
<h3 class="heading">Email Id: <a class=detail>'.$row['email'].'</a></h3>
<br>
</form>
</div>';
}
}
else {
echo "<div class='new'><div class=content><br><h1 style='margin-left: 10%;'>Something Went Wrong !!!</h1><br></div><br><br></div>";
}
?>
</div>
<?php
//More datails
$sql="SELECT * from extradetail where regno=".$regno;
$result=$conn->query($sql);
if($result->num_rows > 0) {
$row = $result->fetch_assoc();
$DOB=isset($row['DOB'])?htmlspecialchars($row['DOB']):0;
$fname=isset($row['fname'])?htmlspecialchars($row['fname']):0;
$mname=isset($row['mname'])?htmlspecialchars($row['mname']):0;
$gemail=isset($row['gemail'])?htmlspecialchars($row['gemail']):0;
$address=isset($row['address'])?htmlspecialchars($row['address']):0;
$m10=isset($row['m10'])?htmlspecialchars($row['m10']):0;
$m12=isset($row['m12'])?htmlspecialchars($row['m12']):0;
$ECA=isset($row['ECA'])&&$row['ECA']!=''?htmlspecialchars($row['ECA']):"N/A";
$Achievement=isset($row['Achievement'])&&$row['Achievement']!=''?htmlspecialchars($row['Achievement']):"N/A";
$hobby=isset($row['hobby'])?htmlspecialchars($row['hobby']):0;
}
else{
$DOB=$fname=$mname=$gemail=$address=$m10=$m12=$ECA=$Achievement=$hobby='N/A';
}
echo '<h1 class="title title2" style="font-size: 3em"> Additional Details</h1>
<div>
<!--content-->
<div class="content">
<img class="design" src="img/back2.png">
<h1> Personal Details:</h1>
<h3 class="heading">Date of Birth: <a class=detail>'.$DOB.'</a></h3>
<input type="hidden" id="dob" value="'.$DOB.'"/>
<h3 class="heading">Age: <a class=detail id="age"></a></h3>
<h3 class="heading">Father\'s Name: <a class=detail>'.$fname.'</a></h3>
<h3 class="heading">Mother\'s Name: <a class=detail>'.$mname.'</a></h3>
<h3 class="heading">Guardian\'s email: <a class=detail>'.$gemail.'</a></h3>
<h3 class="heading">Address: <a class=detail>'.$address.'</a></h3><br>
<br>
</div>
</div>
<br>
<div>
<!--content-->
<div class="content">
<img class="design" src="img/back2.png">
<h1> Academic Details:</h1>
<h3 class="heading">10th Standard marks: <a class=detail>'.$m10.'</a></h3>
<h3 class="heading">12th Standard marks: <a class=detail>'.$m12.'</a></h3>
<h3 class="heading">Extra Curricular<br>Activities: <a class=detail>'.$ECA.'</a></h3>
<h3 class="heading">Scholastic<br>Achievements: <a class=detail>'.$Achievement.'</a></h3>
</div>
<br>
<div class="content" style="min-height:70vh">
<img class="design" src="img/back2.png">
<img src="img/back2.jpg" class="hobby">
<h3 class="heading">Hobbies: <br>
';
$hobbies=(explode(",",$hobby));
foreach($hobbies as $selected)
echo "  <a class=detail>".$selected."</a><br>";
echo '</h3>
</div>
</div>
<br>
<div>
<!--content-->
</div>
</div>
';
?>
<script>
//age
$(document).ready(function(){
(function(){
var dob=new Date($("#dob").val());
var today= new Date();
var age=today.getFullYear()-dob.getFullYear();
if(today.getMonth() < dob.getMonth() || (today.getMonth()==dob.getMonth() && today.getDate()<dob.getDate()))
age--;
$("#age").text(age);
})();
});
</script>
</body>
</html>