· 9 years ago · Nov 06, 2016, 05:04 PM
1<?php
2
3$instance = $_GET['i'];
4
5if(empty($instance)) $instance = 1;
6if(!is_numeric($instance)) $instance = 1;
7
8require 'config.php';
9
10$conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
11
12
13if(isset($_POST['new_instance']))
14{
15 $sql = "SELECT id FROM settings";
16 $result = $conn->query($sql);
17 $instances = $result->num_rows;
18
19 $instance = $instances++;
20 $sql = "INSERT INTO settings () VALUES ()";
21 $result = $conn->query($sql);
22 if($conn->error) die($conn->error);
23
24 $sql = "CREATE TABLE IF NOT EXISTS bets" . $instances . " (
25 id int unsigned PRIMARY KEY AUTO_INCREMENT,
26 pd_id bigint unsigned not null,
27 win int(1) not null,
28 amount bigint not null,
29 target varchar(6) not null,
30 profit bigint not null,
31 `condition` varchar(1) not null,
32 roll varchar(6) not null,
33 client varchar(255) not null,
34 player varchar(255) not null,
35 `time` varchar(30) not null,
36 `round_bet_n` int unsigned not null
37 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
38 $conn->query($sql);
39 if($conn->error) die('Bet history table failed to create. Create it manually or delete this instance and try again :| .' . $conn->error);
40}
41
42$sql = "SELECT * FROM settings WHERE id='$instance' LIMIT 1";
43$result = $conn->query($sql);
44
45if($result->num_rows > 0)
46{
47 $row = $result->fetch_assoc();
48 $settings = $row;
49}
50
51// extract instances
52$sql = "SELECT id FROM settings";
53$result = $conn->query($sql);
54$instances = $result->num_rows;
55?>
56
57
58<!DOCTYPE html>
59<html>
60 <head>
61 <!-- jquery -->
62 <script src="https://code.jquery.com/jquery-3.1.1.min.js"
63 integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
64 crossorigin="anonymous"></script>
65
66 <!-- Latest compiled and minified CSS -->
67 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
68
69 <!-- Optional theme -->
70 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
71
72 <!-- Latest compiled and minified JavaScript -->
73 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
74
75 <link rel="stylesheet" href="/node_modules/toastr/build/toastr.min.css">
76 </head>
77
78 <body>
79 <div class="row main">
80
81 <div class="col-xs-1"></div>
82 <div class="col-xs-10">
83 <h1 class="text-center">MultiLoginBot (or something)</h1>
84 <hr/>
85 <div class="row">
86 <div class="col-xs-2"></div>
87 <div class="col-xs-8 well">
88 <h3>Instances</h3>
89 <p>
90 <?php for($i = 1; $i<=$instances; $i++){
91 if($instance == $i)
92 {
93 echo "<a href='?i=$i' style='font-size:30px; color:red'>$i</a> ";
94 }
95 else {
96 echo "<a href='?i=$i'>$i</a> ";
97 }
98 } ?>
99 </p>
100 <hr/>
101 <form method="post" class="form-instance">
102 <input type="submit" name="new_instance" value="Add new instance" class="btn btn-success btn-md">
103 </form>
104 </div>
105 </div>
106 <div class="row">
107 <div class="col-sm-1"></div>
108 <div class="col-sm-5">
109 <div class="col-sm-12 well">
110 <h3>Limiters</h3>
111 <form method="post" class="form-limits">
112 <div class="form-group">
113 <label>Maximum number of bets</label>
114 <input type="text" name="max" class="form-control" value=<?php echo $settings['max']; ?>>
115 </div>
116 <div class="form-group">
117 <label>Minimum balance</label>
118 <input type="text" class="form-control" name="min_balance" value=<?php echo number_format($settings['min_balance'] / 100000000, 8); ?>>
119 </div>
120 <div class="form-group">
121 <label>Maximum balance</label>
122 <input type="text" name="max_balance" class="form-control" value=<?php echo number_format($settings['max_balance'] / 100000000, 8); ?>>
123 </div>
124 <div class="form-group">
125 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
126 <input type="submit" name="limiters" class="btn btn-primary">
127 </div>
128 </form>
129 </div>
130 </div>
131
132 <div class="col-sm-5">
133 <div class="col-sm-12 well">
134 <h3>Taking profit</h3>
135 <form method="post" class="form-profit">
136 <div class="form-group">
137 <label>Starting balance</label>
138 <input type="text" name="start_balance" class="form-control" value=<?php echo number_format($settings['start_balance'] / 100000000, 8); ?>>
139 </div>
140 <div class="form-group">
141 <label>Withdrawal Threshold</label>
142 <input type="text" name="thresh" class="form-control" value=<?php echo number_format($settings['thresh'] / 100000000, 8); ?>>
143 </div>
144 <div class="form-group">
145 <label>Withdrawal address</label>
146 <input type="text" name="w_address" class="form-control" value=<?php echo $settings['address']; ?>>
147 </div>
148 <div class="form-group">
149 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
150 <input type="submit" class="btn btn-primary">
151 </div>
152 </form>
153 </div>
154 </div>
155 </div>
156
157 <div class="row">
158 <div class="col-sm-1"></div>
159 <div class="col-sm-5">
160 <div class="col-sm-12 well">
161 <h3>Bets</h3>
162 <form method="post" class="form-bet">
163 <div class="form-group">
164 <label>Initial Bet</label>
165 <input type="text" name="initial" class="form-control" value=<?php echo number_format($settings['initial'] / 100000000, 8); ?>>
166 </div>
167 <div class="form-group">
168 <label>Base Bet</label>
169 <input type="text" name="base" class="form-control" value=<?php echo number_format($settings['base'] / 100000000, 8); ?>>
170 </div>
171 <div class="form-group">
172 <label>Reset on win</label>
173 <input type="checkbox" name="resetwin" <?php echo $settings['resetwin'] ? 'checked': ''; ?>>
174 <label>Reset on loose</label>
175 <input type="checkbox" name="resetloose" <?php echo $settings['resetloose'] ? 'checked': ''; ?>>
176 <hr/>
177 <label>Stop ONLY at base bet</label>
178 <input type="checkbox" name="stopbase" <?php echo $settings['stopbase'] ? 'checked': ''; ?>>
179 </div>
180 <div class="form-group">
181 <label>Increase bet on win (%)</label>
182 <input type="text" name="increasewin" class="form-control" value=<?php echo $settings['increasewin'] * 100; ?>>
183 </div>
184 <div class="form-group">
185 <label>Increase bet on loose (%)</label>
186 <input type="text" name="increaseloose" class="form-control" value=<?php echo $settings['increaseloose'] * 100; ?>>
187 </div>
188 <div class="form-group">
189 <label>Max. Bet size</label>
190 <input type="text" name="maxsize" class="form-control" value=<?php echo number_format($settings['maxsize'] / 100000000, 8); ?>>
191 </div>
192 <div class="form-group">
193 <label>Bet target (the number, from 0.00 to 99.99)</label>
194 <input type="text" name="chances" class="form-control" value=<?php echo $settings['chances']; ?>>
195 </div>
196 <div class="form-group">
197 <label>Condition (> or <)</label>
198 <input type="text" class="form-control" name="condition" value=<?php echo $settings['condition']; ?>>
199 </div>
200 <div class="form-group">
201 <label>Return to base bet after x losses in a row (x)</label>
202 <input type="text" name="xlosses" class="form-control" value=<?php echo $settings['xlosses']; ?>>
203 </div>
204 <div class="form-group">
205 <label>Change seed every:</label><small>For primedice there should pass some time between changes</small>
206 <input type="text" class="form-control" name="seed" value=<?php echo $settings['change_seed']; ?>>
207 </div>
208 <div class="form-group">
209 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
210 <input type="submit" name="heeh" class="btn btn-primary">
211 </div>
212 </form>
213 </div>
214 </div>
215
216 <div class="col-sm-5">
217 <div class="col-sm-12 well">
218 <h3>Users (hehe)</h3>
219 <form method="post" class="form-users">
220 <div class="form-group">
221 <label>All accounts</label>
222 <small>Well, for primedice this should be apikeys :)</small>
223 <br/>
224 <small>Format is <i>apikey1;apikey2;apikey3;apikey4;...</i></small>
225 <textarea class="form-control" name="keys"><?php echo $settings['keys']; ?></textarea>
226 </div>
227 <hr/>
228 <div class="form-group">
229 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
230 <input type="submit" class="btn btn-primary">
231 </div>
232 </form>
233 <div class="form-group">
234 <label>Recently used</label>
235 <textarea class="form-control" style="height:200px"><?php echo $recentkeys; ?></textarea>
236 </div>
237 </div>
238 </div>
239 </div>
240 <hr/>
241 <div class="row">
242 <form method=post class="form-test">
243 <div class="form-group text-center">
244 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
245 <input type="submit" name="fave" class="btn btn-warning btn-lg" value="TEST" style="width:60%; height:100px">
246 </div>
247 </form>
248 </div>
249 <hr/>
250 <div class="row">
251 <form method="post" class="form-start">
252 <div class="form-group text-center">
253 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
254 <input type="submit" class="btn btn-danger btn-lg" value="RUN" style="width:60%; height:100px">
255 </div>
256 </form>
257 </div>
258 <hr/>
259 <div class="row">
260 <form method="post" class="form-stop">
261 <div class="form-group text-center">
262 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
263 <input type="submit" class="btn btn-success btn-lg" value="STOP" style="width:60%; height:100px">
264 </div>
265 </form>
266 </div>
267 </div>
268 <div class="col-xs-1"></div>
269
270 <hr/>
271 <!--
272 <div class="row">
273 <div class="col-xs-1"></div>
274 <div class="col-xs-10">
275 <div class="highlight">
276 <pre>
277
278 </pre>
279 </div>
280 </div>
281 </div>
282 -->
283 <script src="/node_modules/toastr/toastr.js"></script>
284 <script>
285 $('.form-limits').submit(function() {
286 var serialize = $(this).serialize();
287 $.post('/ajax', "action=limits&" + serialize, function(data) {
288 data = $.parseJSON(data);
289 if (data.status == "success") {
290 alertSuccess('Success', 'Settings updated');
291 } else if (data.status == "redirect") {
292 window.location = data.redirect;
293 } else if (data.status == "error") {
294 alertError('Error encountered', data.error);
295 } else {
296 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
297 }
298 });
299 return false;
300 });
301
302 $('.form-users').submit(function() {
303 var serialize = $(this).serialize();
304 $.post('/ajax', "action=users&" + serialize, function(data) {
305 data = $.parseJSON(data);
306 if (data.status == "success") {
307 alertSuccess('Success', 'Settings updated');
308 } else if (data.status == "redirect") {
309 window.location = data.redirect;
310 } else if (data.status == "error") {
311 alertError('Error encountered', data.error);
312 } else {
313 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
314 }
315 });
316 return false;
317 });
318
319 $('.form-bet').submit(function() {
320 var serialize = $(this).serialize();
321 $.post('/ajax', "action=bet&" + serialize, function(data) {
322 data = $.parseJSON(data);
323 if (data.status == "success") {
324 alertSuccess('Success', 'Settings updated');
325 } else if (data.status == "redirect") {
326 window.location = data.redirect;
327 } else if (data.status == "error") {
328 alertError('Error encountered', data.error);
329 } else {
330 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
331 }
332 });
333 return false;
334 });
335
336 $('.form-profit').submit(function() {
337 var serialize = $(this).serialize();
338 $.post('/ajax', "action=profit&" + serialize, function(data) {
339 data = $.parseJSON(data);
340 if (data.status == "success") {
341 alertSuccess('Success', 'Settings updated');
342 } else if (data.status == "redirect") {
343 window.location = data.redirect;
344 } else if (data.status == "error") {
345 alertError('Error encountered', data.error);
346 } else {
347 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
348 }
349 });
350 return false;
351 });
352
353 $('.form-test').submit(function() {
354 var serialize = $(this).serialize();
355 $.post('/ajax', "action=test&" + serialize, function(data) {
356 data = $.parseJSON(data);
357 if (data.status == "success") {
358 alertSuccess('Success', 'It seems that it is all good :D RUN');
359 } else if (data.status == "redirect") {
360 window.location = data.redirect;
361 } else if (data.status == "error") {
362 alertError('Error encountered', data.error);
363 } else {
364 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
365 }
366 });
367 return false;
368 });
369
370 $('.form-start').submit(function() {
371 var serialize = $(this).serialize();
372 $.post('/ajax', "action=start&" + serialize, function(data) {
373 data = $.parseJSON(data);
374 if (data.status == "success") {
375 alertSuccess('Success', 'I am running hehe :D');
376 } else if (data.status == "redirect") {
377 window.location = data.redirect;
378 } else if (data.status == "error") {
379 alertError('Error encountered', data.error);
380 } else {
381 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
382 }
383 });
384 return false;
385 });
386
387 $('.form-stop').submit(function() {
388 var serialize = $(this).serialize();
389 $.post('/ajax', "action=stop&" + serialize, function(data) {
390 data = $.parseJSON(data);
391 if (data.status == "success") {
392 alertSuccess('Success', 'Bot stopped');
393 } else if (data.status == "redirect") {
394 window.location = data.redirect;
395 } else if (data.status == "error") {
396 alertError('Error encountered', data.error);
397 } else {
398 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
399 }
400 });
401 return false;
402 });
403
404 toastr.options = {
405 "closeButton": true,
406 "debug": false,
407 "newestOnTop": true,
408 "progressBar": true,
409 "positionClass": "toast-bottom-right",
410 "preventDuplicates": false,
411 "onclick": null,
412 "showDuration": "300",
413 "hideDuration": "1000",
414 "timeOut": "10000",
415<?php
416
417$instance = $_GET['i'];
418
419if(empty($instance)) $instance = 1;
420if(!is_numeric($instance)) $instance = 1;
421
422require 'config.php';
423
424$conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
425
426
427if(isset($_POST['new_instance']))
428{
429 $sql = "SELECT id FROM settings";
430 $result = $conn->query($sql);
431 $instances = $result->num_rows;
432
433 $instance = $instances++;
434 $sql = "INSERT INTO settings () VALUES ()";
435 $result = $conn->query($sql);
436 if($conn->error) die($conn->error);
437
438 $sql = "CREATE TABLE IF NOT EXISTS bets" . $instances . " (
439 id int unsigned PRIMARY KEY AUTO_INCREMENT,
440 pd_id bigint unsigned not null,
441 win int(1) not null,
442 amount bigint not null,
443 target varchar(6) not null,
444 profit bigint not null,
445 `condition` varchar(1) not null,
446 roll varchar(6) not null,
447 client varchar(255) not null,
448 player varchar(255) not null,
449 `time` varchar(30) not null,
450 `round_bet_n` int unsigned not null
451 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
452 $conn->query($sql);
453 if($conn->error) die('Bet history table failed to create. Create it manually or delete this instance and try again :| .' . $conn->error);
454}
455
456$sql = "SELECT * FROM settings WHERE id='$instance' LIMIT 1";
457$result = $conn->query($sql);
458
459if($result->num_rows > 0)
460{
461 $row = $result->fetch_assoc();
462 $settings = $row;
463}
464
465// extract instances
466$sql = "SELECT id FROM settings";
467$result = $conn->query($sql);
468$instances = $result->num_rows;
469?>
470
471
472<!DOCTYPE html>
473<html>
474 <head>
475 <!-- jquery -->
476 <script src="https://code.jquery.com/jquery-3.1.1.min.js"
477 integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
478 crossorigin="anonymous"></script>
479
480 <!-- Latest compiled and minified CSS -->
481 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
482
483 <!-- Optional theme -->
484 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
485
486 <!-- Latest compiled and minified JavaScript -->
487 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
488
489 <link rel="stylesheet" href="/node_modules/toastr/build/toastr.min.css">
490 </head>
491
492 <body>
493 <div class="row main">
494
495 <div class="col-xs-1"></div>
496 <div class="col-xs-10">
497 <h1 class="text-center">MultiLoginBot (or something)</h1>
498 <hr/>
499 <div class="row">
500 <div class="col-xs-2"></div>
501 <div class="col-xs-8 well">
502 <h3>Instances</h3>
503 <p>
504 <?php for($i = 1; $i<=$instances; $i++){
505 if($instance == $i)
506 {
507 echo "<a href='?i=$i' style='font-size:30px; color:red'>$i</a> ";
508 }
509 else {
510 echo "<a href='?i=$i'>$i</a> ";
511 }
512 } ?>
513 </p>
514 <hr/>
515 <form method="post" class="form-instance">
516 <input type="submit" name="new_instance" value="Add new instance" class="btn btn-success btn-md">
517 </form>
518 </div>
519 </div>
520 <div class="row">
521 <div class="col-sm-1"></div>
522 <div class="col-sm-5">
523 <div class="col-sm-12 well">
524 <h3>Limiters</h3>
525 <form method="post" class="form-limits">
526 <div class="form-group">
527 <label>Maximum number of bets</label>
528 <input type="text" name="max" class="form-control" value=<?php echo $settings['max']; ?>>
529 </div>
530 <div class="form-group">
531 <label>Minimum balance</label>
532 <input type="text" class="form-control" name="min_balance" value=<?php echo number_format($settings['min_balance'] / 100000000, 8); ?>>
533 </div>
534 <div class="form-group">
535 <label>Maximum balance</label>
536 <input type="text" name="max_balance" class="form-control" value=<?php echo number_format($settings['max_balance'] / 100000000, 8); ?>>
537 </div>
538 <div class="form-group">
539 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
540 <input type="submit" name="limiters" class="btn btn-primary">
541 </div>
542 </form>
543 </div>
544 </div>
545
546 <div class="col-sm-5">
547 <div class="col-sm-12 well">
548 <h3>Taking profit</h3>
549 <form method="post" class="form-profit">
550 <div class="form-group">
551 <label>Starting balance</label>
552 <input type="text" name="start_balance" class="form-control" value=<?php echo number_format($settings['start_balance'] / 100000000, 8); ?>>
553 </div>
554 <div class="form-group">
555 <label>Withdrawal Threshold</label>
556 <input type="text" name="thresh" class="form-control" value=<?php echo number_format($settings['thresh'] / 100000000, 8); ?>>
557 </div>
558 <div class="form-group">
559 <label>Withdrawal address</label>
560 <input type="text" name="w_address" class="form-control" value=<?php echo $settings['address']; ?>>
561 </div>
562 <div class="form-group">
563 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
564 <input type="submit" class="btn btn-primary">
565 </div>
566 </form>
567 </div>
568 </div>
569 </div>
570
571 <div class="row">
572 <div class="col-sm-1"></div>
573 <div class="col-sm-5">
574 <div class="col-sm-12 well">
575 <h3>Bets</h3>
576 <form method="post" class="form-bet">
577 <div class="form-group">
578 <label>Initial Bet</label>
579 <input type="text" name="initial" class="form-control" value=<?php echo number_format($settings['initial'] / 100000000, 8); ?>>
580 </div>
581 <div class="form-group">
582 <label>Base Bet</label>
583 <input type="text" name="base" class="form-control" value=<?php echo number_format($settings['base'] / 100000000, 8); ?>>
584 </div>
585 <div class="form-group">
586 <label>Reset on win</label>
587 <input type="checkbox" name="resetwin" <?php echo $settings['resetwin'] ? 'checked': ''; ?>>
588 <label>Reset on loose</label>
589 <input type="checkbox" name="resetloose" <?php echo $settings['resetloose'] ? 'checked': ''; ?>>
590 <hr/>
591 <label>Stop ONLY at base bet</label>
592 <input type="checkbox" name="stopbase" <?php echo $settings['stopbase'] ? 'checked': ''; ?>>
593 </div>
594 <div class="form-group">
595 <label>Increase bet on win (%)</label>
596 <input type="text" name="increasewin" class="form-control" value=<?php echo $settings['increasewin'] * 100; ?>>
597 </div>
598 <div class="form-group">
599 <label>Increase bet on loose (%)</label>
600 <input type="text" name="increaseloose" class="form-control" value=<?php echo $settings['increaseloose'] * 100; ?>>
601 </div>
602 <div class="form-group">
603 <label>Max. Bet size</label>
604 <input type="text" name="maxsize" class="form-control" value=<?php echo number_format($settings['maxsize'] / 100000000, 8); ?>>
605 </div>
606 <div class="form-group">
607 <label>Bet target (the number, from 0.00 to 99.99)</label>
608 <input type="text" name="chances" class="form-control" value=<?php echo $settings['chances']; ?>>
609 </div>
610 <div class="form-group">
611 <label>Condition (> or <)</label>
612 <input type="text" class="form-control" name="condition" value=<?php echo $settings['condition']; ?>>
613 </div>
614 <div class="form-group">
615 <label>Return to base bet after x losses in a row (x)</label>
616 <input type="text" name="xlosses" class="form-control" value=<?php echo $settings['xlosses']; ?>>
617 </div>
618 <div class="form-group">
619 <label>Change seed every:</label><small>For primedice there should pass some time between changes</small>
620 <input type="text" class="form-control" name="seed" value=<?php echo $settings['change_seed']; ?>>
621 </div>
622 <div class="form-group">
623 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
624 <input type="submit" name="heeh" class="btn btn-primary">
625 </div>
626 </form>
627 </div>
628 </div>
629
630 <div class="col-sm-5">
631 <div class="col-sm-12 well">
632 <h3>Users (hehe)</h3>
633 <form method="post" class="form-users">
634 <div class="form-group">
635 <label>All accounts</label>
636 <small>Well, for primedice this should be apikeys :)</small>
637 <br/>
638 <small>Format is <i>apikey1;apikey2;apikey3;apikey4;...</i></small>
639 <textarea class="form-control" name="keys"><?php echo $settings['keys']; ?></textarea>
640 </div>
641 <hr/>
642 <div class="form-group">
643 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
644 <input type="submit" class="btn btn-primary">
645 </div>
646 </form>
647 <div class="form-group">
648 <label>Recently used</label>
649 <textarea class="form-control" style="height:200px"><?php echo $recentkeys; ?></textarea>
650 </div>
651 </div>
652 </div>
653 </div>
654 <hr/>
655 <div class="row">
656 <form method=post class="form-test">
657 <div class="form-group text-center">
658 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
659 <input type="submit" name="fave" class="btn btn-warning btn-lg" value="TEST" style="width:60%; height:100px">
660 </div>
661 </form>
662 </div>
663 <hr/>
664 <div class="row">
665 <form method="post" class="form-start">
666 <div class="form-group text-center">
667 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
668 <input type="submit" class="btn btn-danger btn-lg" value="RUN" style="width:60%; height:100px">
669 </div>
670 </form>
671 </div>
672 <hr/>
673 <div class="row">
674 <form method="post" class="form-stop">
675 <div class="form-group text-center">
676 <input type="hidden" name="instance" value="<?php echo $instance; ?>">
677 <input type="submit" class="btn btn-success btn-lg" value="STOP" style="width:60%; height:100px">
678 </div>
679 </form>
680 </div>
681 </div>
682 <div class="col-xs-1"></div>
683
684 <hr/>
685 <!--
686 <div class="row">
687 <div class="col-xs-1"></div>
688 <div class="col-xs-10">
689 <div class="highlight">
690 <pre>
691
692 </pre>
693 </div>
694 </div>
695 </div>
696 -->
697 <script src="/node_modules/toastr/toastr.js"></script>
698 <script>
699 $('.form-limits').submit(function() {
700 var serialize = $(this).serialize();
701 $.post('/ajax.php', "action=limits&" + serialize, function(data) {
702 data = $.parseJSON(data);
703 if (data.status == "success") {
704 alertSuccess('Success', 'Settings updated');
705 } else if (data.status == "redirect") {
706 window.location = data.redirect;
707 } else if (data.status == "error") {
708 alertError('Error encountered', data.error);
709 } else {
710 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
711 }
712 });
713 return false;
714 });
715
716 $('.form-users').submit(function() {
717 var serialize = $(this).serialize();
718 $.post('/ajax.php', "action=users&" + serialize, function(data) {
719 data = $.parseJSON(data);
720 if (data.status == "success") {
721 alertSuccess('Success', 'Settings updated');
722 } else if (data.status == "redirect") {
723 window.location = data.redirect;
724 } else if (data.status == "error") {
725 alertError('Error encountered', data.error);
726 } else {
727 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
728 }
729 });
730 return false;
731 });
732
733 $('.form-bet').submit(function() {
734 var serialize = $(this).serialize();
735 $.post('/ajax.php', "action=bet&" + serialize, function(data) {
736 data = $.parseJSON(data);
737 if (data.status == "success") {
738 alertSuccess('Success', 'Settings updated');
739 } else if (data.status == "redirect") {
740 window.location = data.redirect;
741 } else if (data.status == "error") {
742 alertError('Error encountered', data.error);
743 } else {
744 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
745 }
746 });
747 return false;
748 });
749
750 $('.form-profit').submit(function() {
751 var serialize = $(this).serialize();
752 $.post('/ajax.php', "action=profit&" + serialize, function(data) {
753 data = $.parseJSON(data);
754 if (data.status == "success") {
755 alertSuccess('Success', 'Settings updated');
756 } else if (data.status == "redirect") {
757 window.location = data.redirect;
758 } else if (data.status == "error") {
759 alertError('Error encountered', data.error);
760 } else {
761 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
762 }
763 });
764 return false;
765 });
766
767 $('.form-test').submit(function() {
768 var serialize = $(this).serialize();
769 $.post('/ajax.php', "action=test&" + serialize, function(data) {
770 data = $.parseJSON(data);
771 if (data.status == "success") {
772 alertSuccess('Success', 'It seems that it is all good :D RUN');
773 } else if (data.status == "redirect") {
774 window.location = data.redirect;
775 } else if (data.status == "error") {
776 alertError('Error encountered', data.error);
777 } else {
778 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
779 }
780 });
781 return false;
782 });
783
784 $('.form-start').submit(function() {
785 var serialize = $(this).serialize();
786 $.post('/ajax.php', "action=start&" + serialize, function(data) {
787 data = $.parseJSON(data);
788 if (data.status == "success") {
789 alertSuccess('Success', 'I am running hehe :D');
790 } else if (data.status == "redirect") {
791 window.location = data.redirect;
792 } else if (data.status == "error") {
793 alertError('Error encountered', data.error);
794 } else {
795 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
796 }
797 });
798 return false;
799 });
800
801 $('.form-stop').submit(function() {
802 var serialize = $(this).serialize();
803 $.post('/ajax.php', "action=stop&" + serialize, function(data) {
804 data = $.parseJSON(data);
805 if (data.status == "success") {
806 alertSuccess('Success', 'Bot stopped');
807 } else if (data.status == "redirect") {
808 window.location = data.redirect;
809 } else if (data.status == "error") {
810 alertError('Error encountered', data.error);
811 } else {
812 alertError('Unknown error', 'An unknown error occurred. Try refreshing the page.');
813 }
814 });
815 return false;
816 });
817
818 toastr.options = {
819 "closeButton": true,
820 "debug": false,
821 "newestOnTop": true,
822 "progressBar": true,
823 "positionClass": "toast-bottom-right",
824 "preventDuplicates": false,
825 "onclick": null,
826 "showDuration": "300",
827 "hideDuration": "1000",
828 "timeOut": "10000",
829 "extendedTimeOut": "1000",
830 "showEasing": "swing",
831 "hideEasing": "linear",
832 "showMethod": "fadeIn",
833 "hideMethod": "fadeOut"
834 }
835
836 function alertSuccess(title, message) {
837 toastr["success"](message, title);
838 }
839
840 function alertInfo(title, message) {
841 toastr["info"](message, title)
842 }
843
844 function alertWarning(title, message) {
845 toastr["warning"](message, title)
846 }
847
848 function alertError(title, message) {
849 toastr["error"](message, title)
850 }
851 </script>
852
853 </div>
854 </body>
855</html>