YaWK  24.1
Yet another WebKit
dashboard.php
Go to the documentation of this file.
1 <?php
2 
4 use YAWK\db;
5 use YAWK\language;
6 use YAWK\page;
7 use YAWK\settings;
8 use YAWK\stats;
9 use YAWK\tipOfDay;
10 use YAWK\user;
11 
12 if (!isset($lang))
13 { // create language object
14  $lang = new language();
15 }
16 
17 echo "<!-- Optionally, you can add Slimscroll and FastClick plugins.
18 Both of these plugins are recommended to enhance the
19  user experience. Slimscroll is required when using the
20  fixed layout. -->";
21  echo "
22  <!-- Ionicons -->
23  <link rel=\"stylesheet\" href=\"https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css\">
24  <!-- SlimScroll 1.3.0 -->
25  <script src=\"../system/engines/AdminLTE/plugins/slimScroll/jquery.slimscroll.min.js\"></script>
26  <!-- ChartJS 1.0.1 -->
27  <script src=\"../system/engines/AdminLTE/plugins/chartjs/Chart.min.js\"></script>";
28 
29 // check if stats object is here...
30 if (!isset($stats) || (empty($stats)))
31 {
32  /* @var $db db */
33  // include stats class
34  @require_once '../system/classes/stats.php';
35  // and create new stats object
36  $stats = new stats();
37  $defaultInterval = 10;
38  $defaultPeriod = "MINUTE";
39  $data = $stats->getStatsArray($db, $defaultInterval, $defaultPeriod);
40  $limit = $stats->i_hits;
41 }
42 else
43  {
44  $data = '';
45  }
46 
47 // check if tip of day is enabled
48 if (settings::getSetting($db, "backendTipOfDay") == true)
49 { // include tip of day class
50  @require_once '../system/classes/tipOfDay.php';
51  // create new tip of day object
52  $tipOfDay = new tipOfDay();
53  $tipOfDay->drawTip($db, $lang);
54 }
55 ?>
56 
57 <!-- Info boxes -->
58 <div class="row">
59  <div class="col-md-3 col-sm-6 col-xs-12">
60  <div class="info-box">
61  <!-- facebook icon <span class="info-box-icon bg-blue"><i class="fa fa-facebook-official"></i></span> -->
62  <span class="info-box-icon bg-blue"><i class="fa fa-line-chart"></i></span>
63 
64  <div class="info-box-content">
65  <span class="info-box-text"><?php echo "$lang[IN_LAST24H]"; ?></span>
66  <span class="info-box-number"><?php echo number_format($stats->i_hits, 0, '.', '.'); ?> <small> <?php echo $lang['HITS']; ?></small></span>
67  </div>
68  <!-- /.info-box-content -->
69  </div>
70  <!-- /.info-box -->
71  </div>
72  <!-- /.col -->
73  <div class="col-md-3 col-sm-6 col-xs-12">
74  <div class="info-box">
75  <!-- twitter icon <span class="info-box-icon bg-aqua"><i class="ion-social-twitter-outline"></i></span> -->
76  <span class="info-box-icon bg-aqua"><i class="fa fa-mobile-phone"></i></span>
77 
78  <div class="info-box-content">
79  <span class="info-box-text"><?php echo $lang['DEVICES']; ?></span>
80  <span class="info-box-number"><?php $stats->countDeviceTypes($db, $data); echo round($stats->i_desktopPercent, 1); ?>% <small> Desktop</small></span>
81  <span class="info-box-number"><?php echo round($stats->i_phonePercent, 1); ?>% <small> Phone</small> / <?php echo round($stats->i_tabletPercent, 1); ?>% <small> Tablet</small></span>
82  </div>
83  <!-- /.info-box-content -->
84  </div>
85  <!-- /.info-box -->
86  </div>
87  <!-- /.col -->
88 
89  <!-- fix for small devices only -->
90  <div class="clearfix visible-sm-block"></div>
91 
92  <div class="col-md-3 col-sm-6 col-xs-12">
93  <div class="info-box">
94  <span class="info-box-icon bg-green"><i class="ion-ios-paper-outline"></i></span>
95 
96  <div class="info-box-content">
97  <span class="info-box-text"><?php echo $lang['PAGES']; ?></span>
98  <span class="info-box-number"><?php echo page::countPages($db); ?></span>
99  </div>
100  <!-- /.info-box-content -->
101  </div>
102  <!-- /.info-box -->
103  </div>
104  <!-- /.col -->
105  <div class="col-md-3 col-sm-6 col-xs-12">
106  <div class="info-box">
107  <span class="info-box-icon bg-yellow"><i class="ion ion-ios-people-outline"></i></span>
108 
109  <div class="info-box-content">
110  <span class="info-box-text"><?php echo $lang['USERS']; ?></span>
111  <span class="info-box-number"><?php echo user::countUsers($db); ?></span>
112  </div>
113  <!-- /.info-box-content -->
114  </div>
115  <!-- /.info-box -->
116  </div>
117  <!-- /.col -->
118 </div>
119 <!-- /.row -->
120 
121 
122 
123 <!-- Main row -->
124 <div class="row">
125  <!-- Left col -->
126  <div class="col-md-8">
127  <div class="row">
128  <div class="col-md-12">
129  <!-- DIRECT CHAT -->
130  </div>
131  <!-- /.col -->
132  </div>
133  <!-- /.row -->
134  </div>
135  <!-- /.col -->
136 
137  <div class="col-md-4">
138  <!-- weekday stats -->
139  <?php $stats->drawWeekdayBox($db, $data, $lang, 0); ?>
140  <!-- latest users -->
141  <?php dashboard::drawLatestUsers($db, 8, $lang); ?>
142  <!-- daytime stats -->
143  <?php $stats->drawDaytimeBox($db, $data, $lang); ?>
144  <!-- latest pages stats-->
145  <?php dashboard::drawLatestPagesBox($db, 5, $lang); ?>
146  </div>
147  <!-- /.col -->
148 </div>
149 <!-- /.row -->
print $lang['FILEMAN_UPLOAD']
$data
Definition: stats.php:78
$blog icon
Dashboard class serves a few useful functions for the admin backend.
Definition: dashboard.php:20
Mysqli database class; returns db connection object.
Definition: db.php:16
The language class - support multilingual backend.
Definition: language.php:17
The default pages class. Provide all functions to handle static pages.
Definition: page.php:20
Settings class: get and set YaWK system settings.
Definition: settings.php:9
Statistics - get and set user and page stats.
Definition: stats.php:10
TipOfDay class serve functions to get and draw a tip of the day.
Definition: tipOfDay.php:21
The default user class. Provide all functions to handle the user object.
Definition: user.php:17
function i(e, t)
Definition: plyr.js:1