mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Prevent mysql error if no date is given at edit
This commit is contained in:
@@ -294,13 +294,18 @@ class QSO extends CI_Controller {
|
||||
}
|
||||
|
||||
function qso_save_ajax() {
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
$this->load->library('form_validation');
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard');
|
||||
}
|
||||
$this->form_validation->set_rules('time_on', 'Start Date', 'required');
|
||||
$this->form_validation->set_rules('time_off', 'End Date', 'required');
|
||||
|
||||
$this->logbook_model->edit();
|
||||
if ($this->form_validation->run()) {
|
||||
$this->logbook_model->edit();
|
||||
}
|
||||
}
|
||||
|
||||
function qsl_rcvd($id, $method) {
|
||||
|
||||
@@ -1424,9 +1424,16 @@ class Logbook_model extends CI_Model {
|
||||
$distance = null;
|
||||
}
|
||||
|
||||
$time_on=$this->input->post('time_on');
|
||||
$time_off=$this->input->post('time_off');
|
||||
|
||||
if (($time_off ?? '') == '') {
|
||||
$time_off=$time_on;
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'COL_TIME_ON' => $this->input->post('time_on'),
|
||||
'COL_TIME_OFF' => $this->input->post('time_off'),
|
||||
'COL_TIME_ON' => $time_on,
|
||||
'COL_TIME_OFF' => $time_off,
|
||||
'COL_CALL' => strtoupper(trim($this->input->post('callsign'))),
|
||||
'COL_BAND' => $this->input->post('band'),
|
||||
'COL_BAND_RX' => $this->input->post('band_rx'),
|
||||
|
||||
Reference in New Issue
Block a user