Skip to content

Commit 600228f

Browse files
committed
added simple UI
1 parent c8d4a77 commit 600228f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

index.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
if (isset($_POST['query'])) {
3+
$query = $_POST['query'];
4+
require dirname(__FILE__) . '/sqlFormatter.php';
5+
$o = new SqlFormatter();
6+
$formattedQuery = $o->format($query);
7+
} else {
8+
$query = '';
9+
$formattedQuery = '';
10+
}
11+
?>
12+
<form method="POST">
13+
<label for="query">Query to format<label><br />
14+
<textarea name="query" rows="10" cols="100"><?php echo $query; ?></textarea><br />
15+
<input type="submit" value="Format!" />
16+
<?php if($formattedQuery): ?>
17+
<br />
18+
<br />
19+
<br />
20+
<label for="formattedQuery">Formatted query<label><br />
21+
<textarea name="formattedQuery" rows="10" cols="100"><?php echo $formattedQuery; ?></textarea>
22+
<?php endif; ?>
23+
</form>

0 commit comments

Comments
 (0)