-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqbe.php
140 lines (124 loc) · 5.66 KB
/
qbe.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
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
<?php
/*
* Copyright (C) 2016 spectral369
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
session_start();
if (filter_input(INPUT_POST, 'servername') !== NULL AND filter_input(INPUT_POST, 'username') !== NULL AND
filter_input(INPUT_POST, 'password') !== NULL AND filter_input(INPUT_POST, 'serverport') !== NULL) {
$servern = filter_input(INPUT_POST, 'servername');
$username = filter_input(INPUT_POST, 'username');
$password = filter_input(INPUT_POST, 'password');
$serverp = filter_input(INPUT_POST, 'serverport');
}
$cookie_name = "serverna";
$cookie_port = "port";
$cookie_user = "user";
if (filter_input(INPUT_COOKIE, $cookie_name) === NULL OR filter_input(INPUT_COOKIE, $cookie_name) != $servern) {
setcookie($cookie_name, $servern, time() + (86400 * 5), "/");
}
if (filter_input(INPUT_COOKIE, $cookie_port) === NULL OR filter_input(INPUT_COOKIE, $cookie_port) != $serverp) {
setcookie($cookie_port, $serverp, time() + (86400 * 5), "/");
}
if (filter_input(INPUT_COOKIE, $cookie_user) === NULL OR filter_input(INPUT_COOKIE, $cookie_user) != $username) {
setcookie($cookie_user, $username, time() + (86400 * 5), "/");
}
include("DB/DB.php");
DB::setUP($username, $password, $servern, $serverp);
$conn = DB::connect();
$dbs = $conn->query('show databases;');
?>
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.12.4.min.js"></script>
<link rel="stylesheet" href="css/jquery-ui.css">
<script src="js/jquery-ui.min.js"></script>
<script src="js/pdfmake.min.js"></script>
<script src="js/vfs_fonts.js"></script>
<script type="text/javascript" src="js/customJS.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<title>QBE Web</title>
</head>
<body>
<div id="work">
<!-- wating for response-->
<div id="loading" style="display:none;">
Loading Please Wait....
<img src="img/loader.gif" alt="Loading" />
</div>
<div id="dbs1">
<form id="bazele">
<select id="dbs" name="users" >
<!--aici era un </div> -->
<option value="remove" selected disabled>Chose a Database</option>
<?php
foreach ($dbs as $db => $t) {
echo "<option value='$t[0]'>$t[0]</option>";
}
?>
</select>
<input type="text" class="querytxt" id="queryString">
<input type="button" id="query" value="Query" onclick="both();" disabled>
<input type="button" id="toxml" value="Export to XML" disabled>
<input type="button" id="topdf" value="Export to PDF" disabled>
</form>
<div id="dialog-message" title="Select PDF options" hidden>
<div style="margin-left: 23px;">
<p> Please Select page size:
<select id="pdf-page-size">
<option value="A3">A3</option>
<option value="A4" selected>A4</option>
<option value="A5">A5</option>
<option value="letter">letter</option>
<option value="legal">legal</option>
<option value="folio">folio</option>
<option value="executive">executive</option>
</select>
<br />
Please select page orientation:
<select id="orientation">
<option value="landscape" selected>landscape</option>
<option value="portrait">portrait</option>
</select>
<br />
Please enter a description:
<input type="text" size="28" placeholder="description" id="description" /><br />
</p></div>
</div>
<div id="tabele">
<form id="tabelele">
<select id="table" name="tables" size="23" disabled>
<!--<option value="_blank"></option>-->
</select>
</form>
</div>
<!--tabel query-->
<div id="tab">
<table id="queryTab" >
</table>
</div>
<div id="coloane">
<form id="coloanele">
<select id="col2" size="23" multiple disabled>
<!--<option value="_blank">blank_field</option>-->
</select>
</form>
</div>
</div>
</div>
</body>
</html>