-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbControl.php
More file actions
192 lines (152 loc) · 5.78 KB
/
dbControl.php
File metadata and controls
192 lines (152 loc) · 5.78 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php
include_once("dbLink.php");
$host="localhost";
$user="root";
$pass="";
$db="dbcontrol";
$dblink = dbLink($host,$user,$pass,$db);
if(isset($_POST['loop']))
{
$loop = $_POST['loop'];
}
else
{
$loop=0;
}
echo "<script>console.log('Debug: ".$loop."');</script>";
?>
<html>
<head>
<script src="jquery-2.1.3.min.js"></script>
<style>
#panel {
position:absolute;
width:98%;
top: 10%;
right:auto;
}
.terminal{
padding:15px;
background-color:#cccccc;
-webkit-box-shadow: inset 0px 0px 10px 0px rgba(107,107,107,1);
-moz-box-shadow: inset 0px 0px 10px 0px rgba(107,107,107,1);
box-shadow: inset 0px 0px 10px 0px rgba(107,107,107,1);
height:300px;
overflow:scroll;
}
#controls {
margin-top:20px;
}
</style>
</head>
<body>
<div id="panel">
<div class="terminal">
<?php
include_once("dbTerm.php");
?>
<section id="dialogue"></section>
</div>
<div id="controls">
<form class="form form-table" name="contactform" class="form form-table" method="post" action="dbControl.php">
<table width="450px">
<tr>
<td valign="top">
<label for="username">Username</label>
</td>
<td valign="top">
<input class="form-control hint" type="text" name="username" maxlength="50" size="30" onfocus="inputFocus(this)" onblur="inputBlur(this)"
<?php if(isset($_POST['username']))
{
echo "value={$_POST['username']}";
}?>
>
</td>
</tr>
<tr>
<td valign="top">
<label for="name">Name</label>
</td>
<td valign="top">
<input class="form-control hint" type="text" name="name" maxlength="50" size="30" onfocus="inputFocus(this)" onblur="inputBlur(this)"
<?php if(isset($_POST['name']))
{
echo "value={$_POST['name']}";
}?>
>
</td>
</tr>
<tr>
<td valign="top">
<label for="form">Table</label>
</td>
<td valign="top">
<input class="form-control hint" type="text" name="table" maxlength="80" size="30" onfocus="inputFocus(this)" onblur="inputBlur(this)"
<?php if(isset($_POST['table']))
{
echo "value={$_POST['table']}";
}?>
>
</td>
</tr>
<tr>
<td valign="top">
<label for="password">Password</label>
</td>
<td valign="top">
<input class="form-control hint" type="text" name="password" maxlength="30" size="30" onfocus="inputFocus(this)" onblur="inputBlur(this)">
</td>
</tr>
<tr>
<td valign="top">
<label for="query">Query</label><br>
</td>
<td valign="top">
<textarea for="query" name="query">
<?php if(isset($_POST['query']))
{
echo trim($_POST['query']);
}?></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="Submit">
</td>
</tr>
</table>
<input type="hidden" name="loop" value="<?php echo $loop+1;?>">
<input type="radio" name="access" value="Print" checked> Print
<input type="radio" name="access" value="Insert" > Insert
<input type="radio" name="access" value="Remove" > Remove
<input type="radio" name="access" value="Update"> Update
<input type="radio" name="access" value="CreateTable"> Create Table
<input type="checkbox" name="raw" value="Raw" <?php
if(isset($_POST['raw']))
{
echo "checked";
}
?>> Raw
</form>
<button id="addDB">Add DB</button>
<button id="rmvDB">Remove DB</button>
<button id="addTB">Create Table</button>
<button id="rmvTB">Remove Table</button>
<br>This program ran <?php echo $loop;?> times in a row.
</div>
</div>
<script type="text/javascript">
function addDB(){
$message = "<b>Terminal Refresh...</b>";
$('#dialogue').after($message);
}
JavaScript:
function inputFocus(i){
if(i.value==i.defaultValue){ i.value=""; i.style.color="#000"; }
}
function inputBlur(i){
if(i.value==""){ i.value=i.defaultValue; i.style.color="#888"; }
}
</script>
</body>
</html>