-
Notifications
You must be signed in to change notification settings - Fork 0
/
QueryBuilder.html
440 lines (388 loc) · 19.8 KB
/
QueryBuilder.html
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>EasyQuery</title>
<!--
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<link href="http://cdn.korzh.com/eq/4.3/themes/default/easyquery.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://cdn.korzh.com/eq/4.3/themes/default/eq-icons-default.min.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://cdn.korzh.com/eq/4.3/themes/default/eqview.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.korzh.com/eq/4.3/themes/default/easychart.css" rel="stylesheet" type="text/css" />
-->
<script src="libs/jquey/jquery-1.10.2.js"></script>
<script src="libs/jquey/jquery-ui.js"></script>
<link href="libs/jquey/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="libs/gstatic/loader.js"></script>
<link href="libs/eqjs/css/easyquery.css" rel="stylesheet" type="text/css" media="screen" />
<link href="libs/eqjs/css/eq-icons-default.min.css" rel="stylesheet" type="text/css" media="screen" />
<link href="libs/eqjs/css/eqview.css" rel="stylesheet" type="text/css" />
<link href="libs/eqjs/css/easychart.css" rel="stylesheet" type="text/css" />
<style>
* {
padding: 0;
margin: 0;
}
body, p, td, th, div {
font-family: Trebuchet MS, Tahoma, Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
margin: 0;
padding: 0;
}
</style>
<script type="text/javascript">
var myListRequestHandler = function (params, onResult) {
var processed = true;
if (params.listName == "RegionList") {
var query = EQ.client.getQuery();
var country = EQ.core.getOneValueForAttr(query, "Customer.Country");
if (country == "Canada") {
onResult([
{ id: "BC", text: "British Columbia" },
{ id: "Quebec", text: "Quebec" }
]);
}
else {
onResult([
{ id: "CA", text: "California" },
{ id: "CO", text: "Colorado" },
{ id: "OR", text: "Oregon" },
{ id: "WA", text: "Washington" }
]);
}
}
else {
processed = false;
}
return processed;
};
window.easyQuerySettings = {
loadModelUrl: "EasyQuery.php?action=getModel",
buildQueryUrl: "EasyQuery.php?action=buildQuery",
syncQueryUrl: "EasyQuery.php?action=syncQuery",
executeQueryUrl: "EasyQuery.php?action=executeQuery",
loadQueryUrl: "EasyQuery.php?action=loadQuery",
saveQueryUrl: "EasyQuery.php?action=saveQuery",
listRequestUrl: "EasyQuery.php?action=listRequest",
modelId: "NWind",
listRequestHandler: myListRequestHandler,
entitiesPanel: { showCheckboxes: true },
columnsPanel: { allowAggrColumns: true, attrElementFormat: "{entity} {attr}", showColumnCaptions: true, adjustEntitiesMenuHeight: false },
queryPanel: {alwaysShowButtonsInPredicates: false, adjustEntitiesMenuHeight: false }
};
window.easyQueryViewSettings = {
showChart: true,
useEasyChart: true
};
// Load the Visualization API and the piechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(GoogleVisualizationLoaded);
function GoogleVisualizationLoaded() {
//alert("Visualization loaded!!!");
}
function getPrefix() {
var res = window.location.pathname;
if (res.charAt(res.length-1) !== '/')
res = res + '/';
return res;
}
</script>
</head>
<body>
<div id="main">
<div class="header">
<!--
<div class="title">EasyQuery</div>
<div class="sub-title">User-friendly ad-hoc query builder for your web-site</div>
-->
</div>
<div id="content">
<div class="header-panel">
<div class="entities-block">
<hr class="entities-hr hr" />
<div class="entities-title">Entities</div>
<div class="entities-panel-container">
<!-- EntitiesPanel widget placeholder -->
<div id="EntitiesPanel" onselectstart="return false"></div>
</div>
</div>
<div class="central-block">
<div class="columns-block">
<hr class="columns-hr hr" />
<div class="columns-title">Columns</div>
<div class="columns-panel-container">
<!-- ColumnsPanel widget placeholder -->
<div id="ColumnsPanel"></div>
</div>
</div>
<div class="conditions-block">
<hr class="conditions-hr hr" />
<div class="conditions-title">Conditions</div>
<div class="query-panel-container">
<!-- QueryPanel widget placeholder -->
<div id="QueryPanel"></div>
</div>
</div>
</div>
<div class="menu-block">
<hr class="menu-hr hr" />
<div class="menu-title">Menu</div>
<div class="menu-content">
<div id="ClearQueryButton" class="eqv-button clear-button">Clear query</div>
<!--
<div id="LoadQueryButton" class="eqv-button load-query-button">Load query</div>
<div id="SaveQueryButton" class="eqv-button save-query-button">Save query</div>
-->
<div id="ExecuteQueryButton" class="eqv-button execute-button">Execute</div>
</div>
</div>
</div>
<div class="bottom-panel">
<div class="sql-panel">
<hr class="sql-panel-hr hr" />
<div class="sql-panel-title">SQL</div>
<div id="SqlPanel" class="sql-block">
<div class="sql-panel-result"></div>
</div>
</div>
<div class="result-panel">
<hr class="result-panel-hr hr" />
<div class="result-panel-title">Result
<!--
<span id="btnExport" >
<a href="/EasyQuery/ExportToFileExcel">Export to Excel</a>
<a href="/EasyQuery/ExportToFileCsv">Export to CSV</a>
</span>
-->
</div>
<div id="ResultPanel" class="result-panel-content">
</div>
<div class="result-panel-content-padding">
</div>
</div>
</div>
</div>
</div>
<script src="libs/eqjs/js/eq.all.min.js" type="text/javascript"></script>
<script src="libs/eqjs/js/eq.view.basic.js" type="text/javascript"></script>
<script src="libs/eqjs/js/easychart.js" type="text/javascript"></script>
</body>
</html>
<!-- COLUMNS
<div class="columns-block">
<hr class="columns-hr hr">
<div class="columns-title">Columns</div>
<div class="columns-panel-container">
<!-- ColumnsPanel widget placeholder
<div id="ColumnsPanel" class="eqjs-qc-panel ui-droppable">
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div class="eqjs-qc-header" style="display: block;">
<div class="eqjs-qc-header-expression">Expression</div>
<div class="eqjs-qc-header-title">Title</div>
</div>
<div>
<div class="eqjs-qc-columns ui-sortable" style="display: block; max-height: 83px;">
<div id="ColumnsPanel-col-1" class="eqjs-qc-row eqjs-qc-row-column-entattr">
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder eqjs-qc-colelement">
<div class="eqjs-column-sortbutton eqjs-button eqjs-column-sortbutton-none" title="Sorting" style="display: none;"></div>
</div>
<div class="eqjs-qc-expr-block">
<div class="eqjs-qc-colelement eqjs-qc-attrelement">
<a href="javascript:void(0)" title="applications nombre">applications nombre</a>
</div>
</div>
<div style="display: none;"></div>
<div class="eqjs-qc-colelement eqjs-qc-captionelement">
<a href="javascript:void(0)" title="applications nombre">applications nombre</a>
<input type="text" class="eqjs-qc-ce-editbox" style="display: none;">
</div>
<div class="eqjs-column-buttonsBlock">
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder">
<div class="eqjs-button eqjs-column-button eqjs-column-button-type" title="Change to aggregate column" style="display: none;"></div>
</div>
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder">
<div class="eqjs-button eqjs-column-button eqjs-column-button-delete" title="Delete" style="display: none;"></div>
</div>
</div>
</div>
<div id="ColumnsPanel-col-2" class="eqjs-qc-row eqjs-qc-row-column-aggr">
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder eqjs-qc-colelement">
<div class="eqjs-column-sortbutton eqjs-button eqjs-column-sortbutton-none" title="Sorting" style="display: none;"></div>
</div>
<div class="eqjs-qc-expr-block eqjs-qc-expr-block-aggr">
<div class="eqjs-qc-colelement eqjs-qc-aggrfuncelement">
<a href="javascript:void(0)">Count</a>
</div>
<span class="eqjs-qc-colelement" title="of">of</span>
<div class="eqjs-qc-colelement eqjs-qc-attrelement">
<a href="javascript:void(0)" title="category nombre">category nombre</a>
</div>
</div>
<div style="display: none;"></div>
<div class="eqjs-qc-colelement eqjs-qc-captionelement">
<a href="javascript:void(0)" title="category nombre Count">category nombre Count</a>
<input type="text" class="eqjs-qc-ce-editbox" style="display: none;">
</div>
<div class="eqjs-column-buttonsBlock">
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder">
<div class="eqjs-button eqjs-column-button eqjs-column-button-type aggregated" title="Change to simple column" style="display: none;"></div>
</div>
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder">
<div class="eqjs-button eqjs-column-button eqjs-column-button-delete" title="Delete" style="display: none;"></div>
</div>
</div>
</div>
<div id="ColumnsPanel-col-3" class="eqjs-qc-row eqjs-qc-row-column-aggr active">
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder eqjs-qc-colelement">
<div class="eqjs-column-sortbutton eqjs-button eqjs-column-sortbutton-none" title="Sorting" style="display: block;"></div>
</div>
<div class="eqjs-qc-expr-block eqjs-qc-expr-block-aggr">
<div class="eqjs-qc-colelement eqjs-qc-aggrfuncelement">
<a href="javascript:void(0)">Average</a>
</div>
<span class="eqjs-qc-colelement" title="of">of</span>
<div class="eqjs-qc-colelement eqjs-qc-attrelement">
<a href="javascript:void(0)" title="proyectos avance">proyectos avance</a>
</div>
</div>
<div style="display: none;"></div>
<div class="eqjs-qc-colelement eqjs-qc-captionelement">
<a href="javascript:void(0)" title="proyectos avance Average">proyectos avance Average</a>
<input type="text" class="eqjs-qc-ce-editbox" style="display: none;">
</div>
<div class="eqjs-column-buttonsBlock">
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder">
<div class="eqjs-button eqjs-column-button eqjs-column-button-type aggregated" title="Change to simple column" style="display: block;"></div>
</div>
<div class="eqjs-button-placeholder eqjs-qc-button-placeholder">
<div class="eqjs-button eqjs-column-button eqjs-column-button-delete" title="Delete" style="display: block;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="eqjs-addrow eqjs-qc-addrow eqjs-addrow-empty">
<a href="javascript:void(0)">[Add new column]</a>
</div>
</div>
</div>
</div>
<!-- CONDITIONS
<div class="conditions-block">
<hr class="conditions-hr hr" />
<div class="conditions-title">Conditions</div>
<div class="query-panel-container">
<div id="QueryPanel-pred-root" class="eqjs-qp-predicate eqjs-qp-predicate-root">
<div class="eqjs-qp-row eqjs-qp-row-predicate eqjs-qp-row-predicate-root">
<span class="eqjs-qp-predelement">Select records where </span>
<div class="eqjs-qp-predelement eqjs-qp-predvalueelement">
<a href="javascript:void(0)">all</a>
<div style="display: none;">
</div>
</div>
<span class="eqjs-qp-predelement"> of the following apply</span>
<div class="eqjs-qp-condition-buttonsBlock">
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-addCondition" title="Add condition">
</div>
</div>
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-addPredicate" title="Add group of conditions">
</div>
</div>
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-enable enabled" title="Toggle enable">
</div>
</div>
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-delete" title="Delete">
</div>
</div>
</div>
</div>
<div class="eqjs-qp-conditions" style="max-height: 139px;">
<div id="QueryPanel-cond-1" class="eqjs-qp-row eqjs-qp-row-condition">
<div class="eqjs-qp-condelement eqjs-qp-attrelement">
<a href="javascript:void(0)" title="applications id">applications id</a>
</div>
<div class="eqjs-qp-condelement eqjs-qp-operelement">
<a href="javascript:void(0)">is equal to</a>
<div style="display: none;">
</div>
</div>
<div class="eqjs-qp-condelement eqjs-qp-valueelement">
<a href="javascript:void(0)" title="[enter value]">[enter value]</a>
<input type="text" class="eqjs-qp-ve-editbox" style="display: none;">
</div>
<div class="eqjs-qp-condition-buttonsBlock">
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-enable enabled" title="Toggle enable">
</div>
</div>
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-delete" title="Delete">
</div>
</div>
</div>
</div>
<div id="QueryPanel-cond-2" class="eqjs-qp-row eqjs-qp-row-condition">
<span class="eqjs-qp-condelement eqjs-qp-condition-conjuction">and</span>
<div class="eqjs-qp-condelement eqjs-qp-attrelement">
<a href="javascript:void(0)" title="applications id">applications id</a>
</div>
<div class="eqjs-qp-condelement eqjs-qp-operelement">
<a href="javascript:void(0)">is equal to</a>
<div style="display: none;">
</div>
</div>
<div class="eqjs-qp-condelement eqjs-qp-valueelement">
<a href="javascript:void(0)" title="12">12</a>
<input type="text" class="eqjs-qp-ve-editbox" style="display: none;">
</div>
<div class="eqjs-qp-condition-buttonsBlock">
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-enable enabled" title="Toggle enable">
</div>
</div>
<div class="eqjs-qp-button-placeholder" style="display: none;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-delete" title="Delete">
</div>
</div>
</div>
</div>
<div id="QueryPanel-cond-3" class="eqjs-qp-row eqjs-qp-row-condition active">
<span class="eqjs-qp-condelement eqjs-qp-condition-conjuction">and</span>
<div class="eqjs-qp-condelement eqjs-qp-attrelement">
<a href="javascript:void(0)" title="applications estado">applications estado</a>
</div>
<div class="eqjs-qp-condelement eqjs-qp-operelement">
<a href="javascript:void(0)">starts with</a>
<div style="display: none;">
</div>
</div>
<div class="eqjs-qp-condelement eqjs-qp-valueelement">
<a href="javascript:void(0)" title="123">123</a>
<input type="text" class="eqjs-qp-ve-editbox" style="display: none;">
</div>
<div class="eqjs-qp-condition-buttonsBlock">
<div class="eqjs-qp-button-placeholder" style="display: block;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-enable enabled" title="Toggle enable">
</div>
</div>
<div class="eqjs-qp-button-placeholder" style="display: block;">
<div class="eqjs-qp-condition-button eqjs-qp-condition-button-delete" title="Delete">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
-->