$data['title'] = 'Вы создали комнату! <a href="' . DOMEN . '/' . TICTACTOE . '/dropRoom">Удалить комнату</a>'; if ($userBusyInfo['readyToGo'] === 'ok') { $data['title'] .= ' | <a href="' . DOMEN . '/' . TICTACTOE . '/startGame">Начать</a>'; } } if ($userBusyInfo['action'] === 'joiner') { $data['title'] = 'Вы присоединились к комнате игрока ' . $userBusyInfo['creater']; } echo $data['title']; ?> </div> <div class="roomParam"> <?php //настройки комнаты $data['settings'] = ''; foreach ($userBusyInfo['html']['roomSettings'] as $key => $value) { $numPlayerId = $key === 'numPlayers' ? 'id="numPlayers"' : ''; if ($userBusyInfo[$key]) { $data['settings'] .= '<div>' . '<div class="settingName">' . $value . ':</div>' . '<div ' . $numPlayerId . ' class="settingValue">' . $userBusyInfo[$key] . '</div>' . '</div>'; } } echo $data['settings']; ?> </div><div class="playersContainer"> <?php echo view::addPlayers($userBusyInfo['players'], $userBusyInfo['freeFigure'], $userData['nick'], $userBusyInfo['action']); ?> </div> </div> <?php }
echo mainModel::convertPoints($roomParams['points'], $roomParams['pointsNum'])['text']; ?> <li>Число игроков - <?php echo $roomParams['numPlayers']; ?> <li>Создатель - <?php echo $roomParams['creater']; ?> <li>Победитель - <span class="winner"><?php echo $winner ? $winner : ''; ?> </span> </ul> </div> <?php echo view::viewRoomsUsers($newplayers, $viewers, $roomParams['points'], $login, $roomParams['status']); ?> </div><!-- --> <?php if ($roomParams['type'] === '3d') { echo '<div class="type3d">'; foreach ($gameArray as $sideZ => $valueZ) { echo '<div class="gameSideZ">'; foreach ($valueZ as $sideY => $valueY) { echo '<div class="gameSideY">'; foreach ($valueY as $sideX => $valueX) { $winnerCell = in_array('z' . $sideZ . '_x' . $sideX . '_y' . $sideY, $winnerSide) ? ' winnerCell' : ''; echo '<div class="gameSideX' . $winnerCell . '">'; if ($valueX !== 'empty') { echo $valueX;
?> ">Отправить сообщение</a> </div> <div class="menuItem"> <a href="<?php echo DOMEN . '/' . GUIDE; ?> ">Руководство</a> </div> </div> <div class="usersOnline"> <div class="title">Пользователи он-лайн</div> <div class="container"> <?php echo view::usersOnline(startCore::$authorization->getUsersOnline()); ?> </div> </div> </div><div class="centerContainer"> <?php if (startCore::$controller->getRoute() === TICTACTOE) { require_once VIEW . TICTACTOE . $slash . 'index.php'; } if (startCore::$controller->getRoute() === USERS) { require_once VIEW . USERS . '.php'; } if (startCore::$controller->getRoute() === SENDMESSAGE) { require_once VIEW . SENDMESSAGE . '.php'; } if (startCore::$controller->getRoute() === GUIDE) {
<thead> <tr> <th>№</th> <th>Создатель</th> <th>Длина</th> <th>Фигур</th> <th>Очки</th> <th>Блиц</th> <th>Игроков</th> <th>Зашло</th> <th>Заявка</th> </tr> </thead> <tbody> <?php echo view::viewRooms($rooms); ?> </tbody> </table> <?php if ($userBusyInfo['action'] !== 'creater' and $userBusyInfo['action'] !== 'created') { ?> <div class="addRoom"> <a href="<?php echo DOMEN . '/' . TICTACTOE; ?> /addRoom"> <input type="button" value="Создать комнату"> </a> </div> <?php
private function updateRoomsPage($login) { $tictactoe = new tictactoePlayGame($login); $data = array(); $userBusyInfo = $tictactoe->getUserBusyInfo(); $data['rooms'] = view::viewRooms($tictactoe->getSingleRooms()); $data['roomsHash'] = md5($data['rooms']); $data['status'] = $userBusyInfo['roomStatus']; if ($userBusyInfo['roomStatus'] === 'created') { $data['addPlayers'] = view::addPlayers($userBusyInfo['players'], $userBusyInfo['freeFigure'], $login, $userBusyInfo['action']); $data['addPlayersHash'] = md5($data['addPlayers']); $data['readyTogo'] = $userBusyInfo['creater'] === $login ? $userBusyInfo['readyToGo'] : 'notCreater'; } echo json_encode($data); }