/
funcoes.php
91 lines (62 loc) · 2.31 KB
/
funcoes.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
<?php
function getPaideTodos($array){
foreach($array as $atual){
if($atual["@Ontology#parent"] ==""){
return $atual;}
}
}
function getModelosDominio($idDomain){
$endereco = "core-services-webapp.herokuapp.com/Model/".$idDomain."/hierarchy";
$curl = curl_init($endereco);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
$json = json_decode($curl_response, true);
return $json;
}
function getFilhosTopico($Topico, $array){
echo "<ul class='table-bordered'>";
echo "<li><button name='selecao' value='".$Topico["@Ontology#id"]."' type='submit'>".($Topico["@Ontology#label"])."-".($Topico["@Ontology#id"])."</li></button><br>";
foreach($array as $atual){
if ($atual["@Ontology#parent"]==$Topico["@Ontology#id"]){
// echo "<li>".($atual["@Ontology#label"])."-".($atual["@Ontology#id"])."</li><br>";
getFilhosTopico($atual,$array);
}
}
echo "</ul>";
}
function getSequenceView($idModel){
$endereco = "core-services-webapp.herokuapp.com/Model/".$idModel."/sequence";
$curl = curl_init($endereco);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
$json = json_decode($curl_response, true);
$json = $json["@Ontology#Topic"];
return $json;
}
function getResourcesTopico($idTopico){
$endereco = "core-services-webapp.herokuapp.com/Topic/".$idTopico."/resources";
$curl = curl_init($endereco);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
$json = json_decode($curl_response, true);
$json = $json["@Ontology#Resource"];
return $json;
}
function getNext($idTopico){
$endereco = "core-services-webapp.herokuapp.com/Topic/".$idTopico."/next";
$curl = curl_init($endereco);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
$json = json_decode($curl_response, true);
$json = $json["@Ontology#Topic"];
return $json;
}
function getPrevious($idTopico){
$endereco = "core-services-webapp.herokuapp.com/Topic/".$idTopico."/previous";
$curl = curl_init($endereco);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
$json = json_decode($curl_response, true);
$json = $json["@Ontology#Topic"];
return $json;
}