implement registration
This commit is contained in:
23
backend/views/event/_form_register_card.php
Normal file
23
backend/views/event/_form_register_card.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CardEventRegistrationForm */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="event-registration-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'card_number')->textInput() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? Yii::t('event-registration', 'Create') : Yii::t('event-registration', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
@@ -62,8 +62,52 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'label' => \Yii::t('event', 'Updated At'),
|
||||
'format' => 'datetime'
|
||||
],
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view} {update} {delete} {register-card}',
|
||||
'urlCreator' => function ($action, $model, $key, $index) {
|
||||
$params = ['id' => $model['event_id']];
|
||||
$params[0] = "event" . '/' . $action;
|
||||
return \yii\helpers\Url::toRoute($params);
|
||||
},
|
||||
'buttons' => [
|
||||
'view' => function ($url, $model, $key) {
|
||||
$options = [
|
||||
'title' => Yii::t('yii', 'View'),
|
||||
'aria-label' => Yii::t('yii', 'View'),
|
||||
'data-pjax' => '0',
|
||||
];
|
||||
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options);
|
||||
},
|
||||
'update' => function ($url, $model, $key) {
|
||||
$options = [
|
||||
'title' => Yii::t('yii', 'Update'),
|
||||
'aria-label' => Yii::t('yii', 'Update'),
|
||||
'data-pjax' => '0',
|
||||
];
|
||||
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, $options);
|
||||
},
|
||||
'delete' => function ($url, $model, $key) {
|
||||
$options = [
|
||||
'title' => Yii::t('yii', 'Delete'),
|
||||
'aria-label' => Yii::t('yii', 'Delete'),
|
||||
'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'),
|
||||
'data-method' => 'post',
|
||||
'data-pjax' => '0',
|
||||
];
|
||||
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, $options);
|
||||
},
|
||||
'register-card' => function ($url, $model, $key) {
|
||||
$options = [
|
||||
'title' => Yii::t('yii', 'Register'),
|
||||
'aria-label' => Yii::t('yii', 'Register'),
|
||||
'data-pjax' => '0',
|
||||
];
|
||||
return Html::a('<span class="glyphicon glyphicon-user"></span>', $url, $options);
|
||||
}
|
||||
]
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
21
backend/views/event/register_card.php
Normal file
21
backend/views/event/register_card.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CardEventRegistrationForm */
|
||||
|
||||
$this->title = Yii::t('event-registration', 'Create Event Registration');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('event-registration', 'Event Registrations'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="event-registration-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= $this->render('_form_register_card', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user