<?php use yii\helpers\ArrayHelper; use yii\helpers\Html; use kartik\detail\DetailView; use common\models\Facility; use common\models\Golfer; use common\models\User; use yii2mod\selectize\Selectize; /* @var $this yii\web\View */ /* @var $model common\models\Golfer */ $this->title = $model->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('igolf', 'Golfers'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="golfer-view"> <?php echo DetailView::widget(['model' => $model, 'panel' => ['heading' => '<h3>' . $model->name . '</h3>'], 'labelColOptions' => ['style' => 'width: 30%'], 'attributes' => ['name', 'email:email', 'phone', 'handicap', ['attribute' => 'gender', 'type' => DetailView::INPUT_RADIO_LIST, 'items' => ['' => Yii::t('igolf', 'Unspecified')] + Golfer::getLocalizedConstants('GENDER_')], ['attribute' => 'hand', 'type' => DetailView::INPUT_RADIO_LIST, 'items' => ['' => Yii::t('igolf', 'Unspecified')] + Golfer::getLocalizedConstants('HAND_')], 'homecourse', ['attribute' => 'facility_id', 'value' => isset($model->facility) ? $model->facility->name : '', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => ['' => 'Select home course...'] + ArrayHelper::map(Facility::find()->where(['>', 'id', 0])->asArray()->all(), 'id', 'name'), 'widgetOptions' => ['pluginOptions' => ['items' => ArrayHelper::map(Facility::find()->where(['>', 'id', 0])->asArray()->all(), 'id', 'name')]]], ['attribute' => 'user_id', 'label' => 'User', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map(['' => ''] + User::find()->orderBy('username')->asArray()->all(), 'id', 'username'), 'value' => isset($model->user) ? $model->user->username : '******']]]); ?> </div>
?> <div class="golfer-profile-index"> <div class="row"> <div class="col-lg-8"> <?php if (!$model) { ?> <div class="alert alert-info"> Your are not registered as a golfer. </div> <?php } else { ?> <?php echo DetailView::widget(['model' => $model, 'panel' => ['heading' => '<h3>' . Html::encode($this->title) . '</h3>'], 'labelColOptions' => ['style' => 'width: 30%'], 'formOptions' => ['action' => Url::to(['view', 'id' => $model->id])], 'attributes' => ['name', 'email:email', 'phone', 'handicap', ['attribute' => 'gender', 'type' => DetailView::INPUT_RADIO_LIST, 'items' => ['' => Yii::t('igolf', 'Unspecified')] + Golfer::getLocalizedConstants('GENDER_')], ['attribute' => 'hand', 'type' => DetailView::INPUT_RADIO_LIST, 'items' => ['' => Yii::t('igolf', 'Unspecified')] + Golfer::getLocalizedConstants('HAND_')], ['label' => Yii::t('igolf', 'Home Course'), 'attribute' => 'facility_id', 'value' => isset($model->facility) ? $model->facility->name : '', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => ['' => 'Select home course...'] + ArrayHelper::map(Facility::find()->where(['>', 'id', 0])->asArray()->all(), 'id', 'name'), 'widgetOptions' => ['pluginOptions' => ['items' => ArrayHelper::map(Facility::find()->where(['>', 'id', 0])->asArray()->all(), 'id', 'name')]]]]]); ?> <?php } ?> </div> <div class="col-lg-4"> <h3><?php echo Yii::t('goflleague', 'Menu'); ?> </h3> <h3><?php echo Yii::t('goflleague', 'Enter score');
?> <?php echo $form->field($model, 'homecourse')->textInput(['maxlength' => 80]); ?> <?php echo $form->field($model, 'facility_id')->widget(Selectize::className(), ['items' => ['' => 'Select home course...'] + ArrayHelper::map(Facility::find()->where(['>', 'id', 0])->asArray()->all(), 'id', 'name')]); ?> <?php echo $form->field($model, 'gender')->radioList(Golfer::getLocalizedConstants('GENDER_')); ?> <?php echo $form->field($model, 'hand')->radioList(Golfer::getLocalizedConstants('HAND_')); ?> <?php echo $form->field($model, 'handicap')->textInput(); ?> <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(); ?>
<?php use common\models\Golfer; use kartik\detail\DetailView; use yii\helpers\ArrayHelper; use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\Start */ $this->title = $model->competition->name; $this->params['breadcrumbs'][] = ['label' => Yii::t('igolf', 'Competitions'), 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->competition->name, 'url' => ['competition/view', 'id' => $model->competition_id]]; $this->params['breadcrumbs'][] = Yii::t('igolf', 'Starts'); ?> <div class="start-view"> <?php echo DetailView::widget(['model' => $model, 'panel' => ['heading' => '<h2>' . $this->title . '</h2>'], 'labelColOptions' => ['style' => 'width: 30%'], 'attributes' => [['attribute' => 'gender', 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => Golfer::getLocalizedConstants('GENDER_')], 'age_min', 'age_max', 'handicap_min', 'handicap_max', ['attribute' => 'tees_id', 'value' => $model->tees->name, 'type' => DetailView::INPUT_DROPDOWN_LIST, 'items' => ArrayHelper::map($model->competition->course->getTeesWithHoles()->all(), 'id', 'name')], ['attribute' => 'created_at', 'options' => ['readonly' => true], 'format' => 'datetime'], ['attribute' => 'updated_at', 'options' => ['readonly' => true], 'format' => 'datetime']]]); ?> </div>