1+ <?php
2+ include_once "head.php " ;
3+ ?>
4+ <body>
5+ <?php
6+ include_once "navi.php " ;
7+ ?>
8+ <?php
9+ include_once "data.php " ;
10+ include_once "detail.php " ;
11+
12+ $ mappingExists = array ();
13+ $ noMappingExists = array ();
14+ ?>
15+ <table class="table">
16+ <thead>
17+ <tr>
18+ <th scope="col">Dimension</th>
19+ <th scope="col">Subdimension</th>
20+ <th scope="col">Actvity</th>
21+ <th scope="col">SAMM 2</th>
22+ <th scope="col">ISO 27001</th>
23+ </tr>
24+ </thead>
25+ <tbody>
26+ <?php
27+ function getFlattenedArray ($ array , $ index ) {
28+ if (!array_key_exists ($ index , $ array )) {
29+ return "TODO " ;
30+ }
31+
32+ $ return = "" ;
33+ $ potentialArray = $ array [$ index ];
34+ if (is_array ($ potentialArray )) {
35+ foreach ($ potentialArray as $ element => $ content ) {
36+ $ return .= "$ content " ;
37+ }
38+ }else {
39+ $ return .= $ potentialArray ;
40+ }
41+ return $ return ;
42+ }
43+
44+ foreach ($ dimensions as $ dimension => $ subdimensions ) {
45+ foreach ($ subdimensions as $ subdimension => $ activity ) {
46+ foreach ($ activity as $ activityName => $ content ) {
47+ echo "<tr> " ;
48+ echo "<td> $ dimension</td> " ;
49+ echo "<td> $ subdimension</td> " ;
50+ $ tooltip = "<div class='popoverdetails'> " . build_table_tooltip ( $ content ) . "</div> " ;
51+ echo "<td><div data-toggle= \"popover \" data-title= \"$ activityName \" data-content= \"$ tooltip \" type= \"button \" data-html= \"true \"> " . $ activityName . "</div></td> " ;
52+ echo "<td> " . getFlattenedArray ($ content , "samm2 " ) . "</td> " ;
53+ echo "<td> " . getFlattenedArray ($ content , "iso27001-2017 " ) . "</td> " ;
54+ }
55+ }
56+ }
57+
58+ echo "</table> " ;
59+ //var_dump($noMappingExists);
0 commit comments