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
41baa4a7
Commit
41baa4a7
authored
Mar 09, 2020
by
Trần Văn Minh
Browse files
Options
Browse Files
Download
Plain Diff
select nhạc sĩ chỉnh sửa bài hát
parents
656e7b03
88b66715
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
88 deletions
+105
-88
CmsRanking.php
application/controllers/backend/CmsRanking.php
+0
-0
CmsTrack.php
application/controllers/backend/CmsTrack.php
+1
-1
Track_model.php
application/models/Track_model.php
+56
-4
User_model.php
application/models/User_model.php
+18
-0
admin_template_view.php
application/views/backend/admin_template_view.php
+1
-1
list_by_monthly_view.php
...cation/views/backend/cms_ranking/list_by_monthly_view.php
+14
-79
list_by_weekly_view.php
...ication/views/backend/cms_ranking/list_by_weekly_view.php
+15
-3
No files found.
application/controllers/backend/CmsRanking.php
View file @
41baa4a7
This diff is collapsed.
Click to expand it.
application/controllers/backend/CmsTrack.php
View file @
41baa4a7
...
...
@@ -36,7 +36,7 @@ class CmsTrack extends CI_Controller
//
$pageId
=
(
$pageId
==
0
)
?
1
:
$pageId
;
//
$limit
=
25
;
$limit
=
100
;
$offset
=
(
$pageId
-
1
)
*
$limit
;
$data
[
'offset'
]
=
(
$pageId
-
1
)
*
$limit
;
$totalRecord
=
$this
->
track_model
->
cmsCountAll
(
$fByName
);
...
...
application/models/Track_model.php
View file @
41baa4a7
...
...
@@ -106,14 +106,66 @@ class Track_model extends CI_Model
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
getReportWeekly
(
$week
,
$year
,
$limit
=
100
,
$offset
=
0
)
{
//$sql = "SELECT * FROM report_views_weekly WHERE `week` = ? AND `year` = ? ORDER BY total_point DESC LIMIT {$offset}, {$limit} ";
//$query = $this->db->query($sql, $week, $year);
$this
->
db
->
from
(
'report_views_weekly'
);
$this
->
db
->
where
(
'week ='
,
$week
);
$this
->
db
->
where
(
'year ='
,
$year
);
$this
->
db
->
limit
(
$limit
,
$offset
);
$query
=
$this
->
db
->
get
();
public
function
searchSingle
(
$name
)
return
$query
->
result_array
();
}
public
function
getReportMonthly
(
$month
,
$year
,
$limit
=
100
,
$offset
=
0
)
{
$this
->
db
->
select
(
'*'
);
$this
->
db
->
like
(
'name'
,
$name
);
$query
=
$this
->
db
->
get
(
'track_user'
);
//$sql = "SELECT * FROM reports_views_monthly WHERE `month` = ? AND `year` = ? ORDER BY total_point DESC LIMIT {$offset}, {$limit} ";
//$query = $this->db->query($sql, $month, $year);
$this
->
db
->
from
(
'reports_views_monthly'
);
$this
->
db
->
where
(
'month ='
,
$month
);
$this
->
db
->
where
(
'year ='
,
$year
);
$this
->
db
->
limit
(
$limit
,
$offset
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
getUserByTrack
(
$track_id
)
{
//$query = $this->db->query("SELECT * FROM track_user WHERE track_id=?", $track_id);
//if ($query) $users = $query->result_array();
//return $users;
$this
->
db
->
from
(
'track_user'
);
$this
->
db
->
where
(
'track_id ='
,
$track_id
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
getArtistsByTrack
(
$track_id
)
{
//$query = $this->db->query("SELECT * FROM track_artists WHERE track_id=?", $track_id);
//if ($query) $users = $query->result_array();
//return $users;
$this
->
db
->
from
(
'track_artists'
);
$this
->
db
->
where
(
'track_id ='
,
$track_id
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
public
function
getTrackById
(
$id
)
{
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
where
(
$this
->
_table
.
'.id'
,
$id
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
}
/* End of file welcome.php */
...
...
application/models/User_model.php
View file @
41baa4a7
...
...
@@ -198,6 +198,24 @@ class User_model extends CI_Model
return
$result
;
}
function
getUser
(
$id
=
null
,
$block
=
true
)
{
/*if ($id) {
$blockIds = ($block) ? $this->blockIds() : '0';
$query = $this->db->query("SELECT * FROM users WHERE (id=? OR email=? OR username=?) AND id NOT IN ($blockIds) AND active=?", $id,$id,$id, 1);
if ($query) $user = $query->result_array();
return $user;
} else {
return $this->authUser;
}*/
$this
->
db
->
select
(
$this
->
_table
.
'.*'
);
$this
->
db
->
from
(
$this
->
_table
);
$this
->
db
->
where
(
$this
->
_table
.
'.id'
,
$id
);
$query
=
$this
->
db
->
get
();
return
$query
->
result_array
();
}
}
...
...
application/views/backend/admin_template_view.php
View file @
41baa4a7
...
...
@@ -315,7 +315,7 @@ $action = $CI->router->fetch_method();
<div
class=
"footer"
>
<div
class=
"footer-inner"
>
<div
class=
"footer-content"
>
<span
class=
"bigger-50"
>
©
20
17
</span>
<span
class=
"bigger-50"
>
©
20
20
</span>
</div>
</div>
</div>
...
...
application/views/backend/cms_ranking/list_by_monthly_view.php
View file @
41baa4a7
...
...
@@ -22,7 +22,6 @@
<?php
endif
;
?>
<div
class=
"row"
>
<?php
echo
form_open
(
base_url
()
.
'backend/cmsRanking/listByMonthlyAjax'
);
?>
<div
class=
"col-lg-3"
>
<select
class=
"form-control"
name=
"input-name"
id=
"input-name"
>
<?php
...
...
@@ -34,15 +33,11 @@
endforeach
;
?>
</select>
<!-- <input
class="form-control" type="text"
name="input-name"
id="input-name"
placeholder="Nhập tên bài hát..."/> -->
</div>
<?php
echo
form_close
();
?>
<div
class=
"col-lg-1"
>
<button
class=
"btn btn-sm btn-default"
id=
"excel"
>
Xuất Excel
</button>
<a
href=
""
id=
"btn-export"
>
<button
class=
"btn btn-sm btn-warning"
id=
"excel"
><i
class=
"fa fa-download"
></i>
Export ra Excel
</button>
</a>
</div>
</div>
<!-- /.row -->
...
...
@@ -60,93 +55,27 @@
//Thuc hien viec ve bieu do$data
$
(
document
).
ready
(
function
()
{
var
url
=
'
<?php
echo
base_url
(
"backend/cmsRanking/listByMonthlyAjax"
);
?>
'
;
var
url1
=
'
<?php
echo
base_url
(
"backend/cmsRanking/exportExcel"
);
?>
'
;
// Tìm kiếm theo cú pháp
var
oldTimeout2
=
''
;
$
(
'#input-name'
).
change
(
function
(){
updateExportLink
();
clearTimeout
(
oldTimeout2
);
oldTimeout2
=
setTimeout
(
function
(){
loadDataByAjaxFromInput
(
url
);
},
250
);
});
$
(
'#excel'
).
click
(
function
(){
exportExcel
(
url1
);
// alert('hi');
});
changePagination
(
'0'
);
updateExportLink
();
});
function
exportExcel
(
url1
){
$
(
'#data-loading'
).
show
();
var
csrf_value
=
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
;
var
fByName
=
$
(
"#input-name"
).
val
();
//Ajax ve bieu do
$
.
ajax
({
type
:
"POST"
,
url
:
url1
,
data
:
{
csrf_name
:
csrf_value
,
fByName
:
fByName
},
dataType
:
"text"
,
cache
:
false
,
success
:
function
(
data
){
$
(
'#data-loading'
).
hide
();
changePagination
(
'0'
);
}
});
}
//Ham chung cho cac input
function
loadDataByAjaxFromInput
(
url
){
$
(
'#data-loading'
).
show
();
var
csrf_value
=
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
;
var
fByName
=
$
(
"#input-name"
).
val
();
//Ajax ve bieu do
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
{
csrf_name
:
csrf_value
,
fByName
:
fByName
},
dataType
:
"text"
,
cache
:
false
,
success
:
function
(
data
){
$
(
'#div-response'
).
html
(
data
);
$
(
'#data-loading'
).
hide
();
}
});
}
//Ham chung cho cac SelectBox
function
loadDataByAjaxFromSelectBox
(
id
,
url
){
$
(
'#'
+
id
).
change
(
function
(){
$
(
'#data-loading'
).
show
();
var
csrf_value
=
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
;
var
fByName
=
$
(
"#input-name"
).
val
();
//Ajax ve bieu do
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
{
csrf_name
:
csrf_value
,
fByName
:
fByName
},
dataType
:
"text"
,
cache
:
false
,
success
:
function
(
data
){
$
(
'#div-response'
).
html
(
data
);
$
(
'#data-loading'
).
hide
();
}
});
});
}
function
loadDataByAjaxDateRange
(
dtFrom
,
dtTo
,
url
){
$
(
'#data-loading'
).
show
();
var
csrf_value
=
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
;
var
fByName
=
$
(
"#input-name"
).
val
();
// ajax
//Ajax
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
...
...
@@ -168,7 +97,7 @@
var
csrf_value
=
'
<?php
echo
$this
->
security
->
get_csrf_hash
();
?>
'
;
var
url
=
'
<?php
echo
base_url
()
.
"backend/cmsRanking/listByMonthlyAjax"
;
?>
'
;
var
fByName
=
$
(
"#input-name"
).
val
();
//Ajax
ve bieu do\
//Ajax
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
...
...
@@ -186,4 +115,9 @@
});
}
function
updateExportLink
()
{
var
href
=
'
<?php
echo
base_url
(
"backend/cmsRanking/exportReport/month"
);
?>
/'
+
$
(
"#input-name"
).
val
();
$
(
'#btn-export'
).
attr
(
'href'
,
href
);
}
</script>
\ No newline at end of file
application/views/backend/cms_ranking/list_by_weekly_view.php
View file @
41baa4a7
...
...
@@ -22,7 +22,7 @@
<?php
endif
;
?>
<div
class=
"row"
>
<?php
echo
form_open
(
base_url
()
.
'backend/cmsRanking/listByWeeklyAjax'
);
?>
<?php
/*echo form_open(base_url().'backend/cmsRanking/listByWeeklyAjax'); */
?>
<div
class=
"col-lg-3"
>
<select
class=
"form-control"
name=
"input-name"
id=
"input-name"
>
<?php
...
...
@@ -36,9 +36,11 @@
</select>
</div>
<div
class=
"col-lg-1"
>
<button
class=
"btn btn-sm btn-default"
id=
"delete-filter"
>
Xóa bộ lọc
</button>
<a
href=
""
id=
"btn-export"
>
<button
class=
"btn btn-sm btn-warning"
><i
class=
"fa fa-download"
></i>
Export ra Excel
</button>
</a>
</div>
<?php
echo
form_close
();
?>
<?php
/*echo form_close(); */
?>
</div>
<!-- /.row -->
<div
class=
"space-6"
></div>
...
...
@@ -58,12 +60,16 @@
// Tìm kiếm theo cú pháp
var
oldTimeout2
=
''
;
$
(
'#input-name'
).
change
(
function
(){
updateExportLink
();
clearTimeout
(
oldTimeout2
);
oldTimeout2
=
setTimeout
(
function
(){
loadDataByAjaxFromInput
(
url
);
},
250
);
});
changePagination
(
'0'
);
updateExportLink
();
});
//Ham chung cho cac input
function
loadDataByAjaxFromInput
(
url
){
...
...
@@ -153,5 +159,10 @@
}
});
}
function
updateExportLink
()
{
var
href
=
'
<?php
echo
base_url
(
"backend/cmsRanking/exportReport/week"
);
?>
/'
+
$
(
"#input-name"
).
val
();
$
(
'#btn-export'
).
attr
(
'href'
,
href
);
}
</script>
\ No newline at end of file
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