-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdash.php
86 lines (65 loc) · 2.02 KB
/
dash.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
<?php
global $plog_level; $plog_level=1;
include 'core/Page.php';
if ( !Session::logged_in() ) Page::Redirect('login');
plog("New page!");
$p= new Page;
if ( !$p->ajax ) $p->HTML('header.html',array("###MENU###"=>Dropdown_menu($p)));
$p->title ="Your Website";
$p->CSS( "main.css" );
$p->Jquery();
$getpost=getpost();
$p->HTML('<BR>');
$p->HTML('groundrules.html');
///// Show recent activity
// Show edit activity
global $auth_database;
plog("Get mods!");
$m=new Modification($auth_database);
$mods=$m->Select(' Timestamp > '.strtotime('-1 days').' ORDER BY Timestamp DESC');
$m_auth=new Auth($auth_database);
if ( !false_or_null($mods) ) {
$data=array();
foreach ( $mods as $mod ) {
$user=$m_auth->Get($mod['r_Auth']);
$what='';
$w=json_decode($mod['What'],true);
foreach ( $w as $dataset ) {
foreach ( $dataset as $table=>$change ) {
$edit=strtolower($table).".edit";
if ( $edit == "catalogcategory.edit" ) $edit="category.edit";
else if ( $edit == "catalogexport.edit" ) $edit="export.inspect";
$what.=$table.' <a class="bare" href="'.$edit.'?ID='.$change['I'].'" title="Edit '.$table.' #'.$change['I'].'">#'.$change['I'].'</a>\'s '
.$change['F']. ( isset($change['E']) ? ' » '.$change['E'] : '' );
}
}
$data[]=array(
$user['username'],
$what,
$mod['Message'],
human_datetime(intval($mod['Timestamp'])),
);
}
$table=new TableHelper( array(
'table'=>"table wide",
'thead'=>"tablehead",
'th'=>"tablehead",
'td'=>"tablecell",
'headings'=>array(
'Who',
'What',
' ',
// 'Message',
'When'
),
'data'=>$data
)
);
$p->HTML('<h3>Edit activity since yesterday</h3>');
$p->HTML('<div class="formhighlight"><center>');
$p->Table($table);
$p->HTML('</center></div>');
}
$p->HTML('<div class="addbtn"><a href="edit.log" class="buttonlink bare"><span class="fi-magnifying-glass"></span> See edit log</a></div>');
if ( !$p->ajax ) $p->HTML('footer.html');
$p->Render();