summaryrefslogtreecommitdiff
path: root/down/view
diff options
context:
space:
mode:
Diffstat (limited to 'down/view')
-rw-r--r--down/view/templ-index.php117
-rw-r--r--down/view/templ-noscript.php87
2 files changed, 204 insertions, 0 deletions
diff --git a/down/view/templ-index.php b/down/view/templ-index.php
new file mode 100644
index 0000000..cc554e1
--- /dev/null
+++ b/down/view/templ-index.php
@@ -0,0 +1,117 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
+ <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
+ <link rel="stylesheet" href="../tools/static/sweet-alert.css">
+ <style>
+ <?php echo file_get_contents("../tools/style.css"); ?>
+ </style>
+ <noscript><style>.navbar{margin-bottom:0;}</style></noscript>
+ <title>Is it down? | iamfabulous.de</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'>
+</head>
+<body>
+ <?php require("../tools/navbar.php"); ?>
+<div class="container">
+ <div class="text-center">
+ <div class="row">
+
+ <form id="theform" class="form-horizontal">
+ <fieldset>
+
+ <!-- Form Name -->
+ <legend>
+ <h1>Uptime is the game</h1>
+ <h4>Is your favourite website down?</h4>
+ </legend>
+
+ <!-- Text input-->
+ <div class="form-group">
+ <label class="col-md-4 control-label" for="url">Check if up: </label>
+ <div class="col-md-4">
+ <?php if ( isset($_REQUEST["url"]) && $_REQUEST["url"] != "" ){
+ ?>
+ <input id="url" name="url" placeholder="kernel.org" class="form-control input-md" required="" type="text" <?php echo 'value="'.htmlentities($_REQUEST["url"]) . '"'; ?> autofocus>
+ <?php
+ } else {
+ ?>
+ <input id="url" name="url" placeholder="kernel.org" class="form-control input-md" required="" type="text" autofocus>
+ <?php
+ }
+ ?>
+ </div>
+ </div>
+
+ <!-- Multiple Radios (inline) -->
+ <div class="form-group">
+ <label class="col-md-4 control-label" for="action">Check Type:</label>
+ <div class="col-md-4 text-left">
+ <label class="radio-inline" for="action-0">
+ <input name="action" id="action-0" value="ping" checked="checked" type="radio">
+ Ping
+ </label>
+ <label class="radio-inline" for="action-1">
+ <input name="action" id="action-1" value="http" type="radio">
+ HTTP
+ </label>
+ </div>
+ </div>
+
+ <!-- Button -->
+ <div class="form-group">
+ <label class="col-md-4 control-label" for="submit"></label>
+ <div class="col-md-4">
+ <button type="submit" id="submit" name="" value="" class="btn btn-success">Check it</button>
+ </div>
+ </div>
+
+ </fieldset>
+ </form>
+
+ </div>
+ </div>
+</div>
+
+ <?php require("../tools/footer.php"); ?>
+ <script>
+ window.onload = function(){
+
+ $("#theform").submit( function(e){
+
+ $.ajax({
+ url: "",
+ data: $("#theform").serialize(),
+ dataType: "json",
+ type: "GET",
+
+ success: function( response ){
+
+ if ( response.data == 1 ) {
+ var type = "success";
+ var button= "btn-success";
+ } else {
+ var type= "error";
+ var button= "btn-danger";
+ }
+ swal({
+ title: response.host,
+ text: response.status,
+ type: type,
+ confirmButtonClass: button
+ });
+
+ $("#url").val('');
+ },
+ });
+
+ e.preventDefault();
+ });
+
+ $(".fa-spinner").addClass("fa-spin");
+
+ };
+ </script>
+ <script defer src="../tools/static/sweet-alert.js"></script>
diff --git a/down/view/templ-noscript.php b/down/view/templ-noscript.php
new file mode 100644
index 0000000..d15b665
--- /dev/null
+++ b/down/view/templ-noscript.php
@@ -0,0 +1,87 @@
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
+ <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
+ <style>
+ <?php echo file_get_contents("../tools/style.css"); ?>
+ </style>
+ <noscript><style>.navbar{margin-bottom:0;}</style></noscript>
+ <title>Is it down? | iamfabulous.de</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'>
+</head>
+<body>
+ <?php require("../tools/navbar.php"); ?>
+<div class="container">
+ <div class="text-center">
+ <div class="row">
+
+
+ <h1>Uptime is the game</h1>
+ <h4>Is your favourite website down?</h4>
+ <hr>
+
+ <?php
+ if($json["data"] == 1){
+ ?>
+ <div class="alert alert-success" role="alert">
+ <?php
+ } else {
+ ?>
+ <div class="alert alert-danger" role="alert">
+ <?php
+ }
+ ?>
+ <h1><?php echo htmlentities($json["host"]); ?></h1>
+ <h4><?php echo htmlentities($json["status"]); ?></h4>
+ </div>
+
+ <form id="theform" class="form-horizontal">
+ <fieldset>
+
+ <!-- Form Name -->
+ <legend>
+ <h1>Check another one</h1>
+ </legend>
+
+ <!-- Text input-->
+ <div class="form-group">
+ <label class="col-md-4 control-label" for="url">Check if up: </label>
+ <div class="col-md-4">
+ <input id="url" name="url" placeholder="kernel.org" class="form-control input-md" required="" type="text" autofocus>
+ </div>
+ </div>
+
+ <!-- Multiple Radios (inline) -->
+ <div class="form-group">
+ <label class="col-md-4 control-label" for="action">Check Type:</label>
+ <div class="col-md-4 text-left">
+ <label class="radio-inline" for="action-0">
+ <input name="action" id="action-0" value="ping" checked="checked" type="radio">
+ Ping
+ </label>
+ <label class="radio-inline" for="action-1">
+ <input name="action" id="action-1" value="http" type="radio">
+ HTTP
+ </label>
+ </div>
+ </div>
+
+ <!-- Button -->
+ <div class="form-group">
+ <label class="col-md-4 control-label" for="submit"></label>
+ <div class="col-md-4">
+ <button type="submit" id="submit" name="" value="" class="btn btn-success">Check it</button>
+ </div>
+ </div>
+
+ </fieldset>
+ </form>
+
+ </div>
+ </div>
+</div>
+
+ <?php require("../tools/footer.php"); ?>