-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
133 lines (130 loc) · 6.04 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
<?php
header("Location: https://stats.uptimerobot.com/00Am3toPo");
function is_url_exist($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$precode = substr($code, 0, 1);
if(!($precode == 3 || $precode == 5 )){
$status = '<p style="display: inline" class="green-text text-accent-3">up!</p>';
}else{
$status = '<p style="display: inline" class="deep-orange-text text-accent-3">under maintenance!</p>';
}
curl_close($ch);
return $status;
}
?>
<html>
<head>
<title>IntranetProject - Status</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" media="screen,projection">
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
</head>
<body>
<main>
<div class="container">
<h1 class="center-align"><b>Intranet Project Status</b></h1>
<small class="notice">
<p class="center-align">Click on any Name to visit the site!</p>
</small>
<div class="collection">
<a target="_blank" class="collection-item" href="http://intranetproject.net">Main site is
<?php
echo '<p style="display: inline" class="green-text text-accent-3">up!</p>';
?>
</a>
<a target="_blank" class="collection-item" href="http://docs.intranetproject.net">Docs are
<?php
echo is_url_exist("http://docs.intranetproject.net/");
?>
</a>
<a target="_blank" class="collection-item" href="http://blog.intranetproject.net">Blog is
<?php
echo is_url_exist("http://blog.intranetproject.net/");
?>
</a>
<a target="_blank" class="collection-item" href="http://shop.intranetproject.net">Shop is
<?php
echo is_url_exist("http://shop.intranetproject.net/");
?>
</a>
<a target="_blank" class="collection-item" href="http://packages.intranetproject.net">Package Manager is
<?php
echo is_url_exist("http://packages.intranetproject.net/");
?>
</a>
<a target="_blank" class="collection-item" href="http://account.intranetproject.net">Account Service is
<?php
echo is_url_exist("http://account.intranetproject.net/");
?>
</a>
<a target="_blank" class="collection-item" href="http://download.intranetproject.net">Download is
<?php
echo is_url_exist("http://download.intranetproject.net/");
?>
</a>
<a target="_blank" class="collection-item" href="http://api.intranetproject.net/v1/ping">API is
<?php
echo is_url_exist("http://api.intranetproject.net/v1/ping");
?>
</a>
<a target="_blank" class="collection-item" href="http://docs.api.intranetproject.net">API Docs are
<?php
echo is_url_exist("http://docs.api.intranetproject.net/build/index.html");
?>
</a>
</div>
<!-- <?php
$sql = "SELECT * FROM incidents";
$res = mysqli_query($link, $sql);
if ($res) {
while ($row = $res->fetch_object()) {
echo '<div class="row">
<div class="col s12 m8 offset-m2">
<div class="card red">
<div class="card-content white-text">
<span class="center card-title">' . $row->title . ' on ' . $row->created_at . '</span>
<p>' . $row->text . '</p>
</div>
</div>
</div>
</div>';
}
}
?> -->
</div>
</main>
<footer class="page-footer teal lighten-2">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">End..</h5>
<p class="grey-text text-lighten-4">This is it. Just a simple status site..</p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="https://github.com/IntranetProjec">GitHub</a></li>
<li><a class="grey-text text-lighten-3" href="https://intranetproject.net/imprint.html">Imprint</a></li>
<li>
<p class="grey-text text-lighten-3" href="#!"><b><i>< ></i>
</b> with <i style="color: red;">♥</i> by <a class="grey-text text-lighten-3" href="https://github.com/IntranetProject">Intranet</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2017 Intranet Project
</div>
</div>
</footer>
</div>
</body>
</html>