ChangeDb.php
3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
require("class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
//驗證用戶
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//驗證權限
CheckLevel($logininid,$loginin,$classid,"dbdata");
//默認數據庫
if(!empty($public_r['ebakthisdb'])){
echo"正轉到默認的數據庫,請稍等......<script>self.location.href='ChangeTable.php?mydbname=".$ecms_config['db']['dbname'].$ecms_hashur['ehref']."'</script>";
exit();
}
$sql=$empire->query("SHOW DATABASES");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>選擇數據庫</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function DoDrop(dbname)
{var ok;
ok=confirm("確認要刪除此數據庫?");
if(ok)
{
self.location.href='phome.php?<?=$ecms_hashur['href']?>&phome=DropDb&mydbname='+dbname;
}
}
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td>位置:備份數據 -> <a href="ChangeDb.php<?=$ecms_hashur['whehref']?>">選擇數據庫</a></td>
</tr>
<tr>
<td height="25"><div align="center">備份步驟:<font color="#FF0000">選擇數據庫</font>
-> 選擇要備份的表 -> 開始備份 -> 完成</div></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr class="header">
<td width="60%" height="25">
<div align="center">數據庫名</div></td>
<td width="40%" height="25">
<div align="center">備份</div></td>
</tr>
<?
while($r=$empire->fetch($sql))
{
if($r[0]==$ecms_config['db']['dbname'])
{
$bgcolor="#DBEAF5";
}
else
{
$bgcolor="#FFFFFF";
}
?>
<tr bgcolor="<?=$bgcolor?>">
<td height="25">
<div align="center"><?=$r[0]?></div></td>
<td height="25">
<div align="center">
<input type="button" name="Submit" value="備份數據" onclick="self.location.href='ChangeTable.php?mydbname=<?=$r[0]?><?=$ecms_hashur['ehref']?>';">
<input type="button" name="Submit3" value="刪除數據庫" onclick="javascript:DoDrop('<?=$r[0]?>')">
</div></td>
</tr>
<?
}
db_close();
$empire=null;
?>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="2"><form name="form1" method="post" action="phome.php">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<?=$ecms_hashur['form']?>
<tr class="header">
<td height="25">建立數據庫
<input name="phome" type="hidden" id="phome" value="CreateDb">
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">數據庫名:
<input name="mydbname" type="text" id="mydbname">
<select name="mydbchar" id="mydbchar">
<option value="">默認編碼</option>
<option value="gbk">gbk</option>
<option value="utf8">utf8</option>
<option value="gb2312">gb2312</option>
<option value="big5">big5</option>
<option value="latin1">latin1</option>
</select>
<input type="submit" name="Submit2" value="建立">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>