/** * @return string render input */ protected function renderInput() { $input = Html::dropDownList($this->name, $this->selected, $this->items, $this->options); // If use form model then $input use active input if ($this->hasModel()) { $input = Html::activeDropDownList($this->model, $this->attribute . '[status]', $this->items, $this->options); } $input .= Html::beginTag('div', ['id' => 'status_payment', 'style' => 'margin-top: 20px;']); foreach ($this->columns as $status => $item) { $input .= Html::beginTag('div', ['class' => 'status_payment', 'id' => 'status_payment_' . $status, 'style' => 'display: none']); foreach ($item as $name => $info) { $placeholder = isset($info['placeholder']) ? $info['placeholder'] : null; $value = isset($info['value']) ? $info['value'] : null; $input .= Html::activeInput('text', $this->model, $this->attribute . '[infomation][' . $name . ']', ['placeholder' => $placeholder, 'class' => $this->options['columnClass'], 'readonly' => '', 'value' => $value, 'style' => 'margin-top: 20px;']); } $input .= Html::endTag('div'); } $input .= Html::endTag('div'); return $input; }
<div class="col-lg-12"> <hr> </div> <div class="col-lg-4"> <?php echo \Yii::t('app', 'SENSOR ADMIN MAIL'); ?> <br /><?php echo \Yii::t('app', 'Who will be uploading data?'); ?> </div> <div class="col-lg-8"> <?php echo Html::activeInput('text', $model, 'admin_email'); ?> </div> <div class="col-lg-12 text-center"> <?php echo Html::errorSummary($model); ?> <?php echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($model->isNewRecord ? \Yii::t('app', 'Create sensor') : \Yii::t('app', 'Save sensor')), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-danger']); ?> </div> <div class="col-lg-12"> <br /><br /><br /> </div> </div>
<div class="input-group-btn"> <button type="button" class="btn btn-default iwd-label dropdown-toggle" data-toggle="dropdown"> <?php echo StringHelper::getCurrencySymbol(Html::getAttributeValue($model, $currencyAttributeName)); ?> </button> <button type=button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> <span class="sr-only"><?php echo Yii::t('hipanel', 'Toggle dropdown'); ?> </span> </button> <ul class="dropdown-menu"> <?php foreach (ArrayHelper::remove($currencyAttributeOptions, 'items', []) as $k => $v) { ?> <li> <?php echo Html::a(StringHelper::getCurrencySymbol($k), '#', ['data-value' => $k, 'data-label' => StringHelper::getCurrencySymbol($k)]); ?> </li> <?php } ?> </ul> </div> <?php echo Html::activeInput('text', $model, $attribute, ['class' => 'form-control']); ?> </div>
?> </div> <div class="col-sm-12"> <hr> </div> <div class="col-sm-4"> <?php echo \Yii::t('app', 'YOUR EMAIL'); ?> <br /><?php echo \Yii::t('app', 'If the sensor admin has a question, he will contact you'); ?> </div> <div class="col-sm-8"> <?php echo Html::activeInput('text', $model, 'youremail'); ?> </div> <div class="col-sm-12 text-center"> <?php echo Html::errorSummary($model); ?> <?php echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> Upload Data', ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-danger']); ?> </div> <div class="col-sm-12"> <br /><br /><br /> </div>