Commit a0adad45 by Phạm Văn Đoan

hiển thị tên ca sĩ và tên nhạc sĩ

parent 0f7b956d
......@@ -15,6 +15,7 @@ class CmsTrack extends CI_Controller
date_default_timezone_set("Asia/Ho_Chi_Minh");
//
$this->load->model('mtrack');
$this->load->model('muser');
$this->load->model('mcontest_details');
$this->load->model('mactionlog');
}
......@@ -42,6 +43,8 @@ class CmsTrack extends CI_Controller
$offset = ($pageId - 1) * $limit;
$data['offset'] = ($pageId - 1) * $limit;
$totalRecord = $this->mtrack->cmsCountAll($fByName);
$data['listUser'] = $this->muser->getIdFullname();
//MyHelper::echoPreDie($data['listUser']);
$data['pagination'] = MyHelper::genPaginationLink($totalRecord, $limit, $pageId);
$data['listData'] = $this->mtrack->cmsGetPagination($limit, $offset, $fByName);
//
......
......@@ -2,7 +2,7 @@
class Muser extends CI_Model
{
protected $_table = 'user';
protected $_table = 'users';
public function __construct()
{
......@@ -188,6 +188,21 @@ class Muser extends CI_Model
return $query->result_array();
}
public function getIdFullname()
{
$this->db->select('id, full_name');
$this->db->from($this->_table);
$query = $this->db->get();
$data = $query->result_array();
$result = [];
if ($data) {
foreach ($data as $val) {
$result[$val['id']] = $val['full_name'];
}
}
return $result;
}
}
......
......@@ -68,13 +68,17 @@ class Mtrack extends CI_Model
public function cmsGetPagination($record, $start, $name = null)
{
$this->db->select($this->_table . '.*');
$this->db->select($this->_table . '.*, u1.full_name AS singer_name, u2.full_name AS composer_name');
$this->db->from($this->_table);
$this->db->join('track_user', 'track_user.track_id = tracks.id', 'left');
$this->db->join('track_artists', 'track_artists.track_id = tracks.id', 'left');
$this->db->join('users u1', 'u1.id = track_user.user_id', 'left');
$this->db->join('users u2', 'u2.id = track_artists.user_id', 'left');
if ($name != null) {
$this->db->like('title', $name, 'both');
$this->db->or_like('description', $name, 'both');
$this->db->or_like('slug', $name, 'both');
$this->db->or_like('tag', $name, 'both');
$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);
......
......@@ -63,7 +63,7 @@ $action = $CI->router->fetch_method();
<small>CMS for Administrator</small>
</a>
</div>
<?php //die('a:'.$CI->session->userdata('username')) ?>
<div class="navbar-buttons navbar-header pull-right" role="navigation">
<ul class="nav ace-nav">
<li class="light-blue">
......@@ -222,7 +222,7 @@ $action = $CI->router->fetch_method();
<?php endif; ?>
<!-- Quan ly he thong -->
<?php if($this->session->userdata('is_super') == 1): ?>
<?php if($CI->session->userdata('group_id') == 2 && $CI->session->userdata('is_super') == 1): ?>
<li class="<?php if($controller && $controller == 'cmsSetting') echo 'active open'?>">
<a href="#" class="dropdown-toggle">
<i class="menu-icon fa fa-cogs"></i>
......@@ -364,12 +364,6 @@ $action = $CI->router->fetch_method();
<!-- ace scripts -->
<script src="<?php echo base_url().'public/assets/js/ace-elements.min.js' ?>"></script>
<script src="<?php echo base_url().'public/assets/js/ace.min.js' ?>"></script>
<?php
//$CI->load->model('Msubrequest');
//$minDate = $CI->Msubrequest->getMinDateYMD();
//$minDate = $minDate[0]['createdateYMD'];
//$minDate = date('d/m/Y', strtotime($minDate));
?>
<script type="text/javascript">
$(document).ready(function(){
$('input[name=input-date-range-revenue-daily]').daterangepicker({
......
......@@ -16,10 +16,10 @@
<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: center"></td>
<td style="text-align: center"></td>
<td style="text-align: left"><?php echo $data['singer_name']; ?></td>
<td style="text-align: left"><?php echo $data['composer_name']; ?></td>
<td style="text-align: center">
<a href="<?php echo base_url().'backend/cmsContest/editContest/'.$data['id']; ?>" 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 class="row" style="text-align: center">
<!--<img src="<?php /*echo Myfunction::genSrcImageByBase64($path); */?>" class="img-responsive" width="80%" style="display:inline-table ">-->
<!--<img src="<?php /*echo base_url()*/?>images/airport_homepage.jpg" class="img-responsive" width="80%" style="display:inline-table ">-->
</div>
<!-- /.row -->
\ No newline at end of file
......@@ -56,7 +56,7 @@ $buttonLogin = array(
<div class="widget-body">
<div class="widget-main">
<h4 class="header blue lighter bigger" style="text-align: center">
<i class="ace-icon fa fa-music"></i>CMS
<i class="ace-icon fa fa-music"></i> CMS
</h4>
<div class="text-center">
<img src="<?php echo base_url('images/logo.png') ?>" style="height: 45px">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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