Merge pull request #2890 from int2001/contestb4

Added time of "Worked before" in Contest-Section
pull/2892/head
Andreas Kristiansen 2023-12-31 12:20:17 +01:00 zatwierdzone przez GitHub
commit 695e86ddcb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -189,7 +189,10 @@ class Contesting extends CI_Controller {
header('Content-Type: application/json');
if ($result && $result->num_rows()) {
echo json_encode(array('message' => 'Worked before'));
$timeb4=substr($result->row()->b4,0,5);
$custom_date_format = $this->session->userdata('user_date_format');
$abstimeb4=date($custom_date_format, strtotime($result->row()->COL_TIME_OFF)).' '.date('H:i',strtotime($result->row()->COL_TIME_OFF));
echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before'));
}
return;
}

Wyświetl plik

@ -219,7 +219,8 @@ class Contesting_model extends CI_Model {
$date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]);
$date = $date->format('Y-m-d H:i:s');
$this->db->select('timediff(UTC_TIMESTAMP(),col_time_off) b4, COL_TIME_OFF');
$this->db->where('STATION_ID', $station_id);
$this->db->where('COL_CALL', xss_clean($call));
$this->db->where("COL_BAND", xss_clean($band));
@ -229,6 +230,7 @@ class Contesting_model extends CI_Model {
$this->db->where("COL_MODE", xss_clean($mode));
$this->db->or_where("COL_SUBMODE", xss_clean($mode));
$this->db->group_end();
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "DESC");
$query = $this->db->get($this->config->item('table_name'));
return $query;

Wyświetl plik

@ -241,8 +241,8 @@ function checkIfWorkedBefore() {
'contest': $("#contestname").val()
},
success: function (result) {
if (result.message == 'Worked before') {
$('#callsign_info').text("Worked before!");
if (result.message.substr(0,6) == 'Worked') {
$('#callsign_info').text(result.message);
}
}
});