function delete_image($bannercat_id, $banner_id) { $this->load->library('file_lib'); $bannercat = new bannercat($bannercat_id); $banner = new banner($banner_id); if (!$bannercat->exists()) { show_404(); } if ($banner->isCanNotDelete == 1) { flash_message('error', 'Không thể xóa banner này'); } else { $banner->delete(); flash_message('success', 'Xóa thành công'); } redirect($this->admin_url . "bannercats/list_image/" . $bannercat_id); }
function delete_image($id) { $banner = new banner($id); if (!$banner->exists()) { show_404(); } $bannercat_id = $banner->bannercat_id; $banner->delete(); redirect($this->admin_url . "bannercats/list_image/" . $bannercat_id); }