From 890dfe23560d32199a311560e867c7c576d201bb Mon Sep 17 00:00:00 2001 From: Michal Zimniewicz Date: Sun, 28 Jan 2018 13:07:03 +0100 Subject: properly handle PASS as played board --- tdd-bootstrap.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tdd-bootstrap.php b/tdd-bootstrap.php index bcea810..f85a786 100644 --- a/tdd-bootstrap.php +++ b/tdd-bootstrap.php @@ -37,14 +37,14 @@ class Protocol { $table = (int)$table; if($table && array_key_exists($table, $this->deals_by_tables)) { $contract1 = trim(str_replace(' ', '', $tr->find('td[class="bdc"]', 0)->innertext)); - $tricks1 = trim(str_replace(' ', '', $tr->find('td[class="bdc"]', 3)->innertext)); + $score1 = trim(str_replace(' ', '', end($tr->find('td'))->innertext)); $contract2 = trim(str_replace(' ', '', $tr->next_sibling()->find('td[class="bdc"]', 0)->innertext)); - $tricks2 = trim(str_replace(' ', '', $tr->next_sibling()->find('td[class="bdc"]', 3)->innertext)); + $score2 = trim(str_replace(' ', '', end($tr->next_sibling()->find('td'))->innertext)); // if is played on both tables of a match // note that the contract field for arbitral scores starts with 'A' (e.g. 'ARB' or 'AAA') - if(($tricks1 || strpos($contract1, 'A') === 0) - && ($tricks2 || strpos($contract2, 'A') === 0)) { + if(($score1 !== '' || strpos($contract1, 'A') === 0) + && ($score2 !== '' || strpos($contract2, 'A') === 0)) { $deal = $this->deals_by_tables[$table]; $insert = "

Stół $table – Rozdanie {$deal->deal_num}

" . $deal->html(); $modified = 1; -- cgit v1.2.3