summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
Diffstat (limited to 'http')
-rw-r--r--http/pkle2018-test.php15
-rw-r--r--http/pkle2018.php14
2 files changed, 15 insertions, 14 deletions
diff --git a/http/pkle2018-test.php b/http/pkle2018-test.php
index 9b056c1..c236c0d 100644
--- a/http/pkle2018-test.php
+++ b/http/pkle2018-test.php
@@ -27,13 +27,12 @@ function valiuc(x,y){
}
}
}
- if( y==3 ){
+ if( y>=2 ){
+ if (y==2) x = document.getElementById("swk");
var z = document.getElementById('izw');
- if( valiuc(z,2) ){
- var srednieWk = x.value/z.value;
- if(srednieWk < 0.15) srednieWk = 0.15;
- document.getElementById('srd').value = srednieWk;
- }
+ var srednieWk = x.value/z.value;
+ if(srednieWk < 0.15) srednieWk = 0.15;
+ document.getElementById('srd').value = srednieWk;
}
return true;
} else {
@@ -51,6 +50,7 @@ function typtur(x){
if( t.value!=null && t.value!='' && isFinite(t.value) ){
z.value = x * t.value;
}
+ document.getElementById('izw').readOnly = (x < 4);
}
function loader(show) {
@@ -84,6 +84,7 @@ function sendit(form) {
var params = {
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,
over39_boards: parseInt(form.rozdan.value)
@@ -251,7 +252,7 @@ function submitit(ev){
<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.</small></td>
+ <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>
diff --git a/http/pkle2018.php b/http/pkle2018.php
index 5e7e9e1..f59a29f 100644
--- a/http/pkle2018.php
+++ b/http/pkle2018.php
@@ -259,7 +259,7 @@ else*/if( $_SERVER['REQUEST_METHOD'] == 'POST' ){
endif;
$iuc = $_POST['iuc'];
if( $typ>2 ) $typ = 4;
- $izw = $typ*$iuc;
+ $izw = $_POST['izw'];
if( $izw > 99 ){
$dajp = 1;
}
@@ -296,13 +296,12 @@ function valiuc(x,y){
}
}
}
- if( y==3 ){
- var z = document.getElementById('izw');
- if( valiuc(z,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 {
@@ -320,6 +319,7 @@ function typtur(x){
if( t.value!=null && t.value!='' && isFinite(t.value) ){
z.value = x * t.value;
}
+ document.getElementById('izw').readOnly = (x < 4);
}
function submitit(){
@@ -369,7 +369,7 @@ function submitit(){
-->
</script>
</head>
-<body style="background-color: #F0F0F0; background-image: none">
+<body style="background-color: #F0F0F0; background-image: none" onload="document.getElementById('izw').readOnly = (document.forms['pkl']['typ'].value < 4)">
<form id="pkl" method="post" action="pkle2018.php">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
@@ -465,7 +465,7 @@ function submitit(){
<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)"<?php if( $izw>0 ){echo ' value="'.$izw.'"';}?>><br />
- <small>To pole jest wyliczane<br />automatycznie.</small></td>
+<small>To pole jest wyliczane<br />automatycznie, ale możesz poprawić je<br />dla teamów nieczterosobowoych.</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)"<?php if( $swk>0 ){echo ' value="'.$swk.'"';}?>><br />
<small>Suma WK wszystkich<br />zawodników.</small></td>