-
Notifications
You must be signed in to change notification settings - Fork 0
/
Assistance.php
52 lines (45 loc) · 1.51 KB
/
Assistance.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
<?php
include "AssistanceData.php";
function displayLinks($taskarray){
$html='<ul>';
foreach($taskarray as $item){
$link = $item['link'];
$title = $item['title'];
$abstract = $item['abstract'];
$html .= '<li class="suggest-links"><b><a href='. $link.'>'.$title.'</a></b>'
. '<p class="snippet">'.$abstract.'</p></li>';
}
$html .= '</ul>';
return $html;
}
function display4LinkAssist($task_items){
$html = displayLinks($task_items);
$html = '<h5>People find these are helpful: </h5>'.$html;
return $html;
}
function printMeDis($medis){
$html = '<ol>';
foreach($medis as $medi){
$html .= '<li><a href="#">'.$medi.'</a></li>';
}
$html .= '</ol>';
return $html;
}
function display4DimensionAssist($taskID){
$html = '<div class="suggested-methods"><h5>We found different types/methods of the topic: </h5>';
$html .= printMeDis($taskID['methods']);
$html .= '</div><div class="suggested-dimensions"><h5>You may consider the effectiveness in terms of: </h5>';
$html .= printMeDis($taskID['dimensions']);
$html .= '</div><div class="suggested-links-D"><h5>You might also find these helpful:</h5>';
$html .= displayLinks($taskID['items']);
$html .= '</div>';
return $html;
}
if($asType ==='D'){
echo display4DimensionAssist(${$taskID});
} else if($asType ==='L'){
echo display4LinkAssist(${$taskID}['items']);
} else {
echo 'No assistance data';
}
?>