<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model backend\models\accounting\search\GlHeader */ /* @var $form yii\widgets\ActiveForm */ ?> <?php $form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']); ?> <td style="width: 10%;"><?php echo $form->field($model, 'number')->label(false); //Html::textInput('no', '', ['class' => 'form-control']) ?> </td> <td > <?php echo $form->field($model, 'branch_id')->dropDownList(backend\models\master\Branch::selectAssignedOptions())->label(false); ?> </td> <td > <?php echo Html::submitButton('Search', ['class' => 'btn btn-primary']); ?> </td> <?php ActiveForm::end();
/* @var $this yii\web\View */ /* @var $searchModel backend\models\sales\search\Sales */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Saless'; $this->params['breadcrumbs'][] = $this->title; ?> <p class='pull-right'> <?php echo Html::a('Create Sales', ['create'], ['class' => 'btn btn-default']); ?> </p> <br> <div class="sales-index"> <?php // echo $this->render('_search', ['model' => $searchModel]); $totaLine = 0; foreach ($dataProvider->getModels() as $key => $val) { $totaLine += $val->value; } ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'showFooter' => true, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => 'Sales Num', 'format' => 'html', 'attribute' => 'number', 'value' => function ($model) { return Html::a($model->number, ['view', 'id' => $model->id]); }, 'headerOptions' => ['style' => 'text-align:right; width:10%;']], ['attribute' => 'Date', 'headerOptions' => ['style' => 'text-align:right; width:10%;'], 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'Date', 'dateFormat' => 'dd-MM-yyyy', 'options' => ['class' => 'form-control']]), 'format' => 'html'], ['attribute' => 'branch_id', 'value' => 'branch.name', 'filter' => backend\models\master\Branch::selectAssignedOptions()], ['attribute' => 'vendor_id', 'value' => 'vendor.name', 'filter' => false], ['attribute' => 'value', 'format' => ['decimal', 0], 'headerOptions' => ['style' => 'text-align:right; width:20%;'], 'contentOptions' => ['style' => 'text-align:right;'], 'footerOptions' => ['style' => 'text-align:right;', 'class' => 'text-bold'], 'footer' => number_format($totaLine, 0), 'filter' => false]]]); ?> </div>