/** * Display query has been execute * * @param string $query * @param bool $withLink if true some links will be display */ function displayQuery($query, $withLink = true, $changesLines = '') { global $SQLiteManagerAuth; if (empty($query) && isset($GLOBALS['DisplayQuery'])) { $query = $GLOBALS['DisplayQuery']; } $linkBase = 'main.php?dbsel=' . $GLOBALS['dbsel'] . '&table=' . $GLOBALS['table']; if ($posLim = strpos($query, 'LIMIT')) { $queryLink = substr($query, 0, $posLim - 1); } else { $queryLink = $query; } if (isset($GLOBALS['DbGrid']) && is_object($GLOBALS['DbGrid'])) { if (!empty($GLOBALS['DbGrid']->infoNav['start']) || !empty($GLOBALS['DbGrid']->infoNav['end']) || !empty($GLOBALS['DbGrid']->infoNav['all'])) { $infoNav = '<span style="font-size: 12px">' . $GLOBALS['traduct']->get(136) . ' ' . $GLOBALS['DbGrid']->infoNav['start'] . '-' . $GLOBALS['DbGrid']->infoNav['end'] . '/' . $GLOBALS['DbGrid']->infoNav['all'] . ' </span>'; } } if (!isset($infoNav)) { $infoNav = ''; } if (WITH_AUTH && isset($SQLiteManagerAuth) && !$SQLiteManagerAuth->getAccess('execSQL')) { $withLink = false; } $modifyLink = '[<a href="' . $linkBase . '&action=sql&sql_action=modify&displayResult=&DisplayQuery=' . urlencode($queryLink) . '" class="titleHeader" target="main">' . $GLOBALS['traduct']->get(14) . '</a>]'; $explainLink = '[<a href="' . $linkBase . '&action=sql&sql_action=explain&displayResult=1&DisplayQuery=' . urlencode($queryLink) . '" class="titleHeader" target="main">' . $GLOBALS['traduct']->get(145) . '</a>]'; $replayLink = '[<a href="' . $linkBase . '&action=sql&displayResult=1&DisplayQuery=' . urlencode($queryLink) . '" class="titleHeader" target="main">' . $GLOBALS['traduct']->get(223) . '</a>]'; echo ' <table class="query" cellspacing="0" align="center">'; if ($changesLines != '') { echo '<tr><td bgcolor="#CCCCCC"><span class="sqlsyntaxe"> ' . $changesLines . ' ' . $GLOBALS['traduct']->get(71) . '</span></td></tr>'; } echo ' <tr> <td class="queryTitle" bgcolor="' . $GLOBALS['displayQueryTitleColor'] . '" style="white-space: nowrap"> ' . $GLOBALS['traduct']->get(90) . ' : ' . ($withLink ? ' ' . $infoNav . $modifyLink . ' ' . $explainLink . ' ' . $replayLink : '') . '</td></tr> <tr><td class="queryBody" bgcolor="' . $GLOBALS['displayQueryBgColor'] . '" style="white-space: nowrap"><div class="sqlsyntaxe">' . highlight_query($query) . '</div></td></tr> </table><br/> '; }
/** * Display current VIEW properties * * @access public */ function propView() { echo '<!-- SQLiteViewProperties.class.php : propView() -->' . "\n"; echo '<br>'; echo ' <table cellpadding="2" cellspacing="0" width="90%" class="viewProp"> <tr class="viewPropTitle"><td align="right" width="20%" class="viewPropTitle">' . $GLOBALS['traduct']->get(19) . ' : </td><td align="center" class="viewPropTitle">' . $this->view . '</td></tr> <tr><td align="right" class="viewProp">' . $GLOBALS['traduct']->get(61) . ' : </td><td class="viewProp">' . highlight_query($this->viewProperties) . '</td></tr> </table>'; echo '<div align="center">'; if (!$GLOBALS['workDb']->isReadOnly() && displayCondition('properties')) { echo '<a href="main.php?dbsel=' . $GLOBALS['dbsel'] . '&view=' . $this->view . '&action=modify" class="base" target="main">' . $GLOBALS['traduct']->get(14) . '</a>'; } else { echo '<span class="base"><i>' . $GLOBALS['traduct']->get(14) . '</i></span>'; } echo str_repeat(' ', 10); if (!$GLOBALS['workDb']->isReadOnly() && displayCondition('del')) { echo '<a href="main.php?dbsel=' . $GLOBALS['dbsel'] . '&view=' . $this->view . '&action=delete" class="base" target="main">' . $GLOBALS['traduct']->get(15) . '</a>'; } else { echo '<span class="base"><i>' . $GLOBALS['traduct']->get(15) . '</i></span>'; } echo '</div>'; }