<?php
setDefault('$_GET["action"]');
setDefault('$_GET["s"]', 0);
setDefault('$_GET["scolumn"]');
setDefault('$_GET["sdir"]', 'ASC');
if ( $_GET['action'] == 'edit_row' )
{
require('./includes/edit_row.php');
exit();
}
elseif ( $_GET['action'] == 'drop_row' )
{
require('./includes/drop_row.php');
exit();
}
elseif ( $_GET['action'] == 'insert_row' )
{
require('./includes/insert_row.php');
exit();
}
elseif ( $_GET['action'] == 'empty_table' )
{
require('./includes/empty_table.php');
exit();
}
elseif ( $_GET['action'] == 'drop_table' )
{
require('./includes/drop_table.php');
exit();
}
require('./includes/header.php');
?>
<form method="get" name="form" action="index.php" onsubmit="rename_db(this.newdatabase.value); return false;">
<input type="hidden" name="page" value="rename_database">
<input type="hidden" name="action" value="finish">
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center">
<tr>
<td align="right">
<b>Welcome to txtSQL Administrator 2.0.0</b><br>
<font color="black">Connected to txtSQL <?php echo $sql->version(); ?> running on localhost as <?php echo $_SESSION['txtsqladmin']['username']; ?>@localhost</font>
</td>
</tr>
</table>
<table width="100%" height="80%" cellspacing="3" cellpadding="5" align="center" border="0">
<tr bgcolor="EFEFEF">
<td valign="top">
<table width="100%" height="100%" cellspacing="0" cellpadding="3" border="0">
<tr>
<td width="150" valign="top" bgcolor="E5E5E5">
<?php include('./includes/left.php') ?>
</form>
<form name="form1" method="post" action="index.php?page=table_edit&db=<?php echo $_GET['db']; ?>&table=<?php echo $_GET['table']; ?>&action=edit&s=<?php echo $_GET['s']; ?>">
<input type="hidden" name="whereClause" value="">
<input type="hidden" name="s" value="<?php echo $_GET['s']; ?>">
<input type="hidden" name="scolumn" value="<?php echo $_GET['scolumn']; ?>">
<input type="hidden" name="sdir" value="<?php echo $_GET['sdir']; ?>">
<input type="hidden" name="erow" value="">
</td>
<td valign="top">
<b><font size="5">Viewing database <i><?php echo $_GET['db'];?></i></font><br />
<font size="2">Viewing table structure: <?php echo $_GET['table'];?></font></b>
<br/></br/>
<table width="100%" cellpadding="3" cellspacing="1">
<tr>
<td style="padding-top:0;padding-bottom:0;height:1px;" bgcolor=aeaeae>
</td>
</tr>
<tr>
<td align=center bgcolor=e1e1e1>
<b><a href="index.php?page=table_prop&db=<?php echo $_GET['db']; ?>&table=<?php echo $_GET['table']; ?>">Structure</a>
<a href="index.php?page=table_edit&action=browse_table&db=<?php echo $_GET['db']; ?>&table=<?php echo $_GET['table']; ?>">Browse</a>
<a href="index.php?page=search&db=<?php echo $_GET['db']; ?>&table=<?php echo $_GET['table']; ?>">Search</a>
<a href="index.php?page=table_edit&action=insert_row&db=<?php echo $_GET['db']; ?>&table=<?php echo $_GET['table']; ?>">Insert</a>
<a href="index.php?page=export_database&db=<?php echo $_GET['db']; ?>&table=<?php echo $_GET['table']; ?>&export=-1">Export</a>
<a href="javascript: empty_tbl('<?php echo $_GET['table']; ?>', '<?php echo $_GET['db']; ?>');">Empty</a>
<a href="javascript: drop_tbl('<?php echo $_GET['table']; ?>', '<?php echo $_GET['db']; ?>');">Drop</a>
</b>
</td>
</tr>
<tr>
<td style="padding-top:0;padding-bottom:0;height:1px;" bgcolor="aeaeae">
</td>
</tr>
</table>
<br/>
<table width="98%" cellspacing="1" cellpadding="3" align="center">
<tr align="center">
<td align="right" colspan="<?php
$cols =
execute('describe', array(
'db' => $_GET['db'],
'table' => $_GET['table']
));
$select = array(
'db' => $_GET['db'],
'table' => $_GET['table'],
'limit' => array($_GET['s'], $_GET['s'] + 25)
);
echo ( count($cols) + 1 )."\">\n";
echo "\t\t\t\t\t\t\t\t\t<table width=\"100%\">\n";
echo "\t\t\t\t\t\t\t\t\t\t<tr align=\"right\" valign=\"top\">\n";
echo "\t\t\t\t\t\t\t\t\t\t\t<td align=\"left\">\n";
echo "\t\t\t\t\t\t\t\t\t\t\t\tSort by column: \n";
echo "\t\t\t\t\t\t\t\t\t\t\t\t";
echo "<select class=\"sel\" name=\"sortcolumn\">";
foreach ( $cols as $key => $value )
{
if ( $key == 'primary' )
{
$key = '';
}
echo "<option value=\"".htmlentities($key)."\">".htmlentities($key)."</option>";
}
echo "</select>\n";
echo "\t\t\t\t\t\t\t\t\t\t\t\t<select class=\"sel\" name=\"sortdir\"><option value=\"ASC\">ASC</option><option value=\"DESC\">DESC</option></select>\n";
echo "\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"button\" onclick=\"document.location.href='index.php?page=table_edit&action=browse_table&db={$_GET['db']}&table={$_GET['table']}&s={$_GET['s']}&sdir=' + document.form1.elements['sortdir'].value + '&scolumn=' + document.form1.elements['sortcolumn'].value;\" value=\"Sort\"><br>\n";
if ( !empty($_GET['scolumn']) && !empty($_GET['sdir']) )
{
echo "\t\t\t\t\t\t\t\t\t\t\t\tSorting by column: {$_GET['scolumn']} ( ".( $_GET['sdir'] == 'ASC' ? 'Ascending' : 'Descending' )." )\n";
}
$tableCount = $sql->table_count($_GET['table'], $_GET['db']);
$pages = ceil($tableCount / 25);
$onPage = round($_GET['s'] / 26);
$stop = ( $_GET['s'] + 25 >= $tableCount ) ? $tableCount : $_GET['s'] + 25;
$indent = "\t\t\t\t\t\t\t";
echo "{$indent}\t\t\t\t</td>\n";
echo "{$indent}\t\t\t\t<td>\n";
echo "{$indent}\t\t\t\t\tGo to page: <select name=\"s\" onchange=\"document.location.href='index.php?page=table_edit&action=browse_table&db={$_GET['db']}&table={$_GET['table']}&scolumn={$_GET['scolumn']}&sdir={$_GET['sdir']}&s=' + ( this.value );\" class=\"sel\">\n";
echo "{$indent}\t\t\t\t\t<script>createSelectPage({$pages}, {$onPage}, {$tableCount}, 25);</script>\n";
echo "{$indent}\t\t\t\t\t</select><br>\n";
echo "{$indent}\t\t\t\t\tShowing: ".$_GET['s']." to ".$stop." of ".number_format($tableCount)."<BR>\n";
echo "{$indent}\t\t\t\t</td>\n";
echo "{$indent}\t\t\t</tr>\n";
echo "{$indent}\t\t</table>\n";
echo "{$indent}\t</td>\n";
echo "{$indent}</tr>\n";
echo "{$indent}<tr align=\"center\">\n";
echo "{$indent}\t<td colspan=\"2\">\n";
echo "{$indent}\t</td>\n";
if ( !empty($_GET['scolumn']) && !empty($_GET['sdir']) )
{
$select['orderby'] = array($_GET['scolumn'], $_GET['sdir']);
}
$rows = execute('select', $select);
if ( !empty($rows) )
{
$where = constructWhere($rows, $cols);
foreach ( $cols as $key => $value )
{
if ( $key != 'primary' )
{
$direction = 'ASC';
if ( !empty($_GET['scolumn']) && !empty($_GET['sdir']) && $_GET['scolumn'] == $key )
{
$direction = ( strtoupper($_GET['sdir']) == 'ASC' ) ? 'DESC' : 'ASC';
}
echo "\t\t\t\t\t\t\t\t<td><b>";
echo "<a href=\"index.php?page=table_edit&db={$_GET['db']}&table={$_GET['table']}&s={$_GET['s']}&scolumn={$key}&sdir=$direction\" title=\"Sort Column; $direction\">";
echo ( $key == $cols['primary'] ) ? "<u><font color=\"firebrick\" title=\"Primary Key\">$key</font></u>" : "$key";
echo "</b>";
if ( !emp
没有合适的资源?快使用搜索试试~ 我知道了~
文本数据库管理工具(txtSQLAdmin)
共62个文件
php:38个
gif:14个
png:7个
4星 · 超过85%的资源 需积分: 13 51 下载量 190 浏览量
2009-12-28
12:11:06
上传
评论 2
收藏 69KB RAR 举报
温馨提示
管理文本数据库的工具,超级好用 <?php $CFG = array(); // Path to the txtSQL.class.php file $CFG['txtsql']['class'] = '../daiichigakki20090408/web/cms/vendors/txtSQL/txtSQL.class.php'; // Path to the directory containing 'txtSQL.core.php' $CFG['txtsql']['core_path'] = '../daiichigakki20090408/web/cms/vendors/txtSQL/'; // Path to the directory containing the txtSQL databases $CFG['txtsql']['data_path'] = '../daiichigakki20090408/web/cms/app/data/txtdb/'; include('./startup.php'); ?>
资源推荐
资源详情
资源评论
收起资源包目录
txtSQLAdmin.rar (62个子文件)
txtSQLAdmin
startup.php 556B
index.php 4KB
config.php 474B
includes
headerJS.js 11KB
functions.php 3KB
search.php 8KB
unlock_database.php 288B
insert_column.php 7KB
drop_row.php 442B
create_table.php 8KB
footer.php 305B
add_user.php 260B
lock_database.php 258B
main.php 4KB
view_database.php 6KB
change_pass.php 3KB
colors.css 1KB
dropkey.php 282B
drop_table.php 166B
drop_user.php 257B
export_database.php 9KB
insert_row.php 8KB
users.php 5KB
drop_db.php 120B
edit_column.php 7KB
search_results.php 8KB
drop_column.php 276B
addkey.php 948B
table_edit.php 11KB
rename_db.php 3KB
php_info.php 21B
empty_table.php 187B
edit_user.php 258B
table_prop.php 9KB
edit_row.php 8KB
create_database.php 418B
left.php 3KB
header.php 351B
view_databases.php 4KB
export_table.php 6KB
images
small_lock.gif 109B
header_bg.gif 1KB
small_tbl.gif 92B
small_edit.png 348B
powerbytxtsql.gif 859B
small_databases.gif 118B
small_nodrop.gif 244B
sort_ASC.gif 56B
small_primary.png 289B
small_unlock.gif 106B
small_rename_database.png 279B
small_insert.png 1017B
logo.gif 7KB
small_noprimary.png 289B
small_search.png 246B
Thumbs.db 32KB
gradient.gif 151B
small_exportdb.gif 147B
small_drop.gif 94B
small_tbl_properties.png 279B
small_empty.gif 77B
sort_DESC.gif 57B
共 62 条
- 1
资源评论
- 战歌IT2013-01-11虽然不是很完善,但写的还行,可以参考学习。
- txfuks2014-10-28这个简单方便,很有用。。。
- ccw123ccw2012-02-26只有 数据库 管理工具 不能运行 差 三个文件 txtSQL.class.php txtSQL.core.php 和一个空的数据库 // Path to the txtSQL.class.php file // Path to the directory containing 'txtSQL.core.php' // Path to the directory containing the txtSQL databases
Asimov666
- 粉丝: 3
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功