forked from projectsend/projectsend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
138 lines (120 loc) · 2.93 KB
/
home.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
<?php
/**
* Home page for logged in system users.
*
* @package ProjectSend
*
*/
$load_scripts = array(
'flot',
);
$allowed_levels = array(9,8,7);
require_once('sys.includes.php');
$page_title = __('Dashboard', 'cftp_admin');
$active_nav = 'dashboard';
$body_class = array('dashboard', 'home', 'hide_title');
include('header.php');
define('CAN_INCLUDE_FILES', true);
$log_allowed = array(9);
$show_log = false;
$sys_info = false;
if (in_session_or_cookies($log_allowed)) {
$show_log = true;
$sys_info = true;
}
?>
<div class="col-sm-8">
<div class="row">
<div class="col-sm-12 container_widget_statistics">
<?php include(WIDGETS_FOLDER.'statistics.php'); ?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?php include_once(WIDGETS_FOLDER.'news.php'); ?>
</div>
<?php
if ( $sys_info == true ) {
?>
<div class="col-sm-6">
<?php include_once(WIDGETS_FOLDER.'system-information.php'); ?>
</div>
<?php
}
?>
</div>
</div>
<?php
if ( $show_log == true ) {
?>
<div class="col-sm-4 container_widget_actions_log">
<?php include(WIDGETS_FOLDER.'actions-log.php'); ?>
</div>
<?php
}
?>
<script type="text/javascript">
$(document).ready(function(){
/** STATISTICS */
function ajax_widget_statistics( days ) {
var target = $('.statistics_graph');
target.html('<div class="loading-graph">'+
'<img src="<?php echo BASE_URI; ?>/img/ajax-loader.gif" alt="Loading" />'+
'</div>'
);
$.ajax({
url: '<?php echo WIDGETS_URL; ?>statistics.php',
data: { days:days, ajax_call:true },
success: function(response){
target.html(response);
},
cache:false
});
}
$('.stats_days').click(function(e) {
e.preventDefault();
if ($(this).hasClass('btn-inverse')) {
return false;
}
else {
var days = $(this).data('days');
$('.stats_days').removeClass('btn-inverse');
$(this).addClass('btn-inverse');
ajax_widget_statistics(days);
}
});
ajax_widget_statistics(15);
/** ACTION LOG */
function ajax_widget_log( action ) {
var target = $('.activities_log');
target.html('<div class="loading-graph">'+
'<img src="<?php echo BASE_URI; ?>/img/ajax-loader.gif" alt="Loading" />'+
'</div>'
);
$.ajax({
url: '<?php echo WIDGETS_URL; ?>actions-log.php',
data: { action:action, ajax_call:true },
success: function(response){
target.html(response);
},
cache:false
});
}
// Generate the action log
$('.log_action').click(function(e) {
e.preventDefault();
if ($(this).hasClass('btn-inverse')) {
return false;
}
else {
var action = $(this).data('action');
$('.log_action').removeClass('btn-inverse');
$(this).addClass('btn-inverse');
ajax_widget_log(action);
}
});
ajax_widget_log();
});
</script>
<?php
include('footer.php');