Exemple #1
0
?>
    <?php 
echo $form->field($model, 'mother_name')->textInput();
?>
    <?php 
echo $form->field($model, 'mother_link')->textInput();
?>
    <?php 
echo $form->field($model, 'father_name')->textInput();
?>
    <?php 
echo $form->field($model, 'father_link')->textInput();
?>
    
    <?php 
echo $form->field($model, 'breed_id')->dropDownList(\app\models\Breed::getAll(), ['prompt' => Yii::t('app', '-- select breed --'), 'data-url' => '/pet/subcategory']);
?>

    <?php 
echo $form->field($model, 'brood_id')->dropDownList(\app\models\Brood::getAllWithDate($model->breed_id), ['prompt' => Yii::t('app', '-- select brood --')]);
?>

    <?php 
echo $form->field($model, 'pet_status_id')->dropDownList(\app\models\PetStatus::getAll());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Exemple #2
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pet-index">

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

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

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'petImages', 'value' => function ($data) {
    if ($data->petImages) {
        return "<img src='/" . $data->petImages[0]->source_url . "' />";
    }
    return "<img src='/' />";
}, 'format' => 'raw', 'contentOptions' => ['class' => 'grid-image'], 'filter' => false], 'name', 'date_create', 'date_update', ['attribute' => 'breed_id', 'filter' => \app\models\Breed::getAll(), 'value' => 'brood.breed.name'], ['attribute' => 'brood_id', 'filter' => \app\models\Brood::getAllWithDate(), 'value' => function ($data) {
    return $data->brood->name . " " . $data->brood->date;
}], ['attribute' => 'pet_status_id', 'filter' => \app\models\PetStatus::getAll(), "value" => "petStatus.name"], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemple #3
0
<div class="brood-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'date')->widget(DatePicker::classname(), ['options' => ['placeholder' => Yii::t('app', 'Enter birth date ...')], 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd'], 'removeButton' => false, 'language' => \app\models\Lang::getCurrent()['local']]);
?>

    <?php 
echo $form->field($model, 'breed_id')->dropDownList(\app\models\Breed::getAll());
?>

    <?php 
echo $form->field($model, 'common_status_id')->dropDownList(\app\models\CommonStatus::getAll());
?>

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

    <?php 
ActiveForm::end();
?>
Exemple #4
0
use app\models\Breed;
/* @var $this yii\web\View */
/* @var $searchModel app\models\BroodSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Broods');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="brood-index">

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

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

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'date', 'date_create', 'date_update', ['attribute' => 'breed_id', 'filter' => Breed::getAll(), 'value' => 'breed.name'], ['attribute' => 'common_status_id', 'value' => function ($data) {
    return $data->common_status_id == CommonStatus::ACTIVE ? '<span class="status-button status-active glyphicon glyphicon-refresh"></span>' : '<span class="status-button status-inactive glyphicon glyphicon-refresh"></span>';
}, 'format' => 'raw', 'filter' => CommonStatus::getAll()], ['class' => 'yii\\grid\\ActionColumn']], 'options' => ['data-url' => Yii::$app->urlManager->createUrl(['brood/change-status']), 'class' => 'grid']]);
?>

</div>