-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alumni_Academic_Profile.php
123 lines (103 loc) · 3.5 KB
/
Alumni_Academic_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
<!DOCTYPE html>
<html>
<head>
<title>Student Details</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f7f7f7;
color: #333;
}
#container {
max-width: 800px;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
}
h1 {
text-align: center;
font-size: 36px;
margin-bottom: 30px;
}
.details {
margin-bottom: 30px;
padding: 30px;
border: 2px solid #eee;
border-radius: 10px;
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.1);
}
.details h2 {
font-size: 28px;
margin-bottom: 20px;
border-bottom: 2px solid #eee;
padding-bottom: 10px;
}
.details p {
margin: 0;
font-size: 20px;
line-height: 30px;
}
.details label {
font-weight: bold;
margin-right: 10px;
color: #666;
}
</style>
</head>
<body>
<div id="container">
<h1>Student Details</h1>
<div class="details">
<h2>Personal Information</h2>
<p><label>Roll No:</label> <?php echo getFieldValueFromAcademicDatabase('roll_number'); ?></p>
<p><label>Name:</label> <?php echo getFieldValueFromDatabase('10th') . ' ' . getFieldValueFromDatabase('last_name'); ?></p>
<p><label>Age:</label> <?php echo getFieldValueFromDatabase('age'); ?></p>
<p><label>Specialization:</label> <?php echo getFieldValueFromDatabase('specialization'); ?></p>
<p><label>Area of Interest:</label> <?php echo getFieldValueFromDatabase('area_of_interest'); ?></p>
</div>
<div class="details">
<h2>Academic Information</h2>
<p><label>Class X Percentage:</label> <?php echo getFieldValueFromCompanyDatabase('10th'); ?></p>
<p><label>Class XII Percentage:</label> <?php echo getFieldValueFromCompanyDatabase('12th'); ?></p>
<p><label>CPI:</label> <?php echo getFieldValueFromCompanyDatabase('cpi'); ?></p>
<p><label>Batch Year:</label> <?php echo getFieldValueFromCompanyDatabase('batch_year'); ?></p>
<p><label>Failed in any course:</label> <?php echo getFieldValueFromCompanyDatabase('back'); ?></p>
</div>
</div>
<?php
session_start();
// Check if the user is logged in
if (!isset($_SESSION['user_id'])) {
echo "User not logged in.";
// Redirect or display an error message as needed
exit;
}
// Retrieve the logged-in user's ID from the session
$user_id = $_SESSION['user_id'];
require_once('config.php');
// Function to fetch field value from the database
function getFieldValueFromAcademicDatabase($fieldName) {
// Fetch field value from database
$sql = "SELECT $fieldName FROM alumni_academic_details";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$fieldValue = $row[$fieldName];
// Close connection
$conn->close();
return $fieldValue;
}
function getFieldValueFromCompanyDatabase($fieldName) {
// Fetch field value from database
$sql = "SELECT $fieldName FROM alumni_placement_details";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$fieldValue = $row[$fieldName];
// Close connection
$conn->close();
return $fieldValue;
}
?>
</body>
</html>