POST Each QSO to clublog seperately and if successful mark as sent.
这个提交包含在:
父节点
0c74ac5605
当前提交
5560e5005e
共有 2 个文件被更改,包括 45 次插入 和 26 次删除
|
|
@ -166,7 +166,6 @@ class Clublog extends CI_Controller {
|
||||||
{
|
{
|
||||||
$data['qso'] = $qso;
|
$data['qso'] = $qso;
|
||||||
$adif_string = $this->load->view('adif/data/clublog_realtime', $data, true);
|
$adif_string = $this->load->view('adif/data/clublog_realtime', $data, true);
|
||||||
}
|
|
||||||
|
|
||||||
// initialise the curl request
|
// initialise the curl request
|
||||||
$request = curl_init('https://clublog.org/realtime.php');
|
$request = curl_init('https://clublog.org/realtime.php');
|
||||||
|
|
@ -191,8 +190,18 @@ class Clublog extends CI_Controller {
|
||||||
if(curl_errno($request)) {
|
if(curl_errno($request)) {
|
||||||
echo curl_error($request);
|
echo curl_error($request);
|
||||||
}
|
}
|
||||||
curl_close ($request);
|
|
||||||
|
|
||||||
|
// If Clublog Accepts mark the QSOs
|
||||||
|
if (preg_match('/\baccepted\b/', $response)) {
|
||||||
|
echo "QSOs uploaded and Logbook QSOs marked as sent to Clublog";
|
||||||
|
|
||||||
|
$this->clublog_model->mark_qso_sent($qso->COL_PRIMARY_KEY);
|
||||||
|
echo "Clublog upload for ".$station_row->station_callsign;
|
||||||
|
} else {
|
||||||
|
echo "Error ".$response;
|
||||||
|
}
|
||||||
|
curl_close ($request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,16 @@ class Clublog_model extends CI_Model {
|
||||||
$this->db->update($this->config->item('table_name'), $data);
|
$this->db->update($this->config->item('table_name'), $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mark_qso_sent($qso_id) {
|
||||||
|
$data = array(
|
||||||
|
'COL_CLUBLOG_QSO_UPLOAD_DATE' => date('Y-m-d'),
|
||||||
|
'COL_CLUBLOG_QSO_UPLOAD_STATUS' => "Y",
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->db->where("COL_PRIMARY_KEY", $qso_id);
|
||||||
|
$this->db->update($this->config->item('table_name'), $data);
|
||||||
|
}
|
||||||
|
|
||||||
function get_last_five($station_id) {
|
function get_last_five($station_id) {
|
||||||
$this->db->where('station_id', $station_id);
|
$this->db->where('station_id', $station_id);
|
||||||
$this->db->where("COL_CLUBLOG_QSO_UPLOAD_STATUS", null);
|
$this->db->where("COL_CLUBLOG_QSO_UPLOAD_STATUS", null);
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用