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
c7a56b40
Commit
c7a56b40
authored
Apr 13, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cập nhật chức năng list những bài cần cập nhật thông tin nghệ sĩ
parent
e7081d9e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
226 additions
and
7 deletions
+226
-7
CmsTrack.php
application/controllers/backend/CmsTrack.php
+15
-3
Home.php
application/controllers/backend/Home.php
+12
-1
Track_model.php
application/models/Track_model.php
+74
-0
list_by_weekly_view.php
...on/views/backend/ajax/cms_ranking/list_by_weekly_view.php
+1
-1
add_composer_view.php
application/views/backend/cms_track/add_composer_view.php
+2
-1
add_singer_view.php
application/views/backend/cms_track/add_singer_view.php
+2
-1
home_view.php
application/views/backend/home_view.php
+120
-0
No files found.
application/controllers/backend/CmsTrack.php
View file @
c7a56b40
...
...
@@ -271,7 +271,7 @@ class CmsTrack extends CI_Controller
*
* @param $track_id
*/
public
function
addSinger
(
$track_id
)
public
function
addSinger
(
$track_id
,
$call_back
=
null
)
{
// Thêm đoạn check sự tồn tại của bài hát
...
...
@@ -289,8 +289,9 @@ class CmsTrack extends CI_Controller
$this
->
form_validation
->
set_message
(
'is_unique'
,
'<li class="list-unstyled">Đã tồn tại.</li>'
);
// Xử lý form
if
(
$this
->
form_validation
->
run
(
$this
)
==
false
)
{
$this
->
_data
[
'call_back'
]
=
$call_back
;
$this
->
_data
[
'singer'
]
=
$this
->
input
->
post
(
'singer'
);
$this
->
_data
[
'functionName'
]
=
'Thêm Người thể hiện vào bài hát'
;
$this
->
_data
[
'action'
]
=
'addSinger'
;
$this
->
_data
[
'titlePage'
]
=
'Thêm Người thể hiện vào bài hát'
;
...
...
@@ -304,6 +305,11 @@ class CmsTrack extends CI_Controller
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm mới Ca sĩ cho bài hát.'
,
'Actionlog_model'
,
'tracks'
,
$track_id
);
// Nếu thêm ca sĩ từ trang home thì quay trở về trang home
if
(
$call_back
==
'home'
)
{
redirect
(
base_url
(
'backend/home/index'
));
}
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
}
}
...
...
@@ -332,7 +338,7 @@ class CmsTrack extends CI_Controller
*
* @param $track_id
*/
public
function
addComposer
(
$track_id
)
public
function
addComposer
(
$track_id
,
$call_back
=
null
)
{
// Thêm đoạn check sự tồn tại của bài hát
...
...
@@ -350,6 +356,7 @@ class CmsTrack extends CI_Controller
$this
->
form_validation
->
set_message
(
'is_unique'
,
'<li class="list-unstyled">Đã tồn tại.</li>'
);
// Xử lý form
if
(
$this
->
form_validation
->
run
(
$this
)
==
false
)
{
$this
->
_data
[
'call_back'
]
=
$call_back
;
$this
->
_data
[
'composer'
]
=
$this
->
input
->
post
(
'composer'
);
$this
->
_data
[
'functionName'
]
=
'Thêm Người thể hiện vào bài hát'
;
...
...
@@ -365,6 +372,11 @@ class CmsTrack extends CI_Controller
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm Nhạc sĩ cho bài hát.'
,
'Actionlog_model'
,
'tracks'
,
$track_id
);
// Nếu thêm nhạc sĩ từ trang home thì quay trở về trang home
if
(
$call_back
==
'home'
)
{
redirect
(
base_url
(
'backend/home/index'
));
}
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
}
}
...
...
application/controllers/backend/Home.php
View file @
c7a56b40
...
...
@@ -13,11 +13,22 @@ class Home extends CI_Controller
{
parent
::
__construct
();
date_default_timezone_set
(
"Asia/Ho_Chi_Minh"
);
$this
->
load
->
model
(
'track_model'
);
}
public
function
index
()
{
//$this->output->cache(1*24*60);
$total_update_singer
=
$this
->
track_model
->
getTotalTrackUpdateSinger
();
$track_update_singer
=
$this
->
track_model
->
getTrackUpdateSinger
();
//
$total_update_composer
=
$this
->
track_model
->
getTotalTrackUpdateComposer
();
$track_update_composer
=
$this
->
track_model
->
getTrackUpdateComposer
();
//
$this
->
_data
[
'total_update_singer'
]
=
$total_update_singer
;
$this
->
_data
[
'total_update_composer'
]
=
$total_update_composer
;
//
$this
->
_data
[
'update_singer_list'
]
=
$track_update_singer
;
$this
->
_data
[
'update_composer_list'
]
=
$track_update_composer
;
//
$this
->
_data
[
'functionName'
]
=
'Trang chủ CMS'
;
$this
->
_data
[
'action'
]
=
'index'
;
...
...
application/models/Track_model.php
View file @
c7a56b40
...
...
@@ -431,6 +431,80 @@ class Track_model extends CI_Model
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
/**
* Hàm lấy ds bài hát chưa cập nhật thông tin ca sĩ
*
* @return mixed
*/
public
function
getTrackUpdateSinger
(
$limit
=
50
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
where
(
'singer_list is NULL'
,
null
,
false
);
$this
->
db
->
or_where
(
'singer_list'
,
''
);
$this
->
db
->
limit
(
$limit
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
/**
* Hàm lấy tổng bài hát cần cập nhật ca sĩ
*
* @return int
*/
public
function
getTotalTrackUpdateSinger
()
{
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
where
(
'singer_list is NULL'
,
null
,
false
);
$this
->
db
->
or_where
(
'singer_list'
,
''
);
$query
=
$this
->
db
->
get
();
$result
=
$query
->
result_array
();
if
(
$result
)
{
return
$result
[
0
][
'totalResults'
];
}
else
{
return
0
;
}
}
/**
* Hàm lấy ds bài hát chưa cập nhật thông tin nhạc sĩ
*
* @return mixed
*/
public
function
getTrackUpdateComposer
(
$limit
=
50
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
where
(
'composer_list is NULL'
,
null
,
false
);
$this
->
db
->
or_where
(
'composer_list'
,
''
);
$this
->
db
->
limit
(
$limit
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
/**
* Hàm lấy tổng bài hát cần cập nhật nhạc sĩ
*
* @return int
*/
public
function
getTotalTrackUpdateComposer
()
{
$this
->
db
->
select
(
'COUNT(*) AS totalResults'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
where
(
'composer_list is NULL'
,
null
,
false
);
$this
->
db
->
or_where
(
'composer_list'
,
''
);
$query
=
$this
->
db
->
get
();
$result
=
$query
->
result_array
();
if
(
$result
)
{
return
$result
[
0
][
'totalResults'
];
}
else
{
return
0
;
}
}
}
/* End of file welcome.php */
...
...
application/views/backend/ajax/cms_ranking/list_by_weekly_view.php
View file @
c7a56b40
<div>
<div
class=
"responsive"
>
<table
class=
"table table-striped table-bordered table-hover"
>
<thead>
<tr>
...
...
application/views/backend/cms_track/add_composer_view.php
View file @
c7a56b40
...
...
@@ -6,8 +6,9 @@
<div
class=
"widget-body"
>
<div
class=
"widget-main"
>
<?php
$url
=
(
isset
(
$call_back
)
&&
$call_back
)
?
'backend/cmsTrack/addComposer/'
.
$track
[
0
][
'id'
]
.
'/'
.
$call_back
:
'backend/cmsTrack/addComposer/'
.
$track
[
0
][
'id'
];
$attributes
=
array
(
'class'
=>
'form-horizontal'
,
'id'
=>
'myform'
);
echo
form_open_multipart
(
base_url
(
'backend/cmsTrack/addComposer/'
.
$track
[
0
][
'id'
]
),
$attributes
);
echo
form_open_multipart
(
base_url
(
$url
),
$attributes
);
?>
<div
class=
"form-group"
>
<label
class=
"col-lg-3"
></label>
...
...
application/views/backend/cms_track/add_singer_view.php
View file @
c7a56b40
...
...
@@ -6,8 +6,9 @@
<div
class=
"widget-body"
>
<div
class=
"widget-main"
>
<?php
$url
=
(
isset
(
$call_back
)
&&
$call_back
)
?
'backend/cmsTrack/addSinger/'
.
$track
[
0
][
'id'
]
.
'/'
.
$call_back
:
'backend/cmsTrack/addSinger/'
.
$track
[
0
][
'id'
];
$attributes
=
array
(
'class'
=>
'form-horizontal'
,
'id'
=>
'myform'
);
echo
form_open_multipart
(
base_url
(
'backend/cmsTrack/addSinger/'
.
$track
[
0
][
'id'
]
),
$attributes
);
echo
form_open_multipart
(
base_url
(
$url
),
$attributes
);
?>
<div
class=
"form-group"
>
<label
class=
"col-lg-3"
></label>
...
...
application/views/backend/home_view.php
View file @
c7a56b40
<!--<div class="row">
<div class="col-sm-12">
<div class="widget-box">
<div class="widget-header">
<h4 class="smaller">
Số bài hát <span style="color: red">cần cập nhật</span>
thông tin Ca sĩ: <span style="color: red"><strong>
<?php
/*echo $total_update_singer */
?>
</strong></span>
</h4>
<p>(Hiển thị tối đa 50 bài hát/1 trang)</p>
</div>
<div class="widget-body">
<div class="widget-main">
</div>
</div>
</div>
</div>
</div>-->
<div
class=
"row"
style=
"text-align: center"
>
<!-- Cập nhật thông tin ca sĩ -->
<div
class=
"col-sm-6"
>
<div
class=
"widget-box"
>
<div
class=
"widget-header"
>
<h4
class=
"smaller"
>
Số bài hát
<span
style=
"color: red"
>
cần cập nhật
</span>
thông tin Ca sĩ:
<span
style=
"color: red"
><strong>
<?php
echo
$total_update_singer
?>
</strong></span>
</h4>
<p>
(Hiển thị tối đa 50 bài hát/1 trang)
</p>
</div>
<div
class=
"widget-body"
>
<div
class=
"widget-main"
>
<?php
if
(
is_array
(
$update_singer_list
)
&&
count
(
$update_singer_list
)
>
0
)
:
?>
<div
class=
"responsive"
>
<table
class=
"table table-striped table-bordered table-hover"
>
<thead>
<tr>
<th
style=
"text-align: center"
>
TT
</th>
<th
style=
"text-align: center"
>
Ảnh
</th>
<th
style=
"text-align: center"
>
Tên bài hát
</th>
<th
style=
"text-align: center"
>
Cập nhật
</th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$update_singer_list
as
$key
=>
$track
)
:
?>
<tr>
<td
style=
"text-align: center"
>
<?php
echo
(
$key
+
1
);
?>
</td>
<td
style=
"text-align: center"
><img
style=
"max-width: 50px"
src=
"
<?php
echo
MyHelper
::
getArtByTrack
(
$track
[
'art'
]);
?>
"
></td>
<td
style=
"text-align: left"
title=
"
<?php
echo
$track
[
'title'
];
?>
"
>
<?php
echo
MyHelper
::
truncate
(
$track
[
'title'
]);
?>
<br>
<span
style=
"color: #adadad"
>
ID:
<?php
echo
$track
[
'id'
];
?>
</span>
</td>
<td
style=
"text-align: center"
>
<a
href=
"
<?php
echo
base_url
(
'backend/cmsTrack/addSinger/'
.
$track
[
'id'
]
.
'/home'
)
?>
"
title=
"Click để cập nhật ca sĩ"
>
<i
class=
"fa fa-microphone"
></i>
<i
class=
"fa fa-user"
></i>
</a>
</td>
</tr>
<?php
endforeach
;
?>
</tbody>
</table>
</div>
<?php
else
:
?>
<span>
Đã cập nhật đầy đủ.
</span>
<?php
endif
;
?>
</div>
</div>
</div>
</div>
<!-- Cập nhật thông tin nhạc sĩ -->
<div
class=
"col-sm-6"
>
<div
class=
"widget-box"
>
<div
class=
"widget-header"
>
<h4
class=
"smaller"
>
Số bài hát
<span
style=
"color: red"
>
cần cập nhật
</span>
thông tin Nhạc sĩ:
<span
style=
"color: red"
><strong>
<?php
echo
$total_update_composer
?>
</strong></span></h4>
<p>
(Hiển thị tối đa 50 bài hát/1 trang)
</p>
</div>
<div
class=
"widget-body"
>
<div
class=
"widget-main"
>
<div
class=
"widget-main"
>
<?php
if
(
is_array
(
$update_composer_list
)
&&
count
(
$update_composer_list
)
>
0
)
:
?>
<div
class=
"responsive"
>
<table
class=
"table table-striped table-bordered table-hover"
>
<thead>
<tr>
<th
style=
"text-align: center"
>
TT
</th>
<th
style=
"text-align: center"
>
Ảnh
</th>
<th
style=
"text-align: center"
>
Tên bài hát
</th>
<th
style=
"text-align: center"
>
Cập nhật
</th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$update_composer_list
as
$key
=>
$track
)
:
?>
<tr>
<td
style=
"text-align: center"
>
<?php
echo
(
$key
+
1
);
?>
</td>
<td
style=
"text-align: center"
><img
style=
"max-width: 50px"
src=
"
<?php
echo
MyHelper
::
getArtByTrack
(
$track
[
'art'
]);
?>
"
></td>
<td
style=
"text-align: left"
title=
"
<?php
echo
$track
[
'title'
];
?>
"
>
<?php
echo
MyHelper
::
truncate
(
$track
[
'title'
]);
?>
<br>
<span
style=
"color: #adadad"
>
ID:
<?php
echo
$track
[
'id'
];
?>
</span>
</td>
<td
style=
"text-align: center"
>
<a
href=
"
<?php
echo
base_url
(
'backend/cmsTrack/addComposer/'
.
$track
[
'id'
]
.
'/home'
)
?>
"
title=
"Click để cập nhật nhạc sĩ"
>
<i
class=
"fa fa-microphone"
></i>
<i
class=
"fa fa-user"
></i>
</a>
</td>
</tr>
<?php
endforeach
;
?>
</tbody>
</table>
</div>
<?php
else
:
?>
<span>
Đã cập nhật đầy đủ.
</span>
<?php
endif
;
?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.row -->
\ No newline at end of file
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