//Start SQL-Box $tpl = new MSDTemplate(); $tpl->set_filenames(array('show' => $config['paths']['root'] . './tpl/sqlbrowser/sqlbox.tpl')); if (isset($_GET['readfile']) && $_GET['readfile'] == 1) { $tpl->assign_block_vars('SQLUPLOAD', array('POSTTARGET' => $params, 'LANG_OPENSQLFILE' => $lang['L_SQL_OPENFILE'], 'LANG_OPENSQLFILE_BUTTON' => $lang['L_SQL_OPENFILE_BUTTON'], 'LANG_SQL_MAXSIZE' => $lang['L_MAX_UPLOAD_SIZE'], 'MAX_FILESIZE' => $config['upload_max_filesize'])); } if (isset($_POST['submit_openfile'])) { //open file if (!isset($_FILES['upfile']['name']) || empty($_FILES['upfile']['name'])) { $aus .= '<span class="error">' . $lang['L_FM_UPLOADFILEREQUEST'] . '</span>'; } else { $fn = $_FILES['upfile']['tmp_name']; if (strtolower(substr($_FILES['upfile']['name'], -3)) == ".gz") { $read__user_sqlfile = gzfile($fn); } else { $read__user_sqlfile = file($fn); } $aus .= '<span>geladenes File: <strong>' . $_FILES['upfile']['name'] . '</strong> ' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . '</span>'; $sql_loaded = implode("", $read__user_sqlfile); } } // Sind SQL-Befehle in der SQLLib vorhanden? $sqlcombo = SQL_ComboBox(); if ($sqlcombo > '') { $tpl->assign_block_vars('SQLCOMBO', array('SQL_COMBOBOX' => $sqlcombo)); } $tpl->assign_vars(array('LANG_SQL_WARNING' => $lang['L_SQL_WARNING'], 'ICONPATH' => $config['files']['iconpath'], 'MYSQL_REF' => $mysql_help_ref, 'BOXSIZE' => $config['interface_sqlboxsize'], 'BOXCONTENT' => isset($sql_loaded) ? $sql_loaded : $sql['sql_statement'] . $sql['order_statement'], 'LANG_SQL_BEFEHLE' => $lang['L_SQL_BEFEHLE'], 'TABLE_COMBOBOX' => Table_ComboBox(), 'LANG_SQL_EXEC' => $lang['L_SQL_EXEC'], 'LANG_RESET' => $lang['L_RESET'], 'PARAMS' => $params, 'DB' => $databases['Name'][$dbid], 'DBID' => $dbid, 'TABLENAME' => $tablename, 'ICON_SEARCH' => $icon['search'], 'ICON_UPLOAD' => $icon['upload'], 'ICON_MYSQL_HELP' => $icon['mysql_help'], 'MYSQL_HELP' => $lang['L_TITLE_MYSQL_HELP'], 'DBID' => $databases['db_selected_index'], 'LANG_TOOLBOX' => $lang['L_TOOLS_TOOLBOX'], 'LANG_TOOLS' => $lang['L_TOOLS'], 'LANG_DB' => $lang['L_DB'], 'LANG_TABLE' => $lang['L_TABLE'], 'LANG_SQL_TABLEVIEW' => $lang['L_SQL_TABLEVIEW'], 'LANG_BACK_TO_DB_OVERVIEW' => $lang['L_SQL_BACKDBOVERVIEW'])); if ($tablename > '') { $tpl->assign_block_vars('TABLE_SELECTED', array()); } $tpl->pparse('show');
if (strtolower(substr($_FILES['upfile']['name'], -3)) == ".gz") { $read__user_sqlfile = gzfile($fn); } else { $read__user_sqlfile = file($fn); } $aus .= '<span>geladenes File: <strong>' . $_FILES['upfile']['name'] . '</strong> ' . byte_output(filesize($_FILES['upfile']['tmp_name'])) . '</span>'; $sql_loaded = implode("", $read__user_sqlfile); } } $aus .= '<div id="mysqlbox"><form action="sql.php" method="post">'; //Titelzeile $aus .= '<div id="sqlheaderbox">'; $aus .= '<a href="#" onclick="resizeSQL(0);"><img src="' . $config['files']['iconpath'] . 'close.gif" width="16" height="16" alt="" border="0" vspace="0" hspace="0" align="bottom"></a> '; $aus .= '<a href="#" onclick="resizeSQL(1);"><img src="' . $config['files']['iconpath'] . 'arrowup.gif" width="16" height="16" alt="show less" border="0" vspace="0" hspace="0" align="bottom"></a>'; $aus .= ' <a href="#" onclick="resizeSQL(2);"><img src="' . $config['files']['iconpath'] . 'arrowdown.gif" width="16" height="16" alt="show more" border="0" vspace="0" hspace="0" align="bottom"></a> '; $aus .= '<input class="SQLbutton" type="button" onclick="document.location.href=\'' . $params . '&context=1\'" value="' . $lang['sql_befehle'] . '">' . SQL_ComboBox() . ' ' . Table_ComboBox(); $aus .= ' <input class="SQLbutton" type="reset" name="reset" value="reset"> <input class="SQLbutton" type="submit" name="execsql" value="' . $lang['sql_exec'] . '"> '; if (!isset($_GET['readfile'])) { $aus .= ' <a href="' . $params . '&readfile=1" title="read file"><img src="' . $config['files']['iconpath'] . 'openfile.gif" width="16" height="16" alt="read file" border="0"></a> '; } $aus .= '<a href="' . $mysql_help_ref . '" target="_blanc" title="Mysql-Hilfe"><img src="' . $config['files']['iconpath'] . 'help16.gif" width="16" height="16" alt="" border="0"></a>'; $aus .= '</div>'; //Eingabebox $aus .= '<div id="sbox2"><textarea rows="4" cols="10" style="height:' . $config['interface_sqlboxsize'] . 'px;" name="sqltextarea" id="sqltextarea">' . (isset($sql_loaded) ? $sql_loaded : $sql['sql_statement'] . $sql['order_statement']) . '</textarea>'; $aus .= '<br><div class="ssmall" align="center">' . $lang['sql_warning'] . '</div></div>'; $aus .= '<input type="hidden" name="db" value="' . $db . '"><input type="hidden" name="tablename" value="' . $tablename . '">'; $aus .= '<input type="hidden" name="dbid" value="' . $dbid . '"></form></div><br>'; } if (isset($_GET['mode']) && $context == 0) { if (isset($_GET['recordkey'])) { $rk = stripslashes(urldecode($_GET['recordkey']));