YaWK  24.1
Yet another WebKit
yawk-stats.php
Go to the documentation of this file.
1 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
2 <?php
3 
4 use YAWK\backend;
5 use YAWK\db;
6 use YAWK\language;
7 use YAWK\settings;
8 use YAWK\sys;
9 
10 /** @var $db db */
11 /** @var $lang language */
12 
13 // TEMPLATE WRAPPER - HEADER & breadcrumbs
14 echo "
15  <!-- Content Wrapper. Contains page content -->
16  <div class=\"content-wrapper\" id=\"content-FX\">
17  <!-- Content Header (Page header) -->
18  <section class=\"content-header\">";
19 /* draw Title on top */
20 echo backend::getTitle("YaWK", $lang['SYSTEM'].$lang['INFO']);
21 echo"<ol class=\"breadcrumb\">
22  <li><a href=\"index.php\" title=\"Dashboard\"><i class=\"fa fa-dashboard\"></i> Dashboard</a></li>
23  <li class=\"active\"><a href=\"index.php?page=yawk-stats\" title=\"Pages\"> Statistics</a></li>
24  </ol>
25  </section>
26  <!-- Main content -->
27  <section class=\"content\">";
28 /* page content start here */
29 ?>
30 
31 <div class="row">
32 <div class="col-md-8">
33  <div class="box">
34  <div class="box-header"><h3 class="box-title">Month</h3></div>
35  <div class="box-body">
36 
37  <h4>Server Variablen</h4>
38  <pre>
39  <?php print_r($_SERVER); ?>
40  </pre>
41  <br><br>
42 
43  <h4>Session Variablen</h4>
44  <pre>
45  <?php print_r($_SESSION); ?>
46  </pre>
47  <br><br>
48 
49  <h4>Gesetzte Cookies</h4>
50  <pre>
51  <?php print_r($_COOKIE); ?>
52  </pre>
53  <br><br>
54 
55  <!-- <canvas id="myChart"></canvas> -->
56  </div>
57  </div>
58 </div>
59 <div class="col-md-4">
60  <div class="box">
61  <div class="box-header"><h3 class="box-title">Month</h3></div>
62  <div class="box-body">
63  <?php
64  /*
65  if (sys::isBrowscapSet($_SERVER['HTTP_USER_AGENT']) === false)
66  {
67  echo "Your Browser: <b>". sys::getBrowserName($_SERVER['HTTP_USER_AGENT'])."</b>";
68  }
69  */
70  $useragent = sys::getBrowser('');
71  echo "<h4>Browser Statistik </h4>Your browser: "."<b>". $useragent['name'] . " " . $useragent['version'] . " on " .$useragent['platform'] ."</b><br><br>";
72 
73  echo "<h4>User Statistik</h4>";
74  echo "Current: ".$_SERVER['REQUEST_URI']."<br>";
75  echo "accept language: ".$_SERVER['HTTP_ACCEPT_LANGUAGE']."<br><br>";
76 
77  echo "<h4>Quellcode Statistik</h4>";
78  echo "YaWK Version: ". settings::getSetting($db, "yawkversion");
79  echo " <small>";echo settings::getSettingDescription($db, "yawkversion");echo"</small>";
80 
81  // SET VARS
82  $FILE_PATH = "../"; // full path
83  $data = sys::countCodeLines($FILE_PATH, '.php');
84 
85  echo"<br>YaWK ($FILE_PATH) umfasst insgesamt <b>$data[files]</b> $data[type] files mit exakt <b>$data[lines]</b> Zeilen $data[type] Code</p><br>";
86 
87  echo "<h4>Server Statistik</h4>";
88  if (sys::checkZlib() === true)
89  { // output
90  echo "<p>...zlib found!</p>";
91  }
92  else
93  { // output
94  echo "<p class=\"text-danger\">...zlib not found!</p>";
95  }
96 
97 
98  $FILE_PATH = "../"; // full path
99  $phpFiles = sys::countCodeLines($FILE_PATH, '.php');
100  $cssFiles = sys::countCodeLines($FILE_PATH, '.css');
101  $jsFiles = sys::countCodeLines($FILE_PATH, '.js');
102  $total = $phpFiles['lines'] + $cssFiles['lines'] + $jsFiles['lines'];
103 
104  echo "<h3>Project Summary</h3>";
105  echo "<h4>PHP Files: </h4>";
106  foreach ($phpFiles as $key => $value){
107  if ($value !== '.php')
108  echo $key." : ".$value."<br>";
109  }
110  echo "<h4>CSS Files: </h4>";
111  foreach ($cssFiles as $key => $value){
112  if ($value !== '.css')
113  echo $key." : ".$value."<br>";
114  }
115  echo "<h4>JS Files: </h4>";
116  foreach ($jsFiles as $key => $value){
117  if ($value !== '.js')
118  echo $key." : ".$value."<br>";
119  }
120  echo "Insgesamt z&auml;hlt das Projekt: <b>$total</b> Zeilen Quellcode.";
121 
122  ?>
123  </div>
124  </div>
125 </div>
126 </div>
127 
128 
129 
130 <script>
131  var ctx = document.getElementById('myChart').getContext('2d');
132  var chart = new Chart(ctx, {
133  // The type of chart we want to create
134  type: 'bar',
135 
136  // The data for our dataset
137  data: {
138  labels: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15",
139  "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"],
140  datasets: [{
141  label: "Hits this day",
142  borderColor: 'rgb(51, 122, 183)',
143  backgroundColor: 'rgb(51, 122, 183)',
144  data: [11, 10, 5, 2, 20, 30, 45, 16, 54, 34, 46, 67, 55, 46, 46, 47, 26, 11, 10, 5, 2, 20, 30,
145  45, 16, 64, 58, 46, 67, 55, 46]
146  }]
147  },
148 
149  // Configuration options go here
150  options: {}
151  });
152 </script>
print $lang['FILEMAN_UPLOAD']
$data
Definition: stats.php:78
Backend class serves a few useful functions for the admin backend.
Definition: backend.php:27
Mysqli database class; returns db connection object.
Definition: db.php:16
The language class - support multilingual backend.
Definition: language.php:17
Settings class: get and set YaWK system settings.
Definition: settings.php:9
The sys class - handles yawk's system core functions.
Definition: sys.php:17
type
Definition: menu-new.php:35
$value
$FILE_PATH
Definition: yawk-stats.php:98
$total
Definition: yawk-stats.php:102
$jsFiles
Definition: yawk-stats.php:101
$cssFiles
Definition: yawk-stats.php:100
$phpFiles
Definition: yawk-stats.php:99
$useragent
Definition: yawk-stats.php:70