| Current Path : /var/www/html/dosmv2/backend/modules/documentAutomation/views/documents/ |
| Current File : /var/www/html/dosmv2/backend/modules/documentAutomation/views/documents/create.php |
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\modules\documentAutomation\models\Tags;
$this->title = 'Create Documents';
$this->params['breadcrumbs'][] = ['label' => 'Documents', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $form = ActiveForm::begin(); ?>
<div class="wrapper wrapper-content animated fadeInRight" style="padding: 20px 10px 20px;">
<div class="ibox float-e-margins">
<div class="ibox-content">
<?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>
<?php
$input = $model->content;
preg_match_all('~#(.*?)#~', $input, $output);
$arr = $output[1];
$arr = array_unique($arr);
if (!empty($arr)) {
foreach ($arr as $tags_code) {
$modelTags = Tags::find()->where(['=', 'code', $tags_code])->one();
if (!empty($modelTags)) {
echo '<div class="form-group">
<input type="hidden" name="tagsID[]" value="' . $modelTags->id . '">
<input type="hidden" name="tags_code_' . $modelTags->id . '" value="' . $modelTags->code . '">
<input type="hidden" name="tags_label_' . $modelTags->id . '" value="' . $modelTags->label . '">
<label>' . $modelTags->label . '</label>
<input type="text" class="form-control" name="tags_answer_' . $modelTags->id . '">
</div>';
}
}
}
?>
<div class="form-group">
<?= Html::a(Yii::t('app', 'Cancel'), ['index'], ['class' => 'btn btn-primary']) ?>
<?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-primary']) ?>
</div>
</div>
</div>
</div>
<?php ActiveForm::end(); ?>