printHeader($lang['strhistory']); // Bring to the front always echo "\n"; echo "
\n"; $misc->printConnection($onchange); echo "

"; if (!isset($_REQUEST['database'])) { echo "

{$lang['strnodatabaseselected']}

\n"; return; } if (isset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']])) { include_once('classes/ArrayRecordSet.php'); $history = new ArrayRecordSet($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]); $columns = array( 'query' => array( 'title' => $lang['strsql'], 'field' => field('query'), ), 'paginate' => array( 'title' => $lang['strpaginate'], 'field' => field('paginate'), 'type' => 'yesno', ), 'actions' => array( 'title' => $lang['stractions'], ), ); $actions = array( 'run' => array( 'title' => $lang['strexecute'], 'url' => "sql.php?{$misc->href}&nohistory=t&", 'vars' => array('query' => 'query', 'paginate' => 'paginate'), 'target' => 'detail', ), 'remove' => array( 'title' => $lang['strdelete'], 'url' => "history.php?{$misc->href}&action=confdelhistory&", 'vars' => array('queryid' => 'queryid'), ), ); $misc->printTable($history, $columns, $actions, $lang['strnohistory']); } else echo "

{$lang['strnohistory']}

\n"; echo "\n"; } function doDelHistory($qid, $confirm) { global $misc, $lang; if ($confirm) { $misc->printHeader($lang['strhistory']); // Bring to the front always echo "\n"; echo "

{$lang['strdelhistory']}

\n"; echo "

{$lang['strconfdelhistory']}

\n"; echo "
", htmlentities($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']][$qid]['query']), "
"; echo "
\n"; echo "\n"; echo "\n"; echo $misc->form; echo "\n"; echo "\n"; echo "
\n"; } else unset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']][$qid]); } function doClearHistory($confirm) { global $misc, $lang; if ($confirm) { $misc->printHeader($lang['strhistory']); // Bring to the front always echo "\n"; echo "

{$lang['strclearhistory']}

\n"; echo "

{$lang['strconfclearhistory']}

\n"; echo "
\n"; echo "\n"; echo $misc->form; echo "\n"; echo "\n"; echo "
\n"; } else unset($_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']]); } switch ($action) { case 'confdelhistory': doDelHistory($_REQUEST['queryid'], true); break; case 'delhistory': if (isset($_POST['yes'])) doDelHistory($_REQUEST['queryid'], false); doDefault(); break; case 'confclearhistory': doClearHistory(true); break; case 'clearhistory': if (isset($_POST['yes'])) doClearHistory(false); doDefault(); break; default: doDefault(); } // Set the name of the window $misc->setWindowName('history'); $misc->printFooter(); ?>