forked from nconf/nconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.php
160 lines (129 loc) · 4.88 KB
/
history.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
require_once 'include/head.php';
// Load the dataTables plugin
echo '<script src="include/js/jquery_plugins/jquery.dataTables.min.js" type="text/javascript"></script>';
echo '<script src="include/js/jquery_plugins/jquery.dataTables.fnSetFilteringDelay.js" type="text/javascript"></script>';
if ( !empty($_GET["id"]) ){
?>
<script type="text/javascript">
$(document).ready(function() {
$('#history tbody tr').live('hover', function() {
$(this).children().toggleClass( 'highlighted' );
});
oTable = $('#history').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 0, "desc" ], [5, "desc"] ],
"aLengthMenu": [[30, 100, 500, -1], [30, 100, 500, "All"]],
"iDisplayLength": 30,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "call_file.php?ajax_file=json/history.php&debug=no&id=<?php echo $_GET["id"];?>",
"sDom": '<"H"lrf>t<"F"ip>',
"bAutoWidth": false,
"aoColumns": [
null, null, null, null, null, { "bVisible": false }
],
"fnInitComplete": function() {
$('#history_processing').addClass('ui-widget-header');
$("#loading").hide();
$("#hidden_history").show();
}
});
});
</script>
<?php
$item_class = db_templates("class_name", $_GET["id"]);
$item_name = db_templates("naming_attr", $_GET["id"]);
# Set time seperation (empty row after time-change)
$time_seperation = TRUE;
$show_item_links = FALSE;
# Set title
$title = 'History of '.$item_class.': '.$item_name;
if ( !empty($_SESSION["go_back_page"]) ){
$detail_navigation = '<a class="button_back jQ_tooltip" title="back" href="'.$_SESSION["go_back_page"].'"></a>';
}
# Expand the titel with filter
if ( !empty($_GET["filter"]) ) $title .= '<br>--> filtered for <i>'.$_GET["filter"].'</i>';
}else{
?>
<script type="text/javascript">
$(document).ready(function() {
$('#history tbody tr').live('hover', function() {
$(this).children().toggleClass( 'highlighted' );
});
oTable = $('#history').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 0, "desc" ], [5, "desc"] ],
"aLengthMenu": [[30, 100, 500, -1], [30, 100, 500, "All"]],
"iDisplayLength": 30,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "call_file.php?ajax_file=json/history.php&debug=no",
"sDom": '<"H"lrf>t<"F"ip>',
"bAutoWidth": false,
"aoColumns": [
null, null, null, null, null, { "bVisible": false }
],
"fnInitComplete": function() {
$('#history_processing').addClass('ui-widget-header');
$("#loading").hide();
$("#hidden_history").show();
}
});
// set delay for lower search requests (plugin)
oTable.fnSetFilteringDelay(500);
});
</script>
<?php
# Set title
$title = 'Basic history';
$subtitle = TXT_HISTORY_SUBTITLE;
$time_seperation = FALSE;
$show_item_links = TRUE;
}
### Content
# nav buttons
if (!empty($detail_navigation) ){
echo '<div id="ui-nconf-icon-bar">'
.$detail_navigation.
'</div>';
}
# title
echo '<h2>'.$title.'</h2>';
if ( !empty($subtitle) ){
echo $subtitle."<br><br>";
}
echo '<img id="loading" src="img/working_small.gif">';
echo '<div id="hidden_history" style="display: none;">';
/*
# Get result
$result = db_handler($query, 'result', "get history entries");
# amount of total entries (with a sql function)
$show_num_rows = db_handler('SELECT FOUND_ROWS();', 'getOne', "How many rows totaly");
if ( ( empty($_GET["show"]) OR $_GET["show"] != "all" ) AND $show_num_rows > "5000" ){
$content = 'For performance reasons only the last 5000 entries are listed here. Total history entries found: '.$show_num_rows;
echo NConf_HTML::show_highlight("Output limited to 5000 entries", $content);
echo "<br>";
}
*/
# Show table
echo '<table id="history" style="width: 100%">';
echo '<thead>';
echo '<tr>';
echo '<th width="120">When</td>
<th width="120">Who</td>
<th width="60">Action</td>
<th width="100">Object</td>
<th width="360">Value</td>
<th width="20">ID</td>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
echo '</tbody>';
echo '</table>';
echo '</div>'; // hidden div on loading
mysql_close($dbh);
require_once 'include/foot.php';
?>