This repository was archived by the owner on Nov 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtablelist.asp
More file actions
118 lines (111 loc) · 4.7 KB
/
tablelist.asp
File metadata and controls
118 lines (111 loc) · 4.7 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
118
<%@ Language=VBScript %>
<!--#include file=scripts\inc_common.asp -->
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html>
<head>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link href="default.css" rel="stylesheet" type="text/css">
<title>DBA:<%=langCaptionTablesList%></title>
<script type="text/javascript" language="javascript" src="scripts/common.js" defer></script>
</head>
<body>
<% call DBA_WriteNavigation%>
<%
if not DBAE_DEBUG Then On Error Resume Next
dim dba, sClass, action, tbl, tableColor, tableImage
dim showSysTables
set dba = new DBAdmin
dba.Connect Session(DBA_cfgSessionDBPathName), Session(DBA_cfgSessionDBPassword)
action = CStr(Request("action").Item)
showSysTables = CBool(StpProfile.GetProfileNumber("settings", "sys_tables", 0))
DBA_BeginNewTable langTablesList, "", "90%", ""
if dba.HasError then DBA_WriteError dba.LastError
Select Case action
Case "create"
dba.CreateTable Request.Form("tablename").Item
if dba.HasError then DBA_WriteError dba.LastError
Case "delete"
dba.DeleteTable Request.QueryString("table").Item
if dba.HasError then DBA_WriteError dba.LastError
Case "do_rename"
dba.Tables.Item(Request.Form("table").Item).Name = Request.Form("tablename").Item
if dba.HasError then DBA_WriteError dba.LastError
End Select
%>
<table align="center" border="0" cellpadding="2" cellspacing="1" width="90%">
<tr>
<th><%=langTableName%></th>
<th><%=langCreated%></th>
<th><%=langModified%></th>
<th><%=langActions%></th>
</tr>
<%
for each tbl in dba.Tables.Items
If not tbl.IsSystem or showSysTables Then
Select Case tbl.TableType
Case "SYSTEM TABLE", "ACCESS TABLE"
tableColor = "#808080"
tableImage = ""
Case "LINK", "ALIAS"
tableColor = "#008000"
tableImage = "<img src=""images/linked.gif"" border=""0""> "
Case Else
tableColor = ""
tableImage = ""
End Select
if sClass = "oddrow" then sClass = "evenrow" else sClass = "oddrow"
%>
<tr class="<%=sClass%>" onmouseover="style.backgroundColor='#ffdfbf'" onmouseout="style.backgroundColor=''">
<td><%=tableImage%><font color="<%=tableColor%>"><%=tbl.Name%></font></td>
<td align="right"><%=tbl.DateCreated%></td>
<td align="right"><%=tbl.DateModified%></td>
<td align="right">
<a href="structure.asp?table=<%=Server.URLEncode(tbl.Name)%>"><img src="images/structure.gif" alt="<%=langViewTableStructureAlt%>" border="0" width="16" height="16"></a>
<a href="data.asp?table=<%=Server.URLEncode(tbl.Name)%>"><img src="images/table.gif" alt="<%=langViewTableDataAlt%>" border="0" width="16" height="16"></a>
<a href="recedit.asp?action=edit&table=<%=Server.URLEncode(tbl.Name)%>"><img src="images/cycle.gif" alt="<%=langTableNavigateAlt%>" border="0" width="16" height="16"></a>
<% If StpProfile.ComponentAvailable("ADOX") and not tbl.IsLinked and not tbl.IsSystem Then%>
<a href="tablelist.asp?action=rename&table=<%=Server.URLEncode(tbl.Name)%>"><img src="images/rename.gif" alt="<%=langRenameTableAlt%>" border="0" width="16" height="16"></a>
<% End If%>
<% If not tbl.IsSystem Then%>
<a href="tablelist.asp?action=delete&table=<%=Server.URLEncode(tbl.Name)%>" onclick="return confirm('<%=Replace(Replace(langSureToDeleteTable, "$table_name", tbl.Name), "'", "\'")%>?');"><img src="images/delete.gif" alt="<%=langDeleteTableAlt%>" border="0" width="16" height="16"></a>
<% End If%>
</td>
</tr>
<%
End If
next
%>
</table>
<form action="tablelist.asp" method="post">
<% if action = "rename" Then%>
<input type="hidden" name="table" value="<%=Request.QueryString("table").Item%>">
<input type="hidden" name="action" value="do_rename">
<% else%>
<input type="hidden" name="action" value="create">
<% end if%>
<table align="center" border="0">
<% if action = "rename" Then%>
<tr>
<td colspan="3" align="center"><b><%=langRenameTableAlt%></b></td>
</tr>
<% end if%>
<tr>
<td><%=langNewTableName%></td>
<td><input type="text" name="tablename" value="<%if action = "rename" Then Response.Write Request.QueryString("table").Item%>"></td>
<td><input type="submit" name="submit" value="<%if action = "rename" then Response.Write langRenameTableAlt Else Response.Write langCreateNewTable%>" class="button"></td>
</tr>
<% If StpProfile.ComponentAvailable("ADOX") Then%>
<tr>
<td colspan="3" align="center"><a href="linked.asp"><%=langAddLinkedTable%></a></td>
</tr>
<% End If%>
</table>
</form>
<%
call DBA_EndNewTable
set dba = Nothing
%>
<!--#include file=scripts\inc_footer.inc -->
</body>
</html>