Commit 2a14e835 by Trần Văn Minh

Chi tiết bài hát

parent a3efce17
...@@ -130,7 +130,7 @@ class CmsTrack extends CI_Controller ...@@ -130,7 +130,7 @@ class CmsTrack extends CI_Controller
$this->track_model->update($track_id, $title, $db_art_path); $this->track_model->update($track_id, $title, $db_art_path);
$this->session->set_flashdata('success', 'Cập nhật bài hát thành công'); $this->session->set_flashdata('success', 'Cập nhật bài hát thành công');
redirect(base_url().'backend/cmsTrack/listTrack'); redirect(base_url().'backend/cmsTrack/showTrack/'.$track_id);
} }
} }
......
...@@ -67,15 +67,13 @@ class Track_model extends CI_Model ...@@ -67,15 +67,13 @@ class Track_model extends CI_Model
public function getById($id) public function getById($id)
{ {
$this->db->select($this->_table . '.*, track_user.name AS name_singer, $this->db->select($this->_table . '.*, track_user.name AS name_singer,
track_user.user_id AS id_singer, track_user.id AS id_singer,
track_artists.name AS artist, track_artists.name AS artist,
track_artists.id AS id_track_artist'); track_artists.id AS id_track_artist');
$this->db->from($this->_table); $this->db->from($this->_table);
$this->db->join('track_user', 'track_user.track_id = tracks.id', 'left'); $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('track_artists', 'track_artists.track_id = tracks.id', 'left');
$this->db->where($this->_table . '.id', $id); $this->db->where($this->_table . '.id', $id);
// $this->db->where('track_artists.id', $track_artist);
// $this->db->where('track_user.id', $track_user);/
$query = $this->db->get(); $query = $this->db->get();
return $query->result_array(); return $query->result_array();
} }
......
...@@ -40,16 +40,8 @@ $input_artist = array( ...@@ -40,16 +40,8 @@ $input_artist = array(
<div class="widget-main"> <div class="widget-main">
<?php <?php
$attributes = array('class' => 'form-horizontal', 'id' => 'myform'); $attributes = array('class' => 'form-horizontal', 'id' => 'myform');
if (!$track_user[0]['id']) { isset($track_user[0]['id'])? $user_singer = $track_user[0]['id']: $user_singer = 0;;
$user_singer = 0; isset($track_artists[0]['id']) ? $user_artist = $track_artists[0]['id']: $user_artist = 0;
} else {
$user_singer = $track_user[0]['id'];
}
if (!$track_artists) {
$user_artist = 0;
} else {
$user_artist = $track_artists[0]['id'];
}
echo form_open_multipart(base_url('backend/cmsTrack/editTrack/'.$contest[0]['id'].'/'.$user_singer.'/'.$user_artist), $attributes); echo form_open_multipart(base_url('backend/cmsTrack/editTrack/'.$contest[0]['id'].'/'.$user_singer.'/'.$user_artist), $attributes);
?> ?>
<div class="form-group"> <div class="form-group">
...@@ -124,7 +116,7 @@ $input_artist = array( ...@@ -124,7 +116,7 @@ $input_artist = array(
<div class="form-group"> <div class="form-group">
<div class="col-lg-3"> <div class="col-lg-3">
<a href="<?php echo base_url().'backend/cmsTrack/listTrack'?>" <a href="<?php echo base_url('backend/cmsTrack/showTrack/'.$contest[0]['id']);?>"
onclick="return confirm('Bạn có chắc chắn muốn quay lại Danh sách không?')"> onclick="return confirm('Bạn có chắc chắn muốn quay lại Danh sách không?')">
<button type="button" class="btn btn-sm btn-default"> <button type="button" class="btn btn-sm btn-default">
<i class="ace-icon fa fa-arrow-left"></i>Quay lại <i class="ace-icon fa fa-arrow-left"></i>Quay lại
......
<?php if($this->session->flashdata('success')): ?> <?php if($this->session->flashdata('success')): ?>
<div class="row"> <div class="row">
<div class="alert alert-block alert-success" style="margin-bottom: 5px"> <div class="alert alert-block alert-success" style="margin-bottom: 5px">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<i class="ace-icon fa fa-times"></i> <i class="ace-icon fa fa-times"></i>
</button> </button>
<i class="ace-icon fa fa-check green"></i> <i class="ace-icon fa fa-check green"></i>
<?php echo $this->session->flashdata('success'); ?> <?php echo $this->session->flashdata('success'); ?>
</div>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>
<?php if($this->session->flashdata('error')): ?> <?php if($this->session->flashdata('error')): ?>
<div class="row"> <div class="row">
<div class="alert alert-block alert-danger" style="margin-bottom: 5px"> <div class="alert alert-block alert-danger" style="margin-bottom: 5px">
<button type="button" class="close" data-dismiss="alert"> <button type="button" class="close" data-dismiss="alert">
<i class="ace-icon fa fa-times"></i>
</button>
<i class="ace-icon fa fa-times"></i> <i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?> </button>
</div> <i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>
<?php if(isset($track[0])): ?> <?php if(isset($track[0])): ?>
<div class="row"> <div class="row">
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
<div class="profile-info-name">Ảnh</div> <div class="profile-info-name">Ảnh</div>
<div class="profile-info-value"> <div class="profile-info-value">
<span> <span>
<img src="<?php echo MyHelper::getArtByTrack($track[0]['art']) ?>" style="width: 100px; height: 100px"> <img src="<?php echo MyHelper::getArtByTrack($track[0]['art']) ?>"
style="max-width: 200px; max-height: 200px">
</span> </span>
</div> </div>
</div> </div>
...@@ -42,67 +43,44 @@ ...@@ -42,67 +43,44 @@
<div class="profile-info-row"> <div class="profile-info-row">
<div class="profile-info-name">Tên Bài hát</div> <div class="profile-info-name">Tên Bài hát</div>
<div class="profile-info-value"> <div class="profile-info-value">
<span><?php echo $track[0]['title']?></span> <span><?php echo $track[0]['title']; ?></span>
</div>
</div>
<div class="profile-info-row">
<div class="profile-info-name">Ca sĩ</div>
<div class="profile-info-value">
<!-- <span><?php echo MyHelper::reFormatDate($track[0]['birthday'], 'd/m/Y') ?></span> -->
</div> </div>
</div> </div>
<div class="profile-info-row"> <div class="profile-info-row">
<div class="profile-info-name">Nhạc sĩ</div> <div class="profile-info-name">Sáng tác</div>
<div class="profile-info-value"> <div class="profile-info-value">
<!-- <span><?php echo $user[0]['gender']?></span> --> <span><?php echo $track[0]['artist']; ?></span>
</div> </div>
</div> </div>
<div class="profile-info-row"> <div class="profile-info-row">
<div class="profile-info-name">Mô tả</div> <div class="profile-info-name">Số người biểu diễn</div>
<div class="profile-info-value">
<span><?php echo $track[0]['description']?></span>
</div>
</div>
<!--
<div class="profile-info-row">
<div class="profile-info-name">Địa chỉ</div>
<div class="profile-info-value"> <div class="profile-info-value">
<span><?php echo $user[0]['address']?></span> <span><?php echo count($track); ?></span>
</div> </div>
</div> </div>
<div class="profile-info-row"> <div class="profile-info-row">
<div class="profile-info-name">Email</div> <div class="profile-info-name">Biểu diễn</div>
<div class="profile-info-value"> <div class="profile-info-value">
<span><?php echo $user[0]['email']?></span> <?php if(count($track) > 0) : foreach ($track as $key => $tracks) : ?>
<div style="<?php if(count($track) >1 ) echo 'width: 50%; float:left; text-align: center;';?>
<?php if(count($track) -1 > $key) echo 'border-right: solid #dddddd 2px;'; ?>
">
<?php echo $tracks['name_singer']; ?>
<a
href="<?php echo base_url('backend/cmsTrack/editTrack/'.$track[0]['id'].'/'.$tracks['id_singer'].'/'.$tracks['id_track_artist']); ?>">
<i class="ace-icon fa fa-pencil-square-o bigger-150" style="color: red;"></i>
</a>
</div>
<?php endforeach; ?>
<?php else: echo '<span class="text-danger">Chưa có</span>'; ?>
<?php endif ?>
</div> </div>
</div> </div>
<div class="profile-info-row">
<div class="profile-info-name">Mobile</div>
<div class="profile-info-value">
<span><?php echo $user[0]['mobile']?></span>
</div>
</div>
<div class="profile-info-row">
<div class="profile-info-name">Mã dự thưởng</div>
<div class="profile-info-value">
<span><?php echo $user[0]['reward_code']?></span>
</div>
</div>
<div class="profile-info-row">
<div class="profile-info-name">Ngày tham gia</div>
<div class="profile-info-value">
<span><?php echo MyHelper::reFormatDate($user[0]['created_at']) ?></span>
</div>
</div> -->
</div> </div>
</div> </div>
<?php else: ?> <?php else: ?>
<p>Không tìm thấy thông tin Người chơi!</p> <p>Không tìm thấy thông tin Người chơi!</p>
<?php endif; ?> <?php endif; ?>
\ 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