-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
345 lines (307 loc) · 15 KB
/
Copy pathindex.php
File metadata and controls
345 lines (307 loc) · 15 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<?php
require_once __DIR__ . '/config/db.php';
$student = null;
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$student_id = trim($_POST['student_id'] ?? '');
$dob = trim($_POST['dob'] ?? '');
if ($student_id === '' || $dob === '') {
$error = 'Please enter both Student ID and Date of Birth.';
} else {
$stmt = $pdo->prepare('SELECT * FROM students WHERE student_id = ? AND date_of_birth = ? LIMIT 1');
$stmt->execute([$student_id, $dob]);
$student = $stmt->fetch();
if (!$student) {
$error = 'No result found. Please check your Student ID and Date of Birth.';
}
}
}
function initials($name) {
$parts = explode(' ', trim($name));
$out = '';
foreach (array_slice($parts, 0, 2) as $p) $out .= strtoupper(mb_substr($p, 0, 1));
return $out ?: 'ST';
}
function cgpaLabel($cgpa) {
$c = (float)$cgpa;
if ($c >= 3.75) return 'Distinction';
if ($c >= 3.50) return 'First Class';
if ($c >= 3.00) return 'Second Class';
if ($c >= 2.00) return 'Pass';
return 'Below Pass';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Result — CIU Portal</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<style>
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:'Plus Jakarta Sans',sans-serif;background:#f0f4f9;color:#1e293b;min-height:100vh;}
/* ── NAVBAR ── */
.navbar{background:#0d1f5c;padding:0 24px;height:46px;display:flex;align-items:center;justify-content:space-between;}
.nav-links{display:flex;gap:22px;}
.nav-links a{color:rgba(255,255,255,.72);font-size:12.5px;font-weight:600;text-decoration:none;transition:color .15s;}
.nav-links a:hover{color:#f2b100;}
.nav-right a{color:rgba(255,255,255,.7);font-size:12px;text-decoration:none;margin-left:18px;}
.nav-right a:hover{color:#f2b100;}
/* ── TOPBAR ── */
.topbar{background:#fff;border-bottom:3px solid #f2b100;padding:13px 24px;display:flex;align-items:center;gap:18px;box-shadow:0 2px 8px rgba(0,0,0,.06);}
.topbar img.logo{width:78px;height:78px;object-fit:contain;flex-shrink:0;}
.topbar-text h1{font-size:22px;font-weight:800;color:#0d2260;letter-spacing:-.4px;line-height:1.25;}
.topbar-text .tagline{font-size:11.5px;color:#64748b;margin-top:3px;font-style:italic;}
.topbar-text .motto{font-size:11.5px;color:#d4930a;font-weight:700;margin-top:3px;}
/* ── BREADCRUMB ── */
.breadcrumb{background:#f1f5f9;border-bottom:.5px solid #e2e8f0;padding:9px 24px;font-size:12px;color:#64748b;display:flex;align-items:center;gap:7px;}
.breadcrumb a{color:#0d2260;font-weight:600;text-decoration:none;}
.breadcrumb a:hover{text-decoration:underline;}
/* ── WRAPPER ── */
.wrap{max-width:900px;margin:28px auto;padding:0 20px 70px;}
/* ── SEARCH CARD ── */
.search-card{background:#fff;border-radius:13px;border:.5px solid #dde5f5;padding:22px 24px;box-shadow:0 3px 16px rgba(13,34,96,.07);margin-bottom:22px;}
.search-card .card-title{font-size:13.5px;font-weight:800;color:#0d2260;margin-bottom:16px;display:flex;align-items:center;gap:7px;}
.search-card .card-title svg{width:16px;height:16px;stroke:#0d2260;fill:none;stroke-width:2.2;}
.search-row{display:grid;grid-template-columns:1fr 1fr auto;gap:14px;align-items:end;}
.field label{display:block;font-size:11px;font-weight:700;color:#64748b;margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px;}
.field input{width:100%;padding:11px 13px;border:1.5px solid #e2e8f0;border-radius:9px;font-size:14px;color:#1e293b;background:#f8fafc;font-family:inherit;transition:border-color .2s,background .2s;}
.field input:focus{outline:none;border-color:#0d2260;background:#fff;}
.sbtn{padding:11px 28px;border:none;border-radius:9px;background:#f2b100;color:#1a1200;font-size:14px;font-weight:800;cursor:pointer;height:44px;font-family:inherit;transition:opacity .15s;}
.sbtn:hover{opacity:.9;}
.alert{background:#fee2e2;color:#991b1b;padding:12px 14px;border-radius:9px;font-size:13px;margin-top:14px;border:.5px solid #fecaca;}
/* ── RESULT CARD ── */
.result-card{background:#fff;border-radius:14px;border:.5px solid #dde5f5;overflow:hidden;box-shadow:0 6px 28px rgba(13,34,96,.10);}
/* HERO */
.rc-hero{background:#0d2260;padding:22px 22px 0;}
.rc-hero-row{display:flex;align-items:center;gap:16px;padding-bottom:18px;}
/* Student photo — real image or initials fallback */
.student-photo{width:68px;height:68px;border-radius:50%;object-fit:cover;object-position:top center;border:3px solid #f2b100;flex-shrink:0;box-shadow:0 0 0 3px rgba(255,255,255,.18);}
.avatar-fallback{width:68px;height:68px;border-radius:50%;background:#1e3f9e;border:3px solid #f2b100;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:800;color:#fff;flex-shrink:0;letter-spacing:-.5px;}
.hero-info h2{font-size:18px;font-weight:800;color:#fff;margin-bottom:3px;}
.hero-info .sid{font-size:12px;color:rgba(255,255,255,.62);}
.badge-row{display:flex;gap:6px;margin-top:7px;flex-wrap:wrap;}
.badge{font-size:11px;font-weight:600;padding:3px 10px;border-radius:20px;background:rgba(255,255,255,.13);color:rgba(255,255,255,.87);}
.badge.gold{background:#f2b100;color:#1a1200;}
.tab-strip{display:flex;border-top:.5px solid rgba(255,255,255,.12);margin:0 -22px;padding:0 22px;}
.tab{padding:11px 16px;font-size:12px;font-weight:700;color:rgba(255,255,255,.42);border-bottom:2px solid transparent;}
.tab.active{color:#f2b100;border-bottom-color:#f2b100;}
/* BODY */
.rc-body{padding:20px;}
/* CGPA BANNER */
.cgpa-banner{display:flex;align-items:center;gap:16px;background:#eef3fd;border:.5px solid #c5d4f0;border-radius:11px;padding:15px 18px;margin-bottom:18px;}
.cgpa-circle{width:60px;height:60px;border-radius:50%;background:#0d2260;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0;border:2.5px solid #f2b100;}
.cgpa-circle .num{font-size:17px;font-weight:800;color:#fff;line-height:1;}
.cgpa-circle .denom{font-size:9px;color:rgba(255,255,255,.55);line-height:1.6;}
.cgpa-info h3{font-size:15px;font-weight:700;color:#0d2260;}
.cgpa-info .sub{font-size:12px;color:#64748b;margin-top:2px;}
.grade-pill{display:inline-block;margin-top:6px;background:#dcfce7;color:#15803d;font-size:11px;font-weight:700;padding:3px 11px;border-radius:20px;}
/* INFO GRID */
.info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.info-item{background:#f8fafc;border:.5px solid #e2e8f0;border-radius:10px;padding:12px 13px;}
.info-item .lbl{font-size:10px;font-weight:700;color:#94a3b8;text-transform:uppercase;letter-spacing:.4px;margin-bottom:5px;}
.info-item .val{font-size:14px;font-weight:700;color:#1e293b;}
/* FOOTER STRIP */
.rc-footer{border-top:.5px solid #e2e8f0;padding:12px 20px;display:flex;justify-content:space-between;align-items:center;}
.verified{font-size:11px;color:#64748b;display:flex;align-items:center;gap:5px;}
.verified svg{width:15px;height:15px;stroke:#22c55e;fill:none;stroke-width:2;}
.print-btn{font-size:12px;font-weight:700;color:#0d2260;background:#e8effd;border:none;border-radius:7px;padding:6px 16px;cursor:pointer;display:flex;align-items:center;gap:5px;font-family:inherit;}
.print-btn:hover{background:#d4e1fb;}
.print-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;}
.admin-link{text-align:center;margin-top:18px;}
.admin-link a{color:#0d2260;text-decoration:none;font-weight:700;font-size:13px;}
.admin-link a:hover{text-decoration:underline;}
/* ── SITE FOOTER ── */
.site-footer{background:#0d1f5c;color:rgba(255,255,255,.55);text-align:center;padding:18px 16px;font-size:12px;margin-top:40px;}
.site-footer a{color:#f2b100;text-decoration:none;font-weight:700;}
@media(max-width:640px){
.navbar .nav-links{display:none;}
.search-row{grid-template-columns:1fr;}
.sbtn{width:100%;height:44px;}
.info-grid{grid-template-columns:1fr 1fr;}
.rc-hero-row{flex-direction:column;text-align:center;}
.badge-row{justify-content:center;}
.topbar-text h1{font-size:17px;}
}
@media print{
.navbar,.topbar,.breadcrumb,.search-card,.admin-link,.site-footer{display:none!important;}
body{background:#fff;}
.result-card{box-shadow:none;border:1px solid #e2e8f0;}
.print-btn{display:none!important;}
.wrap{margin:0;padding:0;max-width:100%;}
}
</style>
</head>
<body>
<!-- ── NAVBAR ── -->
<nav class="navbar">
<div class="nav-links">
<a href="https://ciu.edu.bd">Home</a>
<a href="https://ciu.edu.bd/ciu-at-a-glance">About Us</a>
<a href="https://ciu.edu.bd/undergraduate-program-list">Academics</a>
<a href="https://ciu.edu.bd/admission-info">Admissions</a>
<a href="https://ciu.edu.bd/contactus">Contact Us</a>
</div>
<div class="nav-right">
<a href="admin/login.php">Admin</a>
</div>
</nav>
<!-- ── TOPBAR ── -->
<div class="topbar">
<img class="logo" src="assets/logo.png" alt="CIU Logo">
<div class="topbar-text">
<h1>Chittagong Independent University</h1>
<div class="tagline">Minhaj Complex, 12 Jamal Khan Road, Chattogram, Bangladesh</div>
<div class="motto">✦ Lord Advance Me In Knowledge</div>
</div>
</div>
<!-- ── BREADCRUMB ── -->
<div class="breadcrumb">
<a href="https://ciu.edu.bd">Home</a>
<span>›</span>
<a href="https://ciu.edu.bd/ciu-portal">CIU Portal</a>
<span>›</span>
<span>Student Result</span>
</div>
<!-- ── MAIN ── -->
<div class="wrap">
<!-- SEARCH -->
<div class="search-card">
<div class="card-title">
<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35" stroke-linecap="round"/></svg>
Student Result Search
</div>
<form method="POST">
<div class="search-row">
<div class="field">
<label for="student_id">Student ID</label>
<input type="text" id="student_id" name="student_id"
placeholder="e.g. CSE-2021-001"
value="<?php echo htmlspecialchars($_POST['student_id'] ?? ''); ?>" required>
</div>
<div class="field">
<label for="dob">Date of Birth</label>
<input type="date" id="dob" name="dob"
value="<?php echo htmlspecialchars($_POST['dob'] ?? ''); ?>" required>
</div>
<div>
<button type="submit" class="sbtn">View Result</button>
</div>
</div>
<?php if ($error): ?>
<div class="alert"><?php echo htmlspecialchars($error); ?></div>
<?php endif; ?>
</form>
</div>
<!-- RESULT CARD -->
<?php if ($student): ?>
<div class="result-card" id="result">
<!-- HERO -->
<div class="rc-hero">
<div class="rc-hero-row">
<?php
/* Show uploaded photo if exists, else initials avatar */
$photoFile = 'assets/students/' . preg_replace('/[^a-zA-Z0-9_\-]/', '_', $student['student_id']) . '.jpg';
if (!empty($student['photo']) && file_exists(__DIR__ . '/' . $student['photo'])):
?>
<img class="student-photo"
src="<?php echo htmlspecialchars($student['photo']); ?>"
alt="<?php echo htmlspecialchars($student['student_name']); ?>">
<?php elseif (file_exists(__DIR__ . '/' . $photoFile)): ?>
<img class="student-photo"
src="<?php echo htmlspecialchars($photoFile); ?>"
alt="<?php echo htmlspecialchars($student['student_name']); ?>">
<?php else: ?>
<div class="avatar-fallback"><?php echo initials($student['student_name']); ?></div>
<?php endif; ?>
<div class="hero-info">
<h2><?php echo htmlspecialchars($student['student_name']); ?></h2>
<div class="sid">
<?php echo htmlspecialchars($student['student_id']); ?>
·
<?php echo htmlspecialchars($student['program']); ?>
</div>
<div class="badge-row">
<span class="badge"><?php echo htmlspecialchars($student['batch']); ?> Batch</span>
<span class="badge"><?php echo htmlspecialchars($student['session']); ?></span>
<span class="badge gold">Passed <?php echo htmlspecialchars($student['passing_year']); ?></span>
</div>
</div>
</div>
<div class="tab-strip">
<div class="tab active">Academic Result</div>
</div>
</div>
<!-- BODY -->
<div class="rc-body">
<!-- CGPA BANNER -->
<div class="cgpa-banner">
<div class="cgpa-circle">
<span class="num"><?php echo htmlspecialchars($student['cgpa']); ?></span>
<span class="denom">/ 4.00</span>
</div>
<div class="cgpa-info">
<h3>Cumulative GPA (CGPA)</h3>
<div class="sub">
<?php echo htmlspecialchars($student['total_credit']); ?> total credits completed
</div>
<span class="grade-pill">🏆 <?php echo cgpaLabel($student['cgpa']); ?></span>
</div>
</div>
<!-- INFO GRID -->
<div class="info-grid">
<div class="info-item">
<div class="lbl">Student ID</div>
<div class="val"><?php echo htmlspecialchars($student['student_id']); ?></div>
</div>
<div class="info-item">
<div class="lbl">Program</div>
<div class="val"><?php echo htmlspecialchars($student['program']); ?></div>
</div>
<div class="info-item">
<div class="lbl">Batch</div>
<div class="val"><?php echo htmlspecialchars($student['batch']); ?></div>
</div>
<div class="info-item">
<div class="lbl">Session</div>
<div class="val"><?php echo htmlspecialchars($student['session']); ?></div>
</div>
<div class="info-item">
<div class="lbl">Passing Year</div>
<div class="val"><?php echo htmlspecialchars($student['passing_year']); ?></div>
</div>
<div class="info-item">
<div class="lbl">Date of Birth</div>
<div class="val"><?php echo htmlspecialchars($student['date_of_birth']); ?></div>
</div>
</div>
</div>
<!-- FOOTER STRIP -->
<div class="rc-footer">
<div class="verified">
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
Verified — CIU Academic Office
</div>
<button class="print-btn" onclick="window.print()">
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 6 2 18 2 18 9"/>
<path d="M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2"/>
<rect x="6" y="14" width="12" height="8"/>
</svg>
Print Result
</button>
</div>
</div>
<?php endif; ?>
<div class="admin-link"><a href="admin/login.php">Admin Login</a></div>
</div>
<div class="site-footer">
© <?php echo date('Y'); ?> Chittagong Independent University
· Developed by <a href="https://ciu.edu.bd">CIU Software Team</a>
</div>
</body>
</html>