function checkRoundEnding($roundId) { if ($roundId == -1) { return false; } $roundCount = getCheckedDuels($roundId); if ($roundCount == 0) { return false; } else { return $roundCount == countDuelsInRound($roundId); } }
<td></td> </tr> </thead> <tbody> <?php $rounds = getRoundList($id); foreach ($rounds as $round) { if ($round['visible']) { echo "<tr>"; } else { echo "<tr class=redColored>"; } echo "<td>" . $round['id'] . "</td>"; echo "<td><a href=?page=round&tournament=" . $id . "&id=" . $round['id'] . ">" . $round['name'] . "</a></td>"; echo "<td>" . $round['date'] . "</td>"; echo "<td>" . getCheckedDuels($round['id']) . " / " . countDuelsInRound($round['id']) . "</td>"; if ($round['visible']) { echo "<td></td>"; } else { echo "<td>"; echo '<button type = "submit" name = "submit" ' . ' onclick = "openRound(' . $round['id'] . '); return false;" ' . ' class = "btn btn-default">'; echo "Открыть</button>"; //echo "<td><a role=button class='btn btn-default' onclick='openRound(".$round['id'].");'>Открыть</a></td>"; echo "</td>"; } echo "</tr>"; } ?> </tbody> </table>
</table> </div> <script> loadRoundUsers(<?php echo $tournamentId; ?> , <?php echo $roundId; ?> ); </script> <br> <?php $roundDuel = intval(countDuelsInRound($roundId)); $roundVisible = intval(isRoundVisible($roundId)); $checkedDuels = intval(getCheckedDuels($roundId)); if ($roundDuel == 0) { ?> <?php if (getAcceptedRoundUsers($roundId) > 1) { ?> <button type = "submit" name = "startRoundButton" onclick = "startRound(); return false;" class = "btn btn-default">Начать текущий раунд</button> <br> <?php } ?> <?php } if ($roundDuel > 0 && $roundVisible == 0) { ?> <?php