From a2ae2402856f6f1f4376b4f3cc45838ac72be950 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 14 Feb 2019 22:23:41 +0300 Subject: Enabling custom players number for team tournaments --- http/pkle2018-test.php | 15 ++++++++------- http/pkle2018.php | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'http') 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){ W zależności od typu
ilość indywidualistów,
par lub teamów
ZAWODNIKÓW

- To pole jest wyliczane
automatycznie.
+ To pole jest wyliczane
automatycznie, ale możesz poprawić je
dla teamów nieczterosobowych.
SUMA WK

Suma WK wszystkich
zawodników.
diff --git a/http/pkle2018.php b/http/pkle2018.php index b4721ba..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; } @@ -369,7 +369,7 @@ function submitit(){ --> - +
-- cgit v1.2.3