-
Notifications
You must be signed in to change notification settings - Fork 0
/
task-problem.php
82 lines (61 loc) · 1.97 KB
/
task-problem.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
<?php
if(!isset($_GET['task'])) {
header('location: index.php');
exit();
}
$taskcode = $_GET['task'];
include('lib/db.php');
init_db();
$result = getOpAndTaskAndUserByTaskCode($taskcode);
if(is_null($result)) {
header('location: index.php');
exit();
}
$userid = $result['userid'];
$op = $result['op'];
$task = $op['single_task'];
if($task['completed']==1) {
header('location: index.php');
exit();
}
$sid = createNewSessionByUserid($userid);
if(is_null($sid)) {
header('location: index.php');
exit();
}
setcookie('sid', $sid, time() + 365*24*60*60);
$user = getSessionUser($sid);
if(is_null($user)) {
setcookie('sid', '', time() - 3600);
header('Location: index.php');
exit();
}
$css = array('home.css', 'task-completed.css');
include('common/header.php');
include('lib/op-with-tasks-view.php');
?>
<div class="container sections-wrapper"><div class="row"><div class="col-md-6 col-md-offset-3 col-sm-12">
<h2>Problem Reported!</h2>
<p>The problem completing this task has been reported. <br/><br/>
You can tell us more about the problem right here: </p>
<textarea></textarea>
<button type="submit" class="btn btn-success">Send Details</button>
<div class='card' id='complete-task-modal' style='padding:0'>
<div class='modal-header'>
<h4 class='modal-title'><?php echo $op['name']; ?></h4>
<!-- todo: show op details here -->
</div>
<div class='modal-body'>
<p class='modalmsg success'></p>
<span class='data-taskid'><?php echo $task['id']; ?></span>
<ul class='fa-ul task-container' id='task-container'>
<?php echo renderTask($task); ?>
</ul>
</div>
<!-- todo if you can't complete coz you don't have sign, just click here. -->
</div>
</div></div></div>
<?php
$scripts = array('main.js', 'task-problem.js');
include('common/footer.php');
?>