Fix: search button
This commit is contained in:
@@ -2,13 +2,11 @@
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
/*
|
||||
$("#entercode").keydown(function(key) {
|
||||
$("#player_name_list").keydown(function(key) {
|
||||
if(key.keyCode == 13) {
|
||||
editPassword();
|
||||
requestPlayerRecordListAll();
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
initDatePicker();
|
||||
loadAppList();
|
||||
@@ -36,52 +34,38 @@ function initDatePicker() {
|
||||
|
||||
function setDatePickersForWeeks(weeks) {
|
||||
var today = new Date();
|
||||
var tyyyy = today.getFullYear();
|
||||
var tmm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var tdd = String(today.getDate()).padStart(2, '0');
|
||||
updateDatePickerIn("#end_datepicker", today);;
|
||||
|
||||
var startDay = new Date();
|
||||
startDay.setDate(startDay.getDate() - 7 * weeks);
|
||||
var syyyy = startDay.getFullYear();
|
||||
var smm = String(startDay.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var sdd = String(startDay.getDate()).padStart(2, '0');
|
||||
|
||||
$('#start_datepicker').datepicker('update', syyyy + "-" + smm + "-" + sdd);
|
||||
$('#end_datepicker').datepicker('update', tyyyy + "-" + tmm + "-" + tdd);
|
||||
updateDatePickerIn("#start_datepicker", startDay);;
|
||||
}
|
||||
|
||||
function setDatePickersForMonths(months) {
|
||||
var today = new Date();
|
||||
var tyyyy = today.getFullYear();
|
||||
var tmm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var tdd = String(today.getDate()).padStart(2, '0');
|
||||
updateDatePickerIn("#end_datepicker", today);;
|
||||
|
||||
var startDay = new Date();
|
||||
startDay.setMonth(startDay.getMonth() - months);
|
||||
var syyyy = startDay.getFullYear();
|
||||
var smm = String(startDay.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var sdd = String(startDay.getDate()).padStart(2, '0');
|
||||
|
||||
$('#start_datepicker').datepicker('update', syyyy + "-" + smm + "-" + sdd);
|
||||
$('#end_datepicker').datepicker('update', tyyyy + "-" + tmm + "-" + tdd);
|
||||
updateDatePickerIn("#start_datepicker", startDay);;
|
||||
}
|
||||
|
||||
function setDatePickersForYears(years) {
|
||||
var today = new Date();
|
||||
var tyyyy = today.getFullYear();
|
||||
var tmm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var tdd = String(today.getDate()).padStart(2, '0');
|
||||
updateDatePickerIn("#end_datepicker", today);;
|
||||
|
||||
var startDay = new Date();
|
||||
startDay.setFullYear(startDay.getFullYear() - years);
|
||||
var syyyy = startDay.getFullYear();
|
||||
var smm = String(startDay.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var sdd = String(startDay.getDate()).padStart(2, '0');
|
||||
|
||||
$('#start_datepicker').datepicker('update', syyyy + "-" + smm + "-" + sdd);
|
||||
$('#end_datepicker').datepicker('update', tyyyy + "-" + tmm + "-" + tdd);
|
||||
updateDatePickerIn("#start_datepicker", startDay);;
|
||||
}
|
||||
|
||||
function updateDatePickerIn(inputID, date) {
|
||||
var yyyy = date.getFullYear();
|
||||
var mm = String(date.getMonth() + 1).padStart(2, '0'); //January is 0!
|
||||
var dd = String(date.getDate()).padStart(2, '0');
|
||||
|
||||
$(inputID).datepicker('update', yyyy + "-" + mm + "-" + dd);
|
||||
}
|
||||
|
||||
|
||||
function copyToClipboard() {
|
||||
@@ -286,9 +270,7 @@ function showRecordCount(jsonData) {
|
||||
$("#record_count").empty();
|
||||
|
||||
var count = jsonData["RecordList"].length;
|
||||
$("#record_count").append(
|
||||
'<span class="text-info">표시 : ' + count + '개 / 총 : ' + count + '개</span>'
|
||||
);
|
||||
$("#record_count").append('총 ' + count + '개 검색');
|
||||
|
||||
}
|
||||
|
||||
@@ -318,11 +300,11 @@ function showNoResultContent() {
|
||||
function addRecordListItem($date, $time, $name, $subject, $record) {
|
||||
$("#record_table_content").append('\
|
||||
<tr>\
|
||||
<th scope="row">' + $date + '</th>\
|
||||
<td>' + $time + '</td>\
|
||||
<td>' + $name + '</td>\
|
||||
<td>' + $subject + '</td>\
|
||||
<td>' + $record + '</td>\
|
||||
<th scope="row" class="text-center">' + $date + '</th>\
|
||||
<td class="text-center">' + $time + '</td>\
|
||||
<td class="text-center">' + $name + '</td>\
|
||||
<td class="text-center">' + $subject + '</td>\
|
||||
<td class="text-right">' + $record + '</td>\
|
||||
</tr>\
|
||||
');
|
||||
}
|
||||
@@ -445,7 +427,7 @@ function addRecordListItem($date, $time, $name, $subject, $record) {
|
||||
<br/>
|
||||
|
||||
<!-- <button type="button" class="btn btn-primary" onClick="requestPlayerRecordList();">검색 (50개까지 보기)</button> -->
|
||||
<button type="button" id="search_all" class="btn btn-primary" onClick="requestPlayerRecordListAll();">검색 실행</button>
|
||||
<button type="button" id="search_all" class="btn btn-primary col-sm-3" onClick="requestPlayerRecordListAll();">검색 실행</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -457,11 +439,14 @@ function addRecordListItem($date, $time, $name, $subject, $record) {
|
||||
|
||||
<div class="row justify-content-between mb-2">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-primary" onClick="copyToClipboard();">표 내용을 클립보드에 복사</button>
|
||||
<button type="button" class="btn btn-primary" onClick="copyToClipboard();">
|
||||
<span class="oi oi-clipboard" title="icon clipboard" aria-hidden="true"></span>
|
||||
표 내용을 클립보드에 복사
|
||||
</button>
|
||||
<span class="badge badge-pill badge-info" onClick='showModal("recordPopupModal", "recordPopupContent", "search_record_copy_result_to_clipboard");' style="cursor: pointer;">?</span>
|
||||
</div>
|
||||
<div id="record_count" class="col-auto">
|
||||
<span>표시 : 0개 / 총 : 0개</span>
|
||||
<div class="col-auto">
|
||||
<span id="record_count" class="text-info"></span>
|
||||
<!-- <button type="button" class="btn btn-primary" disabled>표 내용을 엑셀 파일로 다운로드</button> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -469,21 +454,17 @@ function addRecordListItem($date, $time, $name, $subject, $record) {
|
||||
<table class="table table-striped" id="dataTable">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">날짜</th>
|
||||
<th scope="col">시간</th>
|
||||
<th scope="col">이름</th>
|
||||
<th scope="col">과목</th>
|
||||
<th scope="col">점수</th>
|
||||
<th scope="col" class="text-center">날짜</th>
|
||||
<th scope="col" class="text-center">시간</th>
|
||||
<th scope="col" class="text-center">이름</th>
|
||||
<th scope="col" class="text-center">과목</th>
|
||||
<th scope="col" class="text-center">점수</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="record_table_content">
|
||||
|
||||
<tr>
|
||||
<th scope="row">2019-03-27</th>
|
||||
<td>17:30</td>
|
||||
<td>박지상</td>
|
||||
<td>한글 타자 연습</td>
|
||||
<td>574</td>
|
||||
<th scope="row" class="table-warning text-center" colspan="5">데이터가 없습니다.</th>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
@@ -28,7 +28,6 @@ $subject_statement = makeSubjectSentence($app_id);
|
||||
// echo "subject : ".$subject_statement."\n";
|
||||
$where_statement = make_where_statement($date_statement, $player_name_statement, $subject_statement);
|
||||
|
||||
$recordCount = get_player_record_count($maestro_id, $where_statement, $limit_count);
|
||||
$recordTotalCount = get_player_record_total_count($maestro_id, $where_statement);
|
||||
$replyJSON = get_player_record_list($maestro_id, $where_statement, $limit_count);
|
||||
if($replyJSON.length === 0) {
|
||||
@@ -37,7 +36,7 @@ if($replyJSON.length === 0) {
|
||||
exit;
|
||||
}
|
||||
|
||||
set_data("RecordCount", $recordCount);
|
||||
set_data("RecordTotalCount", $recordTotalCount);
|
||||
set_data("RecordList", $replyJSON);
|
||||
send_result_success();
|
||||
exit;
|
||||
@@ -113,6 +112,7 @@ function make_where_statement($date_statement, $player_name_statement, $subject_
|
||||
return $where_statement;
|
||||
}
|
||||
|
||||
/*
|
||||
function get_player_record_count($maestro_id, $where_statement, $limit_count) {
|
||||
global $db_conn;
|
||||
|
||||
@@ -137,6 +137,7 @@ function get_player_record_count($maestro_id, $where_statement, $limit_count) {
|
||||
|
||||
return $record_count;
|
||||
}
|
||||
*/
|
||||
|
||||
function get_player_record_total_count($maestro_id, $where_statement) {
|
||||
global $db_conn;
|
||||
@@ -168,7 +169,7 @@ function get_player_record_list($maestro_id, $where_statement, $limit_count) {
|
||||
P.Name AS Name, A.KoreanName AS Subject, BR.BestRecord AS Record
|
||||
FROM best_record BR, player P, App A
|
||||
WHERE BR.MaestroID = ? AND ".$where_statement."
|
||||
ORDER BY BR.RecordDateTime ASC
|
||||
ORDER BY BR.RecordDateTime DESC
|
||||
";
|
||||
|
||||
if($limit_count > 0)
|
||||
|
||||
@@ -28,7 +28,6 @@ $subject_statement = makeSubjectSentence($app_id);
|
||||
// echo "subject : ".$subject_statement."\n";
|
||||
$where_statement = make_where_statement($date_statement, $player_name_statement, $subject_statement);
|
||||
|
||||
$recordCount = get_player_record_count($maestro_id, $where_statement, $limit_count);
|
||||
$recordTotalCount = get_player_record_total_count($maestro_id, $where_statement);
|
||||
$replyJSON = get_player_record_list($maestro_id, $where_statement, $limit_count);
|
||||
if($replyJSON.length === 0) {
|
||||
@@ -37,7 +36,7 @@ if($replyJSON.length === 0) {
|
||||
exit;
|
||||
}
|
||||
|
||||
set_data("RecordCount", $recordCount);
|
||||
set_data("RecordTotalCount", $recordTotalCount);
|
||||
set_data("RecordList", $replyJSON);
|
||||
send_result_success();
|
||||
exit;
|
||||
@@ -115,6 +114,7 @@ function make_where_statement($date_statement, $player_name_statement, $subject_
|
||||
return $where_statement;
|
||||
}
|
||||
|
||||
/*
|
||||
function get_player_record_count($maestro_id, $where_statement, $limit_count) {
|
||||
global $db_conn;
|
||||
|
||||
@@ -139,6 +139,7 @@ function get_player_record_count($maestro_id, $where_statement, $limit_count) {
|
||||
|
||||
return $record_count;
|
||||
}
|
||||
*/
|
||||
|
||||
function get_player_record_total_count($maestro_id, $where_statement) {
|
||||
global $db_conn;
|
||||
@@ -170,7 +171,7 @@ function get_player_record_list($maestro_id, $where_statement, $limit_count) {
|
||||
P.Name AS Name, LS.SubjectName AS Subject, LS.Score AS Record
|
||||
FROM license_score LS, player P
|
||||
WHERE LS.MaestroID = ? AND ".$where_statement."
|
||||
ORDER BY LS.ScoreDateTime ASC
|
||||
ORDER BY LS.ScoreDateTime DESC
|
||||
";
|
||||
|
||||
if($limit_count > 0)
|
||||
|
||||
Reference in New Issue
Block a user