Implemented PoC for getting file(s) to delete when deleting (e)QSLs

This commit is contained in:
int2001
2024-04-03 05:27:51 +00:00
parent af053cabc1
commit 70be289489
3 changed files with 148 additions and 116 deletions

View File

@@ -42,15 +42,8 @@ class Qsl extends CI_Controller {
public function delete() {
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
$id = $this->input->post('id');
$this->load->model('Qsl_model');
$path = $this->Qsl_model->get_imagePath('p');
$file = $this->Qsl_model->getFilename($id)->row();
$filename = $file->filename;
unlink($path.'/'.$filename);
$this->Qsl_model->deleteQsl($id);
}
@@ -174,4 +167,4 @@ class Qsl extends CI_Controller {
$this->load->view('qslcard/qslcarousel', $data);
}
}
}