diff options
author | Michal Zimniewicz <michzimny@gmail.com> | 2020-05-25 20:24:06 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-05-25 20:25:20 +0200 |
commit | f58c5d08749dbb885dc9a7d131fc0f3857780c98 (patch) | |
tree | 3fa832636a48a96a97a0abcb7af0bc822b678701 /index.php |
Initial commit (25.05.2020)
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/index.php b/index.php new file mode 100644 index 0000000..7887f0d --- /dev/null +++ b/index.php @@ -0,0 +1,157 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Nowe tabele VP</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="description" content=""> + <meta name="author" content=""> + + <!-- Le styles --> + <link href="bootstrap/css/bootstrap.css" rel="stylesheet"> + <style type="text/css"> + body { + padding-top: 20px; + padding-bottom: 40px; + } + + /* Custom container */ + .container-narrow { + margin: 0 auto; + max-width: 700px; + } + .container-narrow > hr { + margin: 30px 0; + } + + /* Main marketing message and sign up button */ + .jumbotron { + margin: 60px 0; + text-align: center; + } + .jumbotron h1 { + font-size: 72px; + line-height: 1; + } + .jumbotron .btn { + font-size: 21px; + padding: 14px 24px; + } + + /* Supporting marketing content */ + .marketing { + margin: 60px 0; + } + .marketing p + h4 { + margin-top: 28px; + } + + + th,td { + border: 1px solid silver; + text-align: left; + width: 80px; + text-align: center; + } + .myHidden { + display: none; + text-align: left; + border: 0; + color:silver; + font-size: 0.9em; + } + + body { + text-align: center; + } + table { + margin-left: auto; + margin-right: auto; + } + .footer { + font-size:0.85em; + } + </style> + <link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet"> + + <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="bootstrap/js/html5shiv.js"></script> + <![endif]--> + + <!-- Fav and touch icons --> + <link rel="apple-touch-icon-precomposed" sizes="144x144" href="bootstrap/ico/apple-touch-icon-144-precomposed.png"> + <link rel="apple-touch-icon-precomposed" sizes="114x114" href="bootstrap/ico/apple-touch-icon-114-precomposed.png"> + <link rel="apple-touch-icon-precomposed" sizes="72x72" href="bootstrap/ico/apple-touch-icon-72-precomposed.png"> + <link rel="apple-touch-icon-precomposed" href="bootstrap/ico/apple-touch-icon-57-precomposed.png"> + <link rel="shortcut icon" href="bootstrap/ico/favicon.png"> + </head> + + <body> + + <div class="container-narrow"> + + <div class="masthead"> + <!--<ul class="nav nav-pills pull-right"> + <li class="active"><a href="#">Home</a></li> + <li><a href="#">About</a></li> + <li><a href="#">Contact</a></li> + </ul>--> + <h2 class="muted">Nowe tabele VP</h2> + <!--<h5 style="color:red">Wersja nieoficjalna</h5>--> + </div> + + <hr> + + <form id="boardNumForm" method="post" action="."> + Wprowadź liczbę rozdań: <input type="number" name="n" style="width:40px"><br /> + Typ tabeli: <input type="radio" name="discrete" value="0" checked="checked"> ciągła, + <input type="radio" name="discrete" value="1"> dyskretna<br /><br /> + <a class="btn btn-success" href="#" onclick="document.forms['boardNumForm'].submit();">Pokaż tabelę</a> + </form> + + <?php + $n = $_POST['n']; + $discrete = $_POST['discrete']; + if(($n>0)&&($n<1000)) { + include 'engine.php'; + if($discrete) $disStr = ' (dyskretna)'; + echo "<hr><h3>Tabela VP dla $n rozdań$disStr</h3>"; + if($discrete) echo "<h4 style='color:red'>Obliczanie tabel dyskretnych jest nieoficjalne i nieprzetestowane</h4>"; + echo "<table> + <tr><th>IMP</th><th>VP</th></tr>"; + if(!$discrete) { + $vptable = vptable($n); + foreach($vptable as $imp=>$vp) { + $vp = sprintf('%.2f',$vp); + echo "<tr><td>$imp</td><td>$vp</td></tr>"; + } + } else { + $vptable = vptable_discrete($n); + $last = -1; + foreach($vptable as $vp=>$imp) { + $last++; + echo "<tr><td>$last - $imp</td><td>$vp</td></tr>"; + $last = $imp; + } + $last++; + echo "<tr><td>$last+</td><td>20</td></tr>"; + } + echo '</table>'; + if(!$discrete) { + echo '<br /><a class="btn" href="teamy.php?n='.$n.'">Pobierz tabelę dla programu JFR Teamy</a>'; + } + } + ?> + + + <hr> + + <div class="footer"> + <p>© <a href="http://michzimny.pl/">Michał Zimniewicz</a> dla <a href="http://pzbs.pl/">PZBS</a></p> + </div> + + </div> <!-- /container --> + + </body> +</html> |