-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar.php
44 lines (44 loc) · 1.86 KB
/
calendar.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
<div class="col-lg-8 sidebar-offcanvas sidebar-left">
<h5 class="section-title hidden-lg-down">Calendario</h5>
<div class="card card-block">
<div class="monthly" id="mycalendar"></div>
</div>
</div><!--/span-->
<div class="col-lg-4 sidebar-offcanvas col-nopadding-side sidebar-left">
<h5 class="section-title hidden-lg-down">Legenda</h5>
<div class="card card-block">
<?php
$sql = "SELECT DISTINCT c.name, c.color FROM categories c, calendar_events e WHERE c.name=e.category_name AND e.student_id='" . $_SESSION['student_id'] ."' ";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
echo '
<ul class="list-group">';
while($row = $result->fetch_assoc()) {
$name = $row['name'];
$color = $row['color'];
echo '
<li class="list-group-item">
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" name="'. $name .'" checked>
<style type="text/css" scoped>
.custom-control-input:checked ~ .custom-control-indicator {
background-color: '. $color .';
}
</style>
<span class="custom-control-indicator"></span>
<span class="custom-control-description">'. $name .'</span>
</label>
</li>
';
}
echo '</ul>';
} else {
echo '<div class="row">
<span class="icon-calendar big-grey-icon" aria-hidden="true"></span>
<h3 class="login-card-title">Nessun Evento</h3>
<p class="login-card-subtitle">Attualmente non é previsto nessun evento.</p>
</div>'; //TODO do it better
}
?>
</div>
</div><!--/span-->