예제 #1
0
 function deleteall()
 {
     $menu = $this->input->post('checkinput');
     foreach ($menu as $row) {
         $role = new role($row);
         if (!$role->exists()) {
             continue;
         }
         if ($role->parentmenu_id == NULL) {
             $role->delete();
         } else {
             if ($role->child->count() > 0) {
                 flash_message('error', 'Vui lòng xóa h?t menu con c?a ' . $role->name);
             } else {
                 // $this->firephp->log("sdf");
                 $role->delete();
             }
         }
     }
     redirect($this->admin . 'roles/list_all');
 }