Exemplo n.º 1
0
echo Html::submitButton('Գեներացնել (Generate)', ['class' => 'btn btn-primary']);
?>


<?php 
ActiveForm::end();
?>

<div class="site-index" style="width: 3500px;">

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{delete}', 'urlCreator' => function ($action, $model, $key, $index) {
    if ($action === 'update') {
        $arrayParams = ['MainSearch' => ['region' => $model->region]];
        $arrayParams['id'] = $model->id;
        $params = array_merge(["site/main"], $arrayParams);
        $url = Yii::$app->urlManager->createUrl($params);
        return $url;
    }
    if ($action === 'delete') {
        $arrayParams = ['MainSearch' => ['region' => $model->region], 'id' => $model->id];
        $params = array_merge(["site/delete"], $arrayParams);
        $url = Yii::$app->urlManager->createUrl($params);
        return $url;
    }
}], ['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'city', 'value' => 'city0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'city', ArrayHelper::map(City::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'type', 'value' => 'type0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'type', ArrayHelper::map(Type::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], 'resident', 'children', 'employee', 'retiree', ['attribute' => 'dominant', 'value' => 'dominant0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'retiree', ArrayHelper::map(Dominant::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'mainTrashPlaces.trash_place_id', 'value' => 'trashPlaceMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashPlaces.trash_place_id', ArrayHelper::map(TrashPlace::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'mainTrashMen.trash_man_id', 'value' => 'trashManMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashMen.trash_man_id', ArrayHelper::map(TrashMan::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'filter_trash_out', 'value' => 'trash_out', 'filter' => Html::activeDropDownList($searchModel, 'filter_trash_out', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_trash_count', 'value' => 'trash_count', 'filter' => Html::activeDropDownList($searchModel, 'filter_trash_count', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_1', 'value' => 'summer_count_1', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_1', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_2', 'value' => 'summer_count_2', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_2', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_3', 'value' => 'summer_count_3', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_3', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_summer_4', 'value' => 'summer_count_4', 'filter' => Html::activeDropDownList($searchModel, 'filter_summer_4', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_1', 'value' => 'winter_count_1', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_1', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_2', 'value' => 'winter_count_2', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_2', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_3', 'value' => 'winter_count_3', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_3', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'filter_winter_4', 'value' => 'winter_count_4', 'filter' => Html::activeDropDownList($searchModel, 'filter_winter_4', array('1' => '1-5', '2' => '6-10', '3' => '11-20', '4' => '20+'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'paper', 'value' => 'paper0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'paper', ArrayHelper::map(Paper::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'mainTrashRelations.trash_relation_id', 'value' => 'trashRelationMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashRelations.trash_relation_id', ArrayHelper::map(TrashRelation::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category']), 'contentOptions' => ['style' => 'width: ' . $width . ';']], ['attribute' => 'mainTrashRecycles.trash_recycle_id', 'value' => 'trashRecycleMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainTrashRecycles.trash_recycle_id', ArrayHelper::map(TrashRecycle::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], ['attribute' => 'mainRubberItems.rubber_item_id', 'value' => 'rubberItemsMulti', 'filter' => Html::activeDropDownList($searchModel, 'mainRubberItems.rubber_item_id', ArrayHelper::map(RubberItems::find()->all(), 'id', 'nameBoth'), ['class' => 'form-control', 'prompt' => 'Select Category'])], 'answer_count', 'woman_count', ['attribute' => 'person', 'value' => 'person0.nameBothShort', 'filter' => Html::activeDropDownList($searchModel, 'person', ArrayHelper::map(Person::find()->all(), 'id', 'nameBothShort'), ['class' => 'form-control', 'prompt' => 'Select Category'])], 'date', 'interrogatory']]);
?>


</div>
Exemplo n.º 2
0
echo $form->field($model, 'children', ['options' => ['class' => 'form-inline col-sm-10']])->label(null, ['class' => 'col-sm-4'])->textInput(['class' => 'quantity form-control']);
?>
    <div class="clearfix"></div>

    <?php 
echo $form->field($model, 'employee', ['options' => ['class' => 'form-inline col-sm-10']])->label(null, ['class' => 'col-sm-4'])->textInput(['class' => ' form-control']);
?>
    <div class="clearfix"></div>

    <?php 
echo $form->field($model, 'retiree', ['options' => ['class' => 'form-inline col-sm-10']])->label(null, ['class' => 'col-sm-4'])->textInput(['class' => ' form-control']);
?>
    <div class="clearfix"></div>
    <hr>
    <?php 
echo $form->field($model, 'dominant', ['options' => ['class' => 'form-inline col-sm-10']])->radioList(ArrayHelper::map(Dominant::find()->all(), 'id', 'nameBoth'), ['class' => 'radio col-sm-6', 'separator' => '<span style="padding-left: 30px;"></span>'])->label(null, ['class' => 'col-sm-4']);
?>
    <hr>
    <div class="clearfix"></div>
    <hr>
    <?php 
echo $form->field($model, 'places', ['options' => ['class' => 'form-inline col-sm-10']])->checkboxList(ArrayHelper::map(TrashPlace::find()->all(), 'id', 'nameBoth'), ['class' => 'radio col-sm-6', 'separator' => '<br>'])->label(null, ['class' => 'col-sm-4']);
?>

    <div class="col-sm-2"></div>
    <div class="clearfix"></div>
    <hr>
    <?php 
echo $form->field($model, 'men', ['options' => ['class' => 'form-inline col-sm-10']])->checkboxList(ArrayHelper::map(TrashMan::find()->all(), 'id', 'nameBoth'), ['class' => 'radio col-sm-6', 'separator' => '<br>'])->label(null, ['class' => 'col-sm-4']);
?>
 /**
  * Finds the Dominant model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Dominant the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Dominant::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDominant0()
 {
     return $this->hasOne(Dominant::className(), ['id' => 'dominant']);
 }