Deleting a station profile also deletes all its associated QSOs

pull/394/head
Peter Goodhall 2019-12-03 19:16:40 +00:00
rodzic a290fc5201
commit 81e8b51729
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -73,6 +73,11 @@ class Stations extends CI_Model {
// Clean ID
$clean_id = $this->security->xss_clean($id);
// Delete QSOs
$this->db->where('station_id', $id);
$this->db->delete($this->config->item('table_name'));
// Delete Station Profile
$this->db->delete('station_profile', array('station_id' => $clean_id));
}

Wyświetl plik

@ -70,7 +70,7 @@
<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/delete')."/".$row->station_id; ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want delete QSO <?php echo $row->station_profile_name; ?>?');"><i class="fas fa-trash-alt"></i> Delete</a></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>
<?php } ?>