function delete($id) { $productphotos = new Productphoto($id); if (!$productphotos->exists()) { show_404(); } else { $productphotos->delete(); flash_message('success', 'Thành công. Đối tượng đã được xóa.'); redirect($_SERVER['HTTP_REFERER']); } }