kopia lustrzana https://github.com/magicbug/Cloudlog
Merge pull request #2890 from int2001/contestb4
Added time of "Worked before" in Contest-Sectionpull/2892/head
commit
695e86ddcb
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue