diff options
Diffstat (limited to 'down/view/templ-index.php')
| -rw-r--r-- | down/view/templ-index.php | 117 |
1 files changed, 117 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> |
