-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuniversity.php
More file actions
148 lines (131 loc) · 4.36 KB
/
university.php
File metadata and controls
148 lines (131 loc) · 4.36 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
<?php
// filepath: c:\xampp\htdocs\Learning\SE_Project\university.php
include('site_database.php');
// Get the university name from the URL
$university_name = isset($_GET['university']) ? mysqli_real_escape_string($conn, $_GET['university']) : '';
if (empty($university_name)) {
die("Invalid university name.");
}
// Fetch professors in the specific university
$professors_query = "SELECT id, name FROM prof_login WHERE university = '$university_name'";
$professors_result = mysqli_query($conn, $professors_query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Professors at <?php echo htmlspecialchars($university_name); ?></title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
<style>
body {
font-family: Arial, sans-serif;
background-color: #000;
color: #e6bd09;
margin: 0;
padding: 0;
}
/* Navbar */
.navbar {
display: flex;
justify-content: flex-start;
align-items: center;
background-color: #000000;
padding: 10px 20px;
width: 100%;
}
.navbar a {
text-decoration: none;
color: #ffffff;
font-size: 18px;
margin-left: 50px;
}
.navbar a:hover {
color: #fff;
}
.navbar .logo {
font-size: 24px;
font-weight: bold;
font-family: 'Poppins', sans-serif;
}
/* Main Content */
.main-content {
max-width: 1200px;
margin: 50px auto;
padding: 20px;
background: #111;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
h1 {
text-align: center;
color: #e6bd09;
margin-bottom: 30px;
font-family: 'Poppins', sans-serif; /* Match the font of "ProfRate" */
font-weight: 600;
}
.professor-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
list-style: none;
padding: 0;
}
.professor-card {
background: #222;
color: #e6bd09;
border-radius: 10px;
padding: 20px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.professor-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}
.professor-card a {
text-decoration: none;
color: #e6bd09;
font-weight: bold;
font-size: 18px;
}
.professor-card a:hover {
text-decoration: underline;
}
.no-professors {
text-align: center;
font-size: 18px;
color: #fff;
}
</style>
</head>
<body>
<!-- Navbar -->
<div class="navbar">
<div class="logo">Profrate</div>
<div>
<a href="search_bar.php">Home</a>
</div>
</div>
<!-- Main Content -->
<div class="main-content">
<h1>Professors at <?php echo htmlspecialchars($university_name); ?></h1>
<ul class="professor-list">
<?php if (mysqli_num_rows($professors_result) > 0): ?>
<?php while ($professor = mysqli_fetch_assoc($professors_result)): ?>
<li class="professor-card">
<a href="profile.php?id=<?php echo $professor['id']; ?>" style="display: block; text-decoration: none;">
<div>
<?php echo htmlspecialchars($professor['name']); ?>
</div>
</a>
</li>
<?php endwhile; ?>
<?php else: ?>
<p class="no-professors">No professors found for this university.</p>
<?php endif; ?>
</ul>
</div>
</body>
</html>