<?php /** * Created by PhpStorm. * User: jw * Date: 09/02/16 * Time: 20:41 */ use yii\helpers\Html; use yii\helpers\HtmlPurifier; use kartik\widgets\StarRating; ?> <div class="review_view"> <?php echo StarRating::widget(['name' => 'rating', 'value' => $model->score, 'pluginOptions' => ['readonly' => true, 'showClear' => false, 'showCaption' => false, 'size' => 'xs']]); ?> <p><bold>Beschrijving:</bold><?php echo HtmlPurifier::process($model->explanation); ?> </p> <p><bold>Voor:</bold><?php echo Html::encode($model->vacancy->title); ?> </p> </div> <style> .review_view { float:left;
<span><?= $PRICE_1; ?><?= number_format($model->price / $VALUTE, 2, '.', ''); ?><?= $PRICE_2; ?></span> <label>Quantity:</label> <input id="total" type="text" value="1"/> <button type="button" class="btn btn-fefault cart" onclick="addToCartTotal(<?= $model->id ?>,$('#total').val())"> <i class="fa fa-shopping-cart"></i> В корзину </button> </span> <?php echo StarRating::widget([ 'name' => 'rating_21', 'value' => isset($model->rating) ? $model->rating : 0, 'pluginOptions' => [ 'readonly' => true, 'showClear' => false, 'showCaption' => false, ], ]); ?> <p><b>Доступность:</b> <?= $model->status ? 'В наличии' : 'Нет на складе'; ?></p> <p><b>Aкция:</b> Новинка!</p> <p><b>Бренд: </b><?= isset($model->brend->name) ? $model->brend->name : '' ?></p> <p><b>Категория: </b><?= isset($model->category->name) ? $model->category->name : '' ?></p> <script type="text/javascript" src="//yastatic.net/share/share.js" charset="utf-8"></script> <div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="none" data-yashareQuickServices="vkontakte,facebook,twitter,odnoklassniki,moimir,gplus"></div>
</thead> <tbody> <?php foreach ($posts as $post) { ?> <tr> <td><?php echo $post->id; ?> </td> <td><?php echo Html::a($post->description, ['/blog/posts/view', 'id' => $post->id]); ?> </td> <td><?php echo StarRating::widget(['name' => 'post_rating', 'value' => $post->ratingval, 'pluginOptions' => ['displayOnly' => true, 'size' => '15px']]); ?> </td> <td><?php echo Yii::$app->formatter->asDatetime($post->created_at); ?> </td> </tr> <?php } ?> </tbody> </table> </div><!-- /.table-responsive --> </div><!-- /.box-body --> <div class="box-footer clearfix">
<?php foreach ($dataProvider->getModels() as $pdata) { ?> <div class="row"> <div class ="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="row"> <div class="col-lg-12"> <?php echo Html::a('<h1>' . $pdata['description'] . '</h1>', ['view', 'id' => $pdata['id']]); ?> <?php // Render a display only rating easily echo StarRating::widget(['name' => 'post_rating', 'value' => $pdata['ratingval'], 'pluginOptions' => ['displayOnly' => true, 'size' => 'xs']]); ?> </div> <div class ="col-lg-3 col-md-4 col-sm-4 col-xs-12"> <?php if ($pdata['intro_image'] != null) { echo "<img src=" . plathir\smartblog\helpers\PostHelper::getPostIntroImage($pdata['id']) . " class='pull-left img-responsive' style='width:100%'>"; } ?> </div> <div class ="col-lg-9 col-md-8 col-sm-8 col-xs-12"> <div class="row"> <?php echo substr($pdata['intro_text'], 0, 300); ?>
<?php echo $form->field($ratemodel, 'temprate')->widget(StarRating::classname(), ['pluginOptions' => ['defaultCaption' => 'test', 'min' => 0, 'max' => 5, 'step' => 1, 'size' => 'xs']]); ?> <div class="form-group"> <?php echo Html::submitButton('<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Rate this Post', ['class' => 'btn btn-sm btn-success']); ?> </div> <?php ActiveForm::end(); ?> <?php Pjax::end(); ?> <?php } else { echo StarRating::widget(['name' => 'post_rating', 'value' => $ratemodel->temprate, 'pluginOptions' => ['displayOnly' => true, 'size' => 'xs']]); echo '<span class="label label-info">already rate this post !</span>'; } ?> </div> </div>