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.

这个提交包含在:
AndreasK79 2020-02-07 14:54:49 +01:00
父节点 98377c8b4a
当前提交 a4e942af43
共有 3 个文件被更改,包括 17 次插入0 次删除

查看文件

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

查看文件

@ -81,6 +81,12 @@ class Stations extends CI_Model {
$this->db->delete('station_profile', array('station_id' => $clean_id)); $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) { function set_active($current, $new) {
// Clean inputs // Clean inputs

查看文件

@ -44,6 +44,7 @@
<th></th> <th></th>
<th scope="col"></th> <th scope="col"></th>
<th scope="col"></th> <th scope="col"></th>
<th scope="col"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -69,6 +70,9 @@
<td> <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> <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>
<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> <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> <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> </tr>