-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdmin.php
More file actions
116 lines (95 loc) · 3 KB
/
Admin.php
File metadata and controls
116 lines (95 loc) · 3 KB
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
<?php
/**
* Blog\Admin
* PHP version 7
*
* @category Controller
* @package Library
* @author Bill Rocha <prbr@ymail.com>
* @copyright 2016 Bill Rocha <http://google.com/+BillRocha>
* @license <https://opensource.org/licenses/MIT> MIT
* @version GIT: 0.0.1
* @link http://paulorocha.tk/devbr
*/
namespace Blog;
/**
* Admin Class
*
* @category Controller
* @package Library
* @author Bill Rocha <prbr@ymail.com>
* @license <https://opensource.org/licenses/MIT> MIT
* @link http://paulorocha.tk/devbr
*/
class Admin
{
public $scripts = [];
public $styles = [];
public $patchHtml = __DIR__.'/Html/';
public $header = false;
public $footer = false;
function __construct()
{
/*
* Your code here...
*
*/
}
function index()
{
//return $this->view();
$data['breadcumb'] = '<a href="'._URL.'">Home</a>';
$data['titulo'] = 'Relatórios';
$data['content'] = '<ul>
<li><a href="'._URL.'admin/1/1/10">Acesso diário agrupado pela URL de acesso</a></li>
<li><a href="'._URL.'admin/2/1/10">Artigos mais acessados</a></li>
<li><a href="'._URL.'admin/3/1/10">Acesso de Robots (agrupado por Agent)</a></li>
</ul>';
$this->sendPage('admin', $data);
}
function pagination($r, $param)
{
$par0 = isset($param[0]) ? $param[0] : null;
$par1 = isset($param[1]) ? $param[1] : null;
$par2 = isset($param[2]) ? $param[2] : null;
$par3 = isset($param[3]) ? $param[3] : null;
switch ($par0) {
case '1':
$this->report1($par1, $par2);
break;
case '2':
$this->report2($par1, $par2);
break;
case '3':
$this->report3($par1, $par2);
break;
default:
return $this->index();
break;
}
}
function report1($page = 1, $length = 10)
{
$model = new Model\Reports\Report1;
$data = $model->view($page, $length);
$data['baseUrl'] = 'http://dbrasil.tk/admin/1/';
$data['breadcumb'] = '<a href="'._URL.'admin">Relatórios</a><a href="'._URL.'">Home</a>';
$this->sendPage('admin', $data);
}
function report2($page = 1, $length = 10)
{
$model = new Model\Reports\Report2;
$data = $model->view($page, $length);
$data['baseUrl'] = 'http://dbrasil.tk/admin/2/';
$data['breadcumb'] = '<a href="'._URL.'admin">Relatórios</a><a href="'._URL.'">Home</a>';
$this->sendPage('admin', $data);
}
function report3($page = 1, $length = 10)
{
$model = new Model\Reports\Report3;
$data = $model->view($page, $length);
$data['baseUrl'] = 'http://dbrasil.tk/admin/3/';
$data['breadcumb'] = '<a href="'._URL.'admin">Relatórios</a><a href="'._URL.'">Home</a>';
$this->sendPage('admin', $data);
}
}