123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
- function secondsToTime($seconds_time)
- {
- // if ($seconds_time < 24 * 60 * 60) {
- // return gmdate('H:i:s', $seconds_time);
- // } else {
- $hours = floor($seconds_time / 3600);
- $minutes = floor(($seconds_time - $hours * 3600) / 60);
- $seconds = floor($seconds_time - ($hours * 3600) - ($minutes * 60));
- return $hours."h ".$minutes."m ".$seconds."s";
- // }
- }
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="description" content="">
- <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
- <meta name="generator" content="Jekyll v3.8.5">
- <title>Lost in Ark Queue</title>
- <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
- <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
- <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
- <link rel="manifest" href="site.webmanifest">
- <link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
- <meta name="msapplication-TileColor" content="#da532c">
- <meta name="theme-color" content="#ffffff">
- <meta property="og:type" content="website">
- <meta property="og:url" content="https://bester.dahwa.fr/lostark/">
- <meta property="og:title" content="Lost Paper - Estimation du désespoir">
- <meta property="og:description" content="Si tu veux estimer combien de temps tu vas attendre">
- <meta property="og:image" content="https://bester.dahwa.fr/lostark/la.png">
- <!-- Bootstrap core CSS -->
- <link href="bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
- <style>
- .bd-placeholder-img {
- font-size: 1.125rem;
- text-anchor: middle;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- }
- @media (min-width: 768px) {
- .bd-placeholder-img-lg {
- font-size: 3.5rem;
- }
- }
- </style>
- <!-- Custom styles for this template -->
- <link href="signin.css" rel="stylesheet">
- </head>
- <?php
- $init_ts=mktime();
- if(isset($_POST['init_ts'])) $init_ts=$_POST['init_ts'];
- ?>
- <body class="text-center">
- <form class="form-signin" method=post name=init action="">
- <img class="mb-4" src="la.png" alt="" width="72" height="72">
- <h1 class="h3 mb-3 font-weight-normal">Estimation du désespoir <small>(<?= date("d/m/Y H:i:s") ?>)</small></h1>
- <div class="form-group row">
- <?php
- $disable='';
- $readonly='';
- if(isset($_POST['init_val'])) {
- $disable='DISABLED';
- $readonly='READONLY';
- }
- ?>
- <label for="staticEmail" class="col-sm-4 col-form-label">Position initiale<br><small><?= date("d/m/Y H:i:s",$init_ts)?></small></label>
- <input type="number" class="col-sm-4 form-control-number" name=init_val required value="<?= $_POST['init_val'] ?>" <?= $readonly ?>>
- <input type="hidden" name=init_ts value="<?= $init_ts ?>">
- <button class="col-sm-4 btn btn-lg btn-block" type="submit" name=init value="stage1" <?= $disable ?>> Set</button>
- </div>
- </div>
- <?php
- if(isset($_POST['init_val']))
- if(is_int(intval($_POST['init_val']))) {
- echo '
- <div class="form-group row">
- <label for="staticEmail" class="col-sm-4 col-form-label">Position actuelle<br><small>'.date("d/m/Y H:i:s").'</small></label>';
- $v='';
- if(isset($_POST['current_val'])) $v='value="'.$_POST['current_val'].'"';
- echo ' <input type="number" class="col-sm-4 form-control-number" name=current_val required '.$v.'>';
- echo ' <button class="col-sm-4 btn btn-lg btn-block" type="submit" name=init value="stage2">Set</button>
- <input type="hidden" name=current_ts value="'.mktime().'">
- </div>
- </div>';
- if(isset($_POST['current_val'])) {
- if($_POST['current_val']>=$_POST['init_val']) {
- echo '
- <div class="form-group row">
- <label for="staticEmail" class="col-sm-12 col-form-label">Mmmmh. Tu sembles avoir un problème de doigts, ou de vue ;)</label>
- </div>
- </div>';
- } else {
- $delta_pos=$_POST['init_val']-$_POST['current_val'];
- $delta_ts=$_POST['current_ts']-$_POST['init_ts'];
- $sPos=($delta_ts/$delta_pos);
- $eta=$sPos*$_POST['current_val'];
- $ts=mktime()+$eta;
- $date=date("d/m/Y H:i:s",$ts);
- echo '
- <div class="form-group row">
- <label for="staticEmail" class="col-sm-6 col-form-label">Estimation de la fin de la douleur </label>
- <label for="staticEmail" class="col-sm-6 col-form-label"><b>'.$date.' - soit, dans '.secondsToTime($eta).'</b></label>
- </div>
- </div>';
- }
- }
- }
- ?>
- <?php
- ?>
- </form>
- <?php
- /*
- echo "<pre>";
- print_r($_POST);
- echo "</pre>";
- */
- ?>
- </body>
- </html>
|