<?php
/* @var $this yii\web\View */
use yii\helpers\Html;
$this->title = 'My Yii Application';
?>
<div class="site-index">
<div class="body-content">
<div class="row">
<?php
foreach ($request as $req) { ?>
<div class="col-lg-6">
<h3><?= Html::encode("{$req->h1}") ?></h3>
<h5><?= Html::encode("{$req->content}") ?></h5>
<?php
if ($req->count != 0) {
?>
<h4><?= Html::encode("На складе {$req->count}") ?></h4>
<?php } else { ?>
<h4>Нет на складе</h4>
<?php }
?>
<span><h3><?= Html::encode("Цена {$req->price} Р") ?></h3></span>
<?php $form = \yii\widgets\ActiveForm::begin(); ?>
<?php
if ($req->count > 0 && !Yii::$app->user->isGuest) {
?>
<input name="buy" style="float: right;margin-bottom: 20px;" type="submit" class="btn btn-primary"
value="Добавить в корзину">
<input type="hidden" value="<?= $req->id ?>" name="id">
<input name="more" style="float: right; margin-right: 5px; margin-bottom: 20px;"
type="submit" class="btn btn-primary" value="Подробнее">
<?php
} else { ?>
<input type="hidden" value="<?= $req->id ?>" name="id">
<input name="more" style="float: right; margin-right: 5px; margin-bottom: 20px;"
type="submit" class="btn btn-primary" value="Подробнее">
<?php }
\yii\widgets\ActiveForm::end() ?>
</div>
<?php }
?>
</div>
</div>
</div>