-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
197 lines (186 loc) · 6.21 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
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
<?php
/**
* Index page for regular (non-admin) users
*/
// load up your config file
require_once(filter_input(INPUT_SERVER, 'DOCUMENT_ROOT') . "/resources/config.php");
require_once(filter_input(INPUT_SERVER, 'DOCUMENT_ROOT') . "/dao/user_dao.php");
$PAGETYPE = "public";
require_once(RESOURCES_PATH . "/session.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>KEOPS | Home</title>
<?php
require_once(TEMPLATES_PATH . "/head.php");
?>
</head>
<?php
$signedin = isSignedIn();
if (!isSignedIn()) {
?>
<body class="home-body">
<div class="full-width">
<div class="container">
<div class="home-banner row">
<div class="col-xs-10 col-md-10">
<img src="img/pyramids-icon-white.png" alt="" />
<h1>Welcome to KEOPS</h1>
<h2>Keen Evaluation Of Parallel Sentences</h2>
</div>
<div class="col-xs-10 col-md-10" style="padding-top: 4em;">
<a href="/signin.php" class="btn btn-default outline inverted">Sign in</a>
<a href="/signup.php" class="btn btn-link inverted px-3">Sign up with a token</a>
</div>
</div>
</div>
</div>
<div class="grey-background">
<div class="container">
<div class="card-container row">
<div class="col-md-3">
<div class="card text-center ">
<span class="glyphicon glyphicon-eye-open"></span>
<div class="card-body">
<h4 class="card-title">See your tasks</h4>
<p class="card-text">Your personal dashboard will tell you which tasks you've been assigned and practical details about them.</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center ">
<span class="glyphicon glyphicon-pencil"></span>
<div class="card-body">
<h4 class="card-title">Action!</h4>
<p class="card-text">Start or resume an evaluation task, read the guidelines, annotate sentences, send comments and contact your PM in case of doubt.</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center ">
<span class="glyphicon glyphicon-stats"></span>
<div class="card-body">
<h4 class="card-title">Project stats</h4>
<p class="card-text">At any point of completion of a task, see its status and a recap of the work done. Download your own results.</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-center">
<span class="glyphicon glyphicon-ok"></span>
<div class="card-body">
<h4 class="card-title">Done!</h4>
<p class="card-text">Communicate with your PM whenever you need it. Easily send your finished task.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}else{
?>
<body>
<?php require_once(TEMPLATES_PATH . "/header.php"); ?>
<div class="container">
<?php
if (isset($_SESSION["error"])) {
?>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title"><strong>Oops!</strong></h3>
</div>
<div class="panel-body">
<p>
<?php
switch ($_SESSION["error"]) {
case "signuploggedin":
echo "Please, logout before signing up a different user.";
break;
case "error":
default:
echo "Sorry, your request could not be processed. Please, try again later.";
break;
}
$_SESSION["error"] = null;
?>
</p>
</div>
</div>
<?php
}
?>
<?php
//This should be in the header
if (isset($_SESSION["userinfo"])) {
$user = $_SESSION["userinfo"];
if (!$user->active == true) {
?>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title"><strong>Oops!</strong></h3>
</div>
<div class="panel-body">
<p>
Your account has been disabled. Please, contact an administrator if you think this is an error.
</p>
</div>
</div>
<?php } else { ?>
<div class="page-header">
<h3>Your tasks</h3>
<p>Check the status of the tasks assigned to you</p>
</div>
<table id="user-tasks-table" class="table table-striped table-bordered display responsive nowrap" data-projectid="" cellspacing="0" width="100%">
<thead>
<tr>
<th>ID</th>
<th>Project</th>
<th title="Source language">SL</th>
<th title="Target language">TL</th>
<th>Size</th>
<th>Status</th>
<th>Creation date</th>
<th>Type</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<th>ID</th>
<th>Project</th>
<th title="Source language">SL</th>
<th title="Target language">TL</th>
<th>Size</th>
<th>Status</th>
<th>Creation date</th>
<th>Type</th>
<th></th>
<th></th>
</tr>
</tfoot>
</table>
<?php
}
}
}
?>
</div>
</div>
<?php
if (isSignedIn()) {
require_once(TEMPLATES_PATH . "/footer.php");
} else {
require_once(TEMPLATES_PATH . "/home-footer.php");
}
?>
<?php
require_once(TEMPLATES_PATH . "/resources.php");
?>
</body>
</html>