/
index.php
77 lines (65 loc) · 2.06 KB
/
index.php
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/xml; charset=utf-8"0>
<title>Sql-Simple</title>
<script language="javascript" src="media/js/jquery.js"></script>
<script language="javascript" src="media/js/jquery.dataTables.js"></script>
<script language="javascript" src="media/js/TableTools.min.js"></script>
<script language="javascript" src="media/ZeroClipboard/ZeroClipboard.js"></script>
<link rel="stylesheet" type="text/css" href="media/css/style.css"/>
<link rel="stylesheet" type="text/css" href="media/css/TableTools.css"/>
</head>
<body>
<?php
error_reporting(E_ALL);
//for yaml
include("spyc.php");
$sqltemplates = spyc_load_file( "templates.yaml" );
$categories = array();
foreach($sqltemplates as $t)
{
$c = explode(",", $t['tags']);
foreach($c as $d)
{
$categories[$d][]=$t;
}
}
?>
<h1>Sql Simple</h1>
<div id="special">
<a href="#" onclick="$.get('rpc.php',{fn:'backup'},function(data){alert('Datenbank gesichert');});" >Datenbank sichern</a> <b>|</b>
<a href="help.html">Hilfe</a>
</div>
<div id="content">
<h2>Wählen Sie Ihre Aufgabe:</h2>
<select id="selTemplate" size="15">
<?
foreach($categories as $key => $tpls)
{
echo "<optgroup label=\"$key\">";
foreach($tpls as $tpl)
echo "<option value='$tpl[name]'>$tpl[desc]</option>";
echo "</optgroup>";
}
?>
</select>
<button id="preview">SQL Preview</button>
<h2>Setzen Sie die Variablen:</h2>
<div id="input"></div>
<div id="sqlpreview"></div>
<button id="exec">Execute</button>
<h2>Durchführung</h2>
<div id="loading">
<img src="media/images/loading.gif" width="150" />
</div>
<div id="exec"></div>
<!-- <pre><? print_r($sqltemplates); ?></pre> -->
<script language="javascript">
var templates=<?=json_encode($sqltemplates);?>;
</script>
<script language="javascript" src="media/js/function.js"></script>
</div>
</body>
</html>