-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhome.php
96 lines (82 loc) · 4.02 KB
/
home.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
<head>
<link rel="stylesheet" type="text/css" href="style/main.css">
<div id="particles-js"></div>
<script type="text/javascript" src="scripts/particles.js"></script>
<script type="text/javascript" src="scripts/app.js"></script>
</head>
<div id="main">
<div class="box">
<!--SIDEBAR -->
<div class="box-child">
<div class="collapse" id="leftCol">
<div class="p-2">
<?php
include('sidebarCalendar.php');
?>
</div>
<div class="part" style="z-index:100">
<h5 id="demofont1"><?php echo get_current_user_labName(); ?></h5>
<h8 id="demofont2" style="margin:right">This week at a glimpse.</h8>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a class="nav-link" id="hypertext" href="#">
This week's cost <?php echo(isset($_GET['w']) ? getWeekCost($_GET['w']) .'$' : getWeekCost(date_format(date_create(),'W')) .'$');?>
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="hypertext" href="#">
Time allocated <?php echo(isset($_GET['w']) ? getWeekHours($_GET['w']) .'h' : getWeekHours(date_format(date_create(),'W')) .'h');?>
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="hypertext" data-toggle="collapse" data-target="#supplementTable">List of chemicals consumed</a>
<?php include('supplementsCalendar.php'); ?>
</li>
</ul>
</div>
</div>
</div>
<!--Main -->
<div class="col">
<!-- calendar top -->
<div class="row">
<!--Top text -->
<h2 id="demofont3">
<?php
if(!isset($_GET['w'])) {
#set first day
$today = date_create();
$day = date_isodate_set($today, date_format($today,'o'), date_format($today,'W') , 1 ); #TODO: change year
#set week startpoint
$monday = $day;
#print week
$week = date_format($day,'W');
echo 'Calendar for '. date_format($day,'M') .' Week '. $week;
} else {
$today = date_create();
#set monday of specified week
$day = date_isodate_set(date_create(), date_format(date_create(),'o'), $_GET['w'] , 1 ); #TODO: change year
#set week startpoint
$monday = $day;
#print week
$week = $_GET['w'];
echo 'Calendar for '. date_format($day,'M') .' Week '. $week;
}
?>
</h2>
<a class="week-link" href=<?php echo('?w='. ((int)$week-1)); ?>><img id='imglink' src="gfx/left_cal.png"></a>
<a class="week-link" href=<?php echo('?w='. ((int)$week+1)); ?>><img id='imglink' src="gfx/right_cal.png"></a>
<a class="week-link pr-3" data-toggle='modal' href='#newExperiment'><img id='imglink' src="gfx/plus.png"></a>
</div>
<?php
#if(!isset($_SESSION['lab'])){
include('newExperiment.php');
include('calendar.php');
#} else {
#include(''); //OOPS something went wrong
#}
?>
</div>
</div>
</div>
</div>