Esempio n. 1
1
</p>
            <div class="clearfix"></div>
            <p>
                <?php 
foreach ($model->images as $image) {
    ?>
                    <?php 
    echo Html::a(Html::img('/admin/images/products/galleries/' . $image->name, ['alt' => $image->alt, 'width' => 70, 'height' => 70, 'class' => 'img-thumbnail']), ['/admin/images/products/galleries/' . $image->name], ['data-lightbox' => 'product-gallery']);
    ?>
 
                <?php 
}
?>
            </p>
            <p><?php 
echo StarRating::widget(['name' => 'rating', 'value' => $model->rating, 'disabled' => $isRatingDisabled, 'pluginOptions' => ['size' => 'sm', 'showClear' => false, 'showCaption' => false], 'pluginEvents' => ["rating.change" => "function () {\n                        console.log(\$(this).val()); \n                        \$.ajax({\n                            type: 'POST',\n                            url: '/site/product-rating',\n                            data: {rating: \$(this).val(), id: {$model->id}},\n                            success: function(res) {\n                                // if (res === 'forbidden') {\n                                //     \$('.star-rating').removeClass('rating-active');\n                                //     \$('.star-rating').addClass('rating-disabled');\n                                //     \$('#w0').prop('disabled', true);\n                                //     return;\n                                // }\n                                location.reload();\n                            }\n                        });\n                        return false;\n                    }"]]);
?>
</p>
            <?php 
echo ProductHelper::getButtons($model);
?>
        </article>

    </div>
</div>





Esempio n. 2
0
?>
    
    <?php 
echo $form->field($model, 'old_price')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'currency')->textInput(['maxlength' => true, 'placeholder' => 'По умолчанию грн.']);
?>

    <?php 
echo $form->field($model, 'vendor')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'rating')->widget(StarRating::classname(), ['pluginOptions' => ['size' => 'lg']]);
?>

    <?php 
echo $form->field($model, 'brand')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'user_id')->dropdownList($model::getUserList());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Esempio n. 3
0
echo $model->description;
?>
</p>
            </div>
        </div>

        <div class="rating-box box-body box box-primary">
            <div class="col-md-12 background-white"><h3 class="color-blue text-aqua text-center">Current Rating</h3></div>
            <div class="col-md-6">
                <div class="rating-box">

                    <?php 
$form = ActiveForm::begin(['action' => '@web/rating/create', 'id' => 'rateform' . $model->id]);
?>
                    <?php 
echo StarRating::widget(['name' => 'Rating[rate]', 'value' => Rating::averageRating($model->id) == 0 ? 0 : Rating::averageRating($model->id), 'disabled' => Yii::$app->user->identity->level == 0 ? true : Rating::countEntered(Yii::$app->user->id, $model->id), 'id' => 'rateinput' . $model->id]);
?>
                    <?php 
echo Html::hiddenInput('Rating[activity_id]', $model->id);
?>
                    <?php 
//var_dump($model->id); die();
?>
                    <?php 
ActiveForm::end();
?>
                </div>        
            </div>
            <div class="col-md-6">
                <h1 class="font-large color-green text-center">Your activity got <span class="color-orange"><?php 
echo $rate->averageRating($model->id);
	<label class="control-label" for="endorsement-decisiveness">Creativity</label>
	</td>
	<td>
	<?php 
echo $form->field($endorsementmodel, 'creativity')->widget(StarRating::classname(), ['pluginOptions' => ['size' => 'xs', 'showCaption' => false, 'readonly' => true]])->label(false);
?>
	</td>
	</tr>
	
	<tr>
	<td style="padding: 5px;">
	<label class="control-label" for="endorsement-decisiveness">Decisiveness</label>
	</td>
	<td>
	<?php 
echo $form->field($endorsementmodel, 'decisiveness')->widget(StarRating::classname(), ['pluginOptions' => ['size' => 'xs', 'showCaption' => false, 'readonly' => true]])->label(false);
?>
	</td>
	</tr>
	</table>
	</div>
	</div>
	
	<label class="control-label">My Post</label>
	<a href="#" id="profilepost"><pre style="width:85%"><h5 id="mypost"><?php 
echo $about;
?>
</h5></pre></a>
	
	<div id="profileupdatepost">
	<?php 
Esempio n. 5
0
<?php

/**
 * @var \common\components\View $this
 * @var \app\modules\main\models\Review $model
 */
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use kartik\rating\StarRating;
echo Html::beginTag('div', ['class' => 'review-item', 'id' => "comment-item-{$model->id}"]);
echo Html::beginTag('div', ['class' => 'review-info']);
echo Html::tag('span', $model->username, ['class' => 'review-username']);
if (!empty($model->email)) {
    echo '&nbsp;|&nbsp;';
    echo Html::mailto($model->email, null, ['class' => 'review-email']);
}
echo '&nbsp;|&nbsp;';
echo Html::tag('span', Yii::$app->formatter->asDatetime($model->created_at), ['class' => 'review-date']);
echo Html::endTag('div');
$options = ArrayHelper::merge($model->metaFields->rating->inputClass['widgetOptions'], ['name' => "review-rating-{$model->id}", 'value' => $model->rating, 'readonly' => true, 'pluginOptions' => ['size' => 'xs']]);
echo Html::tag('div', StarRating::widget($options), ['class' => 'review-rating']);
echo Html::tag('div', $model->text, ['class' => 'review-text']);
echo Html::endTag('div');
    echo round($endorsement->creativity, 1);
    ?>
</b></center>
	</td>
	</tr>
	
	<tr>
	<td style="padding: 5px;">
	<label class="control-label" for="endorsement-decisiveness">Decisiveness</label>
	</td>
	<?php 
    if ($canRate) {
        ?>
	<td>
	<?php 
        echo $form->field($endorsementmodel, 'decisiveness')->widget(StarRating::classname(), ['pluginOptions' => ['size' => 'xs', 'showCaption' => true], 'pluginEvents' => ["rating.change" => "function() \n\t{ \n\tvar rating = document.getElementById('endorsement-decisiveness').value;\n\tvar friendun = document.getElementById('sofhidid').value;\n\t\$.ajax({\n\t\t\ttype:'POST',\t            \n\t        url:'index.php?r=profile/default/updateendorsement',\n\t\t\tdata:'rating='+rating+'&friendun='+friendun+'&ratefield=decisiveness',\n\t        success:function(data) {\n\t\t\t},\n\t\t\terror:function(jqXHR, textStatus, errorThrown){\n\t\t\talert('error::'+errorThrown);}\n\t        });\n\t}\n\t"]])->label(false);
        ?>
	</td>
	<?php 
    }
    ?>
	<td background="uploads/siteimages/star1.jpg" style="height:55px;width:80px">
	<center><b><?php 
    echo round($endorsement->decisiveness, 1);
    ?>
</b></center>
	</td>
	</tr>
	</table>
	<?php 
    ActiveForm::end();
Esempio n. 7
0
            <div class="col-sm-12">
                <div class="blog-post-area">
                    <h2 class="title text-center">Новости</h2>


                    <?php 
    foreach ($models as $blog) {
        ?>

                        <div class="single-blog-post">
                            <h3><?php 
        echo Html::encode($blog->title);
        ?>
</h3>
                            <?php 
        echo StarRating::widget(['name' => $blog->id, 'id' => $blog->id, 'value' => isset($blog->rating) ? $blog->rating : 0, 'pluginOptions' => ['readonly' => true, 'showClear' => false, 'showCaption' => false]]);
        ?>

                            <div class="post-meta">
                                <ul>
                                    <li><i class="fa fa-user"></i><?php 
        echo $blog->user->username;
        ?>
</li>
                                    <li><i class="fa fa-clock-o"></i><?php 
        echo date("H:i", $blog->created_at);
        ?>
</li>
                                    <li><i class="fa fa-calendar"></i><?php 
        echo date("d m Y", $blog->created_at);
        ?>
Esempio n. 8
0
                                        <div class="grey-card-two">
                                            <div class="image-box-small">
                                                
                                                <h3 class="text-center color-blue bold-fonts"><?php 
        echo Html::a($ratings->activity->title, ['activity/view', 'id' => $ratings->activity->id], ['class' => 'profile-link']);
        ?>
</h3>
                                               
                                                <p class="text-center"><?php 
        echo date("F jS, Y", strtotime($ratings->activity->date));
        ?>
</p>
                                            </div>
                                            <div class="rating-box">
                                                <?php 
        echo StarRating::widget(['name' => 'Rating[rate]', 'value' => $ratings->user_rate == 0 ? 0 : $ratings->user_rate, 'disabled' => true, 'id' => 'rateinput' . $ratings->id]);
        ?>
                                                <?php 
        echo Html::hiddenInput('Rating[activity_id]', $ratings->id);
        ?>
                                            </div>
                                        </div>
                                    </div>
                                    <?php 
        if (++$i > 2) {
            break;
        }
    }
    ?>
                                <!-- ratings by children -->
                            <?php 
Esempio n. 9
0
                    <h2 class="product-list"><?php 
    echo Html::a($product->title, ['/' . $product->slug_ru]);
    ?>
</h2>
                    <p><?php 
    echo Html::a(Html::img('/admin/images/products/titles/' . $product->image, ['alt' => $product->image_alt, 'width' => 150, 'height' => 150, 'class' => 'leftimg img-thumbnail']), ['/' . $product->slug_ru]);
    echo nl2br($product->short_description, false);
    ?>
</p>
                    <p><?php 
    echo Html::a('Подробнее &raquo;', ['/' . $product->slug_ru], ['class' => 'btn btn-default']);
    ?>
</p>
                    <div class="clearfix"></div>
                    <p><?php 
    echo StarRating::widget(['name' => 'rating', 'value' => $product->rating, 'disabled' => true, 'pluginOptions' => ['size' => 'sm', 'showClear' => false, 'showCaption' => false]]);
    ?>
</p>
                    <?php 
    echo ProductHelper::getButtons($product);
    ?>
                </article>
                <hr>
            <?php 
}
?>
        </div>

    </div>
</div>
Esempio n. 10
0
?>

        <?php 
echo $form->field($model, 'q07')->widget(StarRating::classname(), ['pluginOptions' => ['showClear' => false, 'showCaption' => false, 'step' => 1]]);
?>

        <?php 
echo $form->field($model, 'q08')->widget(StarRating::classname(), ['pluginOptions' => ['showClear' => false, 'showCaption' => false, 'step' => 1]]);
?>

        <?php 
echo $form->field($model, 'q09')->widget(StarRating::classname(), ['pluginOptions' => ['showClear' => false, 'showCaption' => false, 'step' => 1]]);
?>

        <?php 
echo $form->field($model, 'q10')->widget(StarRating::classname(), ['pluginOptions' => ['showClear' => false, 'showCaption' => false, 'step' => 1]]);
?>

        <?php 
echo $form->field($model, 'comment')->textarea(['rows' => 6]);
?>

        <div class="form-group">
            <?php 
echo Html::submitButton(Yii::t('backend', 'Submit'), ['class' => 'btn btn-success']);
?>
        </div>

        <?php 
ActiveForm::end();
?>
Esempio n. 11
0
/**
 * Created by PhpStorm.
 * User: dev
 * Date: 11/18/15
 * Time: 13:53
 */
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use unclead\widgets\MultipleInput;
use unclead\widgets\MultipleInputColumn;
use kartik\date\DatePicker;
use kartik\select2\Select2;
use kartik\growl\Growl;
echo DatePicker::widget(['name' => 'check_issue_date', 'value' => date('d-M-Y', strtotime('+2 days')), 'options' => ['placeholder' => 'Select issue date ...'], 'pluginOptions' => ['format' => 'dd-M-yyyy', 'todayHighlight' => true]]);
echo \kartik\time\TimePicker::widget(['name' => 'start_time', 'value' => '11:24', 'pluginOptions' => ['showSeconds' => false, 'showMeridian' => false]]);
echo \kartik\rating\StarRating::widget(['name' => 'rating_1', 'pluginOptions' => ['disabled' => false, 'showClear' => true]]);
?>



<?php 
$form = ActiveForm::begin([]);
?>

<h3>Single column</h3>
<?php 
echo $form->field($model, 'emails')->widget(\unclead\widgets\MultipleInput::className(), ['limit' => 6, 'allowEmptyList' => false, 'enableGuessTitle' => true, 'min' => 2, 'addButtonPosition' => \unclead\widgets\MultipleInput::POS_HEADER])->label(false);
//echo $form->field($model, 'list')->widget(Select2::classname(), [
//    'data' => \app\models\TestModel::getTestDataList(),
//    'language' => 'de',
//    'options' => ['placeholder' => 'Select a state ...', 'multiple' => true],
Esempio n. 12
0
$this->params['breadcrumbs'][] = $this->title;
?>
<style type="text/css" scoped="scoped">
    .rating-xs {font-size: 150%}
</style>
<div style='position: relative'>  
    <?php 
echo Html::img($model->getImageUrl(), ['class' => 'center-block img-responsive image', 'alt' => $model->name]);
?>
    <div class='center-block' style="width: 10%; position: absolute;  bottom: -5%; left: 42%">
        <?php 
$form_rate = ActiveForm::begin(['id' => 'rate-form', 'action' => ['languecenter/rate'], 'options' => ['method' => 'post']]);
?>

        <?php 
echo $form_rate->field($rate, 'value')->widget(StarRating::classname(), ['pluginOptions' => ['step' => 1, 'showClear' => false, 'showCaption' => false, 'showLabel' => false, 'size' => 'xs'], 'pluginEvents' => ['rating.change' => 'function(event, value) {
                    var a= getId();
                    $.ajax({
                    type: "POST",
                    url: "/languecenter/rate",
                    data: { rate: value,idlang: a},
                });}']])->label('');
?>
        <?php 
ActiveForm::end();
?>
    </div>
    <script>
        function getId(){
            return <?php 
echo $model->ID;
Esempio n. 13
0
 /**
  * Формирование Html кода поля для вывода в форме
  * @param ActiveForm $form объект форма
  * @param array $options массив html атрибутов поля
  * @param bool|int $index инднкс модели при табличном вводе
  * @return string
  */
 public function renderInput(ActiveForm $form, array $options = [], $index = false)
 {
     $options = ArrayHelper::merge($this->options, $options);
     $widgetOptions = ArrayHelper::merge(["options" => ["class" => "form-control"]], $this->widgetOptions, ["options" => $options]);
     return $form->field($this->modelField->model, $this->getFormAttrName($index, $this->modelField->attr))->widget(StarRating::className(), $widgetOptions);
 }
Esempio n. 14
0
			type: "gantt",
			renderAt: "chart-container",
			width: "100%",
			height: "600",
			dataFormat: "json",
			dataSource: myData
		})
		.render();
	});
', $this::POS_READY);
/* AUTHOR -ptr.nov- GRIDVIEW PILOT*/
$gv_pilot = GridView::widget(['id' => 'gv-pilot', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => 'Header', 'attribute' => 'SORT', 'value' => function ($model, $key, $index, $widget) {
    $Proj_sort = Pilotproject::find()->where(['ID' => $model->SORT])->one();
    return $Proj_sort->PILOT_NM;
}, 'filter' => ArrayHelper::map(Pilotproject::find()->where('ID=SORT')->asArray()->all(), 'ID', 'PILOT_NM'), 'group' => true], ['label' => 'Sechedule', 'attribute' => 'PILOT_NM'], ['attribute' => 'PLAN_DATE1', 'filterType' => GridView::FILTER_DATE], ['attribute' => 'PLAN_DATE2', 'filterType' => GridView::FILTER_DATE], ['attribute' => 'BOBOT', 'format' => 'Html', 'value' => function ($model, $key, $index, $widget) {
    return StarRating::widget(['name' => 'rating_1']);
}], ['attribute' => 'ACTUAL_DATE1', 'filterType' => GridView::FILTER_DATE], ['attribute' => 'ACTUAL_DATE2', 'filterType' => GridView::FILTER_DATE], ['label' => 'Discription', 'attribute' => 'DSCRP', 'mergeHeader' => true, 'value' => function ($model, $key, $index, $widget) {
    if ($model->DSCRP != '') {
        return substr($model->DSCRP, 0, 30) . ' ...';
        //Author -ptr.nov- limit disply text
    } else {
        return '';
    }
}], ['label' => 'Status', 'attribute' => 'STATUS', 'format' => 'html', 'hAlign' => 'center', 'value' => function ($model) {
    if ($model->STATUS == 0) {
        return Html::a('<i class="fa fa-edit"></i> &nbsp;&nbsp;&nbsp;&nbsp;Open', '', ['class' => 'btn btn-success btn-sm', 'title' => 'Open']);
    } else {
        if ($model->STATUS == 1) {
            return Html::a('<i class="fa fa-close"></i> &nbsp;&nbsp;&nbsp;&nbsp;Close', '', ['class' => 'btn btn-danger btn-sm', 'title' => 'Closing']);
        }
    }
Esempio n. 15
0
    return Html::a('<button type="button" class="btn btn-primary btn-xs" style="width:50px; height:50px">View </button>', ['/hrd/employe/view', 'id' => $model->EMP_ID], ['data-toggle' => "modal", 'data-target' => "#activity-emp", 'data-title' => $model->EMP_ID]);
}]]], 'panel' => ['type' => GridView::TYPE_SUCCESS, 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('app', 'Create ', ['modelClass' => 'Employe']), '/hrd/employe/create', ['data-toggle' => "modal", 'data-target' => "#activity-emp", 'class' => 'btn btn-success'])], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'active'], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => ['fontAwesome' => true, 'showConfirmAlert' => false, 'target' => GridView::TARGET_BLANK]]]);
//---EMPLOYE RESIGN --
$tab_employe_resign = GridView::widget(['id' => 'resign', 'dataProvider' => $dataProvider1, 'filterModel' => $searchModel1, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}', 'header' => 'Action', 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<button type="button" class="btn btn-danger btn-xs" style="width:50px; height:50px">View </button>', ['view', 'id' => $model->EMP_ID], ['data-toggle' => "modal", 'data-target' => "#activity-emp", 'data-title' => $model->EMP_ID]);
}]], ['attribute' => 'PIC', 'format' => 'html', 'value' => function ($data) {
    return Html::img(Yii::getAlias('@HRD_EMP_UploadUrl') . '/' . $data->EMP_IMG, ['width' => '40']);
}], 'EMP_ID', ['attribute' => 'EMP_NM'], 'EMP_NM_BLK', ['attribute' => 'corpOne.CORP_NM', 'filter' => $Combo_Corp], ['attribute' => 'deptOne.DEP_NM', 'filter' => $Combo_Dept], ['attribute' => 'deptsub.DEP_SUB_NM', 'filter' => $Combo_SubDept], ['attribute' => 'groupfunction.GF_NM', 'filter' => $Combo_GrpFnc], ['attribute' => 'groupseqmen.SEQ_NM', 'filter' => $Combo_Seq], ['attribute' => 'jobgrade.JOBGRADE_NM', 'filter' => $Combo_Jab], ['attribute' => 'sttOne.STS_NM', 'filter' => $Combo_Status], ['attribute' => 'EMP_JOIN_DATE', 'filterType' => \kartik\grid\GridView::FILTER_DATE_RANGE, 'filterWidgetOptions' => ['attribute' => 'EMP_JOIN_DATE', 'presetDropdown' => TRUE, 'convertFormat' => true, 'pluginOptions' => ['format' => 'Y-m-d', 'separator' => ' TO ', 'opens' => 'left']]], ['attribute' => 'EMP_RESIGN_DATE', 'filterType' => \kartik\grid\GridView::FILTER_DATE_RANGE, 'filterWidgetOptions' => ['attribute' => 'EMP_RESIGN_DATE', 'presetDropdown' => TRUE, 'convertFormat' => true, 'pluginOptions' => ['format' => 'Y-m-d', 'separator' => ' TO ', 'opens' => 'left']]]], 'panel' => ['type' => GridView::TYPE_SUCCESS], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'resign']], 'hover' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => ['fontAwesome' => true, 'showConfirmAlert' => false, 'target' => GridView::TARGET_BLANK]]);
?>


<?php 
use kartik\rating\StarRating;
use kartik\sortable\Sortable;
// With model & without ActiveForm
$strRat = StarRating::widget(['name' => 'rating_1', 'pluginOptions' => ['disabled' => true, 'showClear' => false]]);
/*
	use kartik\sortinput\SortableInput;
	
	//$model = Employe::find();
$sortImg= SortableInput::widget([
    //'model' => $model,
    //'attribute' => 'EMP_IMG',
    'hideInput' => false,
    'delimiter' => '~',
    'items' => [['content' =>$Combo_Corp]]
     
]);
*/
use kartik\affix\Affix;
$content = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.';
Esempio n. 16
0
use kartik\rating\StarRating;
/* @var $this yii\web\View */
/* @var $searchModel app\models\DepartmentsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Departments';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="departments-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Departments', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'group_id', 'rate1', ['attribute' => 'rate1', 'format' => 'raw', 'value' => function ($model) {
    return StarRating::widget(['model' => $model, 'name' => 'rating', 'pluginOptions' => ['showCaption' => false, 'showClear' => false, 'readonly' => true], 'value' => $model->rate1]);
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Esempio n. 17
0
/* @var $this yii\web\View */
/* @var $model app\models\Departments */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="departments-form">
    <?php 
$form = ActiveForm::begin();
?>
    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
    
    <?php 
echo $form->field($model, 'group_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(app\models\Groups::find()->all(), 'id', 'name'), 'language' => 'th', 'options' => ['placeholder' => 'เลือกกลุ่มงาน ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
    
    <?php 
echo $form->field($model, 'rate1')->widget(StarRating::className(), ['pluginOptions' => ['size' => 'md', 'showCaption' => FALSE]]);
?>
    
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
    <?php 
ActiveForm::end();
?>
</div>

Esempio n. 18
0
<?php

/**
 * Created by PhpStorm.
 * User: jw
 * Date: 04/02/16
 * Time: 21:09
 */
use kartik\rating\StarRating;
use yii\helpers\Html;
/* @var $this yii\web\View */
$this->title = 'Reviews';
$this->params['breadcrumbs'][] = ['label' => 'Student', 'url' => ['student/index']];
$this->params['breadcrumbs'][] = 'Reviews';
?>

<h1> Reviews</h1>
<!--<?php 
echo Html::a('Create new review', ['create'], ['class' => 'btn btn-success float']);
?>
 -->
<br />
    <h2> Reviews about me</h2>
    <?php 
echo StarRating::widget(['name' => 'avg_rating', 'value' => round($avgScore, 2, PHP_ROUND_HALF_UP), 'pluginOptions' => ['readonly' => true, 'showClear' => false, 'showCaption' => true, 'size' => 'sm']]);
?>



    <?php 
echo \yii\widgets\ListView::widget(['dataProvider' => $dataProvider, 'itemView' => "../../shared/review/_review"]);
Esempio n. 19
0
    foreach ($dataProvider->models as $review) {
        ?>
                        <div class="review-preview">
                            <a href="<?php 
        echo Url::to(['/review/view', 'id' => $review->id]);
        ?>
">
                                <h2 class="review-title">
                                    <?php 
        echo $review->title;
        ?>
                                </h2>
                            </a>

                            <?php 
        echo StarRating::widget(['id' => 'rating' . $review->id, 'name' => 'rating', 'value' => $review->rating, 'pluginOptions' => ['readonly' => true, 'showClear' => false, 'showCaption' => false, 'stars' => 5, 'size' => 'xs']]);
        ?>

                            <h3 class="review-subtitle">
                                <?php 
        echo StringHelper::truncateWords($review->text, 30);
        ?>
                            </h3>

                            <?php 
        if (isset($author)) {
            $cities = implode(', ', ArrayHelper::getColumn($review->cities, 'name'));
            ?>
                                <p class="review-meta">
                                    <?php 
            echo empty($cities) ? 'Для всех городов России' : $cities;