-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist-commands.php
101 lines (86 loc) · 2.76 KB
/
list-commands.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
<?php
session_start();
if(!isset($_SESSION["username"])){
header("location:index.php");
}
//$term = $_GET["term"];
$scope = $_GET["scope"];
$json_file = "tools.json";
$headers_array = array("#", "value", "label", "kind", "desc", "order", "icon");
if (strcmp($scope, "menu") == 0) {
$json_file = "menus.json";
$headers_array = array("#", "value", "label", "kind", "desc", "level", "icon");
} else
$scope = "tool";
$items = json_decode(file_get_contents($json_file), true);
$results_array = array();
foreach ($items as $item) {
$results_array[] = $item;
}
//echo json_encode($results);
include "conn.php";
include "header.php";
?>
<h1><?php echo $scope; ?> list <small>total: <?php echo count($results_array); ?></small></h1>
<table class="table table-striped table-hover">
<thead><tr></tr></thead>
<tbody></tbody>
</table>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
<script src="js/libs/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="js/libs/jquery-ui-1.8.22.custom.min.js"></script>
<script type="text/javascript" src="js/libs/jcarousel/jquery.jcarousel.min.js"></script>
<script src="js/libs/jcview/jquery.vt.jcview.js"></script>
<script src="js/libs/log4javascript.js"></script>
<script type="text/javascript">
/* MENU
{
"value": "photoshop-preferences-guides_grid_slices",
"label": "Photoshop > Preferences > Guides, Grid, & Slices",
"kind": "Photoshop",
"desc": "",
"level": "3",
"icon": "white.png"
},
TOOL
{
"value": "single-column-marquee",
"label": "Single Column Marquee",
"kind": "Selection",
"desc": "",
"order": "2",
"icon": "2_3.png"
},
*/
$(document).ready(function() {
var results_array = <?php echo json_encode($results_array); ?>;
var headers_array = <?php echo json_encode($headers_array); ?>;
var html = "";
$.each(headers_array, function(index, item) {
html = html + "<th>" + item + "</th>";
});
$("table thead tr").append(html);
$.each(results_array, function(index, item) {
$tr = $("<tr/>");
$tr.append("<td>" + parseInt(index+1) + "</td>")
//console.log(item);
$.each(item, function(i, v) {
//console.log(v);
$tr.append($("<td/>").html(v));
});
$("table tbody").append($tr);
});
});
</script>
<script src="js/script.js"></script>
<!--
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
-->
</body>
</html>