Example #1
0
 public function getDateWithTooltip()
 {
     return '<span rel="tooltip" title="' . $this->getDateString() . '">' . AlexBond::time_since(time() - strtotime($this->when)) . '</span>';
 }
Example #2
0
<tr <?php 
if ($item->tillFinish) {
    echo 'class="danger"';
}
?>
>
    <td><?php 
echo Users::model()->getUsernameWithLink($item->playerId);
?>
</td>
    <td><?php 
echo $item->kills;
?>
 <a href="#victims<?php 
echo $item->id;
?>
" data-toggle="modal"><i class="fa fa-eye"></i></a>
    </td>
    <td><?php 
echo $item->deaths;
?>
</td>
    <td><?php 
echo $item->shots;
?>
</td>
    <td><?php 
echo AlexBond::secToTime($item->timeInGame);
?>
</td>
</tr>
Example #3
0
    ?>
</td>
                        <td><?php 
    echo $item->getServerName();
    ?>
</td>
                        <td><?php 
    echo $item->getMapName();
    ?>
</td>
                        <td class="winTeam"><?php 
    echo Users::model()->getUsernameWithAvatarAndLink($item->winnerId, 15);
    ?>
</td>
                        <td><?php 
    echo AlexBond::secToTime($item->end - $item->start);
    ?>
</td>
                        <td>
                            <a class="btn btn-sm btn-default"
                               href="<?php 
    echo $this->createUrl("view", ["id" => $item->id]);
    ?>
">Просмотреть</a>
                        </td>
                    </tr>
                <?php 
}
?>
            </table>
            <?php 
Example #4
0
                </div>
            </div>
            <hr/>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-striped table-condensed table-bordered">
                <tr>
                    <th>Позиция</th>
                    <th>Ник</th>
                    <th>Время в игре</th>
                </tr>
                <?php 
$players = [];
/**
 * @var $item TntrunStatsPlayers
 */
foreach ($model->players as $item) {
    $players[] = ["pos" => $item->position, "model" => $item];
}
$players = AlexBond::record_sort($players, "pos");
foreach ($players as $item) {
    $this->renderPartial("partial/_viewPlayer", ["item" => $item["model"]]);
}
?>
            </table>

        </div>
    </div>
</div>
Example #5
0
                </div>
                <div class="col-md-4">
                    <h4>Карта</h4>
                    <?php 
echo $model->getMapName();
?>
                </div>
                <div class="col-md-4">
                    <h4>Время игры</h4>
                    <span
                        title="<?php 
echo date("j.n.Y G:i:s", $model->start) . " - " . date("j.n.Y G:i:s", $model->end);
?>
"
                        rel="tooltip"><?php 
echo AlexBond::secToTime($model->end - $model->start);
?>
</span>
                </div>
            </div>
            <hr/>
        </div>
    </div>
    <?php 
$teams = ["red" => [], "blue" => [], "green" => [], "yellow" => []];
foreach ($model->players as $item) {
    switch ($item->team) {
        case 1:
            $teams['red'][] = $item;
            break;
        case 2:
Example #6
0
    /**
     * This gets rendered in the forum table.
     * Showing last post subject, with link to it, time of post, and name of poster, with link.
     */
    public function renderLastpostCell()
    {
        $lastpost = $this->lastPost;
        if (null == $lastpost) {
            return '<div style="text-align:center;">-</div>';
        }
        $thread = $lastpost->thread;
        $threadlink = CHtml::link(CHtml::encode($thread->subject), $thread->url);
        $authorlink = Users::model()->getUsernameWithLink($lastpost->author_id);
        return '<div style="position:relative; text-align: left;">
<a class="pull-left" style="position:relative; margin: 4px 5px 0 0;">
' . Users::model()->getAvatar($lastpost->author->username, 32) . '
</a>
' . Users::model()->getUsernameWithLink($lastpost->author_id, true) . '
<div>
<small>' . CHtml::link(AlexBond::time_since(time() - $lastpost->created), $thread->url) . '</small>
</div>
</div>';
    }
Example #7
0
        echo $this->createUrl("/support/support/view", ["id" => $item->id]);
        ?>
">
                                        <span
                                            class="photo"><?php 
        echo Users::model()->getAvatar($item->user->username, 40);
        ?>
</span>
									<span class="subject">
									<span class="from"><?php 
        echo $item->user->username;
        ?>
</span>
									<span
                                        class="time"><?php 
        echo AlexBond::time_since(time() - $item->dateCreated);
        ?>
</span>
									</span>
									<span class="message">
									<?php 
        echo CHtml::encode($item->subject);
        ?>
									</span>
                                        </a>
                                    </li>
                                <?php 
    }
}
?>
                        </ul>
Example #8
0
                </tr>
                <?php 
$players = [];
$leaved = [];
/**
 * @var $item QcStatsPlayers
 */
foreach ($model->players as $item) {
    if (!$item->tillFinish) {
        $players[] = ["kills" => $item->kills, "model" => $item];
    } else {
        $leaved[] = ["kills" => $item->kills, "model" => $item];
    }
}
$players = AlexBond::record_sort($players, "kills", true);
$leaved = AlexBond::record_sort($leaved, "kills", true);
foreach ($players as $item) {
    $this->renderPartial("partial/_viewPlayer", ["item" => $item["model"]]);
}
foreach ($leaved as $item) {
    $this->renderPartial("partial/_viewPlayer", ["item" => $item["model"]]);
}
?>
            </table>

        </div>
    </div>
</div>
<?php 
foreach ($model->players as $item) {
    $this->renderPartial("partial/_viewPlayerVictims", ["item" => $item]);
Example #9
0
    <div id="dashboard">
        <div class="row">
            <div class="col-lg-4 col-lg-offset-4 col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-12">
                <div class="dashboard-stat red">
                    <div class="visual">
                        <i class="fa fa-group"></i>
                    </div>
                    <div class="details">
                        <div class="number">
                            <?php 
echo $count = Users::model()->count("active=1");
?>
                        </div>
                        <div class="desc">
                            <?php 
echo AlexBond::doPlural($count, "Юзверь", "Юзверя", "Юзверей");
?>
                        </div>
                    </div>
                    <a class="more" href="<?php 
echo $this->createUrl("/users/users/index");
?>
">
                        Просмотреть всех <i class="m-fa fa-swapright m-fa fa-white"></i>
                    </a>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                <div class="dashboard-stat blue">
Example #10
0
    $i++;
}
?>
                    </div>
                    <div class="col-md-6">
                        <?php 
$i = 1;
foreach ($data as $key => $item) {
    echo "<p>";
    if ($item['by'] == $model->id) {
        echo Users::model()->getUsernameAvatarWithLink($model->id, 16) . " убил " . Users::model()->getUsernameWithAvatarAndLink($item['to'], 16);
    } else {
        echo Users::model()->getUsernameWithAvatarAndLink($item['by'], 16) . " убил " . Users::model()->getUsernameAvatarWithLink($model->id, 16);
    }
    echo " в " . CHtml::link(Yii::app()->params['gameTypes'][$item['in']]["name"], Yii::app()->createUrl("/stats/" . Yii::app()->params['gameTypes'][$item['in']]["url"] . "/view", ["id" => $item['inId']]));
    echo " <span rel='tooltip' title='" . date("d.m.Y H:m:i", $item['when']) . "'>" . AlexBond::time_since(time() - $item['when']) . "</span>";
    echo "</p>";
    unset($data[$key]);
    if ($i == 25) {
        break;
    }
    $i++;
}
?>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="bans">
                <?php 
$bans = BanLog::model()->getLogOfUser($model->id);
if (count($bans) == 0) {
Example #11
0
    public function renderLastpostCell()
    {
        //$lastpost = $this->lastPost;
        //if (null == $lastpost) return '<div style="text-align:center;">-</div>';
        return '<div style="position:relative; text-align: left;">
<a class="pull-left" style="position:relative; margin: 4px 5px 0 0;">
' . Users::model()->getAvatar(Users::model()->getUserNameFromID($this->lastPost_user_id), 32) . '
</a>
' . Users::model()->getUsernameWithLink($this->lastPost_user_id, true) . '
<div>
<small>' . AlexBond::time_since(time() - $this->lastPost_time) . '</small>
</div>
</div>';
    }
Example #12
0
                    <?php 
echo Users::model()->getUsernameWithLink($data->author_id, true);
?>
                    <?php 
echo $data->author->getBadges();
?>
                    <div>
                        <a data-container="body" data-placement="right"
                           rel="tooltip" title=""
                           data-original-title="<?php 
echo Yii::app()->controller->module->format_date($data->created, 'long');
?>
">
                            <small>
                                написал <?php 
echo AlexBond::time_since(time() - $data->created);
?>
 назад.
                            </small>
                        </a>
                    </div>
                </div>
                <?php 
?>
                <?php 
if ($isAdmin) {
    $deleteConfirm = "Ты уверен? Сообщение будет удалено навсегда!";
    echo CHtml::ajaxLink('Удалить', array('/forum/post/delete', 'id' => $data->id), array('type' => 'POST', 'success' => 'function(){document.location.reload(true);}'), array('confirm' => $deleteConfirm, 'id' => 'post' . $data->id, "class" => "btn btn-danger btn-sm pull-right", "style" => "margin-left: 5px")) . " ";
}
if ($isAdmin || Yii::app()->user->id == $data->author_id) {
    ?>