-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
123 lines (106 loc) · 2.81 KB
/
index.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
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
<?php
session_start();
require_once("php/cookies.php");
if (!isset($_SESSION["user_data"]))
{
$userdata = load_login_data_from_cookies();
if (isset($userdata))
$_SESSION["user_data"] = $userdata;
else
{
header("Location: /todolist/login.php");
die();
}
}
?>
<html>
<head>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<style>
.dont-break-out {
/* These are technically the same, but use both */
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
/* This is the dangerous one in WebKit, as it breaks things wherever */
word-break: break-all;
/* Instead use this non-standard one: */
word-break: break-word;
/* Adds a hyphen where the word breaks, if supported (No Blink) */
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
</style>
</head>
<body>
<div>
<div style='display:inline-block;width:49%;'> <u> TODO List </u> </div>
<div style='display:inline-block;width:49%;text-align:right;'>
<a href='php/logout.php'>Logout</a>
</div>
</div>
<div>
<br>
<input type='checkbox' onclick='toggle_view_complete_tasks()'
<?php
if (isset($_SESSION['view_complete']))
if ($_SESSION['view_complete'])
echo 'checked';
?>
/> View Concluded Tasks
<br>
<input type='checkbox' onclick='toggle_view_next_deadlines()'
<?php
if (isset($_SESSION['view_next_deadlines']))
if ($_SESSION['view_next_deadlines'])
echo 'checked';
?>
/> View Next Deadlines
<br>
</div>
<br>
<br>
<div style='width:90%'>
<div id='main' style='display:inline-block;float:left;'>
<div id="root">
<div id="subtasks0"></div>
<div id="new"></div>
</div>
</div>
<div id='next_deadlines' style='display:inline-block;float:right;'>
</div>
</div>
<script type="text/javascript" src="http://www.fmtz.com.br/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
$(function(){
list_root_tasks();
setInterval(function() {
$.ajax({method: "POST", url: "php/user_is_logged.php"}).done(function(data) {
if (data == 0) {
window.location.replace('php/logout.php');
}
});
}, 5000);
<?php
$view_deadlines_active = FALSE;
if (isset($_SESSION['view_next_deadlines']))
{
if ($_SESSION['view_next_deadlines'])
{
$view_deadlines_active = TRUE;
echo 'list_next_deadlines()';
}
}
if (! $view_deadlines_active)
{
echo "$('#next_deadlines').hide();\n";
echo "$('#main').css('width', '99%');";
}
?>
});
</script>
</body>
</html>