Commit bf846aa6 by Phạm Văn Đoan

Merge branch 'dev' of http://git.dcv.vn/doanpv/vmusicchart-cms into dev

parents 5c4fcced 0dd94093
...@@ -179,8 +179,8 @@ class CmsTrack extends CI_Controller ...@@ -179,8 +179,8 @@ class CmsTrack extends CI_Controller
$this->_data['src_option'] = $this->input->post('src_option'); $this->_data['src_option'] = $this->input->post('src_option');
$this->_data['link'] = $this->input->post('link'); $this->_data['link'] = $this->input->post('link');
$this->_data['nct_id'] = $this->input->post('nct_id'); $this->_data['nct_id'] = $this->input->post('nct_id');
//
error_log('avc: '.$this->input->post('src_option'));
$this->_data['functionName'] = 'Tạo mới Bài hát'; $this->_data['functionName'] = 'Tạo mới Bài hát';
$this->_data['action'] = 'addTrack'; $this->_data['action'] = 'addTrack';
$this->_data['titlePage'] = 'Tạo mới Bài hát'; $this->_data['titlePage'] = 'Tạo mới Bài hát';
...@@ -246,11 +246,30 @@ class CmsTrack extends CI_Controller ...@@ -246,11 +246,30 @@ class CmsTrack extends CI_Controller
$this->_data['track'] = $contest = $this->track_model->getById($track_id); $this->_data['track'] = $contest = $this->track_model->getById($track_id);
$this->_data['list_user'] = $list_user = $this->track_model->getListUsers(); $this->_data['list_user'] = $list_user = $this->track_model->getListUsers();
$this->form_validation->set_rules(
'singer',
'Ca sĩ',
'trim|required|callback_check_default|xss_clean'
);
$this->form_validation->set_message('required', '<li class="list-unstyled">Bắt buộc nhập, chọn.</li>');
$this->form_validation->set_message('is_unique', '<li class="list-unstyled">Đã tồn tại.</li>');
// Xử lý form đăng nhập
if($this->form_validation->run($this) == false) {
$this->_data['singer'] = $this->input->post('singer');
$this->_data['functionName'] = 'Thêm Người thể hiện vào bài hát'; $this->_data['functionName'] = 'Thêm Người thể hiện vào bài hát';
$this->_data['action'] = 'addSinger'; $this->_data['action'] = 'addSinger';
$this->_data['titlePage'] = 'Thêm Người thể hiện vào bài hát'; $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->_data['loadPage'] = 'backend/cms_track/add_singer_view';
$this->load->view('backend/admin_template_view', $this->_data); $this->load->view('backend/admin_template_view', $this->_data);
} else {
$singer = $this->input->post('singer');
$this->track_model->add_singer($singer,$track_id);
$this->session->set_flashdata('success', 'Thêm ca sĩ vào bài hát thành công');
}
} }
public function showTrack($track_id) public function showTrack($track_id)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Track_model extends CI_Model class Track_model extends CI_Model
{ {
protected $_table = 'tracks'; protected $_table = 'tracks';
protected $track_user = 'track_user';
protected $track_artists = 'track_artists';
public function __construct() public function __construct()
{ {
...@@ -27,7 +29,7 @@ class Track_model extends CI_Model ...@@ -27,7 +29,7 @@ class Track_model extends CI_Model
$this->db->set('name', $query[0]['full_name']); $this->db->set('name', $query[0]['full_name']);
} }
$this->db->set('track_id', $track_id); $this->db->set('track_id', $track_id);
$this->db->insert('track_user'); $this->db->insert($this->track_user);
} }
public function add_artist($user_id, $track_id) public function add_artist($user_id, $track_id)
...@@ -40,7 +42,7 @@ class Track_model extends CI_Model ...@@ -40,7 +42,7 @@ class Track_model extends CI_Model
$this->db->set('name', $query[0]['full_name']); $this->db->set('name', $query[0]['full_name']);
} }
$this->db->set('track_id', $track_id); $this->db->set('track_id', $track_id);
$this->db->insert('track_artists'); $this->db->insert($this->track_artists);
} }
public function update($id, $dataUpdate, $art_path) public function update($id, $dataUpdate, $art_path)
...@@ -63,11 +65,11 @@ class Track_model extends CI_Model ...@@ -63,11 +65,11 @@ class Track_model extends CI_Model
} }
if ($active == 'insert') { if ($active == 'insert') {
$this->db->set('track_id', $id_track); $this->db->set('track_id', $id_track);
$this->db->insert('track_artists'); $this->db->insert($this->track_artists);
} else { } else {
$this->db->where('track_id', $id_track); $this->db->where('track_id', $id_track);
$this->db->where('id', $id); $this->db->where('id', $id);
$this->db->update('track_artists'); $this->db->update($this->track_artists);
} }
} }
...@@ -98,7 +100,7 @@ class Track_model extends CI_Model ...@@ -98,7 +100,7 @@ class Track_model extends CI_Model
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($this->track_artists, 'track_artists.track_id = tracks.id', 'left');
$this->db->where($this->_table . '.id', $id); $this->db->where($this->_table . '.id', $id);
$query = $this->db->get(); $query = $this->db->get();
return $query->result_array(); return $query->result_array();
...@@ -165,7 +167,7 @@ class Track_model extends CI_Model ...@@ -165,7 +167,7 @@ class Track_model extends CI_Model
track_artists.name AS composer_name2, track_artists.id AS id_artist'); track_artists.name AS composer_name2, track_artists.id AS id_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($this->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 u1', 'u1.id = track_user.user_id', 'left');
$this->db->join('users u2', 'u2.id = track_artists.user_id', 'left'); $this->db->join('users u2', 'u2.id = track_artists.user_id', 'left');
if ($name != null) { if ($name != null) {
...@@ -273,7 +275,7 @@ class Track_model extends CI_Model ...@@ -273,7 +275,7 @@ class Track_model extends CI_Model
//if ($query) $users = $query->result_array(); //if ($query) $users = $query->result_array();
//return $users; //return $users;
$this->db->from('track_artists'); $this->db->from($this->track_artists);
$this->db->where('track_id =', $track_id); $this->db->where('track_id =', $track_id);
$query = $this->db->get(); $query = $this->db->get();
......
...@@ -90,7 +90,8 @@ $input_link_keeng = array( ...@@ -90,7 +90,8 @@ $input_link_keeng = array(
if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');} if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');}
?> ?>
</div> </div>
</div><div class="form-group"> </div>
<div class="form-group">
<label class="col-lg-3">Username (*)</label> <label class="col-lg-3">Username (*)</label>
<div class="col-lg-3"> <div class="col-lg-3">
<?php <?php
...@@ -180,7 +181,8 @@ $input_link_keeng = array( ...@@ -180,7 +181,8 @@ $input_link_keeng = array(
</div> </div>
<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/cmsArtist/listArtist'?>" onclick="return confirm('Bạn có chắc chắn muốn quay lại Danh sách không?')"> <a href="<?php echo base_url().'backend/cmsArtist/listArtist'?>"
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
</button> </button>
...@@ -201,12 +203,12 @@ $input_link_keeng = array( ...@@ -201,12 +203,12 @@ $input_link_keeng = array(
</div> </div>
</div><!-- /.row --> </div><!-- /.row -->
<script> <script>
$(document).ready(function(){ $(document).ready(function() {
$('.date-picker').datepicker({ $('.date-picker').datepicker({
autoclose: true, autoclose: true,
todayHighlight: true, todayHighlight: true,
minDate: '<?php echo date('Y-m-d')?>' minDate: '<?php echo date('Y-m-d ')?>'
}) })
}); });
</script> </script>
\ No newline at end of file
...@@ -98,7 +98,8 @@ $input_link_keeng = array( ...@@ -98,7 +98,8 @@ $input_link_keeng = array(
if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');} if(validation_errors()){echo form_error('id', '<div class="error">', '</div>');}
?> ?>
</div> </div>
</div><div class="form-group"> </div>
<div class="form-group">
<label class="col-lg-3">Username (*)</label> <label class="col-lg-3">Username (*)</label>
<div class="col-lg-3"> <div class="col-lg-3">
<?php <?php
...@@ -188,7 +189,8 @@ $input_link_keeng = array( ...@@ -188,7 +189,8 @@ $input_link_keeng = array(
</div> </div>
<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/cmsArtist/listArtist'?>" onclick="return confirm('Bạn có chắc chắn muốn quay lại Danh sách không?')"> <a href="<?php echo base_url().'backend/cmsArtist/listArtist'?>"
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
</button> </button>
...@@ -209,12 +211,12 @@ $input_link_keeng = array( ...@@ -209,12 +211,12 @@ $input_link_keeng = array(
</div> </div>
</div><!-- /.row --> </div><!-- /.row -->
<script> <script>
$(document).ready(function(){ $(document).ready(function() {
$('.date-picker').datepicker({ $('.date-picker').datepicker({
autoclose: true, autoclose: true,
todayHighlight: true, todayHighlight: true,
minDate: '<?php echo date('Y-m-d')?>' minDate: '<?php echo date('Y-m-d')?>'
}) })
}); });
</script> </script>
\ No newline at end of file
<?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>
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<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> <i class="ace-icon fa fa-times"></i>
...@@ -18,29 +18,27 @@ ...@@ -18,29 +18,27 @@
<i class="ace-icon fa fa-times"></i> <i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?> <?php echo $this->session->flashdata('error'); ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">
<?php echo form_open(base_url().'backend/cmsArtist/listArtistAjax'); ?> <?php echo form_open(base_url().'backend/cmsArtist/listArtistAjax'); ?>
<div class="col-lg-3"> <div class="col-lg-3">
<input <input class="form-control" type="text" name="input-name" id="input-name"
class="form-control" type="text" placeholder="Nhập tên nghệ sĩ, email..." />
name="input-name"
id="input-name"
placeholder="Nhập tên nghệ sĩ, email..."/>
</div> </div>
<div class="col-lg-1"> <div class="col-lg-1">
<button class="btn btn-sm btn-default" id="delete-filter">Xóa bộ lọc</button> <button class="btn btn-sm btn-default" id="delete-filter">Xóa bộ lọc</button>
</div> </div>
<?php echo form_close(); ?> <?php echo form_close(); ?>
<div class="col-lg-1" style="float:right;"> <div class="col-lg-1" style="float:right;">
<a class="btn btn-sm btn-success" href="<?php echo base_url('backend/cmsArtist/addArtist');?>"><i class="glyphicon-plus">Thêm</i></a> <a class="btn btn-sm btn-success" href="<?php echo base_url('backend/cmsArtist/addArtist');?>"><i
class="glyphicon-plus">Thêm</i></a>
</div> </div>
</div> </div>
<!-- /.row --> <!-- /.row -->
<div class="space-6"></div> <div class="space-6"></div>
<div class="row" > <div class="row">
<div style="text-align: center" id="data-loading"> <div style="text-align: center" id="data-loading">
<i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu... <i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu...
</div> </div>
...@@ -51,20 +49,20 @@ ...@@ -51,20 +49,20 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//Thuc hien viec ve bieu do$data //Thuc hien viec ve bieu do$data
$(document).ready(function() { $(document).ready(function() {
var url = '<?php echo base_url("backend/cmsArtist/listArtistAjax"); ?>'; var url = '<?php echo base_url("backend/cmsArtist/listArtistAjax"); ?>';
// Tìm kiếm theo cú pháp // Tìm kiếm theo cú pháp
var oldTimeout2 = ''; var oldTimeout2 = '';
$('#input-name').keyup(function(){ $('#input-name').keyup(function() {
clearTimeout(oldTimeout2); clearTimeout(oldTimeout2);
oldTimeout2 = setTimeout(function(){ oldTimeout2 = setTimeout(function() {
loadDataByAjaxFromInput(url); loadDataByAjaxFromInput(url);
}, 250); }, 250);
}); });
// Xóa bộ lọc // Xóa bộ lọc
$('#delete-filter').click(function(){ $('#delete-filter').click(function() {
$("#input-name").val(''); $("#input-name").val('');
changePagination('0'); changePagination('0');
return false; return false;
...@@ -72,9 +70,9 @@ ...@@ -72,9 +70,9 @@
}); });
changePagination('0'); changePagination('0');
}); });
//Ham chung cho cac input //Ham chung cho cac input
function loadDataByAjaxFromInput(url){ function loadDataByAjaxFromInput(url) {
$('#data-loading').show(); $('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val(); var fByName = $("#input-name").val();
...@@ -88,15 +86,15 @@ ...@@ -88,15 +86,15 @@
}, },
dataType: "text", dataType: "text",
cache: false, cache: false,
success: function(data){ success: function(data) {
$('#div-response').html(data); $('#div-response').html(data);
$('#data-loading').hide(); $('#data-loading').hide();
} }
}); });
} }
//Ham chung cho cac SelectBox //Ham chung cho cac SelectBox
function loadDataByAjaxFromSelectBox(id, url){ function loadDataByAjaxFromSelectBox(id, url) {
$('#'+id).change(function(){ $('#' + id).change(function() {
$('#data-loading').show(); $('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val(); var fByName = $("#input-name").val();
...@@ -110,15 +108,15 @@ ...@@ -110,15 +108,15 @@
}, },
dataType: "text", dataType: "text",
cache: false, cache: false,
success: function(data){ success: function(data) {
$('#div-response').html(data); $('#div-response').html(data);
$('#data-loading').hide(); $('#data-loading').hide();
} }
}); });
}); });
} }
function loadDataByAjaxDateRange(dtFrom, dtTo, url){ function loadDataByAjaxDateRange(dtFrom, dtTo, url) {
$('#data-loading').show(); $('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val(); var fByName = $("#input-name").val();
...@@ -132,14 +130,14 @@ ...@@ -132,14 +130,14 @@
}, },
dataType: "text", dataType: "text",
cache: false, cache: false,
success: function(data){ success: function(data) {
$('#div-response').html(data); $('#div-response').html(data);
$('#data-loading').hide(); $('#data-loading').hide();
} }
}); });
} }
function changePagination(pageId) { function changePagination(pageId) {
$('#data-loading').show(); $('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var url = '<?php echo base_url()."backend/cmsArtist/listArtistAjax"; ?>'; var url = '<?php echo base_url()."backend/cmsArtist/listArtistAjax"; ?>';
...@@ -155,11 +153,10 @@ ...@@ -155,11 +153,10 @@
}, },
dataType: "text", dataType: "text",
cache: false, cache: false,
success: function(data){ success: function(data) {
$('#div-response').html(data); $('#div-response').html(data);
$('#data-loading').hide(); $('#data-loading').hide();
} }
}); });
} }
</script> </script>
\ No newline at end of file
<?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>
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<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> <i class="ace-icon fa fa-times"></i>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<i class="ace-icon fa fa-times"></i> <i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?> <?php echo $this->session->flashdata('error'); ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if(isset($user[0])): ?> <?php if(isset($user[0])): ?>
<div class="row"> <div class="row">
...@@ -105,5 +105,5 @@ ...@@ -105,5 +105,5 @@
</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 Ca sĩ/Nhạc sĩ!</p>
<?php endif; ?> <?php endif; ?>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="widget-main"> <div class="widget-main">
<?php <?php
$attributes = array('class' => 'form-horizontal', 'id' => 'myform'); $attributes = array('class' => 'form-horizontal', 'id' => 'myform');
echo form_open_multipart(base_url('backend/cmsTrack/editTrack/'.$track[0]['id']), $attributes); echo form_open_multipart(base_url('backend/cmsTrack/addSinger/'.$track[0]['id']), $attributes);
?> ?>
<div class="form-group"> <div class="form-group">
<label class="col-lg-3"></label> <label class="col-lg-3"></label>
...@@ -30,15 +30,17 @@ ...@@ -30,15 +30,17 @@
<div class="form-group"> <div class="form-group">
<label class="col-lg-3">Thêm Tên Ca sĩ</label> <label class="col-lg-3">Thêm Tên Ca sĩ</label>
<div class="col-lg-3"> <div class="col-lg-3">
<select id='form-field-select-3' name="update_singer" style='width: 200px;' class="chosen-select form-control" <select id='form-field-select-3' name="singer" style='width: 200px;'
data-placeholder="Choose a State..."> class="chosen-select form-control" data-placeholder="Choose a State...">
<option value="-1">Chọn ca sĩ</option> <option value="0">Chọn ca sĩ</option>
<?php foreach ($list_user as $singer): ?> <?php foreach ($list_user as $singers): ?>
<option value="<?php echo $singer['id']; ?>"> <option value="<?php echo $singers['id']; ?>"
<?php echo $singer['full_name']; ?> <?php if($singer && $singer == $singers['id']){ echo 'selected="selected"';}else echo ''; ?>>
<?php echo $singers['full_name']; ?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<?php if(validation_errors()){echo form_error('singer', '<div class="error">', '</div>');} ?>
</div> </div>
</div> </div>
......
...@@ -81,8 +81,8 @@ $input_artist = array( ...@@ -81,8 +81,8 @@ $input_artist = array(
<div class="form-group"> <div class="form-group">
<label class="col-lg-3">Cập nhật Tên Ca sĩ</label> <label class="col-lg-3">Cập nhật Tên Ca sĩ</label>
<div class="col-lg-3"> <div class="col-lg-3">
<select id='form-field-select-3' name="update_singer" style='width: 200px;' class="chosen-select form-control" <select id='form-field-select-3' name="update_singer" style='width: 200px;'
data-placeholder="Choose a State..."> class="chosen-select form-control" data-placeholder="Choose a State...">
<option value="-1">Chọn ca sĩ</option> <option value="-1">Chọn ca sĩ</option>
<?php foreach ($list_user as $singer): ?> <?php foreach ($list_user as $singer): ?>
<option value="<?php echo $singer['id']; ?>"> <option value="<?php echo $singer['id']; ?>">
...@@ -95,8 +95,8 @@ $input_artist = array( ...@@ -95,8 +95,8 @@ $input_artist = array(
<div class="form-group"> <div class="form-group">
<label class="col-lg-3">Cập nhập Tên nhạc sĩ</label> <label class="col-lg-3">Cập nhập Tên nhạc sĩ</label>
<div class="col-lg-3"> <div class="col-lg-3">
<select id='form-field-select-3' name="update_artist" style='width: 200px;' class="chosen-select form-control" <select id='form-field-select-3' name="update_artist" style='width: 200px;'
data-placeholder="Choose a State..."> class="chosen-select form-control" data-placeholder="Choose a State...">
<option value="-1">Chọn nhạc sĩ</option> <option value="-1">Chọn nhạc sĩ</option>
<?php foreach ($list_user as $artist): ?> <?php foreach ($list_user as $artist): ?>
<option value="<?php echo $artist['id']; ?>"> <option value="<?php echo $artist['id']; ?>">
...@@ -110,6 +110,10 @@ $input_artist = array( ...@@ -110,6 +110,10 @@ $input_artist = array(
<div class="form-group"> <div class="form-group">
<label class="col-lg-3">Ảnh Bài hát</label> <label class="col-lg-3">Ảnh Bài hát</label>
<div class="col-lg-3"> <div class="col-lg-3">
<?php if ($contest[0]['art'] != null) : ?>
<img src="<?php echo MyHelper::getArtByTrack($contest[0]['art']); ?>"
style="width: 100%; margin-bottom: 15px;">
<?php endif; ?>
<input type="file" name="avatar" size="20" /> <input type="file" name="avatar" size="20" />
</div> </div>
</div> </div>
......
<?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>
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<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> <i class="ace-icon fa fa-times"></i>
...@@ -18,18 +18,14 @@ ...@@ -18,18 +18,14 @@
<i class="ace-icon fa fa-times"></i> <i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?> <?php echo $this->session->flashdata('error'); ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">
<?php echo form_open(base_url().'backend/cmsTrack/listTrackAjax'); ?> <?php echo form_open(base_url().'backend/cmsTrack/listTrackAjax'); ?>
<!-- Tìm kiếm theo tên bài hát --> <!-- Tìm kiếm theo tên bài hát -->
<div class="col-lg-3"> <div class="col-lg-3">
<input <input class="form-control" type="text" name="input-name" id="input-name" placeholder="Nhập tên bài hát..." />
class="form-control" type="text"
name="input-name"
id="input-name"
placeholder="Nhập tên bài hát..."/>
</div> </div>
<!-- Lọc theo thông tin ca sĩ --> <!-- Lọc theo thông tin ca sĩ -->
<div class="col-lg-3"> <div class="col-lg-3">
...@@ -53,12 +49,13 @@ ...@@ -53,12 +49,13 @@
</div> </div>
<?php echo form_close(); ?> <?php echo form_close(); ?>
<div class="col-lg-1" style="float:right;"> <div class="col-lg-1" style="float:right;">
<a class="btn btn-sm btn-success" href="<?php echo base_url('backend/cmsTrack/addTrack');?>"><i class="glyphicon-plus">Thêm</i></a> <a class="btn btn-sm btn-success" href="<?php echo base_url('backend/cmsTrack/addTrack');?>"><i
class="glyphicon-plus">Thêm</i></a>
</div> </div>
</div> </div>
<!-- /.row --> <!-- /.row -->
<div class="space-6"></div> <div class="space-6"></div>
<div class="row" > <div class="row">
<div style="text-align: center" id="data-loading"> <div style="text-align: center" id="data-loading">
<i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu... <i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu...
</div> </div>
...@@ -68,15 +65,15 @@ ...@@ -68,15 +65,15 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
//Thuc hien viec ve bieu do$data //Thuc hien viec ve bieu do$data
$(document).ready(function() { $(document).ready(function() {
var url = '<?php echo base_url("backend/cmsTrack/listTrackAjax"); ?>'; var url = '<?php echo base_url("backend/cmsTrack/listTrackAjax"); ?>';
// Tìm kiếm theo cú pháp // Tìm kiếm theo cú pháp
var oldTimeout2 = ''; var oldTimeout2 = '';
$('#input-name').keyup(function(){ $('#input-name').keyup(function() {
clearTimeout(oldTimeout2); clearTimeout(oldTimeout2);
oldTimeout2 = setTimeout(function(){ oldTimeout2 = setTimeout(function() {
loadDataByAjaxFromInput(url); loadDataByAjaxFromInput(url);
}, 250); }, 250);
}); });
...@@ -85,7 +82,7 @@ ...@@ -85,7 +82,7 @@
loadDataByAjaxFromSelectBox('fByComposer', url); loadDataByAjaxFromSelectBox('fByComposer', url);
// Xóa bộ lọc // Xóa bộ lọc
$('#delete-filter').click(function(){ $('#delete-filter').click(function() {
$("#input-name").val(''); $("#input-name").val('');
$("#fBySinger").val('-1'); $("#fBySinger").val('-1');
$("#fByComposer").val('-1'); $("#fByComposer").val('-1');
...@@ -96,33 +93,33 @@ ...@@ -96,33 +93,33 @@
changePagination('0', url); changePagination('0', url);
}); });
//Ham chung cho cac input //Ham chung cho cac input
function loadDataByAjaxFromInput(url){ function loadDataByAjaxFromInput(url) {
$('#data-loading').show(); $('#data-loading').show();
callAjax(0, url); callAjax(0, url);
} }
//Ham chung cho cac SelectBox //Ham chung cho cac SelectBox
function loadDataByAjaxFromSelectBox(id, url){ function loadDataByAjaxFromSelectBox(id, url) {
$('#'+id).change(function(){ $('#' + id).change(function() {
$('#data-loading').show(); $('#data-loading').show();
callAjax(0, url); callAjax(0, url);
}); });
} }
function loadDataByAjaxDateRange(dtFrom, dtTo, url){ function loadDataByAjaxDateRange(dtFrom, dtTo, url) {
$('#data-loading').show(); $('#data-loading').show();
callAjax(pageId, url); callAjax(pageId, url);
} }
function changePagination(pageId, url) { function changePagination(pageId, url) {
$('#data-loading').show(); $('#data-loading').show();
callAjax(pageId, url); callAjax(pageId, url);
} }
function callAjax(pageId, url) { function callAjax(pageId, url) {
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>'; var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val(); var fByName = $("#input-name").val();
var fBySinger = $("#fBySinger").val(); var fBySinger = $("#fBySinger").val();
...@@ -140,11 +137,10 @@ ...@@ -140,11 +137,10 @@
}, },
dataType: "text", dataType: "text",
cache: false, cache: false,
success: function(data){ success: function(data) {
$('#div-response').html(data); $('#div-response').html(data);
$('#data-loading').hide(); $('#data-loading').hide();
} }
}); });
} }
</script> </script>
\ No newline at end of file
...@@ -22,8 +22,12 @@ ...@@ -22,8 +22,12 @@
<?php endif; ?> <?php endif; ?>
<?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/addSinger/'.$track[0]['id']);?>"><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>
...@@ -72,10 +76,10 @@ ...@@ -72,10 +76,10 @@
<div class="profile-info-value"> <div class="profile-info-value">
<?php if(count($track) > 0) : foreach ($track as $key => $tracks) : ?> <?php if(count($track) > 0) : foreach ($track as $key => $tracks) : ?>
<div <div
style="<?php if(count($track) >1 ) : echo 'width: 50%; float:left; text-align: center;'; endif; if(count($track) -1 > $key) : echo 'border-right: solid #dddddd 2px;'; endif; ?>"> style="<?php if(count($track) >1 ) : echo 'width: 50%; float:left; text-align: left;'; endif; if(count($track) -1 > $key) : echo 'border-right: solid #dddddd 2px;'; endif; ?>">
<?php echo $tracks['name_singer']; ?> <?php echo $tracks['name_singer']; ?>
<a <a href="<?php echo base_url('backend/cmsTrack/editTrack/'.$track[0]['id'].'/'.$tracks['id_singer'].'/'.$tracks['id_track_artist']); ?>"
href="<?php echo base_url('backend/cmsTrack/editTrack/'.$track[0]['id'].'/'.$tracks['id_singer'].'/'.$tracks['id_track_artist']); ?>"> title="Click để thay đổi ca sĩ">
<i class="ace-icon fa fa-pencil-square-o bigger-150" style="color: red;"></i> <i class="ace-icon fa fa-pencil-square-o bigger-150" style="color: red;"></i>
</a> </a>
</div> </div>
...@@ -98,5 +102,5 @@ ...@@ -98,5 +102,5 @@
</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 Bài hát!</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