diff options
author | Michal Zimniewicz <michzimny@gmail.com> | 2018-01-28 13:07:03 +0100 |
---|---|---|
committer | Michal Zimniewicz <michzimny@gmail.com> | 2018-01-28 13:07:03 +0100 |
commit | 890dfe23560d32199a311560e867c7c576d201bb (patch) | |
tree | 9522387355a45bf8638dedd3644ed1e62d860ca8 | |
parent | 9ccba9a707d072e73e694d61053ce392fe8c8b88 (diff) |
properly handle PASS as played board
-rw-r--r-- | tdd-bootstrap.php | 8 |
1 files 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 = "<h4>Stół $table – Rozdanie {$deal->deal_num}</h4>" . $deal->html(); $modified = 1; |