Added a button to only delete the log, not the profile. I found this to be valuable when testing out the import, and not having to create a new profile each time.

pull/410/head
AndreasK79 2020-02-07 14:54:49 +01:00
rodzic 98377c8b4a
commit a4e942af43
3 zmienionych plików z 17 dodań i 0 usunięć

Wyświetl plik

@ -122,4 +122,11 @@ class Station extends CI_Controller {
redirect('station');
}
public function deletelog($id) {
$this->load->model('stations');
$this->stations->deletelog($id);
redirect('station');
}
}

Wyświetl plik

@ -81,6 +81,12 @@ class Stations extends CI_Model {
$this->db->delete('station_profile', array('station_id' => $clean_id));
}
function deletelog($id) {
// Delete QSOs
$this->db->where('station_id', $id);
$this->db->delete($this->config->item('table_name'));
}
function set_active($current, $new) {
// Clean inputs

Wyświetl plik

@ -44,6 +44,7 @@
<th></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@ -69,6 +70,9 @@
<td>
<a href="<?php echo site_url('station/edit')."/".$row->station_id; ?>" class="btn btn-info btn-sm"><i class="fas fa-edit-alt"></i> Edit</a>
</td>
<td>
<a href="<?php echo site_url('station/deletelog')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete all QSOs within this station profile?');"><i class="fas fa-trash-alt"></i> Delete log</a></td>
</td>
<td>
<a href="<?php echo site_url('station/delete')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want delete station profile <?php echo $row->station_profile_name; ?> this will delete all QSOs within this station profile?');"><i class="fas fa-trash-alt"></i> Delete</a></td>
</tr>