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
68223263
Commit
68223263
authored
Jul 01, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cập nhật lưu tên bài hát khi chọn blacklist
parent
4efddab5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
CmsTrack.php
application/controllers/backend/CmsTrack.php
+2
-1
Crawler_listen_blacklist_model.php
application/models/Crawler_listen_blacklist_model.php
+2
-2
show_track_view.php
application/views/backend/cms_track/show_track_view.php
+7
-6
No files found.
application/controllers/backend/CmsTrack.php
View file @
68223263
...
...
@@ -554,10 +554,11 @@ class CmsTrack extends CI_Controller
public
function
updateBlacklistByAjax
()
{
$track_id
=
$this
->
input
->
post
(
'track_id'
);
$title
=
$this
->
input
->
post
(
'title'
);
$src
=
$this
->
input
->
post
(
'src'
);
$selected
=
$this
->
input
->
post
(
'selected'
);
//
$result
=
$this
->
crawler_listen_blacklist_model
->
checkAndUpdate
(
$track_id
,
$src
,
$selected
);
$result
=
$this
->
crawler_listen_blacklist_model
->
checkAndUpdate
(
$track_id
,
$
title
,
$
src
,
$selected
);
//
if
(
$result
)
{
echo
json_encode
([
...
...
application/models/Crawler_listen_blacklist_model.php
View file @
68223263
...
...
@@ -47,7 +47,7 @@ class Crawler_listen_blacklist_model extends CI_Model
return
$data
;
}
public
function
checkAndUpdate
(
$track_id
,
$src
,
$selected
)
public
function
checkAndUpdate
(
$track_id
,
$
title
,
$
src
,
$selected
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
...
...
@@ -66,7 +66,7 @@ class Crawler_listen_blacklist_model extends CI_Model
$this
->
db
->
insert
(
$this
->
_table
,
[
'track_id'
=>
$track_id
,
'src'
=>
strtolower
(
$src
),
'title'
=>
null
,
'title'
=>
$title
,
'created_at'
=>
date
(
'Y-m-d H:i:s'
),
'updated_at'
=>
date
(
'Y-m-d H:i:s'
)
]);
...
...
application/views/backend/cms_track/show_track_view.php
View file @
68223263
...
...
@@ -97,17 +97,17 @@
<div
class=
"profile-info-value"
>
<label>
<input
type=
"checkbox"
value=
"zing"
id=
"chk_zing"
onclick=
"updateBlacklistByAjax(
<?php
echo
$track
[
0
][
'id'
]
?>
, 'zing')"
onclick=
"updateBlacklistByAjax(
<?php
echo
$track
[
0
][
'id'
]
?>
, '
<?php
echo
str_replace
([
"'"
,
'"'
],
[
","
],
$track
[
0
][
'title'
]);
?>
', '
zing')"
<?php
echo
(
in_array
(
'zing'
,
$blacklist
)
?
'checked'
:
''
)
?>
>
Zing
</label><br>
<label>
<input
type=
"checkbox"
value=
"nct"
id=
"chk_nct"
onclick=
"updateBlacklistByAjax(
<?php
echo
$track
[
0
][
'id'
]
?>
, 'nct')"
onclick=
"updateBlacklistByAjax(
<?php
echo
$track
[
0
][
'id'
]
?>
, '
<?php
echo
str_replace
([
"'"
,
'"'
],
[
","
],
$track
[
0
][
'title'
]);
?>
', '
nct')"
<?php
echo
(
in_array
(
'nct'
,
$blacklist
)
?
'checked'
:
''
)
?>
>
NCT
</label><br>
<label>
<input
type=
"checkbox"
value=
"keeng"
id=
"chk_keeng"
onclick=
"updateBlacklistByAjax(
<?php
echo
$track
[
0
][
'id'
]
?>
, 'keeng')"
onclick=
"updateBlacklistByAjax(
<?php
echo
$track
[
0
][
'id'
]
?>
, '
<?php
echo
str_replace
([
"'"
,
'"'
],
[
","
],
$track
[
0
][
'title'
]);
?>
', '
keeng')"
<?php
echo
(
in_array
(
'keeng'
,
$blacklist
)
?
'checked'
:
''
)
?>
>
Keeng
</label>
</div>
...
...
@@ -129,7 +129,7 @@
<p>
Không tìm thấy thông tin Bài hát!
</p>
<?php
endif
;
?>
<script>
function
updateBlacklistByAjax
(
track_id
,
src
)
{
function
updateBlacklistByAjax
(
track_id
,
title
,
src
)
{
var
selected
=
0
;
if
(
$
(
'#chk_'
+
src
).
is
(
":checked"
))
{
...
...
@@ -138,15 +138,16 @@
selected
=
0
;
}
callAjax
(
track_id
,
src
,
selected
);
callAjax
(
track_id
,
title
,
src
,
selected
);
}
function
callAjax
(
track_id
,
src
,
selected
)
{
function
callAjax
(
track_id
,
title
,
src
,
selected
)
{
var
csrf_value
=
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
;
var
url
=
'
<?php
echo
base_url
(
"backend/cmsTrack/updateBlacklistByAjax"
);
?>
'
;
var
dataReq
=
{
csrf_name
:
csrf_value
,
track_id
:
track_id
,
title
:
title
,
src
:
src
,
selected
:
selected
};
...
...
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