-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php~
More file actions
242 lines (220 loc) · 9.82 KB
/
index.php~
File metadata and controls
242 lines (220 loc) · 9.82 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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include_once 'db_config.php';
?>
<html>
<head>
<meta charset="utf-8" />
<title>Generic Query Builder</title>
<link rel="shortcut icon" href="../favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.9.2.custom.min.css"/>
<link rel="stylesheet" type="text/css" href="css/mhs.css"/>
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="js/mhs.js"></script>
<script type="text/javascript" src="js/d3.v3.min.js"></script>
<script type="text/javascript" src="http://public.tableausoftware.com/javascripts/api/tableau_v8.js"></script>
<script>
$(function() {
// $("#dialog").dialog({
// autoOpen: false,
//
// })
// $("#openDB").click(function() {
// $("#dialog").dialog("open");
// });
// $("#pickAField").click(function() {
// $("#pickField").dialog("open");
// });
// <!-- $("#editField").click(function() { -->
// <!-- $("#pickField").dialog("open");-->
// <!-- }); -->
});
</script>
</head>
<body height="100%">
<div><span><!-- <img src="img/logo_multicare.jpg"/> -->QUERY BUILDER LOGO</span>
<span style="position: absolute;right: 10px"><!--<img src="img/Ctr.Web.Data.Sci_uw_Inst.Tech.png"/>--></span></div>
<div style="width: 100%;text-align: right"><a href="#" class="systemLinks">My Account</a> <a href="#" class="systemLinks">Log Out</a></div>
<br/>
<div style="height:100%">
<div id="leftColumn">
<div id="fieldInfo">
<p>Visualization Field:</p>
<input id="fieldTextBox" type="text" disabled="disabled" value=""></input>
<a id="editField">Change</a>
</div>
<div id="fieldList">
<?php
$tablesSchema = execute("select * from information_schema.columns where table_schema = '$DBName' order by table_name,ordinal_position");
?>
<ul>
<?php
$currentTable = "";
$oldTable = "";
$title = "";
$ui = "";
?>
<?php foreach ($tablesSchema as $row): ?>
<?php
// if ($row['ORDINAL_POSITION'] == 1) {
// continue;
// }
$oldTable = $currentTable;
$currentTable = $row['TABLE_NAME'];
$title = "<div>" . $oldTable . "</div>";
if ($currentTable != $oldTable && $oldTable != "") {
//HTML Will print
echo "<li>$title<ul>$ui</ul><li>";
$ui = "<li name='" . $row['TABLE_NAME'] . "~" . $row['COLUMN_NAME'] . "'>" . $row['COLUMN_NAME'] . "</li>";
} else {
$ui.= "<li name='" . $row['TABLE_NAME'] . "~" . $row['COLUMN_NAME'] . "'>" . $row['COLUMN_NAME'] . "</li>";
}
?>
<?php endforeach; ?>
<?php echo "<li>$title<ul>$ui</ul><li>"; ?>
</ul>
</div>
<button id="openDB">Pick Database Connection</button>
<!-- <div id="dialogConnection" title="Enter Database Information">
<p class="validateTips">All form fields are required.</p>
<form>
<fieldset>
<label for="name">Database Name:</label> </br>
<input type="text" name="DBName" id="DBName" class="text ui-widget-content ui-corner-all" /> </br>
<label for="username">Database Username:</label> </br>
<input type="text" name="DBUser" id="DBUser" value="" class="text ui-widget-content ui-corner-all" /> </br>
<label for="password">Database Password:</label> </br>
<input type="password" name="DBPassword" id="DBPassword" value="" class="text ui-widget-content ui-corner-all" /> </br>
</fieldset>
</form>
</div>-->
<hr class="panelbreak" />
<div id="segments">
<h3>My Segments</h3>
<ul>
<li>Test 1</li>
<li>Test 2</li>
<li>Test 3</li>
</ul>
<h3>Shared Segments</h3>
<ul>
<li>Test 1</li>
<li>Test 2</li>
<li>Test 3</li>
</ul>
</div>
</div>
<div id="rightContent">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Segment Generation</a></li>
<li><a href="#tabs-2">Explore Models</a></li>
<li><a href="#tabs-3">Test Models</a></li>
<li><a href="#tabs-3">Display Models</a></li>
<li><a href="#tabs-3">Visualize</a></li>
</ul>
<div id="tabs-1">
<!--<div id="test_tabl" style="width: 100%" class="dashed stats"></div>-->
<div id="dropContainer" style="width: 40%" class="dashed container">
<div class="label">Drag Fields Here</div>
<ul id="drop">
</ul>
</div>
<div id="stats" style="align: right; width: 50%" class="dashed stats">
<div style="clear: both"></div>
</div>
<!--<script>
var vizDiv = document.getElementById('test_tabl');
var vizURL = 'http://public.tableausoftware.com/views/wasl_scores_bydist_bysubgrp/dash_1';
var options = {
width:'950px',
height:'750px'
};
viz = new tableauSoftware.Viz(vizDiv, vizURL, options);
</script>-->
<script>
var map = new Datamap({
element: document.getElementById('container'),
fills: {
HIGH: '#afafaf',
LOW: '#123456',
MEDIUM: 'blue',
UNKNOWN: 'rgb(0,0,0)',
defaultFill: 'green'
},
data: {
IRL: {
fillKey: 'LOW',
numberOfThings: 2002
},
USA: {
fillKey: 'MEDIUM',
numberOfThings: 10381
}
}
});
//draw a legend for this map
map.legend();
</script>
<div id="tabs-2">
</div>
<div id="tabs-3">
</div>
</div>
</div>
<div style="clear:both"></div>
</div>
<div id="dialog" title="Select Join Field">
<div id="possibleJoinFields">
</div>
</div>
</body>
<!-- <div class="mark">
<img src="img/settings.png" />
</div>-->
<div id="options">
<div>
<img onclick="toggleOptions()" style="cursor: pointer;" src="img/exit-icon.png" />
</div>
<table class="options_table">
<tr>
<td>Visualization Field:</td>
</tr>
<tr>
<td>
<select id="chooseField" name="chooseField" onchange="updateVisualizationField(this)" >
<?php
$strSQL = "SELECT DISTINCT(COLUMN_NAME) FROM INFORMATION_SCHEMA.`COLUMNS` WHERE table_schema='$DBName';";
$result = execute($strSQL);
?>
<?php foreach ($result as $row):
if ($row["COLUMN_NAME"] == 'Gender') {
?>
<option value = <?php echo $row["COLUMN_NAME"] ?> selected="selected"> <?php echo $row["COLUMN_NAME"] ?> </option>
<?php
} else if ($row["COLUMN_NAME"] != 'seq') {
?>
<option value = <?php echo $row["COLUMN_NAME"] ?>> <?php echo $row["COLUMN_NAME"] ?> </option>
<?php
}
?>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr>
<td>Visualization Type:</td>
</tr>
<tr>
<td>
<select>
<option>Pie Chart</option>
<option>Bar Chart</option>
</select>
</td>
</tr>
</table>
</div>
</html>