}
require 'config.php';
dol_include_once('/query/class/query.class.php');
dol_include_once('/query/class/dashboard.class.php');
$langs->load('query@query');
$action = GETPOST('action');
$dashboard = new TQDashBoard();
$PDOdb = new TPDOdb();
$fk_user_to_use = GETPOST('fk_user');
if (empty($user->id) && !empty($fk_user_to_use)) {
    $user->fetch($fk_user_to_use);
}
switch ($action) {
    case 'delete':
        $dashboard->load($PDOdb, GETPOST('id'));
        $dashboard->delete($PDOdb);
        setEventMessage($langs->trans('DeleteSuccess'));
        header('Location:dashboard.php');
        exit;
        break;
    case 'view':
        $dashboard->load($PDOdb, GETPOST('id'));
        fiche($dashboard);
        break;
    case 'add':
        if (empty($user->rights->query->dashboard->create)) {
            accessforbidden();
        }
        fiche($dashboard);
        break;
    case 'run':