Passed
Push — master ( 29baaf...069627 )
by Mihail
06:51
created

Apps/View/Front/default/profile/search.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use Ffcms\Core\Helper\Date;
4
use Ffcms\Core\Helper\HTML\Form;
5
use Ffcms\Core\Helper\Type\Str;
6
use Ffcms\Core\Helper\Url;
7
8
/** @var $this object */
9
/** @var $model Apps\Model\Front\Profile\FormUserSearch */
10
/** @var $records object */
11
/** @var $pagination object */
12
/** @var $ratingOn int */
13
14
$this->title = __('User list') . ': ' . __('Search');
15
16
$this->breadcrumbs = [
17
    Url::to('main/index') => __('Home'),
18
    $this->title
19
];
20
21
?>
22
23
<h1><?= $this->title ?></h1>
24
<?= $this->render('profile/_listTab', ['rating' => $ratingOn]) ?>
25
<br />
26
<?php $form = new Form($model, ['class' => 'form-horizontal', 'action' => '']) ?>
27
28
<?= $form->start() ?>
0 ignored issues
show
The method start() does not seem to exist on object<Ffcms\Core\Helper\HTML\Form>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
29
30
<?= $form->field('query', 'text', ['class' => 'form-control'], __('Enter user nickname or part of user nickname, more then 3 characters')) ?>
31
32
<div class="col-md-offset-3 col-md-9"><?= $form->submitButton(__('Search'), ['class' => 'btn btn-primary']) ?></div>
33
34
<?= $form->finish() ?>
35
<?php
36 View Code Duplication
if ($records === null || $records->count() < 1) {
37
    if ($model->send()) {
38
        echo '<div class="row"><div class="col-md-12"><div class="alert alert-danger">' . __('Users are not founded!') . '</div></div></div>';
39
    }
40
41
    return;
42
}
43
?>
44 View Code Duplication
<?php foreach ($records as $profile) :?>
45
    <div class="row" style="padding-top: 10px;">
46
        <div class="col-md-2">
47
            <div class="text-center"><img src="<?= $profile->getAvatarUrl('small') ?>" class="img-responsive img-circle img-thumbnail"/></div>
48
        </div>
49
        <div class="col-md-8">
50
            <h3>
51
                <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name') : $profile->nick) ?>
52
            </h3>
53
            <p><?= __('Registered') ?>: <?= Date::convertToDatetime($profile->created_at, Date::FORMAT_TO_DAY) ?></p>
54
        </div>
55
        <div class="col-md-2">
56
            <h3 class="pull-right">
57
                <?php
58
                $markLabel = 'badge';
59
                if ($profile->rating > 0) {
60
                    $markLabel = 'alert-success';
61
                } elseif ($profile->rating < 0) {
62
                    $markLabel = 'alert-danger';
63
                }
64
                ?>
65
                <span class="label <?= $markLabel ?>">
66
                    <?= $profile->rating > 0 ? '+' : null ?><?= $profile->rating ?>
67
                </span>
68
            </h3>
69
        </div>
70
    </div>
71
    <hr/>
72
<?php endforeach; ?>
73
<div class="text-center">
74
    <?= $pagination->display(['class' => 'pagination pagination-centered']) ?>
75
</div>