Example #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');
 }
                }
            }
        }
        break;
    case 'delete_entry':
        // Check for dependencies
        $administration_role = new role($_POST['roles_id']);
        if ($administration_role->has_dependencies()) {
            $error_level = 3;
            // Related employee-role(s) exist
            $_POST['action'] = '';
        }
        break;
    case 'delete_entry_confirmed':
        $administration_role = new role($_POST['roles_id']);
        $administration_role->delete();
        unset($_POST['roles_id']);
        $_POST['action'] = '';
        break;
}
// Create a new role object with id == 0 (default)
$_SESSION['role'] = new role(0, $_POST['projects_id']);
// header //
require DIR_WS_INCLUDES . 'header.php';
?>
<!-- body //-->
  <table style="border-width:0px;width:100%;border-spacing:3">
    <tr>
      <td style="width:<?php 
echo BOX_WIDTH;
?>