Commit d0c642e6 by Phạm Văn Đoan

thay đổi list bài hát

parent 892abd2a
......@@ -123,7 +123,7 @@ class Track_model extends CI_Model
}
}
public function cmsGetPagination($record, $start, $name = null)
public function cmsGetPaginationBk($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');
......
......@@ -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>
......
<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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment