-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·275 lines (198 loc) · 6.49 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
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
<?php
//Get Functions
//define('__ROOT__', dirname(dirname(__FILE__)));
//require_once(__ROOT__.'/wagonsroll/src/settings.php');
require 'src/wagonsroll/wagonsroll_autoloader.php';
?>
<!doctype html>
<html lang="en">
<head>
<title>Wagons Roll</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="assets/wagonsroll.css" rel="stylesheet" />
</head>
<body>
<?php
// Parse with sections
$ini_array = parse_ini_file("wagonsroll.ini",true);
//Queue to use
$queueID = $ini_array['queue_info']['email'];
// $configTemplate = file_get_contents('assets/configTemplate.html', true);
?>
<form name="add_post" method="post">
<center>
<table style="width:95%;">
<tr>
<td style="width:13%;">
<div class="container box">
<div class="form-group" align="left">
<input type="button" valign="top" name="post_button" id="post_button" value="Update" class="btn btn-info" />
</div>
<input type="checkbox" id="queueOpen" />
<label for="queueOpen">Open Process</label>
<br>
<input type="checkbox" id="archive" />
<label for="archive">Archive Session</label>
</div>
<div class="container box">
<div id="queueID">Queue <br><i>
<?php echo $queueID; ?>
</i>
</div>
<div id="postCountDown"></div>
</div>
</td>
<td style="width:40%;">
<div id="systembox">
<div id="systemStatus">
</div>
</div>
</td>
<td style="width:40%;">
<div id="banner">
<img src="assets/banner.png" alt="Wagons Roll By FinTechllc.com">
</div>
</td>
</tr>
</table>
</center>
<!-- <div class="form-group">
<textarea name="post_name" id="post_name" class="form-control" rows="3"></textarea>
</div>
-->
</form>
<ul class="nav nav-tabs my-tab">
<li class="active"><a data-toggle="tab" href="#home">Queue</a></li>
<li><a data-toggle="tab" href="#settings">Settings</a></li>
<li><a data-toggle="tab" href="#setup">Setup & Validate</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<h3>Queue</h3>
<div id="load_posts"></div>
</div>
<div id="settings" class="tab-pane fade">
<div class="container settingwrapper">
<h4><div class="col-md-10">Settings</div>
</h4>
</div>
<div>
<div id="queueStatus"></div>
</div>
<div>
Wagons Roll To External System Mapping
</div>
<?php
//echo $configTemplate;
echo '<pre>' . print_r($ini_array,true) . '</pre>';
?>
</div>
<div id="setup" class="tab-pane fade">
<h3>System Setup</h3>
<p>Run System Updates for Changes and Database Changes</p>
<input type="button" valign="top" name="system_check" id="system_check" value="System Check" class="btn btn-info" />
<input type="button" valign="top" name="system_update" id="system_update" value="System Update" class="btn btn-info" />
<div id="systemReport"></div>
</div>
</div> <!--Tab Content end -->
</div>
</body>
</html>
<script>
$(document).ready(function(){
var timeWait = 30
var timeLeft = timeWait;
//var timerId = setInterval(countdown, 1000);
var elem = document.getElementById('postCountDown');
var queueData = document.getElementById('load_posts');
var queueOpen = $("#queueOpen").is(":checked");
elem.innerHTML = 'Queue Closed';
//elem.innerHTML = 'Updating in <br><i>' + timeLeft + '</i> seconds';
function countdown() {
var queueOpen = $("#queueOpen").is(":checked");
if (timeLeft == -1) { //times up
if (queueOpen) {
$('#load_posts').load("queue.php");
elem.innerHTML = 'Queue Updating';
}else{ //Not Open
$('#load_posts').unload("queue.php");
elem.innerHTML = 'Queue Closed<br><i>' + timeLeft + '</i> seconds';
}
timeLeft = timeWait;
} else { //Times not up
//$('#load_posts').unload("queue.php");
if (queueOpen) {
elem.innerHTML = 'Queue Recheck in <br><i>' + timeLeft + '</i> seconds';
}else{
elem.innerHTML = 'Queue Closed';
queueData.innerHTML = '';
//$('#load_posts').unload("queue.php");
clearInterval(timerId);
}
timeLeft--;
}
}
$('#post_button').click(function(){
var post_name = $('#post_name').val();
var queueOpen = $("#queueOpen").is(":checked");
if (queueOpen) {
$('#load_posts').load("queue.php").fadeIn("slow");
clearInterval(timerId);
var timerId = setInterval(countdown, 1000);
}else{
$('#load_posts').unload("queue.php");
clearInterval(timerId);
}
//trim() is used to remover spaces
if($.trim(post_name) != '')
{
$.ajax({
url:"post.php",
method:"POST",
data:{post_name:post_name},
dataType:"text",
success:function(data)
{
$('#post_name').val("");
}
});
}
}); //sUBMIT
//Check System Status
$('#systemStatus').load("src/wagonsroll/setup.php");
//Check System Status
$('#queueStatus').load("src/wagonsroll/settings.php");
//Validate the system table files are correct version and format
$('#system_check').click(function(){
$.ajax({
url:"src/wagonsroll/setup.php",
method:"POST",
data:{
function: "verify"
},
dataType:"text",
success:function(data)
{
$('#systemReport').append(data);
}
});
});
//Create and Update the system
$('#system_update').click(function(){
$.ajax({
url:"src/wagonsroll/setup.php",
method:"POST",
data:{
function: "update"
},
dataType:"text",
success:function(data)
{
$('#systemReport').append(data);
}
});
});
}); //Document Ready
</script>