Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vmusicchart-cms
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Văn Đoan
vmusicchart-cms
Commits
f50902f8
Commit
f50902f8
authored
Apr 13, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixbug khi thêm ca sĩ cho bài hát
parent
f08f7ee8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
CmsTrack.php
application/controllers/backend/CmsTrack.php
+3
-2
Track_model.php
application/models/Track_model.php
+21
-5
list_track_view.php
application/views/backend/cms_track/list_track_view.php
+4
-0
No files found.
application/controllers/backend/CmsTrack.php
View file @
f50902f8
...
...
@@ -300,7 +300,7 @@ class CmsTrack extends CI_Controller
}
else
{
$singer
=
$this
->
input
->
post
(
'singer'
);
$this
->
track_model
->
add_singer
(
$singer
,
$track_id
);
$this
->
session
->
set_flashdata
(
'success'
,
'
Thêm c
a sĩ vào bài hát thành công'
);
$this
->
session
->
set_flashdata
(
'success'
,
'
Cập nhật C
a sĩ vào bài hát thành công'
);
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm mới Ca sĩ cho bài hát.'
,
'Actionlog_model'
,
'tracks'
,
$track_id
);
...
...
@@ -330,6 +330,7 @@ class CmsTrack extends CI_Controller
// Ghi log
$this
->
actionlog_model
->
add
(
'DELETED'
,
'Xóa Ca sĩ khỏi bài hát.'
,
'Actionlog_model'
,
'tracks'
,
$track_id
);
$this
->
session
->
set_flashdata
(
'success'
,
'Xóa Ca sĩ khỏi bài hát thành công'
);
redirect
(
base_url
(
'backend/cmsTrack/showTrack/'
.
$track_id
));
}
...
...
@@ -367,7 +368,7 @@ class CmsTrack extends CI_Controller
}
else
{
$composer
=
$this
->
input
->
post
(
'composer'
);
$this
->
track_model
->
add_artist
(
$composer
,
$track_id
);
$this
->
session
->
set_flashdata
(
'success'
,
'
Thêm
Nhạc sĩ vào bài hát thành công'
);
$this
->
session
->
set_flashdata
(
'success'
,
'
Cập nhật
Nhạc sĩ vào bài hát thành công'
);
// Ghi log
$this
->
actionlog_model
->
add
(
'ADDED'
,
'Thêm Nhạc sĩ cho bài hát.'
,
'Actionlog_model'
,
'tracks'
,
$track_id
);
...
...
application/models/Track_model.php
View file @
f50902f8
...
...
@@ -28,16 +28,32 @@ class Track_model extends CI_Model
*/
public
function
add_singer
(
$user_id
,
$track_id
)
{
// Kiểm tra tồn tại singer
$this
->
db
->
select
(
'full_name'
);
$this
->
db
->
where
(
'id'
,
$user_id
);
$query
=
$this
->
db
->
get
(
'users'
)
->
result_array
();
if
(
$query
)
{
$this
->
db
->
set
(
'name'
,
$query
[
0
][
'full_name'
]);
}
$this
->
db
->
set
(
'user_id'
,
$user_id
);
$query_user
=
$this
->
db
->
get
(
$this
->
_table_user
)
->
result_array
();
if
(
$query_user
)
{
// Kiểm tra tồn tại track
$this
->
db
->
select
(
'id'
);
$this
->
db
->
where
(
'id'
,
$track_id
);
$query_track
=
$this
->
db
->
get
(
$this
->
_table
)
->
result_array
();
if
(
$query_track
)
{
// Kiểm tra tồn tại track-singer
$this
->
db
->
select
(
'*'
);
$this
->
db
->
where
(
'track_id'
,
$track_id
);
$this
->
db
->
where
(
'user_id'
,
$user_id
);
$this
->
db
->
limit
(
1
);
$query_singer
=
$this
->
db
->
get
(
$this
->
_table_track_user
)
->
result_array
();
// Nếu chưa có thì insert, có rồi thì thôi
if
(
empty
(
$query_singer
))
{
$this
->
db
->
set
(
'track_id'
,
$track_id
);
$this
->
db
->
set
(
'user_id'
,
$user_id
);
$this
->
db
->
set
(
'name'
,
$query_user
[
0
][
'full_name'
]);
$this
->
db
->
insert
(
$this
->
_table_track_user
);
}
}
}
}
/**
* Xử lý thông tin nhạc sĩ
...
...
application/views/backend/cms_track/list_track_view.php
View file @
f50902f8
<?php
if
(
$this
->
session
->
flashdata
(
'success'
))
:
?>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"alert alert-block alert-success"
style=
"margin-bottom: 5px"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
>
<i
class=
"ace-icon fa fa-times"
></i>
...
...
@@ -7,10 +8,12 @@
<i
class=
"ace-icon fa fa-check green"
></i>
<?php
echo
$this
->
session
->
flashdata
(
'success'
);
?>
</div>
</div>
</div>
<?php
endif
;
?>
<?php
if
(
$this
->
session
->
flashdata
(
'error'
))
:
?>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"alert alert-block alert-danger"
style=
"margin-bottom: 5px"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
>
<i
class=
"ace-icon fa fa-times"
></i>
...
...
@@ -18,6 +21,7 @@
<i
class=
"ace-icon fa fa-times"
></i>
<?php
echo
$this
->
session
->
flashdata
(
'error'
);
?>
</div>
</div>
</div>
<?php
endif
;
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment