Removed unused functions at Dashboard / Secured webadif

这个提交包含在:
int2001 2023-07-31 05:34:44 +00:00
父节点 ef65d6a7c4
当前提交 8e5dacea01
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B
共有 2 个文件被更改,包括 34 次插入86 次删除

查看文件

@ -212,42 +212,4 @@ class Dashboard extends CI_Controller {
} }
function todays_map() {
$this->load->library('qra');
$this->load->model('logbook_model');
// TODO: Auth
$qsos = $this->logbook_model->get_todays_qsos('');
echo "{\"markers\": [";
foreach ($qsos->result() as $row) {
//print_r($row);
if($row->COL_GRIDSQUARE != null) {
$stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE);
echo "{\"point\":new GLatLng(".$stn_loc[0].",".$stn_loc[1]."), \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
echo "\",\"label\":\"".$row->COL_CALL."\"},";
} else {
$query = $this->db->query('
SELECT *
FROM dxcc_entities
WHERE prefix = SUBSTRING( \''.$row->COL_CALL.'\', 1, LENGTH( prefix ) )
ORDER BY LENGTH( prefix ) DESC
LIMIT 1
');
foreach ($query->result() as $dxcc) {
echo "{\"point\":new GLatLng(".$dxcc->lat.",".$dxcc->long."), \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />Band: ".$row->COL_BAND."<br />Mode: ";
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
echo "\",\"label\":\"".$row->COL_CALL."\"},";
}
}
}
echo "]";
echo "}";
} }
}

查看文件

@ -1500,45 +1500,50 @@ class Logbook_model extends CI_Model {
/* /*
* Function returns the QSOs from the logbook, which have not been either marked as uploaded to webADIF * Function returns the QSOs from the logbook, which have not been either marked as uploaded to webADIF
*/ */
function get_webadif_qsos($station_id,$from = null, $to = null){ function get_webadif_qsos($station_id,$from = null, $to = null){
$sql = " $CI =& get_instance();
$CI->load->model('Stations');
if (!$CI->Stations->check_station_is_accessible($station_id)) {
return;
}
$sql = "
SELECT qsos.*, station_profile.*, dxcc_entities.name as station_country SELECT qsos.*, station_profile.*, dxcc_entities.name as station_country
FROM %s qsos FROM %s qsos
INNER JOIN station_profile ON qsos.station_id = station_profile.station_id INNER JOIN station_profile ON qsos.station_id = station_profile.station_id
LEFT JOIN dxcc_entities on qsos.col_my_dxcc = dxcc_entities.adif LEFT JOIN dxcc_entities on qsos.col_my_dxcc = dxcc_entities.adif
LEFT OUTER JOIN webadif ON qsos.COL_PRIMARY_KEY = webadif.qso_id LEFT OUTER JOIN webadif ON qsos.COL_PRIMARY_KEY = webadif.qso_id
WHERE qsos.station_id = %d WHERE qsos.station_id = %d
AND qsos.COL_SAT_NAME = 'QO-100' AND qsos.COL_SAT_NAME = 'QO-100'
AND webadif.upload_date IS NULL AND webadif.upload_date IS NULL
"; ";
$sql = sprintf( $sql = sprintf(
$sql, $sql,
$this->config->item('table_name'), $this->config->item('table_name'),
$station_id $station_id
); );
if ($from) { if ($from) {
$from = DateTime::createFromFormat('d/m/Y', $from); $from = DateTime::createFromFormat('d/m/Y', $from);
$from = $from->format('Y-m-d'); $from = $from->format('Y-m-d');
$sql.=" AND qsos.COL_TIME_ON >= %s"; $sql.=" AND qsos.COL_TIME_ON >= %s";
$sql=sprintf( $sql=sprintf(
$sql, $sql,
$this->db->escape($from) $this->db->escape($from)
); );
} }
if ($to) { if ($to) {
$to = DateTime::createFromFormat('d/m/Y', $to); $to = DateTime::createFromFormat('d/m/Y', $to);
$to = $to->format('Y-m-d'); $to = $to->format('Y-m-d');
$sql.=" AND qsos.COL_TIME_ON <= %s"; $sql.=" AND qsos.COL_TIME_ON <= %s";
$sql=sprintf( $sql=sprintf(
$sql, $sql,
$this->db->escape($to) $this->db->escape($to)
); );
} }
return $this->db->query($sql); return $this->db->query($sql);
} }
/* /*
* Function returns all the station_id's with HRDLOG Code * Function returns all the station_id's with HRDLOG Code
@ -1737,26 +1742,7 @@ class Logbook_model extends CI_Model {
return $query; return $query;
} }
function get_date_qsos($date) { function totals_year() {
$this->db->select('COL_CALL, COL_BAND, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME');
$this->db->order_by("COL_TIME_ON", "desc");
$start = $date." 00:00:00";
$end = $date." 23:59:59";
$this->db->where("COL_TIME_ON BETWEEN '".$start."' AND '".$end."'");
$query = $this->db->get($this->config->item('table_name'));
return $query;
}
function get_todays_qsos() {
$morning = date('Y-m-d 00:00:00');
$night = date('Y-m-d 23:59:59');
$query = $this->db->query('SELECT * FROM '.$this->config->item('table_name').' WHERE COL_TIME_ON between \''.$morning.'\' AND \''.$night.'\'');
return $query;
}
function totals_year() {
$CI =& get_instance(); $CI =& get_instance();
$CI->load->model('logbooks_model'); $CI->load->model('logbooks_model');