kopia lustrzana https://github.com/magicbug/Cloudlog
Added QSL-Received-Button
rodzic
fad58f6bff
commit
42c24dc402
|
@ -109,6 +109,29 @@ class QSO extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
function qsl_rcvd() {
|
||||
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
$query = $this->logbook_model->qso_info($this->uri->segment(3));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('id', 'ID', 'required');
|
||||
|
||||
$data = $query->row();
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
{
|
||||
$this->load->view('qso/qsl_rcvd', $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->logbook_model->qsl_rcvd();
|
||||
$this->session->set_flashdata('notice', 'QSL registered');
|
||||
$this->load->view('qso/qsl_rcvd_done');
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete QSO */
|
||||
function delete($id) {
|
||||
$this->load->model('logbook_model');
|
||||
|
|
|
@ -269,6 +269,20 @@ class Logbook_model extends CI_Model {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* QSL received */
|
||||
function qsl_rcvd() {
|
||||
|
||||
$data = array(
|
||||
'COL_QSLRDATE' => date('Y-m-d'),
|
||||
'COL_QSL_RCVD' => "Y"
|
||||
);
|
||||
|
||||
$this->db->where('COL_PRIMARY_KEY', $this->input->post('id'));
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
|
||||
}
|
||||
|
||||
/* Return last 10 QSOs */
|
||||
function last_ten() {
|
||||
$this->db->select('COL_CALL, COL_BAND, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_NAME, COL_COUNTRY, COL_PRIMARY_KEY, COL_SAT_NAME');
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<td>LoTW</td>
|
||||
<?php } ?>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
|
@ -58,6 +59,7 @@
|
|||
<?php } ?>
|
||||
|
||||
<td><a class="btn btn-primary" role="button" data-fancybox data-type="iframe" data-src="<?php echo site_url('qso/edit'); ?>/<?php echo $row->COL_PRIMARY_KEY; ?>" href="javascript:;"><i class="fas fa-edit"></i> Edit</a></td>
|
||||
<td><a class="btn btn-primary" role="button" data-fancybox data-type="iframe" data-src="<?php echo site_url('qso/qsl_rcvd'); ?>/<?php echo $row->COL_PRIMARY_KEY; ?>" href="javascript:;"><i class="fas fa-edit"></i> QSL RCVD</a></td>
|
||||
<?php if($this->config->item('callsign_tags') == true) { ?>
|
||||
<?php if($row->COL_STATION_CALLSIGN != null) { ?>
|
||||
<td><span class="label notice"><?php echo $row->COL_STATION_CALLSIGN; ?></span></td>
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
* NOTE: If you change these, also change the error_reporting() code below
|
||||
*/
|
||||
#define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
|
||||
define('ENVIRONMENT', 'development');
|
||||
# define('ENVIRONMENT', 'development');
|
||||
define('ENVIRONMENT', 'production');
|
||||
|
||||
/*
|
||||
*---------------------------------------------------------------
|
||||
|
|
Ładowanie…
Reference in New Issue