Resets date and time on post qso if the saved date and time was set for more than 24 hours ago.

pull/531/head
AndreasK79 2020-06-04 22:29:20 +02:00
rodzic 0c11f4e9a7
commit cac020c4ea
2 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -57,6 +57,7 @@ class QSO extends CI_Controller {
$qso_data = array(
'start_date' => $this->input->post('start_date'),
'start_time' => $this->input->post('start_time'),
'time_stamp' => time(),
'band' => $this->input->post('band'),
'freq' => $this->input->post('freq_display'),
'freq_rx' => $this->input->post('freq_display_rx'),

Wyświetl plik

@ -38,12 +38,28 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="start_date">Date</label>
<input type="text" class="form-control form-control-sm input_date" name="start_date" id="start_date" value="<?php if ($this->session->userdata('start_date') != NULL) {echo $this->session->userdata('start_date');} else {echo date('d-m-Y');} ?>" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> >
<input type="text" class="form-control form-control-sm input_date" name="start_date" id="start_date" value="
<?php
if (($this->session->userdata('start_date') != NULL && ((time() - $this->session->userdata('time_stamp')) < 24 * 60 * 60))) {
echo $this->session->userdata('start_date');
} else {
echo date('d-m-Y');
}
?>
" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?> >
</div>
<div class="form-group col-md-6">
<label for="start_time">Time</label>
<input type="text" class="form-control form-control-sm input_time" name="start_time" id="start_time" value="<?php if ($this->session->userdata('start_time') != NULL) {echo $this->session->userdata('start_time');} else {echo date('H:i');} ?>" size="7" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?>>
<input type="text" class="form-control form-control-sm input_time" name="start_time" id="start_time" value="
<?php
if (($this->session->userdata('start_time') != NULL && ((time() - $this->session->userdata('time_stamp')) < 24 * 60 * 60))) {
echo $this->session->userdata('start_time');
} else {
echo date('H:i');
}
?>
" size="7" <?php echo ($_GET['manual'] == 0 ? "disabled" : ""); ?>>
</div>
<?php if ( $_GET['manual'] == 0 ) { ?>