Пример #1
0
 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);
 }
Пример #2
0
 function down_position_image($id, $banner_id, $step = 1)
 {
     $o = new bannercat();
     $o->get_by_id($id);
     if (!$o->exists()) {
         show_404("Không tìm thấy");
     }
     for ($i = 0; $i < $step; $i++) {
         $o->down_position();
     }
     //  flash_message('warning','Không th? thay d?i v? trí du?c n?a ');
     redirect($this->admin . 'banners/list_image/' . $banner_id);
 }