-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
103 lines (98 loc) · 5.26 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
<?php
require_once("system/config.php");
require_once("system/view.php");
require_once("library/session.php");
$checking_status = new Config();
$session = new Session();
if($checking_status->connect_to_server() == "success"){
//Check Session
$session->status();
}
else{
?>
<html>
<head>
<title>404 Error Connection</title>
<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">
<!-- Sweetalert Css -->
<link href="assets/plugins/sweetalert/sweetalert.css" rel="stylesheet" />
<!-- Custom Css -->
<link rel="stylesheet" href="assets/css/main.css">
<!-- AdminCC You can choose a theme from css/themes instead of get all themes -->
<link rel="stylesheet" href="assets/css/all-themes.css" />
</head>
</head>
<body>
<!-- Jquery Core Js -->
<script src="assets/bundles/libscripts.bundle.js"></script> <!-- Lib Scripts Plugin Js -->
<script src="assets/bundles/vendorscripts.bundle.js"></script> <!-- Lib Scripts Plugin Js -->
<script src="assets/plugins/sweetalert/sweetalert.min.js"></script> <!-- SweetAlert Plugin Js -->
<script src="assets/bundles/mainscripts.bundle.js"></script><!-- Custom Js -->
<script>
$(document).ready(function(){
load_server();
})
function load_server(){
swal({
// title: "Oops!",
title : "Mencoba menghubungkan ke server...",
timer : 2000,
showCancelButton: false,
showConfirmButton : false,
closeOnConfirm: false
}, function () {
setTimeout(function () {
$.ajax({
type: "GET",
url: "system/Ajax.php",
data: {
request : "server_connection"
},
dataType: "JSON",
success: function (data) {
if(data.checking == "success"){
swal({
title : "Berhasil!",
text : "Telah terhubung ke server, halaman akan direfresh",
type : "success",
timer : 2000,
showConfirmButton : false
}, function(){
location.reload();
})
}
else if(data.checking == "failed"){
swal({
title : "Gagal!",
text : "Gagal terhubung ke server, mencoba kembali...",
type : "error",
timer : 2000,
showConfirmButton : false,
showCancelButton : false,
}, function(){
load_server();
});
}
},
error : function(jqXHR, textStatus, errorThrown){
swal({
title : "Oops!",
text : "Gagal melakukan penghubungan server, mencoba kembali...",
type : "error",
timer : 2000,
showConfirmButton : false,
showCancelButton : false,
}, function(){
load_server();
});
}
});
}, 2000);
});
}
</script>
</body>
</html>
<?php
}
?>