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
d0c642e6
Commit
d0c642e6
authored
Mar 11, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thay đổi list bài hát
parent
892abd2a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
14 deletions
+69
-14
Track_model.php
application/models/Track_model.php
+18
-1
list_track_view.php
application/views/backend/ajax/cms_track/list_track_view.php
+5
-13
list_track_view.php.bk
...ation/views/backend/ajax/cms_track/list_track_view.php.bk
+46
-0
No files found.
application/models/Track_model.php
View file @
d0c642e6
...
...
@@ -123,7 +123,7 @@ class Track_model extends CI_Model
}
}
public
function
cmsGetPagination
(
$record
,
$start
,
$name
=
null
)
public
function
cmsGetPagination
Bk
(
$record
,
$start
,
$name
=
null
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*, u1.full_name AS singer_name, u2.full_name AS composer_name,
track_user.name AS singer_name2, track_user.id AS id_user,
...
...
@@ -148,6 +148,23 @@ class Track_model extends CI_Model
return
$query
->
result_array
();
}
public
function
cmsGetPagination
(
$record
,
$start
,
$name
=
null
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
if
(
$name
!=
null
)
{
$this
->
db
->
like
(
'tracks.title'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.description'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.slug'
,
$name
,
'both'
);
$this
->
db
->
or_like
(
'tracks.tag'
,
$name
,
'both'
);
}
$this
->
db
->
order_by
(
$this
->
_table
.
'.title'
,
'asc'
);
$this
->
db
->
limit
(
$record
,
$start
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
getListForSelectBox
()
{
$this
->
db
->
select
(
'id, fullname, username, sid'
);
...
...
application/views/backend/ajax/cms_track/list_track_view.php
View file @
d0c642e6
...
...
@@ -3,10 +3,9 @@
<thead>
<tr>
<th
style=
"text-align: center"
>
TT
</th>
<th
style=
"text-align: center"
>
Ảnh
</th>
<th
style=
"text-align: center"
>
#ID
</th>
<th
style=
"text-align: center"
>
Tên bài hát
</th>
<th
style=
"text-align: center"
>
Ca sĩ
</th>
<th
style=
"text-align: center"
>
Nhạc sĩ
</th>
<th
style=
"text-align: center"
>
Xử lý
</th>
</tr>
</thead>
...
...
@@ -14,20 +13,13 @@
<?php
if
(
count
(
$listData
)
>
0
)
:
foreach
(
$listData
as
$key
=>
$data
)
:
?>
<tr>
<td
style=
"text-align: center"
>
<?php
echo
(
$key
+
1
+
$offset
);
?>
</td>
<td
style=
"text-align: center"
>
<img
style=
"max-width: 50px"
src=
"
<?php
echo
MyHelper
::
getArtByTrack
(
$data
[
'art'
])
?>
"
>
</td>
<td
style=
"text-align: center"
>
#
<?php
echo
$data
[
'id'
];
?>
</td>
<td
style=
"text-align: left"
>
<?php
echo
$data
[
'title'
];
?>
</td>
<td
style=
"text-align: left"
>
<?php
echo
(
$data
[
'singer_name'
])
?
$data
[
'singer_name'
]
:
$data
[
'singer_name2'
];
?>
</td>
<td
style=
"text-align: left"
>
<?php
echo
(
$data
[
'composer_name'
])
?
$data
[
'composer_name'
]
:
$data
[
'composer_name2'
];
?>
</td>
<td
style=
"text-align: center"
>
<?php
if
(
!
$data
[
'id_user'
])
{
$data
[
'id_user'
]
=
0
;
}
if
(
!
$data
[
'id_artist'
])
{
$data
[
'id_artist'
]
=
0
;
}
?>
<a
href=
"
<?php
echo
base_url
()
.
'backend/cmsTrack/editTrack/'
.
$data
[
'id'
]
.
'/'
.
$data
[
'id_user'
]
.
'/'
.
$data
[
'id_artist'
];
?>
"
title=
"Xem chi tiết"
>
<a
href=
"
<?php
echo
base_url
()
.
'backend/cmsTrack/editTrack/'
.
$data
[
'id'
];
?>
"
title=
"Xem chi tiết"
>
<i
class=
"ace-icon fa fa-pencil bigger-130"
></i>
</a>
</td>
...
...
application/views/backend/ajax/cms_track/list_track_view.php.bk
0 → 100644
View file @
d0c642e6
<div style="max-height: 465px; overflow: scroll">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="text-align: center">TT</th>
<th style="text-align: center">#ID</th>
<th style="text-align: center">Tên bài hát</th>
<th style="text-align: center">Ca sĩ</th>
<th style="text-align: center">Nhạc sĩ</th>
<th style="text-align: center">Xử lý</th>
</tr>
</thead>
<tbody>
<?php if(count($listData) > 0): foreach($listData as $key => $data): ?>
<tr>
<td style="text-align: center"><?php echo ($key+1+$offset); ?></td>
<td style="text-align: center">#<?php echo $data['id']; ?></td>
<td style="text-align: left"><?php echo $data['title']; ?></td>
<td style="text-align: left"><?php echo ($data['singer_name']) ? $data['singer_name'] : $data['singer_name2']; ?></td>
<td style="text-align: left"><?php echo ($data['composer_name']) ? $data['composer_name'] : $data['composer_name2']; ?></td>
<td style="text-align: center">
<?php
if (!$data['id_user']) {
$data['id_user'] = 0;
}
if (!$data['id_artist']) {
$data['id_artist'] = 0;
}
?>
<a href="<?php echo base_url().'backend/cmsTrack/editTrack/'.$data['id'].'/'.$data['id_user'].'/'.$data['id_artist']; ?>" title="Xem chi tiết">
<i class="ace-icon fa fa-pencil bigger-130"></i>
</a>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="10" style="color: red; font-style: italic">Không có dữ liệu nào!</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<!-- /.row -->
<div style="text-align: center;"><?php echo $pagination; ?></div>
\ 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