-
Notifications
You must be signed in to change notification settings - Fork 0
/
situatie-scolara.php
78 lines (63 loc) · 2.54 KB
/
situatie-scolara.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
<?php
define('BASEPATH', true);
session_start();
require('backend/config/db.php');
if(!isset($_SESSION["user"])) {
header("Location: login.php");
exit();
}
// users logic 2
$stmt = $pdo->prepare("SELECT * FROM users WHERE email=:email");
$stmt -> bindParam(':email', $_SESSION['user']);
$stmt->execute();
$conturi = $stmt->fetchAll();
foreach($conturi as $cont)
//grades logic
$sql = "SELECT subject_id, grade FROM grades WHERE user_id = $cont[id]";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$grades = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="preload" href="styles/FontAwesome/css/all.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link rel="stylesheet" href="styles/situatie/all.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.min.css'>
</head>
<body>
<?php include './important/rightbar.php'; ?>
<?php include './important/sidebar.php'; ?>
<div class="my-grades-box">
<div class="my-grades-box-content">
<h1>Situatie scolara</h1>
<?php
if($grades) {
foreach ($grades as $grade) { ?>
<div class="my-grades-box-content-grades">
<div class="my-grades-box-content-grades-content">
<div class="my-grades-box-content-grades-content-subject">
<h1><?php if($grade['subject_id'] == 1) {
echo 'Limba Romana'; }
else if($grade['subject_id'] == 2) {
echo 'Matematica';
} else if($grade['subject_id'] == 3) {
echo 'Limba Incepătoare (1)';
} else if ($grade['subject_id'] == 4) {
echo 'Limba Latină';
} else if($grade['subject_id'] == 5) {
echo 'Psihologie';
}?></h1>
<h1><?php echo $grade['grade'] ?></h1>
</div>
</div>
<?php } } else {?> <h1>Nu ai note. </h1> <?php }?>
<div class="absente-box">
</div>
</body>
</html>