started the barebones to add realtime clublog uploading

pull/373/head
Peter Goodhall 2019-10-12 23:10:22 +01:00
rodzic fc6bc4f8a7
commit ffa1e12048
2 zmienionych plików z 36 dodań i 0 usunięć

Wyświetl plik

@ -137,6 +137,31 @@ class Clublog extends CI_Controller {
$this->clublog_model->mark_all_qsos_notsent($clean_station_id);
}
function realtime() {
$this->load->model('stations');
$this->load->model('clublog_model');
$station_profiles = $this->stations->all_with_count();
// if station profiles exist
if($station_profiles->num_rows()){
// Loop through station profiles
foreach ($station_profiles->result() as $station_row)
{
// if the station profile has more than 1 qso
if($station_row->qso_total > 0) {
$qsos = $this->clublog_model->get_last_five($station_row->station_id);
foreach ($qsos->result() as $qso)
{
print_r($qso);
}
}
}
}
}
// Find DXCC
function find_dxcc($callsign) {
$clean_callsign = $this->security->xss_clean($callsign);

Wyświetl plik

@ -27,6 +27,17 @@ class Clublog_model extends CI_Model {
$this->db->update($this->config->item('table_name'), $data);
}
function get_last_five($station_id) {
$this->db->where('station_id', $station_id);
$this->db->where("COL_CLUBLOG_QSO_UPLOAD_STATUS", null);
$this->db->or_where("COL_CLUBLOG_QSO_UPLOAD_STATUS", "");
$this->db->or_where("COL_CLUBLOG_QSO_UPLOAD_STATUS", "N");
$this->db->limit(5);
$query = $this->db->get($this->config->item('table_name'));
return $query;
}
function mark_all_qsos_notsent($station_id) {
$data = array(
'COL_CLUBLOG_QSO_UPLOAD_DATE' => null,