Exemple #1
0
$this->title = 'Wagons';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wagon-index">

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

    <p>
        <?php 
echo Html::button('Thêm toa', ['value' => Url::to('wagon/create'), 'class' => 'btn btn-success', 'id' => 'modalButton']);
?>
    </p>

    <?php 
Modal::begin(['header' => '<h4>THÊM TOA XE</h4>', 'id' => 'modal', 'size' => 'modal-lg']);
echo "<div id='modalContent'></div>";
Modal::end();
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'wagon_number', 'created_year', ['attribute' => 'start_date', 'value' => 'start_date', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'start_date', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['attribute' => 'wagon_status_id_status', 'value' => 'wagonStatusIdStatus.name_of_status', 'filter' => Html::activeDropDownList($searchModel, 'wagon_status_id_status', ArrayHelper::map(WagonStatus::find()->all(), 'status_id', 'name_of_status'), ['class' => 'form-control', 'prompt' => 'Please select...'])], ['attribute' => 'station_station_id', 'value' => 'stationStation.station_name', 'filter' => Html::activeDropDownList($searchModel, 'station_station_id', ArrayHelper::map(\app\models\Station::find()->all(), 'station_id', 'station_name'), ['class' => 'form-control', 'prompt' => 'Please select...'])], ['attribute' => 'kind_of_wagon_kind_id', 'value' => 'kindOfWagonKind.kind_name', 'filter' => Html::activeDropDownList($searchModel, 'kind_of_wagon_kind_id', ArrayHelper::map(\app\models\KindOfWagon::find()->all(), 'kind_id', 'kind_name'), ['class' => 'form-control', 'prompt' => 'Please select...'])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

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

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

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'begin_day', 'value' => 'begin_day', 'contentOptions' => ['style' => 'width:10%'], 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'begin_day', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['attribute' => 'repair_day', 'contentOptions' => ['style' => 'width:10%'], 'value' => function ($data) {
    $date = date("d-m-Y", strtotime($data["repair_day"]));
    $date2 = new DateTime($date);
    $date2->add(new DateInterval('P20M'));
    return $date2->format("Y-m-d");
}, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'repair_day', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['attribute' => 'repair_complete_day', 'contentOptions' => ['style' => 'width:10%'], 'value' => function ($data) {
    $date = date("d-m-Y", strtotime($data["repair_day"]));
    $date2 = new DateTime($date);
    $date2->add(new DateInterval('P20M'));
    $date2 = $date2->add(new DateInterval('P10D'));
    return $date2->format("Y-m-d");
}, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'repair_complete_day', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']])], ['attribute' => 'wagon_wagon_id', 'value' => 'wagonWagon.wagon_number', 'filter' => Html::activeDropDownList($searchModel, 'wagon_wagon_id', ArrayHelper::map(Wagon::find()->all(), 'wagon_id', 'wagon_number'), ['class' => 'form-control', 'prompt' => 'Please select...'])], ['attribute' => 'brand_repair_brand_repair_id', 'value' => 'brandRepairBrandRepair.name', 'filter' => Html::activeDropDownList($searchModel, 'brand_repair_brand_repair_id', ArrayHelper::map(\app\models\BrandRepair::find()->all(), 'brand_repair_id', 'name'), ['class' => 'form-control', 'prompt' => 'Please select...'])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemple #3
0
 public function datePicker($options = [])
 {
     /* if ($this->form->type == ActiveForm::TYPE_VERTICAL) {
        //$options = array_merge($options, ['options' => ['style' => 'display:table-cell;']]);
        $options = array_merge($options, ['options' => ['class' => 'show']]);
        } */
     $this->parts['{input}'] = DatePicker::widget(array_merge($options, ['model' => $this->model, 'attribute' => $this->attribute]));
     return $this;
 }
Exemple #4
0
</div>
<?php 
if ($marker != 0) {
    ?>
<div class="col-md-12">
    <div class="row">
        <p>Укажите период времени, за который хотели бы получить отчет:</p>
    </div>
</div>
<div class="row">
    <?php 
    $form = ActiveForm::begin(['action' => 'second-result']);
    ?>
    <div class="col-md-9">
        <?php 
    echo DatePicker::widget(['name' => 'from', 'value' => $dateRange[0], 'type' => DatePicker::TYPE_RANGE, 'name2' => 'to', 'value2' => $dateRange[1], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd'], 'separator' => 'по']);
    ?>
    </div>
    <div class="col-md-3">
        <div class="btn-group">
            <?php 
    echo \yii\helpers\Html::submitButton('Вывести отчет');
    ?>
        </div>
    </div>
    <?php 
    ActiveForm::end();
    ?>
    <?php 
}
?>