Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vmusicchart-cms
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Văn Đoan
vmusicchart-cms
Commits
f6124c8d
Commit
f6124c8d
authored
Apr 13, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixbug quản lý log: bỏ action và fix lọc + tìm kiếm
parent
033d243d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
31 deletions
+24
-31
CmsSetting.php
application/controllers/backend/CmsSetting.php
+4
-2
CmsTrack.php
application/controllers/backend/CmsTrack.php
+6
-6
Actionlog_model.php
application/models/Actionlog_model.php
+12
-12
log_action_view.php
...cation/views/backend/ajax/cms_setting/log_action_view.php
+0
-9
log_action_view.php
...ion/views/backend/cms_setting/log_cms/log_action_view.php
+2
-2
No files found.
application/controllers/backend/CmsSetting.php
View file @
f6124c8d
...
@@ -1280,6 +1280,7 @@ class CmsSetting extends CI_Controller
...
@@ -1280,6 +1280,7 @@ class CmsSetting extends CI_Controller
//
//
$data
=
array
();
$data
=
array
();
$filterByAccount
=
$this
->
input
->
post
(
'filterByAccount'
);
$filterByAccount
=
$this
->
input
->
post
(
'filterByAccount'
);
$filterByActionType
=
$this
->
input
->
post
(
'filterByActionType'
);
$pageId
=
$this
->
input
->
post
(
'pageId'
);
$pageId
=
$this
->
input
->
post
(
'pageId'
);
//
//
$pageId
=
(
$pageId
==
0
)
?
1
:
$pageId
;
$pageId
=
(
$pageId
==
0
)
?
1
:
$pageId
;
...
@@ -1287,9 +1288,10 @@ class CmsSetting extends CI_Controller
...
@@ -1287,9 +1288,10 @@ class CmsSetting extends CI_Controller
$limit
=
20
;
$limit
=
20
;
$offset
=
(
$pageId
-
1
)
*
$limit
;
$offset
=
(
$pageId
-
1
)
*
$limit
;
$data
[
'offset'
]
=
(
$pageId
-
1
)
*
$limit
;
$data
[
'offset'
]
=
(
$pageId
-
1
)
*
$limit
;
$totalRecord
=
$this
->
actionlog_model
->
countAll
(
$filterByAccount
);
$totalRecord
=
$this
->
actionlog_model
->
countAll
(
null
,
null
,
null
,
$filterByAccount
,
$filterByActionType
);
$data
[
'pagination'
]
=
MyHelper
::
genPaginationLink
(
$totalRecord
,
$limit
,
$pageId
);
$data
[
'pagination'
]
=
MyHelper
::
genPaginationLink
(
$totalRecord
,
$limit
,
$pageId
);
$data
[
'listData'
]
=
$this
->
actionlog_model
->
getPagination
(
$limit
,
$offset
,
$filterByAccount
);
//getPagination($record, $start, $dtFrom=NULL, $dtTo=NULL, $filterByIP=NULL, $filterByAccount=NULL, $filterByActionType=NULL)
$data
[
'listData'
]
=
$this
->
actionlog_model
->
getPagination
(
$limit
,
$offset
,
null
,
null
,
null
,
$filterByAccount
,
$filterByActionType
);
//
//
$this
->
load
->
view
(
'backend/ajax/cms_setting/log_action_view'
,
$data
);
$this
->
load
->
view
(
'backend/ajax/cms_setting/log_action_view'
,
$data
);
}
}
...
...
application/controllers/backend/CmsTrack.php
View file @
f6124c8d
...
@@ -136,7 +136,7 @@ class CmsTrack extends CI_Controller
...
@@ -136,7 +136,7 @@ class CmsTrack extends CI_Controller
$this
->
track_model
->
update_track_user
(
$track_id
,
$id_singer
,
$id_user
,
$active_singer
);
$this
->
track_model
->
update_track_user
(
$track_id
,
$id_singer
,
$id_user
,
$active_singer
);
// Ghi log
// Ghi log
$this
->
actionlog_model
->
add
(
'UPDATED'
,
'Cập nhật bài hát.'
,
'Actionlog_model'
,
'
action_log
'
,
$track_id
);
$this
->
actionlog_model
->
add
(
'UPDATED'
,
'Cập nhật bài hát.'
,
'Actionlog_model'
,
'
tracks
'
,
$track_id
);
$this
->
session
->
set_flashdata
(
'success'
,
'Cập nhật bài hát thành công'
);
$this
->
session
->
set_flashdata
(
'success'
,
'Cập nhật bài hát thành công'
);
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
...
@@ -243,7 +243,7 @@ class CmsTrack extends CI_Controller
...
@@ -243,7 +243,7 @@ class CmsTrack extends CI_Controller
$this
->
track_model
->
add_artist
(
$artist
,
$insert_id
);
$this
->
track_model
->
add_artist
(
$artist
,
$insert_id
);
}
}
// Ghi log
// Ghi log
// $this->mactionlog->add('UPDATED', 'Cập nhật Cuộc đua thành công!', 'Mactionlog', '
action_log
', $contest_id);
// $this->mactionlog->add('UPDATED', 'Cập nhật Cuộc đua thành công!', 'Mactionlog', '
tracks
', $contest_id);
//
//
$this
->
session
->
set_flashdata
(
'success'
,
'Tạo Bài hát thành công'
);
$this
->
session
->
set_flashdata
(
'success'
,
'Tạo Bài hát thành công'
);
}
else
{
}
else
{
...
@@ -251,7 +251,7 @@ class CmsTrack extends CI_Controller
...
@@ -251,7 +251,7 @@ class CmsTrack extends CI_Controller
}
}
// Ghi log
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm mới bài hát.'
,
'Actionlog_model'
,
'
action_log
'
,
null
);
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm mới bài hát.'
,
'Actionlog_model'
,
'
tracks
'
,
null
);
redirect
(
base_url
(
'backend/cmsTrack/listTrack'
));
redirect
(
base_url
(
'backend/cmsTrack/listTrack'
));
}
}
...
@@ -293,7 +293,7 @@ class CmsTrack extends CI_Controller
...
@@ -293,7 +293,7 @@ class CmsTrack extends CI_Controller
$this
->
session
->
set_flashdata
(
'success'
,
'Thêm ca sĩ vào bài hát thành công'
);
$this
->
session
->
set_flashdata
(
'success'
,
'Thêm ca sĩ vào bài hát thành công'
);
// Ghi log
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm mới Ca sĩ cho bài hát.'
,
'Actionlog_model'
,
'
action_log
'
,
$track_id
);
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm mới Ca sĩ cho bài hát.'
,
'Actionlog_model'
,
'
tracks
'
,
$track_id
);
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
}
}
...
@@ -313,7 +313,7 @@ class CmsTrack extends CI_Controller
...
@@ -313,7 +313,7 @@ class CmsTrack extends CI_Controller
$this
->
track_model
->
removeSinger
(
$track_id
,
$singer_id
);
$this
->
track_model
->
removeSinger
(
$track_id
,
$singer_id
);
// Ghi log
// Ghi log
$this
->
actionlog_model
->
add
(
'DELETED'
,
'Xóa Ca sĩ khỏi bài hát.'
,
'Actionlog_model'
,
'
action_log
'
,
$track_id
);
$this
->
actionlog_model
->
add
(
'DELETED'
,
'Xóa Ca sĩ khỏi bài hát.'
,
'Actionlog_model'
,
'
tracks
'
,
$track_id
);
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
}
}
...
@@ -354,7 +354,7 @@ class CmsTrack extends CI_Controller
...
@@ -354,7 +354,7 @@ class CmsTrack extends CI_Controller
$this
->
session
->
set_flashdata
(
'success'
,
'Thêm Nhạc sĩ vào bài hát thành công'
);
$this
->
session
->
set_flashdata
(
'success'
,
'Thêm Nhạc sĩ vào bài hát thành công'
);
// Ghi log
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm Nhạc sĩ cho bài hát.'
,
'Actionlog_model'
,
'
action_log
'
,
$track_id
);
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm Nhạc sĩ cho bài hát.'
,
'Actionlog_model'
,
'
tracks
'
,
$track_id
);
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
}
}
...
...
application/models/Actionlog_model.php
View file @
f6124c8d
...
@@ -50,15 +50,15 @@ class Actionlog_model extends CI_Model {
...
@@ -50,15 +50,15 @@ class Actionlog_model extends CI_Model {
return
$query
->
result_array
();
return
$query
->
result_array
();
}
}
public
function
countAll
(
$dtFrom
=
NULL
,
$dtTo
=
NULL
,
$filterByIP
=
NULL
,
$filterByAccount
=
NULL
,
$filterByActionType
=
NULL
){
public
function
countAll
(
$dtFrom
=
null
,
$dtTo
=
null
,
$filterByIP
=
null
,
$filterByAccount
=
null
,
$filterByActionType
=
null
){
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
from
(
$this
->
_table
);
if
(
$dtFrom
!=
NULL
){
$this
->
db
->
where
(
'DATE(created_at) >='
,
$dtFrom
);}
if
(
$dtFrom
!=
null
){
$this
->
db
->
where
(
'DATE(created_at) >='
,
$dtFrom
);}
if
(
$dtTo
!=
NULL
){
$this
->
db
->
where
(
'DATE(created_at) <='
,
$dtTo
);}
if
(
$dtTo
!=
null
){
$this
->
db
->
where
(
'DATE(created_at) <='
,
$dtTo
);}
if
(
$filterByIP
!=
NULL
){
$this
->
db
->
like
(
'ip_address'
,
$filterByIP
);}
if
(
$filterByIP
!=
null
){
$this
->
db
->
like
(
'ip_address'
,
$filterByIP
);}
if
(
$filterByAccount
!=
NULL
){
$this
->
db
->
like
(
'actor_name'
,
$filterByAccount
);}
if
(
$filterByAccount
!=
null
){
$this
->
db
->
like
(
'actor_name'
,
$filterByAccount
);}
if
(
$filterByActionType
!=
NULL
){
$this
->
db
->
where
(
'UPPER(action)'
,
$filterByActionType
);}
if
(
$filterByActionType
!=
null
){
$this
->
db
->
where
(
'UPPER(action)'
,
$filterByActionType
);}
$query
=
$this
->
db
->
get
();
$query
=
$this
->
db
->
get
();
$result
=
$query
->
result_array
();
$result
=
$query
->
result_array
();
...
@@ -69,15 +69,15 @@ class Actionlog_model extends CI_Model {
...
@@ -69,15 +69,15 @@ class Actionlog_model extends CI_Model {
}
}
}
}
public
function
getPagination
(
$record
,
$start
,
$dtFrom
=
NULL
,
$dtTo
=
NULL
,
$filterByIP
=
NULL
,
$filterByAccount
=
NULL
,
$filterByActionType
=
NULL
){
public
function
getPagination
(
$record
,
$start
,
$dtFrom
=
null
,
$dtTo
=
null
,
$filterByIP
=
null
,
$filterByAccount
=
null
,
$filterByActionType
=
null
){
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
from
(
$this
->
_table
);
if
(
$dtFrom
!=
NULL
){
$this
->
db
->
where
(
'DATE(created_at) >='
,
$dtFrom
);}
if
(
$dtFrom
!=
null
){
$this
->
db
->
where
(
'DATE(created_at) >='
,
$dtFrom
);}
if
(
$dtTo
!=
NULL
){
$this
->
db
->
where
(
'DATE(created_at) <='
,
$dtTo
);}
if
(
$dtTo
!=
null
){
$this
->
db
->
where
(
'DATE(created_at) <='
,
$dtTo
);}
if
(
$filterByIP
!=
NULL
){
$this
->
db
->
like
(
'ip_address'
,
$filterByIP
);}
if
(
$filterByIP
!=
null
){
$this
->
db
->
like
(
'ip_address'
,
$filterByIP
);}
if
(
$filterByAccount
!=
NULL
){
$this
->
db
->
like
(
'actor_name'
,
$filterByAccount
);}
if
(
$filterByAccount
!=
null
){
$this
->
db
->
like
(
'actor_name'
,
$filterByAccount
);}
if
(
$filterByActionType
!=
NULL
){
$this
->
db
->
where
(
'UPPER(action)'
,
$filterByActionType
);}
if
(
$filterByActionType
!=
null
){
$this
->
db
->
where
(
'UPPER(action)'
,
$filterByActionType
);}
$this
->
db
->
order_by
(
$this
->
_table
.
'.id'
,
'desc'
);
$this
->
db
->
order_by
(
$this
->
_table
.
'.id'
,
'desc'
);
$this
->
db
->
limit
(
$record
,
$start
);
$this
->
db
->
limit
(
$record
,
$start
);
...
...
application/views/backend/ajax/cms_setting/log_action_view.php
View file @
f6124c8d
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
<th
style=
"text-align: center"
>
ID bản ghi
</th>
<th
style=
"text-align: center"
>
ID bản ghi
</th>
<th
style=
"text-align: center"
>
IP
</th>
<th
style=
"text-align: center"
>
IP
</th>
<th
style=
"text-align: center"
>
Ngày tạo
</th>
<th
style=
"text-align: center"
>
Ngày tạo
</th>
<th
style=
"text-align: center"
>
Xử lý
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
...
@@ -32,14 +31,6 @@
...
@@ -32,14 +31,6 @@
<td
style=
"text-align: center"
>
<td
style=
"text-align: center"
>
<?php
echo
MyHelper
::
reFormatDate
(
$data
[
'created_at'
]);
?>
<?php
echo
MyHelper
::
reFormatDate
(
$data
[
'created_at'
]);
?>
</td>
</td>
<td
style=
"text-align: center"
>
<?php
if
((
time
()
-
strtotime
(
$data
[
'created_at'
]))
>
15
*
24
*
3600
)
:
?>
<a
href=
"
<?php
echo
base_url
()
.
'dcvsetting/deleteLogAction/'
.
$data
[
'id'
];
?>
"
onclick=
"return confirm('Bạn có chắc chắn muốn xóa không?')"
title=
"Xóa"
>
<i
class=
"ace-icon red fa fa-trash-o bigger-130"
></i>
</a>
<?php
else
:
echo
'Xóa sau '
.
(
15
-
(
gmdate
(
'd'
,
time
()
-
strtotime
(
$data
[
'created_at'
]))))
.
' ngày'
;
endif
;
?>
</td>
</tr>
</tr>
<?php
<?php
endforeach
;
endforeach
;
...
...
application/views/backend/cms_setting/log_cms/log_action_view.php
View file @
f6124c8d
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
clearTimeout
(
oldTimeout
);
clearTimeout
(
oldTimeout
);
oldTimeout
=
setTimeout
(
function
(){
oldTimeout
=
setTimeout
(
function
(){
loadDataByAjaxFromInput
(
url
);
loadDataByAjaxFromInput
(
url
);
},
100
0
);
},
25
0
);
});
});
// Tìm kiếm theo cú pháp
// Tìm kiếm theo cú pháp
var
oldTimeout2
=
''
;
var
oldTimeout2
=
''
;
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
clearTimeout
(
oldTimeout2
);
clearTimeout
(
oldTimeout2
);
oldTimeout2
=
setTimeout
(
function
(){
oldTimeout2
=
setTimeout
(
function
(){
loadDataByAjaxFromInput
(
url
);
loadDataByAjaxFromInput
(
url
);
},
100
0
);
},
25
0
);
});
});
// Tìm kiếm theo kênh
// Tìm kiếm theo kênh
loadDataByAjaxFromSelectBox
(
"select-action-type"
,
url
);
loadDataByAjaxFromSelectBox
(
"select-action-type"
,
url
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment