summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
Diffstat (limited to 'http')
-rw-r--r--http/api-inc.php78
-rw-r--r--http/api.php44
-rw-r--r--http/index.php2
-rw-r--r--http/pkle.php2
-rw-r--r--http/pkle2020.php1
-rw-r--r--http/pkle2020a.php317
6 files changed, 402 insertions, 42 deletions
diff --git a/http/api-inc.php b/http/api-inc.php
index 565e66c..2606df7 100644
--- a/http/api-inc.php
+++ b/http/api-inc.php
@@ -28,9 +28,30 @@ function recursive_ksort(&$array, $flags = SORT_REGULAR) {
class ParametersException extends Exception {};
+function run($parameters) {
+ $versionClasses = array(
+ '1' => 'ApiPklV1', // RegKlas 2018.11.01
+ '2' => 'ApiPklV2', // RegKMP 2020.01.01
+ '3' => 'ApiPklV3', // local BNET 2020.05.01
+ '_default' => 'ApiPklV3'
+ );
+ $version = isset($parameters['version']) ? $parameters['version'] : '_default';
+ $apiClass = isset($versionClasses[$version]) ? $versionClasses[$version] : $versionClasses['_default'];
+ $api = new $apiClass($parameters);
+ if ($parameters['tournament_rank'] == ApiPkl::RANK_KMP) {
+ $result = $api->calculate_kmp_points();
+ } else if ($parameters['tournament_rank'] == ApiPkl::RANK_BNET) {
+ $result = $api->calculate_bridgenet_points();
+ } else {
+ $result = $api->calculate_points();
+ }
+ return $result;
+}
+
class ApiPkl {
const RANK_KMP = 101;
+ const RANK_BNET = 102;
protected $parameters;
@@ -74,7 +95,7 @@ class ApiPkl {
if (!isset($this->parameters['manual']) || !isset($this->parameters['manual']['min_points']) || !isset($this->parameters['manual']['tournament_weight'])) {
$this->ensure_parameters(array('tournament_rank', 'over39_boards'));
$this->check_values($this->parameters, array(
- 'tournament_rank' => function($r) { return ctype_digit($r) && ((intval($r) >= 0 && intval($r) <= 7) || intval($r) == ApiPkl::RANK_KMP); },
+ 'tournament_rank' => function($r) { return ctype_digit($r) && ((intval($r) >= 0 && intval($r) <= 7) || in_array(intval($r), array(ApiPkl::RANK_KMP, ApiPkl::RANK_BNET))); },
'over39_boards' => function($r) { return ctype_digit($r) && intval($r) >= 0 && intval($r) <= 1; }
));
} else {
@@ -99,17 +120,20 @@ class ApiPkl {
if ($return['type'] != 2 && $this->parameters['tournament_rank'] == ApiPkl::RANK_KMP) {
throw new ParametersException('Parameter: type has incorrect value (' . $return['type'] . ') for KMP tournament');
}
+ if (isset($this->parameters['boards'])) {
+ $return['boards'] = intval($this->parameters['boards']);
+ }
$return['contestants'] = intval($this->parameters['contestants']);
$return['players'] = isset($this->parameters['players']) ? intval($this->parameters['players']) : intval($this->parameters['contestants']) * $return['type'];
$return['title_sum'] = floatval($this->parameters['title_sum']);
$weights = array(
- array(1, 2, 4, 5, 7, 10, 15, 25, ApiPkl::RANK_KMP => 0),
- array(2, 3, 5, 7, 10, 15, 25, 40, ApiPkl::RANK_KMP => 0)
+ array(1, 2, 4, 5, 7, 10, 15, 25, ApiPkl::RANK_KMP => 0, ApiPkl::RANK_BNET => 1),
+ array(2, 3, 5, 7, 10, 15, 25, 40, ApiPkl::RANK_KMP => 0, ApiPkl::RANK_BNET => 1) // not 2, according to MarcinW
);
$return['tournament_weight'] = (isset($this->parameters['manual']) && isset($this->parameters['manual']['tournament_weight'])) ? intval($this->parameters['manual']['tournament_weight']) : $weights[intval($this->parameters['over39_boards'])][intval($this->parameters['tournament_rank'])];
$min_points = array(
- array(0, 0, 0, 0, 50, 75, 150, 200, ApiPkl::RANK_KMP => 0),
- array(0, 0, 0, 0, 70, 100, 200, 300, ApiPkl::RANK_KMP => 0)
+ array(0, 0, 0, 0, 50, 75, 150, 200, ApiPkl::RANK_KMP => 0, ApiPkl::RANK_BNET => 0),
+ array(0, 0, 0, 0, 70, 100, 200, 300, ApiPkl::RANK_KMP => 0, ApiPkl::RANK_BNET => 0)
);
$return['min_points'] = (isset($this->parameters['manual']) && isset($this->parameters['manual']['min_points'])) ? intval($this->parameters['manual']['min_points']) : $min_points[intval($this->parameters['over39_boards'])][intval($this->parameters['tournament_rank'])];
$return['players_coefficient'] = (isset($this->parameters['manual']) && isset($this->parameters['manual']['players_coefficient'])) ? floatval($this->parameters['manual']['players_coefficient']) : 0.05;
@@ -167,18 +191,20 @@ class ApiPkl {
return 0.0;
}
- function calculate_points() {
+ function calculate_points($min_points=1, $scale_factor=1.0) {
$max_points = safe_ceil(max(
$this->parameters['min_points'],
(1 + 0.25 * ($this->parameters['type'] > 2)) * (max(0.15, $this->parameters['title_sum'] / $this->parameters['players']) * $this->parameters['tournament_weight'] + $this->parameters['players_coefficient'] * $this->parameters['contestants'] * $this->parameters['type'])
));
- $min_points = 1;
$result = array("sum" => 0, "points" => array());
for ($place = 1; $place <= $this->parameters['contestants']; $place++) {
$percentage = $this->get_percentage_from_position($place, $this->parameters['contestants'], $this->parameters['points_cutoffs']);
- $points = safe_ceil(floatval($max_points) * $percentage);
- $result['points'][$place] = max($min_points, intval($points));
- $result['sum'] += $this->parameters['type'] * $result['points'][$place];
+ $points = safe_ceil(floatval($max_points) * $percentage * $scale_factor);
+ $points = max($min_points, intval($points));
+ if ($points > 0) {
+ $result['points'][$place] = $points;
+ $result['sum'] += $this->parameters['type'] * $result['points'][$place];
+ }
}
return $result;
}
@@ -199,6 +225,10 @@ class ApiPkl {
}
return $result;
}
+
+ function calculate_bridgenet_points() {
+ throw new ParametersException('BridgeNET points not supported in this API version');
+ }
}
class ApiPklV1 extends ApiPkl {}
@@ -217,4 +247,32 @@ class ApiPklV2 extends ApiPklV1 {
}
+class ApiPklV3 extends ApiPklV2 {
+
+ function check_parameters() {
+ if (isset($this->parameters['tournament_rank']) && $this->parameters['tournament_rank'] == ApiPkl::RANK_BNET) {
+ $this->ensure_parameters(array('boards', 'type'));
+ if ($this->parameters['type'] == 4) {
+ throw new ParametersException('Parameter: type has incorrect value (' . $this->parameters['type'] . ') for BridgeNET tournament');
+ }
+ if (isset($this->parameters['manual'])) {
+ unset($this->parameters['manual']);
+ }
+ }
+ if (isset($this->parameters['boards'])) {
+ $this->check_values($this->parameters, array(
+ 'boards' => function($r) { return ctype_digit($r); }
+ ));
+ $this->parameters['over39_boards'] = strval(intval($this->parameters['boards'] > 39));
+ }
+ return parent::check_parameters();
+ }
+
+ function calculate_bridgenet_points() {
+ $factor = min($this->parameters['boards'] / 27.0, 1.0);
+ return $this->calculate_points(0, $factor);
+ }
+
+}
+
?>
diff --git a/http/api.php b/http/api.php
index acf2752..6241aca 100644
--- a/http/api.php
+++ b/http/api.php
@@ -5,8 +5,9 @@ Parametry:
- rodzaj turnieju (4 => teamy, 2 => pary, 1 => ind)
- l. uczestników
- suma WK
- - ranga turnieju (0 => K, 1 => Ok, 2 => R, 3 => O, 4 => O*, 5 => O**, 6 => O***, 7 => O****) (opcjonalny, jeśli podano ręczne minPKL i wagę)
+ - ranga turnieju (0 => K, 1 => Ok, 2 => R, 3 => O, 4 => O*, 5 => O**, 6 => O***, 7 => O****, 101 => KMP, 102 => B-NET Lokalny) (opcjonalny, jeśli podano ręczne minPKL i wagę)
- l. rozdań => 40? (opcjonalny, jeśli podano ręczne minPKL i wagę)
+ - l. rozdań (jeśli obecny, przesłania l. rozdań => 40?, obowiązkowy dla turniejów BridgeNET)
- ręczne minPKL za pierwsze (opcjonalny)
- ręczna waga (opcjonalny)
- ręczny współczynnik zawodniczy (opcjonalny)
@@ -18,6 +19,7 @@ Parametry:
"title_sum": 230,
"tournament_rank": 3,
"over39_boards": 0,
+ "boards": 30,
"manual": {
"min_points": 50,
"tournament_weight": 50,
@@ -30,35 +32,17 @@ Parametry:
require_once('api-inc.php');
-function run($parameters) {
-
- try {
- $versionClasses = array(
- '1' => 'ApiPklV1', // RegKlas 2018.11.01
- '2' => 'ApiPklV2', // RegKMP 2020.01.01
- '_default' => 'ApiPklV2'
- );
- $version = isset($parameters['version']) ? $parameters['version'] : '_default';
- $apiClass = isset($versionClasses[$version]) ? $versionClasses[$version] : $versionClasses['_default'];
- $api = new $apiClass($parameters);
- if ($parameters['tournament_rank'] == ApiPkl::RANK_KMP) {
- $result = $api->calculate_kmp_points();
- } else {
- $result = $api->calculate_points();
- }
- return $result;
- }
- catch (ParametersException $e) {
- http_response_code(400);
- die(json_encode($e->getMessage()));
- }
- catch (Exception $e) {
- http_response_code(500);
- die(json_encode($e->getMessage()));
- }
+try {
+ header('Content-Type: application/json');
+ print(json_encode(run($_REQUEST)));
+}
+catch (ParametersException $e) {
+ http_response_code(400);
+ die(json_encode($e->getMessage()));
+}
+catch (Exception $e) {
+ http_response_code(500);
+ die(json_encode($e->getMessage()));
}
-
-header('Content-Type: application/json');
-print(json_encode(run($_REQUEST)));
?>
diff --git a/http/index.php b/http/index.php
index 8159e28..13594c7 100644
--- a/http/index.php
+++ b/http/index.php
@@ -1,3 +1,3 @@
<?php
-Header('location: pkle2018.php');
+Header('location: pkle2020a.php');
die();
diff --git a/http/pkle.php b/http/pkle.php
index 0bc46be..13594c7 100644
--- a/http/pkle.php
+++ b/http/pkle.php
@@ -1,3 +1,3 @@
<?php
-Header('location: pkle2020.php');
+Header('location: pkle2020a.php');
die();
diff --git a/http/pkle2020.php b/http/pkle2020.php
index 8f350d6..25bee03 100644
--- a/http/pkle2020.php
+++ b/http/pkle2020.php
@@ -82,6 +82,7 @@ function display() {
function sendit(form) {
var params = {
+ version: 2, // the 2020 KMP version of 2018 RegKlas
type: parseInt(form.typ.value),
contestants: parseInt(form.iuc.value),
players: parseInt(form.izw.value),
diff --git a/http/pkle2020a.php b/http/pkle2020a.php
new file mode 100644
index 0000000..4a8d9e8
--- /dev/null
+++ b/http/pkle2020a.php
@@ -0,0 +1,317 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <meta http-equiv="pragma" content="no-cache">
+ <meta http-equiv="cache-control" content="no-cache">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Kargulator PKLi</title>
+ <link rel="stylesheet" href="style.css" type="text/css">
+ <link rel="icon" href="images/favicon.ico" type="image/x-icon">
+ <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
+ <script type="text/javascript">
+ <!--
+function valiuc(x,y){
+ if( !(x.value==null || x.value=='') ){
+ x.value = x.value.replace(',','.');
+ if( isFinite(x.value)){
+ if( y==1 ){
+ if( document.getElementsByName("typ")[0].checked ){
+ document.getElementById("izw").value = x.value;
+ } else {
+ if( document.getElementsByName("typ")[1].checked ){
+ document.getElementById("izw").value = 2 * x.value;
+ } else {
+ if( document.getElementsByName("typ")[2].checked ){
+ document.getElementById("izw").value = 4 * x.value;
+ }
+ }
+ }
+ valiuc(document.getElementById("izw"), 2);
+ }
+ if( y>=2 ){
+ if (y==2) x = document.getElementById("swk");
+ var z = document.getElementById('izw');
+ var srednieWk = x.value/z.value;
+ if(srednieWk < 0.15) srednieWk = 0.15;
+ document.getElementById('srd').value = srednieWk;
+ }
+ return true;
+ } else {
+ alert(x.value+' to nie liczba!');
+ x.select();
+ x.focus();
+ return false;
+ }
+ }
+}
+
+function typtur(x){
+ var t = document.getElementById("iuc");
+ var z = document.getElementById("izw");
+ if( t.value!=null && t.value!='' && isFinite(t.value) ){
+ z.value = x * t.value;
+ }
+ document.getElementById('izw').readOnly = (x < 4);
+ valiuc(document.getElementById("izw"), 2);
+}
+
+function loader(show) {
+ document.getElementById("loader").style.display = show ? 'block' : 'none';
+ document.getElementById("sqlbuttons").style.display = show ? 'none' : 'block';
+ document.getElementById("pkltablebox").style.display = show ? 'none' : 'block';
+}
+
+function display() {
+ if (this.status != 200) {
+ alert(this.responseText);
+ } else {
+ var response = JSON.parse(this.responseText);
+ var sqlPary = ['UPDATE `dodatki` SET `pkl` = 0;'];
+ var sqlTeamy = ['UPDATE `addons` SET `mastr` = 0;'];
+ var pklHTML = ['<tr><td class="t">Miejsce</td><td class="t">&nbsp;&nbsp;&nbsp;PKL&nbsp;&nbsp;&nbsp;</td></tr>'];
+ for (var place = 1; place <= parseInt(document.getElementsByName('iuc')[0].value); place++) {
+ if (response.points[place]) {
+ sqlPary.push('UPDATE `dodatki` SET `pkl` = ' + response.points[place] + ' WHERE `miejsce` = ' + place + ';');
+ sqlTeamy.push('UPDATE `addons` SET `mastr` = ' + response.points[place] + ' WHERE `place` = ' + place + ';');
+ pklHTML.push('<tr><td class="t">' + place + '</td><td class="t">' + response.points[place] + '</td></tr>');
+ }
+ }
+ pklHTML.push('<tr><td class="p">SUMA PKL</td><td class="t">' + response.sum + '</td></tr>');
+ document.getElementById('outsql').innerHTML = sqlPary.join("\n");
+ document.getElementById('outsql2').innerHTML = sqlTeamy.join("\n");
+ document.getElementById("pkltable").innerHTML = pklHTML.join("");
+ }
+ loader(false);
+}
+
+function sendit(form) {
+ var params = {
+ version: 3, // the 2020 local B**eNET edition
+ type: parseInt(form.typ.value),
+ contestants: parseInt(form.iuc.value),
+ players: parseInt(form.izw.value),
+ title_sum: parseFloat(form.swk.value),
+ tournament_rank: 8-form.rng.value,
+ boards: parseInt(form.rozdan.value)
+ }
+ params['over39_boards'] = (params['boards'] > 39) * 1;
+ var tourtypes = ['tk', 'to', 'tp', 'ok', 'ok1', 'ot', 'gp', 'gg'];
+ tourtypes[101] = 'kmp';
+ tourtypes[102] = 'bnet';
+ params['manual[players_coefficient]'] = parseFloat(form.zaw.value);
+ params['manual[min_points]'] = parseInt(form['min' + (8-params.tournament_rank) + (params.over39_boards ? '_' : '')].value);
+ params['manual[tournament_weight]'] = parseInt(form['r' + tourtypes[params.tournament_rank] + (params.over39_boards ? '_' : '')].value);
+ for (var i = 0; i < 2; i++) {
+ params['manual[points_cutoffs]['+i+'][0]'] = parseFloat(form['pru'+(i+1)].value) / 100;
+ params['manual[points_cutoffs]['+i+'][1]'] = parseFloat(form['prp'+(i+1)].value) / 100;
+ }
+ params['manual[points_cutoffs][2][0]'] = parseFloat(form.pru3.value) / 100;
+ params['manual[points_cutoffs][2][1]'] = 0;
+ var paramString = [];
+ for (var param in params) {
+ paramString.push(param + '=' + params[param]);
+ }
+ loader(true);
+ var xhr = new XMLHttpRequest();
+ xhr.addEventListener('load', display);
+ xhr.open('POST', 'api.php', true);
+ xhr.setRequestHeader("Content-Type", 'application/x-www-form-urlencoded');
+ xhr.send(paramString.join('&'));
+}
+
+function submitit(ev){
+ if( document.getElementsByName("typ")[0].checked ||
+ document.getElementsByName("typ")[1].checked ||
+ document.getElementsByName("typ")[2].checked ){
+ if( document.getElementsByName("rng")[0].checked ||
+ document.getElementsByName("rng")[1].checked ||
+ document.getElementsByName("rng")[2].checked ||
+ document.getElementsByName("rng")[3].checked ||
+ document.getElementsByName("rng")[4].checked ||
+ document.getElementsByName("rng")[5].checked ||
+ document.getElementsByName("rng")[6].checked ||
+ document.getElementsByName("rng")[7].checked ||
+ document.getElementsByName("rng")[8].checked ||
+ document.getElementsByName("rng")[9].checked ){
+ var t = document.getElementById("iuc")
+ if( t.value!=null && t.value!='' && isFinite(t.value) ){
+ t = document.getElementById("izw");
+ if( t.value!=null && t.value!='' && isFinite(t.value) ){
+ t = document.getElementById("swk");
+ if( t.value!=null && t.value!='' && isFinite(t.value) ){
+ sendit(ev);
+ } else {
+ alert('Brak sumy WK!');
+ t.select();
+ }
+ } else {
+ alert('Brak liczby zawodników!');
+ t.select();
+ }
+ } else {
+ alert('Brak liczby uczestników!');
+ t.select();
+ }
+ } else {
+ alert('Wybierz rangę turnieju');
+ document.getElementsByName("rng")[0].select();
+ }
+ } else {
+ alert('Wybierz typ turnieju');
+ document.getElementsByName("typ")[0].select();
+ }
+}
+ -->
+ </script>
+ </head>
+ <body style="background-color: #F0F0F0; background-image: none">
+ <form id="pkl">
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><img src="images/logo_pzbs.gif"></td>
+ <td colspan="3" align="center"><h3>KALKULATOR PKLI W TURNIEJACH PZBS<br>
+ zgodny z <span style="color:#d00">nowym regulaminem (obowiązującym od 01.11.2018)</span><br>
+ z <span style="color:#d00">nowym regulaminem KMP (obowiązującym od 01.01.2020)</span><br>
+ oraz <span style="color:#d00">regulaminem BridgeNET Lokalnego (obowiązującym od 01.05.2020)</span></h3>
+ Przejdź do <a href="pkle2020.php"><b>kalkulatora sprzed 01.05.2020</b></a>
+ <br><br>
+ Możesz eksperymentować ze wszystkimi (prawie) parametrami.<br>
+ Dla przywrócenia stanu regulaminowego otwórz ponownie stronę.</td>
+ <td><img src="images/logo_pzbs.gif"></td>
+ </tr>
+ <tr><td colspan="5">&nbsp;</td></tr>
+ <tr>
+ <td align="center" colspan="2"><b>turniej do 39 rozdań</b></td>
+ <td align="center" colspan="2"><b>turniej od 40 rozdań</b></td>
+ </tr>
+ <tr>
+ <td align="right">WAGA<br>turnieju</td><td align="left">MINIMUM<br>za 1. miejsce</td>
+ <td align="right">WAGA<br>turnieju</td><td align="left">MINIMUM<br>za 1. miejsce</td>
+ <td align="left" colspan="3">WSP:</td>
+ </tr>
+ <tr>
+ <td align="right" rowspan="3">
+ OTP<sup>&lowast;&lowast;&lowast;&lowast;</sup>: <input type="text" id="rgg" name="rgg" maxlength="3" style="width:30px" value="25"><br />
+ OTP<sup>&lowast;&lowast;&lowast;</sup>: <input type="text" id="rgp" name="rgp" maxlength="3" style="width:30px" value="15"><br />
+ OTP<sup>&lowast;&lowast;</sup>: <input type="text" id="rot" name="rot" maxlength="3" style="width:30px" value="10"><br />
+ OTP<sup>&lowast;</sup>: <input type="text" id="rok1" name="rok1" maxlength="3" style="width:30px" value="7"><br />
+ OTP: <input type="text" id="rok" name="rok" maxlength="3" style="width:30px" value="5"><br />
+ Regionalny: <input type="text" id="rtp" name="rtp" maxlength="3" style="width:30px" value="4"><br />
+ Okręgowy: <input type="text" id="rto" name="rto" maxlength="3" style="width:30px" value="2"><br />
+ Klubowy: <input type="text" id="rtk" name="rtk" maxlength="3" style="width:30px" value="1">
+ <input type="hidden" id="rkmp" name="rkmp" value="1">
+ <input type="hidden" id="rbnet" name="rbnet" value="1">
+ </td>
+ <td align="left" rowspan="3">
+ <input type="text" id="min1" name="min1" maxlength="3" style="width:30px" value="200"><br />
+ <input type="text" id="min2" name="min2" maxlength="3" style="width:30px" value="150"><br />
+ <input type="text" id="min3" name="min3" maxlength="3" style="width:30px" value="75"><br />
+ <input type="text" id="min4" name="min4" maxlength="3" style="width:30px" value="50"><br />
+ <input type="text" id="min5" name="min5" maxlength="3" style="width:30px" value="0"><br />
+ <input type="text" id="min6" name="min6" maxlength="3" style="width:30px" value="0"><br />
+ <input type="text" id="min7" name="min7" maxlength="3" style="width:30px" value="0"><br />
+ <input type="text" id="min8" name="min8" maxlength="3" style="width:30px" value="0">
+ <input type="hidden" id="min-93" name="min-93" value="0"></td>
+ <input type="hidden" id="min-94" name="min-94" value="0"></td>
+ <td align="right" rowspan="3">
+ OTP<sup>&lowast;&lowast;&lowast;&lowast;</sup>: <input type="text" id="rgg_" name="rgg_" maxlength="3" style="width:30px" value="40"><br />
+ OTP<sup>&lowast;&lowast;&lowast;</sup>: <input type="text" id="rgp_" name="rgp_" maxlength="3" style="width:30px" value="25"><br />
+ OTP<sup>&lowast;&lowast;</sup>: <input type="text" id="rot_" name="rot_" maxlength="3" style="width:30px" value="15"><br />
+ OTP<sup>&lowast;</sup>: <input type="text" id="rok1_" name="rok1_" maxlength="3" style="width:30px" value="10"><br />
+ OTP: <input type="text" id="rok_" name="rok_" maxlength="3" style="width:30px" value="7"><br />
+ Regionalny: <input type="text" id="rtp_" name="rtp_" maxlength="3" style="width:30px" value="5"><br />
+ Okręgowy: <input type="text" id="rto_" name="rto_" maxlength="3" style="width:30px" value="3"><br />
+ Klubowy: <input type="text" id="rtk_" name="rtk_" maxlength="3" style="width:30px" value="2">
+ <input type="hidden" id="rkmp_" name="rkmp_" value="1">
+ <input type="hidden" id="rbnet_" name="rbnet_" value="1">
+ </td>
+ <td align="left" rowspan="3">
+ <input type="text" id="min1_" name="min1_" maxlength="3" style="width:30px" value="300"><br />
+ <input type="text" id="min2_" name="min2_" maxlength="3" style="width:30px" value="200"><br />
+ <input type="text" id="min3_" name="min3_" maxlength="3" style="width:30px" value="100"><br />
+ <input type="text" id="min4_" name="min4_" maxlength="3" style="width:30px" value="70"><br />
+ <input type="text" id="min5_" name="min5_" maxlength="3" style="width:30px" value="0"><br />
+ <input type="text" id="min6_" name="min6_" maxlength="3" style="width:30px" value="0"><br />
+ <input type="text" id="min7_" name="min7_" maxlength="3" style="width:30px" value="0"><br />
+ <input type="text" id="min8_" name="min8_" maxlength="3" style="width:30px" value="0">
+ <input type="hidden" id="min-93_" name="min-93_" value="0"></td>
+ <input type="hidden" id="min-94_" name="min-94_" value="0"></td>
+ <td align="left" valign="top"><input type="text" id="zaw" name="zaw" maxlength="5" style="width:30px" value="0.05"></td>
+ <td valign="top" colspan="2">PKL za 1 m = <b>śr.WK&times;WAGA + il.zaw&times;WSP</b></td>
+ </tr>
+ <tr>
+ <td align="right" valign="top"><br /><br /><br /><br /><input type="text" id="prp1" name="prp1" style="width:18px" value="90">%<br /><input type="text" id="prp2" name="prp2" style="width:18px" value="20">%</td>
+ <td colspan="2" align="left"><img src="images/pkle.png"></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td colspan="2"><table cellspacing="0" cellpadding="0"><tr><td align="right" style="width:50px"><input type="text" id="pru1" name="pru1" style="width:18px" value="2">%</td><td align="right" style="width:25px"><input type="text" id="pru2" name="pru2" style="width:18px" value="20">%</td><td align="right" style="width:55px"><input type="text" id="pru3" name="pru3" style="width:18px" value="50">%</td></tr></table></td>
+ </tr>
+
+ <tr><td colspan="5">&nbsp;</td></tr>
+ <tr>
+ <td valign=top>TYP ZAWODÓW<br />
+ <input type="radio" name="typ" id="tp1" value="1" onclick="typtur(1)"><label for="tp1">&nbsp;Indywiduel</label><br />
+ <input type="radio" name="typ" id="tp2" value="2" onclick="typtur(2)"><label for="tp2">&nbsp;Pary</label><br />
+ <input type="radio" name="typ" id="tp3" value="4" onclick="typtur(4)"><label for="tp3">&nbsp;Teamy</label>
+ </td>
+ <td align="CENTER" valign=top>
+ LICZBA ROZDAŃ<br>
+ <input type="text" name="rozdan" maxlength="3" style="width:50px" />
+ </td>
+ <td align="CENTER" valign=top>UCZESTNIKÓW<br />
+ <input type="text" id="iuc" name="iuc" maxlength="3" style="width:50px" onblur="valiuc(this,1)"><br />
+ <small>W zależności od typu<br />ilość indywidualistów,<br />par lub teamów</small></td>
+ <td align="CENTER" valign=top>ZAWODNIKÓW<br />
+ <input type="text" id="izw" name="izw" readonly="readonly" maxlength="4" style="width:50px" onblur="valiuc(this,2)"><br />
+ <small>To pole jest wyliczane<br />automatycznie, ale możesz poprawić je<br />dla teamów nieczterosobowych.</small></td>
+ <td align="CENTER" valign=top>SUMA WK<br />
+ <input type="text" id="swk" name="swk" maxlength="7" style="width:70px" onblur="valiuc(this,3)"><br />
+ <small>Suma WK wszystkich<br />zawodników.</small></td>
+ </tr>
+ <tr>
+ <td><br/>
+ RANGA ZAWODÓW<br />
+ <input type="radio" name="rng" id="rg1" value="1"><label for="rg1">&nbsp;OTP<sup>&lowast;&lowast;&lowast;&lowast;</sup></label><br />
+ <input type="radio" name="rng" id="rg2" value="2"><label for="rg2">&nbsp;OTP<sup>&lowast;&lowast;&lowast;</sup></label><br />
+ <input type="radio" name="rng" id="rg3" value="3"><label for="rg3">&nbsp;OTP<sup>&lowast;&lowast;</sup></label><br />
+ <input type="radio" name="rng" id="rg4" value="4"><label for="rg4">&nbsp;OTP<sup>&lowast;</sup></label><br />
+ <input type="radio" name="rng" id="rg5" value="5"><label for="rg5">&nbsp;OTP</label><br />
+ </td>
+ <td>
+ <br/>
+ <br/>
+ <input type="radio" name="rng" id="rg_kmp" value="-93"><label for="rg_kmp">&nbsp;KMP</label><br />
+ <input type="radio" name="rng" id="rg6" value="6"><label for="rg6">&nbsp;Regionalny</label><br />
+ <input type="radio" name="rng" id="rg7" value="7"><label for="rg7">&nbsp;Okręgowy</label><br />
+ <input type="radio" name="rng" id="rg8" value="8"><label for="rg8">&nbsp;Klubowy</label><br />
+ <input type="radio" name="rng" id="rg_bnet" value="-94"><label for="rg_bnet">&nbsp;BridgeNET Lokalny</label>
+ </td>
+ <td align="CENTER" colspan="3">Średnie WK zawodnika w turnieju:&nbsp;
+ <input type="text" id="srd" name="srd" readonly="readonly"><br />
+ </td>
+ </tr>
+ <tr><td colspan="5">&nbsp;</td></tr>
+ <tr>
+ <td align="CENTER" colspan="2">
+ <input type="button" value="Policz PKLe" onclick="submitit(this.form)"></td>
+ <td colspan="3">
+ <div id="sqlbuttons">
+ <input type="button" value="SQL dla JFR Pary" onclick="document.getElementById('outsql').style.display=(document.getElementById('outsql').style.display=='none') ? 'block' : 'none';document.getElementById('outsql2').style.display='none'"><input type="button" value="SQL dla JFR Teamy" onclick="document.getElementById('outsql2').style.display=(document.getElementById('outsql2').style.display=='none') ? 'block' : 'none';document.getElementById('outsql').style.display='none'">
+ </div>
+ </td>
+ </tr>
+ <tr><td colspan="2" align="center">
+ <div id="pkltablebox">
+ <table id="pkltable"><tr><td class="t">Miejsce</td><td class="t">&nbsp;&nbsp;&nbsp;PKL&nbsp;&nbsp;&nbsp;</td></tr>
+ <tr><td class="p">SUMA PKL</td><td class="t"></td></tr>
+ </table>
+ </div>
+ </td><td colspan="3" valign="top"><pre id="outsql" style="display: none"></pre></td>
+ <td colspan="3" valign="top"><pre id="outsql2" style="display: none"></pre></td></tr>
+ <tr><td colspan="5" class="copyright">&copy;'2009, Jan Romański dla PZBS</td></tr>
+ </table>
+ </form>
+ <div id="loader">Cierpliwości, liczę...</div>
+ </body>
+</html>