Commit 0a33c82e by Trần Văn Minh

view thêm ca sĩ vào bài hát

parent d4b1a742
...@@ -50,7 +50,7 @@ class CmsTrack extends CI_Controller ...@@ -50,7 +50,7 @@ class CmsTrack extends CI_Controller
public function editTrack($track_id, $id_user = '', $id_artist = '') public function editTrack($track_id, $id_user = '', $id_artist = '')
{ {
$this->_data['contest'] = $contest = $this->track_model->getById($track_id, $id_user, $id_artist); $this->_data['contest'] = $contest = $this->track_model->getById($track_id);
$track_user = ''; $track_user = '';
$this->_data['track_artists'] = $track_artists = ''; $this->_data['track_artists'] = $track_artists = '';
if ($id_user != 0) { if ($id_user != 0) {
...@@ -90,9 +90,6 @@ class CmsTrack extends CI_Controller ...@@ -90,9 +90,6 @@ class CmsTrack extends CI_Controller
$this->_data['singer'] = $this->input->post('singer'); $this->_data['singer'] = $this->input->post('singer');
$this->_data['artist'] = $this->input->post('artist'); $this->_data['artist'] = $this->input->post('artist');
$this->_data['update_artist'] = $this->input->post('update_artist'); $this->_data['update_artist'] = $this->input->post('update_artist');
//
// error_log('abv: '.$this->input->post('src_option'));
die('abv: '.$this->input->post('src_option'));
$this->_data['functionName'] = 'Cập nhật thông tin'; $this->_data['functionName'] = 'Cập nhật thông tin';
$this->_data['action'] = 'editTrack'; $this->_data['action'] = 'editTrack';
$this->_data['titlePage'] = 'Cập nhật thông tin'; $this->_data['titlePage'] = 'Cập nhật thông tin';
...@@ -246,7 +243,14 @@ class CmsTrack extends CI_Controller ...@@ -246,7 +243,14 @@ class CmsTrack extends CI_Controller
public function addSinger($track_id) public function addSinger($track_id)
{ {
# code... $this->_data['track'] = $contest = $this->track_model->getById($track_id);
$this->_data['list_user'] = $list_user = $this->track_model->getListUsers();
$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';
$this->_data['loadPage'] = 'backend/cms_track/add_singer_view';
$this->load->view('backend/admin_template_view', $this->_data);
} }
public function showTrack($track_id) public function showTrack($track_id)
......
<?php
?>
<div class="row">
<div class="widget-box">
<div class="widget-header">
<p class="widget-title">Cập nhật thông tin bài hát</p>
</div>
<div class="widget-body">
<div class="widget-main">
<?php
$attributes = array('class' => 'form-horizontal', 'id' => 'myform');
echo form_open_multipart(base_url('backend/cmsTrack/editTrack/'.$track[0]['id']), $attributes);
?>
<div class="form-group">
<label class="col-lg-3"></label>
<div class="col-lg-3">
<input type="hidden" name="id" value="<?php echo $track[0]['id']; ?>" />
<?php
if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');}
?>
</div>
</div>
<div class="form-group">
<label class="col-lg-3">Tên bài hát (*)</label>
<div class="col-lg-3">
<p><?php echo $track[0]['title']; ?></p>
</div>
</div>
<div class="form-group">
<label class="col-lg-3">Thêm Tên Ca sĩ</label>
<div class="col-lg-3">
<select id='form-field-select-3' name="update_singer" style='width: 200px;' class="chosen-select form-control"
data-placeholder="Choose a State...">
<option value="-1">Chọn ca sĩ</option>
<?php foreach ($list_user as $singer): ?>
<option value="<?php echo $singer['id']; ?>">
<?php echo $singer['full_name']; ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-3">
<a href="<?php echo base_url('backend/cmsTrack/showTrack/'.$track[0]['id']);?>"
onclick="return confirm('Bạn có chắc chắn muốn quay lại trang chi tiết không?')">
<button type="button" class="btn btn-sm btn-default">
<i class="ace-icon fa fa-arrow-left"></i>Quay lại
</button>
</a>
</div>
<div class="col-lg-4">
<button class="btn btn-sm btn-primary" type="submit" name="btnSave">
<i class="ace-icon fa fa-check bigger-110"></i>Lưu lại
</button>
<button class="btn btn-sm" type="reset">
<i class="ace-icon fa fa-undo bigger-110"></i>Xóa form
</button>
</div>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>
</div><!-- /.row -->
<script>
$(document).ready(function() {
$('.chosen-select').chosen({
allow_single_deselect: true,
no_results_text: "Không có kết quả cần tìm"
});
$(window)
.off('resize.chosen')
.on('resize.chosen', function() {
$('.chosen-select').each(function() {
var $this = $(this);
$this.next().css({
'width': $this.parent().width()
});
})
}).trigger('resize.chosen');
//resize chosen on sidebar collapse/expand
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
if (event_name != 'sidebar_collapsed') return;
$('.chosen-select').each(function() {
var $this = $(this);
$this.next().css({
'width': $this.parent().width()
});
})
});
});
</script>
\ No newline at end of file
...@@ -108,7 +108,7 @@ $input_artist = array( ...@@ -108,7 +108,7 @@ $input_artist = array(
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-lg-3">Ảnh nhạc sĩ</label> <label class="col-lg-3">Ảnh Bài hát</label>
<div class="col-lg-3"> <div class="col-lg-3">
<input type="file" name="avatar" size="20" /> <input type="file" name="avatar" size="20" />
</div> </div>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<?php if(isset($track[0])): ?> <?php if(isset($track[0])): ?>
<div class="row"> <div class="row">
<div class="col-lg-2"> <div class="col-lg-2">
<a class="btn btn-sm btn-success" href="<?php echo base_url('backend/cmsTrack/addTrack');?>"><i class="glyphicon-plus">Thêm ca sĩ</i></a> <a class="btn btn-sm btn-success" href="<?php echo base_url('backend/cmsTrack/addSinger/'.$track[0]['id']);?>"><i class="glyphicon-plus">Thêm ca sĩ</i></a>
</div> </div>
</div> </div>
<br> <br>
......
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