Exemple #1
0
<?php

use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use kartik\grid\GridView;
use common\models\Facility;
use common\models\Message;
/* @var $this yii\web\View */
/* @var $searchModel backend\MessageSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('igolf', 'Messages');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="message-index">

    <h1>    <h1><?php 
echo Html::encode($this->title);
?>
 <?php 
echo Html::a(Yii::t('igolf', 'Create {modelClass}', ['modelClass' => 'Message']), ['create'], ['class' => 'btn btn-success']);
?>
</h1>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'subject', ['attribute' => 'message_type', 'filter' => Message::getLocalizedConstants('TYPE_')], ['attribute' => 'facility_id', 'filter' => ArrayHelper::map(Facility::find()->asArray()->all(), 'id', 'name'), 'value' => 'facility.name'], ['attribute' => 'status', 'filter' => Message::getLocalizedConstants('STATUS_')], 'updated_at', ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{view} {delete}']]]);
?>

</div>
Exemple #2
0
echo $form->field($model, 'message_type')->dropDownList(Message::getLocalizedConstants('TYPE_'));
?>

    <?php 
echo $form->field($model, 'facility_id')->dropDownList(['' => ''] + ArrayHelper::map(Facility::find()->asArray()->all(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'message_start')->widget(DateTimePicker::classname(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'message_end')->widget(DateTimePicker::classname(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(Message::getLocalizedConstants('STATUS_'));
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('igolf', 'Create') : Yii::t('igolf', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>
Exemple #3
0
<?php

use yii\helpers\Html;
use kartik\detail\DetailView;
use common\models\Message;
/* @var $this yii\web\View */
/* @var $model common\models\Message */
$this->title = $model->subject;
$this->params['breadcrumbs'][] = ['label' => Yii::t('igolf', 'Messages'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="message-view">

    <?php 
echo DetailView::widget(['model' => $model, 'panel' => ['heading' => '<h3>' . $this->title . '</h3>'], 'labelColOptions' => ['style' => 'width: 30%'], 'attributes' => ['subject', ['attribute' => 'body', 'type' => DetailView::INPUT_TEXTAREA], ['attribute' => 'message_start', 'type' => DetailView::INPUT_DATETIME], ['attribute' => 'message_end', 'type' => DetailView::INPUT_DATETIME], ['attribute' => 'message_type', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => Message::getLocalizedConstants('TYPE_')], ['attribute' => 'status', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => Message::getLocalizedConstants('STATUS_')], ['attribute' => 'created_at', 'format' => 'datetime', 'displayOnly' => true, 'noWrap' => true, 'value' => new DateTime($model->created_at)], ['attribute' => 'updated_at', 'format' => 'datetime', 'displayOnly' => true, 'noWrap' => true, 'value' => new DateTime($model->updated_at)]]]);
?>

	<?php 
echo $this->render('../media/_add', ['model' => $model]);
?>

</div>