|
<style>
|
|
table {
|
|
border-collapse: collapse;
|
|
width: 20em;
|
|
}
|
|
|
|
table thead {
|
|
font-weight: bold;
|
|
text-align: center;
|
|
background-color: lightgray;
|
|
}
|
|
|
|
table, td {
|
|
border: 1px solid black;
|
|
}
|
|
|
|
td.right {
|
|
width: 3em;
|
|
text-align: right;
|
|
}
|
|
footer {
|
|
position: absolute;
|
|
bottom: 1em;
|
|
}
|
|
</style>
|
|
<?php
|
|
$br="\n";
|
|
if($argc == 2)
|
|
{
|
|
$p = $argv[1];
|
|
list($key, $clenu) = explode('=', $argv[1]);
|
|
if($key != 'pocet')
|
|
{
|
|
exit("\nChybný parametr\n");
|
|
}
|
|
}
|
|
elseif(1 * htmlspecialchars($_GET["pocet"]) > 0)
|
|
{
|
|
$key='pocet';
|
|
$clenu=1 * htmlspecialchars($_GET["pocet"]);
|
|
$br="\n<br>";
|
|
}
|
|
else
|
|
{
|
|
# exit("\nChybný parametr $argc\n");
|
|
$clenu=0;
|
|
}
|
|
$clenu = round(1 * $clenu, 0);
|
|
$petina=ceil($clenu / 5);
|
|
$desetina=ceil($clenu / 10);
|
|
$setina=ceil($clenu / 100);
|
|
$odmocnina=ceil(2 * sqrt($clenu));
|
|
$svolani=max(min($petina, $odmocnina), $setina);
|
|
$zarazeni=ceil($svolani / 2);
|
|
?>
|
|
<form action="/kalkulacka.php" method="get">
|
|
<label for="pocet">Počet členů sdružení či orgánu:</label>
|
|
<input style="width: 4em" type="text" name="pocet" id="pocet" value=<?php echo $clenu; ?>><input type="submit" value="OK">
|
|
</form>
|
|
<table>
|
|
<thead>
|
|
<tr><td colspan=2>Vypočtené hodnoty jsou zaokrouhleny<br>na celé číslo nahoru.</td></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><?php echo "Setina";?></td>
|
|
<td class="right"><?php echo $setina;?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo "Desetina";?></td>
|
|
<td class="right"><?php echo $desetina;?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo "Pětina";?></td>
|
|
<td class="right"><?php echo $petina;?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo "2x odmocnina";?></td>
|
|
<td class="right"><?php echo $odmocnina;?></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br><table>
|
|
<thead>
|
|
<tr><td colspan=2>Hodnoty podle jednacího řádu.</td></tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><?php echo "Rozeslání členského podnětu";?></td>
|
|
<td class="right"><?php echo $zarazeni;?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo "Zařazení na běžící jednání";?></td>
|
|
<td class="right"><?php echo $zarazeni;?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo "Svolácní jednání";?></td>
|
|
<td class="right"><?php echo $svolani;?></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<footer><address>Autor: Petr Vileta, 2/2020</address> Licence <a href="http://www.wtfpl.net/about/" target="_blank">WTFPL</a></footer>
|