2019-08-29 03:13:24 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class Qslprint_model extends CI_Model {
|
|
|
|
|
|
|
|
|
|
function __construct()
|
|
|
|
|
{
|
|
|
|
|
parent::__construct();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mark_qsos_printed() {
|
2019-09-28 05:04:49 +08:00
|
|
|
$CI =& get_instance();
|
|
|
|
|
$CI->load->model('Stations');
|
|
|
|
|
$station_id = $CI->Stations->find_active();
|
2021-05-08 16:29:47 +08:00
|
|
|
|
2019-08-29 03:13:24 +08:00
|
|
|
$data = array(
|
|
|
|
|
'COL_QSLSDATE' => date('Y-m-d'),
|
|
|
|
|
'COL_QSL_SENT' => "Y",
|
|
|
|
|
'COL_QSL_SENT_VIA' => "B",
|
|
|
|
|
);
|
|
|
|
|
|
2020-05-26 05:05:21 +08:00
|
|
|
$this->db->where_in("COL_QSL_SENT", array("R","Q"));
|
2019-09-28 05:04:49 +08:00
|
|
|
$this->db->where("station_id", $station_id);
|
2019-08-29 03:13:24 +08:00
|
|
|
$this->db->update($this->config->item('table_name'), $data);
|
|
|
|
|
}
|
2021-05-08 16:29:47 +08:00
|
|
|
|
|
|
|
|
function get_qsos_for_print() {
|
|
|
|
|
$CI =& get_instance();
|
|
|
|
|
$CI->load->model('Stations');
|
|
|
|
|
|
|
|
|
|
$active_station_id = $this->stations->find_active();
|
|
|
|
|
|
|
|
|
|
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
|
|
|
|
|
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
|
|
|
|
$this->db->where_in('COL_QSL_SENT', array('R', 'Q'));
|
|
|
|
|
$this->db->order_by("COL_TIME_ON", "ASC");
|
|
|
|
|
$query = $this->db->get($this->config->item('table_name'));
|
|
|
|
|
|
|
|
|
|
return $query;
|
|
|
|
|
}
|
2019-08-29 03:13:24 +08:00
|
|
|
}
|
|
|
|
|
|
2021-05-08 16:29:47 +08:00
|
|
|
?>
|