Commit 3621cf57 by Phạm Văn Đoan

update báo sai sót BXH

parent a9c82018
......@@ -41,7 +41,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
*/
if ($_SERVER['SERVER_NAME'] == 'localhost') {
$config['base_url'] = 'http://localhost/vmusicchart-cms/';
$config['base_url'] = 'http://localhost:8089/vmusicchart-cms/';
} else {
$config['base_url'] = 'http://cms.vmusicchart.vn/';
}
......@@ -401,6 +401,8 @@ $config['csrf_exclude_uris'] = array(
'backend/cmsRanking/listByWeeklyAjax',
'backend/cmsRanking/listByMonthlyAjax',
'backend/cmsRanking/getTrackHistoryAjax',
'backend/cmsRanking/reportOverlappingAjax',
'backend/cmsRanking/getRankingByAjax',
'backend/cmsTrack/listTrackAjax',
'backend/cmsTrack/addTrack',
......@@ -417,6 +419,8 @@ $config['csrf_exclude_uris'] = array(
'backend/cmsSetting/logUserAjax',
'backend/cmsSetting/logActionAjax',
'backend/cmsSetting/overlapRankingAjax',
'account/updateMobileAjax',
'pageNotFound/[a-zA-Z0-9]+',
'api/apiGame/postUpdateGame',
......
......@@ -21,6 +21,7 @@ class CmsRanking extends CI_Controller
$this->load->model('report_views_daily_model');
$this->load->model('report_views_weekly_model');
$this->load->model('report_views_monthly_model');
$this->load->model('report_violation_model');
$this->load->model('crawler_listen_history_model');
$this->load->model('actionlog_model');
}
......@@ -379,4 +380,103 @@ class CmsRanking extends CI_Controller
$this->load->view('backend/ajax/cms_ranking/history_chart_view', $response);
}
/**
* Hàm lấy ds BXH để đổ vào select box
*/
public function getRankingByAjax()
{
$time = $this->input->post('time');
$scope = $this->input->post('scope');
//
$limit = 100;
$offset = 0;
switch ($scope) {
case 'DAILY':
$date = str_replace('/', '-', $time);
$data['ranking'] = $this->report_views_daily_model->cmsGetPagination($limit, $offset, $date);
break;
case 'WEEKLY':
$data['ranking'] = $this->report_views_weekly_model->cmsGetPagination($limit, $offset, $time);
break;
case 'MONTHLY':
$data['ranking'] = $this->report_views_monthly_model->cmsGetPagination($limit, $offset, $time);
break;
default:
$data['ranking'] = [];
}
$data['scope'] = $scope;
//
$this->load->view('backend/ajax/cms_ranking/ranking_selection_view', $data);
}
/**
* Hàm lưu báo cáo sai sót ở BXH
*/
public function reportOverlappingAjax()
{
$keep_ranking = $this->input->post('keep_ranking');
$keep_track_id = $this->input->post('keep_track_id');
$keep_track_title = $this->input->post('keep_track_title');
//
$delete_ranking = $this->input->post('delete_ranking');
$delete_track_id = $this->input->post('delete_track_id');
$delete_track_title = $this->input->post('delete_track_title');
//
$scope = $this->input->post('scope');
//
if ($delete_track_id > 0) {
$data_insert = [
'scope' => $scope,
'keep_ranking' => $keep_ranking,
'keep_track_id' => $keep_track_id,
'keep_track_title' => trim($keep_track_title),
'delete_ranking' => $delete_ranking,
'delete_track_id' => $delete_track_id,
'delete_track_title' => trim($delete_track_title),
'status' => 0,
'report_by' => $this->session->userdata('id'),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
];
$id = $this->report_violation_model->add($data_insert);
if ($id > 0) {
echo json_encode([
'code' => 200,
'message' => 'Thành công',
'data' => null
]);
} else {
echo json_encode([
'code' => 400,
'message' => 'Không thành công',
'data' => null
]);
}
} else {
echo json_encode([
'code' => 400,
'message' => 'Không thành công',
'data' => null
]);
}
}
/**
* Hàm xử lý trùng BXH
* @param $id
*/
public function processOverlapRanking($id)
{
$overlap = $this->report_violation_model->getById($id, 0);
if (isset($overlap[0])) {
print_r($overlap);
} else {
}
}
}
\ No newline at end of file
......@@ -1800,6 +1800,35 @@ class CmsSetting extends CI_Controller
redirect(base_url().'backend/cmsSetting/listSendEmail');
}
public function overlapRanking()
{
$this->_data['functionName'] = 'Xử lý trùng BXH';
$this->_data['action'] = __FUNCTION__;
$this->_data['titlePage'] = 'Xử lý trùng BXH';
$this->_data['loadPage'] = 'backend/cms_setting/ranking/overlap_ranking_view';
$this->load->view('backend/admin_template_view', $this->_data);
}
public function overlapRankingAjax()
{
$this->load->model('report_violation_model');
//
$data = array();
$fByName = $this->input->post('fByName');
$pageId = $this->input->post('pageId');
//
$pageId = ($pageId == 0) ? 1 : $pageId;
//
$limit = 15;
$offset = ($pageId - 1)*$limit;
$data['offset'] = ($pageId - 1)*$limit;
$totalRecord = $this->report_violation_model->cmsCountAll($fByName);
$data['pagination'] = MyHelper::genPaginationLink($totalRecord, $limit, $pageId);
$data['listData'] = $this->report_violation_model->cmsGetPagination($limit, $offset, $fByName);
//
$this->load->view('backend/ajax/cms_setting/overlap_ranking_view', $data);
}
......
......@@ -867,6 +867,21 @@ class MyHelper
return $ret;
}
/**
* Hàm tải view dạng partial
*
* @param $view_path
* @param null $tags
*
* @return mixed
*/
public static function loadView($view_path, $tags = null)
{
$CI = & get_instance();
$CI->data['tags'] = $tags;
return $CI->load->view($view_path, $CI->data);
}
}
/* End */
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Report_violation_model extends CI_Model
{
protected $_table='report_violations';
public function __construct(){
parent::__construct();
date_default_timezone_set("Asia/Ho_Chi_Minh");
}
public function add($dataInsert)
{
$this->db->insert($this->_table, $dataInsert);
$insert_id = $this->db->insert_id();
return $insert_id;
}
public function getById($id, $status=0){
$this->db->select($this->_table.'.*');
$this->db->from($this->_table);
$this->db->where($this->_table.'.id', $id);
$this->db->where($this->_table.'.status', $status);
$query = $this->db->get();
return $query->result_array();
}
public function cmsCountAll($name = null)
{
$this->db->select('COUNT(*) AS totalResults');
$this->db->from($this->_table);
if ($name != null) {
$this->db->where('date', date('Y-m-d', strtotime($name)));
}
$query = $this->db->get();
$result = $query->result_array();
if ($result) {
return $result[0]['totalResults'];
} else {
return 0;
}
}
/**
* Hàm lấy dữ liệu phân trang
*
* @param $record
* @param $start
* @param null $name
*
* @return mixed
*/
public function cmsGetPagination($record, $start, $name = null)
{
$this->db->select($this->_table . '.*');
$this->db->from($this->_table);
$this->db->order_by($this->_table . '.created_at', 'desc');
$this->db->limit($record, $start);
$query = $this->db->get();
return $query->result_array();
}
}
\ No newline at end of file
......@@ -271,6 +271,13 @@ $action = $CI->router->fetch_method();
<b class="arrow"></b>
</li>
<li class="<?php if($action && $action == 'overlapRanking') echo 'active'?>">
<a href="<?php echo base_url().'backend/cmsSetting/overlapRanking'; ?>">
<i class="menu-icon fa fa-caret-right"></i>Xử lý trùng BXH
</a>
<b class="arrow"></b>
</li>
<li class="<?php if($action && $action == 'logUser') echo 'active'?>">
<a href="<?php echo base_url().'backend/cmsSetting/logUser'; ?>">
<i class="menu-icon fa fa-caret-right"></i>Log nhập, xuất
......
<?php if(is_array($ranking) && count($ranking) > 0): ?>
<option value="-1" ranking="-1">- Chọn -</option>
<?php foreach ($ranking as $item): $ranking = isset($item['ranking']) ? $item['ranking'] : $item['order']; ?>
<option value="<?php echo $item['track_id']; ?>" ranking="<?php echo $item['ranking'] ?>">
<?php echo $ranking . '. ' . $item['name_song'] . ' (ID= '.$item['track_id'].')'; ?>
</option>
<?php endforeach; ?>
<?php else: ?>
<option value="-1" ranking="-1">- Chọn -</option>
<?php endif; ?>
<div>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th style="text-align: center">STT</th>
<th style="text-align: center">Nguồn BXH</th>
<th style="text-align: center">Ranking - Bài hát đúng - ID</th>
<th style="text-align: center">Ranking - Bài hát trùng / muốn gỡ bỏ - ID</th>
<th style="text-align: center">Trạng thái</th>
<th style="text-align: center">Xử lý</th>
</tr>
</thead>
<tbody>
<?php if(count($listData) > 0): foreach($listData as $key => $data): ?>
<tr>
<td style="text-align: center"><?php echo ($key+1+$offset); ?></td>
<td style="text-align: center"><?php echo $data['scope']; ?></td>
<td style="text-align: left">
<?php echo $data['keep_track_title']; ?>
</td>
<td style="text-align: left">
<?php echo $data['delete_track_title']; ?>
</td>
<td>
<?php echo (($data['status'] == 1) ? 'Đã xử lý' : 'Chờ xử lý') ?>
</td>
<td>
<?php if($data['status'] == 0): ?>
<a href="<?php echo base_url('backend/cmsRanking/processOverlapRanking/'.$data['id']); ?>" title="Xử lý xóa trùng">
<i class="ace-icon fa fa-trash bigger-130 color-red"></i>
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="11" style="color: red; font-style: italic">Không có dữ liệu nào!</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<!-- /.row -->
<div style="text-align: center;"><?php echo $pagination; ?></div>
\ No newline at end of file
<?php if($this->session->flashdata('success')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-check green"></i>
<?php echo $this->session->flashdata('success'); ?>
</div>
</div>
<?php endif; ?>
<?php if($this->session->flashdata('error')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?>
</div>
</div>
<?php endif; ?>
\ No newline at end of file
<?php if($this->session->flashdata('success')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-check green"></i>
<?php echo $this->session->flashdata('success'); ?>
</div>
</div>
<?php endif; ?>
<?php if($this->session->flashdata('error')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?>
</div>
</div>
<?php endif; ?>
<!-- Thông báo lỗi -->
<?php MyHelper::loadView('backend/cms_partials/error_message_view') ?>
<div class="row">
<div class="col-lg-3">
<div class="input-group text-center">
......@@ -31,9 +10,6 @@
</span>
</div>
</div>
<!--<div class="col-lg-1">
<button class="btn btn-sm btn-default" id="delete-filter">Xóa bộ lọc</button>
</div>-->
<div class="col-lg-1">
<a href="" id="btn-export">
<button class="btn btn-sm btn-warning"><i class="fa fa-download"></i> Export ra Excel</button>
......@@ -46,32 +22,18 @@
<div style="text-align: center" id="data-loading">
<i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu...
</div>
<div class="col-md-12">
<span style="color: red"><i>Lưu ý: BXH ngày có từ 30/03/2020</i></span>
</div>
<?php MyHelper::loadView(
'backend/cms_ranking/partials/title_report_violation',
'Lưu ý: BXH ngày có từ 30/03/2020'
)?>
<div class="col-lg-12">
<div id="div-response"></div>
</div>
</div>
<!-- modal -->
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="modal-track-chart">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="padding: 10px !important;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Lịch sử lượt nghe bài: <span id="track_title" style="color: red;"></span></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" id="div-history-chart"></div>
</div>
</div>
<!--<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Đóng</button>
</div>-->
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- modal lịch sử lượt nghe -->
<?php MyHelper::loadView('backend/cms_ranking/partials/history_chart_modal')?>
<!-- modal báo cáo trùng bài hát -->
<?php MyHelper::loadView('backend/cms_ranking/partials/report_violation_modal')?>
<script type="text/javascript">
//Thuc hien viec ve bieu do$data
$(document).ready(function() {
......@@ -176,4 +138,6 @@
}
});
}
</script>
\ No newline at end of file
</script>
<!-- tải js xử lý cáo báo sai sót -->
<?php MyHelper::loadView('backend/cms_ranking/partials/js_process_report', 'DAILY')?>
\ No newline at end of file
<?php if($this->session->flashdata('success')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-check green"></i>
<?php echo $this->session->flashdata('success'); ?>
</div>
</div>
<?php endif; ?>
<?php if($this->session->flashdata('error')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?>
</div>
</div>
<?php endif; ?>
<!-- Thông báo lỗi -->
<?php MyHelper::loadView('backend/cms_partials/error_message_view') ?>
<div class="row">
<div class="col-lg-4">
<select class="form-control" name="input-name" id="input-name">
<select class="form-control" name="input-date-picker" id="input-date-picker">
<?php foreach ($month_list as $key => $val): ?>
<option value = "<?php echo $key; ?>"><?php echo $val; ?></option>
<?php endforeach; ?>
......@@ -41,14 +20,16 @@
<div style="text-align: center" id="data-loading">
<i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu...
</div>
<div class="col-md-12">
<span style="color: red"><i>Lưu ý: BXH từ tháng 04/2020 sử dụng dữ liệu mới (Dữ liệu mới có từ ngày 30/3/2020)</i></span>
</div>
<?php MyHelper::loadView(
'backend/cms_ranking/partials/title_report_violation',
'Lưu ý: BXH từ tháng 04/2020 sử dụng dữ liệu mới'
)?>
<div class="col-lg-12">
<div id="div-response"></div>
</div>
</div>
<!-- modal báo cáo trùng bài hát -->
<?php MyHelper::loadView('backend/cms_ranking/partials/report_violation_modal')?>
<script type="text/javascript">
//Thuc hien viec ve bieu do$data
$(document).ready(function() {
......@@ -56,7 +37,7 @@
// Tìm kiếm theo cú pháp
var oldTimeout2 = '';
$('#input-name').change(function(){
$('#input-date-picker').change(function(){
updateExportLink();
clearTimeout(oldTimeout2);
oldTimeout2 = setTimeout(function(){
......@@ -72,7 +53,7 @@
function loadDataByAjaxFromInput(url){
$('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val();
var fByName = $("#input-date-picker").val();
//Ajax
$.ajax({
type: "POST",
......@@ -94,7 +75,7 @@
$('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var url = '<?php echo base_url()."backend/cmsRanking/listByMonthlyAjax"; ?>';
var fByName = $("#input-name").val();
var fByName = $("#input-date-picker").val();
//Ajax
$.ajax({
type: "POST",
......@@ -114,8 +95,10 @@
}
function updateExportLink() {
var href = '<?php echo base_url("backend/cmsRanking/exportReport/monthly"); ?>/' + $("#input-name").val();
var href = '<?php echo base_url("backend/cmsRanking/exportReport/monthly"); ?>/' + $("#input-date-picker").val();
$('#btn-export').attr('href', href);
}
</script>
\ No newline at end of file
</script>
<!-- tải js xử lý cáo báo sai sót -->
<?php MyHelper::loadView('backend/cms_ranking/partials/js_process_report', 'MONTHLY')?>
\ No newline at end of file
<?php if($this->session->flashdata('success')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-check green"></i>
<?php echo $this->session->flashdata('success'); ?>
</div>
</div>
<?php endif; ?>
<?php if($this->session->flashdata('error')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?>
</div>
</div>
<?php endif; ?>
<!-- Thông báo lỗi -->
<?php MyHelper::loadView('backend/cms_partials/error_message_view') ?>
<div class="row">
<div class="col-lg-4">
<select class="form-control" name="input-name" id="input-name">
<select class="form-control" name="input-date-picker" id="input-date-picker">
<?php foreach ($week_list as $key => $week): ?>
<option value = "<?php echo $key; ?>"><?php echo $week; ?></option>
<?php endforeach; ?>
......@@ -41,21 +20,23 @@
<div style="text-align: center" id="data-loading">
<i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu...
</div>
<div class="col-md-12">
<span style="color: red"><i>Lưu ý: BXH từ tuần 14/2020 sử dụng dữ liệu mới</i></span>
</div>
<?php MyHelper::loadView(
'backend/cms_ranking/partials/title_report_violation',
'Lưu ý: BXH từ tuần 14/2020 sử dụng dữ liệu mới'
)?>
<div class="col-lg-12">
<div id="div-response"></div>
</div>
</div>
<!-- modal báo cáo trùng bài hát -->
<?php MyHelper::loadView('backend/cms_ranking/partials/report_violation_modal')?>
<script type="text/javascript">
//Thuc hien viec ve bieu do$data
$(document).ready(function() {
var url = '<?php echo base_url("backend/cmsRanking/listByWeeklyAjax"); ?>';
// Tìm kiếm theo cú pháp
var oldTimeout2 = '';
$('#input-name').change(function(){
$('#input-date-picker').change(function(){
updateExportLink();
clearTimeout(oldTimeout2);
oldTimeout2 = setTimeout(function(){
......@@ -71,7 +52,7 @@
function loadDataByAjaxFromInput(url){
$('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val();
var fByName = $("#input-date-picker").val();
//Ajax ve bieu do
$.ajax({
type: "POST",
......@@ -93,7 +74,7 @@
$('#'+id).change(function(){
$('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val();
var fByName = $("#input-date-picker").val();
//Ajax ve bieu do
$.ajax({
type: "POST",
......@@ -115,7 +96,7 @@
function loadDataByAjaxDateRange(dtFrom, dtTo, url){
$('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-name").val();
var fByName = $("#input-date-picker").val();
// ajax
$.ajax({
type: "POST",
......@@ -137,7 +118,7 @@
$('#data-loading').show();
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var url = '<?php echo base_url()."backend/cmsRanking/listByWeeklyAjax"; ?>';
var fByName = $("#input-name").val();
var fByName = $("#input-date-picker").val();
//Ajax ve bieu do\
$.ajax({
type: "POST",
......@@ -157,8 +138,10 @@
}
function updateExportLink() {
var href = '<?php echo base_url("backend/cmsRanking/exportReport/weekly"); ?>/' + $("#input-name").val();
var href = '<?php echo base_url("backend/cmsRanking/exportReport/weekly"); ?>/' + $("#input-date-picker").val();
$('#btn-export').attr('href', href);
}
</script>
\ No newline at end of file
</script>
<!-- tải js xử lý cáo báo sai sót -->
<?php MyHelper::loadView('backend/cms_ranking/partials/js_process_report', 'WEEKLY')?>
\ No newline at end of file
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="modal-track-chart">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header" style="padding: 10px !important;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Lịch sử lượt nghe bài: <span id="track_title" style="color: red;"></span></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" id="div-history-chart"></div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<script type="text/javascript">
$(document).ready(function() {
// Lấy thông tin bài hát
$("#ranking_true").change(function(){
$('#keep_ranking').val($('#ranking_true option:selected').attr('ranking'));
$('#keep_track_title').val($('#ranking_true option:selected').text());
});
$("#ranking_false").change(function(){
$('#delete_ranking').val($('#ranking_false option:selected').attr('ranking'));
$('#delete_track_title').val($('#ranking_false option:selected').text());
});
});
// Hàm lấy ds BXH và hiển thị modal báo cáo sai sót
function showReportModal() {
$('#data-loading').show();
var time = ($("#input-date-picker").val()) ? $("#input-date-picker").val() : null;
$.ajax({
type: "POST",
url: '<?php echo base_url("backend/cmsRanking/getRankingByAjax"); ?>',
data: {
csrf_name: '<?php echo $this->security->get_csrf_hash(); ?>',
time: time,
scope: '<?php echo (isset($tags) ? $tags : 'DAILY')?>'
},
dataType: "HTML",
cache: false,
success: function(data) {
$('#ranking_at').html(time);
$('#ranking_true').html(data);
$('#ranking_false').html(data);
//
$('#data-loading').hide();
$('#modal-overlapping-ranking').modal('show');
},
error: function () {
$('#data-loading').hide();
}
});
}
// Hàm gửi data báo cáo sai sót
function sendReportOverlapping() {
var keep_ranking = $('#keep_ranking').val();
var keep_track_id = $('#ranking_true').val();
var keep_track_title = $('#keep_track_title').val();
//
var delete_ranking = $('#delete_ranking').val();
var delete_track_id = $('#ranking_false').val();
var delete_track_title = $('#delete_track_title').val();
//
if (parseInt(delete_track_id) > 0) {
if (parseInt(keep_track_id) != parseInt(delete_track_id)) {
$.ajax({
type: "POST",
url: '<?php echo base_url("backend/cmsRanking/reportOverlappingAjax"); ?>',
data: {
csrf_name: '<?php echo $this->security->get_csrf_hash(); ?>',
fByName: ($("#input-date-picker").val()) ? $("#input-date-picker").val() : null,
keep_ranking: keep_ranking,
keep_track_id: keep_track_id,
keep_track_title: (keep_track_title) ? keep_track_title.trim() : keep_track_title,
delete_ranking: delete_ranking,
delete_track_id: delete_track_id,
delete_track_title: (delete_track_title) ? delete_track_title.trim() : delete_track_title,
scope: '<?php echo (isset($tags) ? $tags : 'DAILY')?>'
},
dataType: "JSON",
cache: false,
success: function(data) {
$('#modal-overlapping-ranking').modal('hide');
if (data.code == 200) {
//
} else {}
},
error: function () {}
});
} else {
alert('Hai bài hát phải khác nhau!')
}
} else {
alert('Bạn vui lòng, chọn bài hát muốn gỡ bỏ khỏi BXH!');
}
}
</script>
\ No newline at end of file
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="modal-overlapping-ranking">
<div class="modal-dialog" role="document">
<div class="modal-content" style="width: 500px; margin: auto">
<div class="modal-header" style="padding: 10px !important;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Báo cáo trùng bài hát</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>BXH: <span id="ranking_at" style="color: red"></span></label>
<input type="hidden" id="keep_ranking" value="">
<input type="hidden" id="delete_ranking" value="">
<input type="hidden" id="keep_track_title" value="">
<input type="hidden" id="delete_track_title" value="">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label>Bài hát đúng</label>
<select id='ranking_true' name="ranking_true"
class="chosen-select form-control" data-placeholder="Choose a State...">
<option value="-1" ranking="-1">- Chọn -</option>
</select>
</div>
</div>
<div class="col-md-12" style="margin-top: 10px">
<div class="form-group">
<label>Bài hát trùng hoặc muốn gỡ khỏi BXH</label>
<select id='ranking_false' name="ranking_false"
class="chosen-select form-control" data-placeholder="Choose a State...">
<option value="-1" ranking="-1">- Chọn -</option>
</select>
</div>
</div>
<div class="col-md-12 text-center" style="margin-top: 15px">
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal" style="width: 100px">Hủy bỏ</button>
<button type="button" class="btn btn-sm btn-danger" style="width: 100px" onclick="sendReportOverlapping()">Gửi báo cáo</button>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="col-md-6">
<span style="color: red"><i><?php echo (isset($tags) ? $tags : '')?></i></span>
</div>
<div class="col-lg-6 text-right">
<span>
<i class="fa fa-warning color-yellow"></i>&nbsp;Báo trùng bài hoặc muốn gỡ bỏ khỏi BXH
<a href="javascript:void(0)" title="Click để báo cáo trùng bài hát"
onclick="showReportModal()" class="color-red">TẠI ĐÂY
</a>
</span>
</div>
\ No newline at end of file
<?php if($this->session->flashdata('success')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-check green"></i>
<?php echo $this->session->flashdata('success'); ?>
</div>
</div>
<?php endif; ?>
<?php if($this->session->flashdata('error')): ?>
<div class="row">
<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>
</button>
<i class="ace-icon fa fa-times"></i>
<?php echo $this->session->flashdata('error'); ?>
</div>
</div>
<?php endif; ?>
<div class="row" >
<div style="text-align: center" id="data-loading">
<i class="fa fa-refresh fa-spin bigger-200"></i> Đang tải dữ liệu...
</div>
<div class="col-md-6">
<span style="color: red"><i>Lưu ý: BXH ngày có từ 30/03/2020</i></span>
</div>
<div class="col-lg-12">
<div id="div-response"></div>
</div>
</div>
<script type="text/javascript">
//Thuc hien viec ve bieu do$data
$(document).ready(function() {
var url = '<?php echo base_url("backend/cmsSetting/overlapRankingAjax"); ?>';
// Tìm kiếm theo cú pháp
var oldTimeout2 = '';
$('#input-date-picker').change(function(){
clearTimeout(oldTimeout2);
oldTimeout2 = setTimeout(function(){
//loadDataByAjaxFromInput(url);
}, 250);
});
// Xóa bộ lọc
$('#delete-filter').click(function(){
$("#input-date-picker").val('<?php echo date('d/m/Y', time()-86400)?>');
changePagination('0');
return false;
});
changePagination('0');
});
function changePagination(pageId) {
$('#data-loading').show();
var url = '<?php echo base_url("backend/cmsSetting/overlapRankingAjax"); ?>';
callAjax(pageId, url);
}
function callAjax(pageId, url) {
var csrf_value = '<?php echo $this->security->get_csrf_hash(); ?>';
var fByName = $("#input-date-picker").val();
var dataReq = {
csrf_name: csrf_value,
fByName: fByName,
pageId: pageId
};
//Ajax
$.ajax({
type: "POST",
url: url,
data: dataReq,
dataType: "text",
cache: false,
success: function(data) {
$('#div-response').html(data);
$('#data-loading').hide();
}
});
}
</script>
\ 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