/**
  * @inheritdoc
  */
 public function run()
 {
     $id = Html::getInputId($this->model, 'image_deleted');
     $options = ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showUpload' => false], 'pluginEvents' => ['fileclear' => "function() { \$('#{$id}').val(1);}"]];
     if ($this->model->imageUrl !== null) {
         $options['pluginOptions']['initialPreview'] = [Html::img($this->model->imageUrl, ['class' => 'file-preview-image'])];
     }
     echo $this->form->field($this->model, 'image_deleted', ['template' => '{input}'])->hiddenInput();
     echo $this->form->field($this->model, 'image')->widget(FileInput::classname(), $options);
 }
Esempio n. 2
3
                for(var i = 0; i < arr.length; i++){
                    if(arr[i] === fileName){
                        arr.splice(i, 1);
                    }
                }

                $("#tour-smallimg").val("");
            }']]);
?>

    <?php 
echo $form->field($model, 'smallimg')->label("")->textInput(['maxlength' => true, 'class' => 'sr-only']);
?>

    <?php 
echo $form->field($model, 'limg', ['options' => ['name' => 'limg', 'class' => 'form-group']])->label('Largeimg')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true, 'name' => 'smallimg'], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['/file-upload/upload']), 'maxFileCount' => 10], 'pluginEvents' => ['fileuploaded' => 'function(event, data, previewId, index){
                var lag = $("#tour-largeimg").val().split(" "),
                    //fileName = data.files[index].name.replace(" (Copy)", "1").replace(" ", "_");
                    fileName = data.response.files.name;

                for(var i = 0; i < lag.length; i++){
                    if(lag[i] === ""){
                        lag.splice(i, 1);
                    }
                }

                lag.push(fileName);
                $("#tour-largeimg").val(lag.join(" "));
            }', 'filesuccessremove' => 'function(event, id){
                var name = $("#" + id + " img").attr("title"),
                    fileName = name.replace(" ", "_");
Esempio n. 3
0
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use kartik\dynagrid\DynaGrid;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel app\models\Fregat\DocfilesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Загруженные файлы';
$this->params['breadcrumbs'] = Proc::Breadcrumbs($this);
?>
<div class="docfiles-index">

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

    <?php 
echo $form->field($model, 'docFile')->widget(FileInput::classname(), ['pluginOptions' => ['uploadUrl' => Url::to(['Fregat/docfiles/create']), 'dropZoneEnabled' => false, 'previewZoomSettings' => ['image' => ['width' => 'auto', 'height' => '100%']]], 'pluginEvents' => ["fileuploaded" => 'function(event, data, previewId, index) { UploadedFiles("docfilesgrid", event, data); }']]);
?>

    <?php 
ActiveForm::end();
?>

    <?php 
$result = Proc::GetLastBreadcrumbsFromSession();
$foreign = isset($result['dopparams']['foreign']) ? $result['dopparams']['foreign'] : '';
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'docfilesgrid'], 'columns' => Proc::DGcols(['columns' => [['attribute' => 'docfiles_ext', 'format' => 'raw', 'value' => 'docfiles_iconshow', 'contentOptions' => ['style' => 'width: 40px; text-align: center;'], 'filter' => false], ['attribute' => 'docfiles_name', 'format' => 'raw', 'value' => 'docfiles_name_html'], ['attribute' => 'docfiles_hash', 'visible' => false]], 'buttons' => array_merge(empty($foreign) ? [] : ['chooseajax' => ['Fregat/docfiles/assign-to-select2']], Yii::$app->user->can('DocfilesEdit') ? ['deleteajax' => ['Fregat/docfiles/delete']] : [])]), 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<i class="glyphicon glyphicon-file"></i> ' . $this->title]]]));
?>
</div>
Esempio n. 4
0
                <li>Size image: 1024x100</li>
            </ul>
            <label>Update Advertise</label>
            <ul>
                <li>Type: image/flash/html</li>
                <li>Position: right</li>
                <li>Size: 400x350</li>
            </ul>
        </div>
        <div class='col-md-8 center-block '>
            <?php 
$title = isset($model->name) && !empty($model->name) ? $model->name : 'Advertise';
echo Html::img($model->getImageUrl(), ['class' => 'img-thumbnail center-block', 'alt' => $title, 'title' => $title]);
?>
            <?php 
echo $form->field($model, 'img')->widget(FileInput::classname(), ['name' => 'image-member', 'pluginOptions' => ['showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => yii::t('advertise', 'Select Photo')], 'options' => ['accept' => 'image/*']]);
?>
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'start_at')->widget(DateTimePicker::classname(), ['type' => DateTimePicker::TYPE_COMPONENT_PREPEND, 'options' => ['placeholder' => 'Enter event time ...'], 'value' => '23-Feb-1982 01:10', 'layout' => '{picker}{input}', 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'todayBtn' => true, 'format' => 'mm/dd/yyyy hh:ii:ss']]);
?>

            <?php 
echo $form->field($model, 'end_at')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Enter event time ...'], 'layout' => '{picker}{input}', 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'todayBtn' => true, 'format' => 'mm/dd/yyyy hh:ii:ss']]);
?>

            <?php 
echo $form->field($model, 'is_show')->widget(CheckboxX::classname(), ['autoLabel' => false, 'pluginOptions' => ['threeState' => false, 'size' => 'md']])->label("Is Show");
?>
Esempio n. 5
0
    <?php 
$language_items = [];
foreach ($languages as $key => $language) {
    $field = $form->field($model, "name_{$language->url}")->textInput(['maxlength' => true])->label('Name');
    if ($languageDefault->url == $language->url) {
        $field = $form->field($model, "name")->textInput(['maxlength' => true]);
    }
    $language_items[] = ['label' => Yii::t('backend', $language->name), 'content' => "<p>{$field}</p>", 'active' => $key == 0];
}
echo Tabs::widget(['items' => $language_items]);
?>


    <?php 
echo $form->field($model, 'file')->widget(FileInput::classname(), ['options' => ['multiple' => false, 'accept' => 'pdf/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showUpload' => false]])->label(Yii::t('backend', 'PDF File'));
?>

    <?php 
echo Html::a($model->file, $model->getUploadedFileUrl('file'), array('target' => '_blank'));
?>
    <br/><br/>

    <?php 
echo $form->field($model, 'order')->textInput();
?>

    <?php 
echo $form->field($model, 'id')->hiddenInput();
?>
Esempio n. 6
0
        </div>
    </div>
    <div class="row">
        <div class="col-md-4"><?php 
echo $form->field($model, 'drivers_passport')->textInput(['maxlength' => true]);
?>
</div> 
        <div class="col-md-4"> <?php 
echo $form->field($model, 'drivers_licence')->textInput(['maxlength' => true]);
?>
</div>
    </div>    
    <div class="row">
        <div class=" col-md-12">
            <?php 
echo $form->field($model, 'docs[]')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['initialPreview' => $model->initialPreview($model->docs, 'docs', 'file'), 'initialPreviewConfig' => $model->initialPreview($model->docs, 'docs', 'config'), 'allowedFileExtensions' => ['pdf', 'jpg'], 'showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => true, 'overwriteInitial' => false]])->label(false);
?>
        </div>
    </div>

    <?php 
if ($model->isNewRecord) {
    echo $form->field($model, 'appilcant_id')->hiddenInput(['maxlength' => true, 'value' => $id])->label(false);
} else {
    echo $form->field($model, 'appilcant_id')->hiddenInput(['maxlength' => true])->label(false);
}
?>
    <?php 
//$form->field($model, 'appilcant_id')->textInput(['maxlength' => true, 'value' => $id])->label(false)
?>
Esempio n. 7
0
echo $form->field($profile, 'full_name')->textInput(['placeholder' => Yii::t('app', 'Enter user full name...')]);
?>
            </div>
            <div class="col-sm-6">
                <?php 
echo $form->field($profile, 'company')->textInput(['placeholder' => Yii::t('app', 'Enter user company...')]);
?>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <?php 
if ($profile->avatar) {
    echo $form->field($profile, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t("app", "Select Picture"), 'initialPreview' => [Html::img($profile->getAvatarUrl(), ['class' => 'file-preview-image', 'alt' => $profile->full_name, 'title' => $profile->full_name])], 'overwriteInitial' => true, 'showRemove' => false, 'showUpload' => false]]);
} else {
    echo $form->field($profile, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t("app", "Select Photo"), 'showRemove' => false, 'showUpload' => false]]);
}
?>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <?php 
echo $form->field($profile, 'timezone')->dropDownList($timezones)->label(Yii::t("app", "Timezone"));
?>
            </div>
            <div class="col-sm-6">
                <?php 
echo $form->field($profile, 'language')->dropDownList($languages)->label(Yii::t("app", "Language"));
?>
            </div>
Esempio n. 8
0
/* @var $this yii\web\View */
/* @var $model common\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?//= $form->field($model, 'status')->textInput() ?>
    <div class="row">
        <div class="col-md-6">
            <?php 
echo $form->field($model, 'photo')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->photo ? [Html::img($model->photoUrl, ['class' => 'file-preview-image', 'alt' => $model->username, 'title' => $model->username])] : false, 'showUpload' => false, 'allowedFileExtensions' => ['jpg', 'gif', 'png', 'bmp']]]);
?>
            <?php 
echo $form->field($model, 'category_id')->dropDownList($model->categoryList());
?>
            <?php 
echo $form->field($model, 'tagIds')->checkboxList(ArrayHelper::map(\common\models\Tag::find()->all(), 'id', 'title'));
?>
        </div>
        <div class="col-md-6">
            <div class="row">
                <div class="col-md-6">
                    <?php 
echo $form->field($model, 'first_name')->textInput();
?>
                </div>
Esempio n. 9
0
 * @copyright Copyright (c) 2015 kangqingfei
 * @license MIT
 */
use yii\helpers\Html;
use kartik\form\ActiveForm;
use kartik\file\FileInput;
?>
<div class="container-fluid">
    <div class="row">
        <?php 
$form = ActiveForm::begin(['id' => 'form-register', 'options' => ['enctype' => 'multipart/form-data']]);
?>

        <div class="col-md-3 col-md-offset-1">
            <?php 
echo $form->field($model, 'avatar')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'showMessage' => true, 'pluginOptions' => ['previewFileType' => 'image', 'showCaption' => false, 'showUpload' => false, 'showRemove' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-picture"></i> ', 'browseLabel' => '更换头像', 'initialPreview' => [Html::img($model['avatar'] ? $model['avatar'] : Yii::$app->params['defaultAvatar'] . '?imageView2/1/w/200/h/200', ['class' => 'file-preview-image', 'alt' => '没找到默认头像', 'title' => '头像'])]]]);
?>
        </div>

        <div class="col-md-4 col-md-offset-1">
            <br/>
            <?php 
echo $form->field($model, 'username', ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-user"></i>']], 'showLabels' => false, 'enableAjaxValidation' => true])->textInput(['placeholder' => '请输入用户名']);
?>
            <br/>

            <?php 
echo $form->field($model, 'email', ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-envelope"></i>']], 'showLabels' => false, 'enableAjaxValidation' => true])->textInput(['placeholder' => '请输入邮箱']);
?>
            <br/>
Esempio n. 10
0
}
?>
	<?php 
echo $form->field($model, 'bn')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => $pluginOptions, 'pluginEvents' => ['fileclear' => 'function(){$("#bnChanged").val("true")}', 'fileloaded' => 'function(){$("#bnChanged").val("true")}']]);
?>

	<input type="hidden" name="titleChanged" value="false" id="titleChanged">
	<?php 
if ($model->isNewRecord) {
    $pluginOptions = ['showUpload' => false, 'initialPreviewShowDelete' => true, 'previewFileType' => 'image'];
} else {
    $pluginOptions = ['showUpload' => false, 'initialPreview' => [Html::img(Yii::getAlias('@web') . "/img/titulo/" . $model->picture, ['class' => 'file-preview-image', 'alt' => $model->picture])], 'initialPreviewShowDelete' => true, 'previewFileType' => 'image'];
}
?>
	<?php 
echo $form->field($model, 'title')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => $pluginOptions, 'pluginEvents' => ['fileclear' => 'function(){$("#titleChanged").val("true")}', 'fileloaded' => 'function(){$("#titleChanged").val("true")}']]);
?>

    <?php 
echo $form->field($model, 'color')->widget(ColorInput::classname(), ['options' => ['placeholder' => 'Selecciona un color...']]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(['ACTIVE' => 'ACTIVE', 'INACTIVE' => 'INACTIVE'], ['prompt' => '']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Esempio n. 11
0
use yii\bootstrap\ActiveForm;
use yii\bootstrap\Button;
use kartik\file\FileInput;
// @var $this yii\web\View
// @var $form yii\bootstrap\ActiveForm
// @var $model \common\models\UploadForm
$this->title = 'Firmwares';
$this->params['breadcrumbs'][] = $this->title;
$dataProvider = new ActiveDataProvider(['query' => Yii::$app->user->can('admin') ? Firmware::find() : Firmware::findByUser(Yii::$app->user->identity->username), 'pagination' => ['pageSize' => 20]]);
?>

<div class="box">
  <div class="box-body">
<?php 
$form = ActiveForm::begin(['id' => 'upload-form', 'action' => '/firmware/upload', 'options' => ['enctype' => 'multipart/form-data', 'class' => 'form-inline']]);
echo $form->field($model = new UploadForm(), 'file')->widget(FileInput::classname(), ['pluginOptions' => ['showPreview' => false, 'showCaption' => true, 'showRemove' => true, 'showUpload' => true, 'browseLabel' => 'Add firmware']]);
ActiveForm::end();
?>
  </div>
</div>

<div class="box">
  <div class="box-body">
<?php 
if (Yii::$app->user->can('listResources')) {
    echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'description'], ['attribute' => 'manufacturer_id', 'value' => function ($model, $index, $widget) {
        return $model->manufacturer ? $model->manufacturer->name : '';
    }], ['attribute' => 'model_number_id', 'value' => function ($model, $index, $widget) {
        return $model->modelNumber ? $model->modelNumber->value : '';
    }], ['attribute' => 'device_type_id', 'value' => function ($model, $index, $widget) {
        return $model->deviceType ? $model->deviceType->name : '';
Esempio n. 12
0
<?php

use kartik\file\FileInput;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model app\modules\images\models\ImgImage */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="img-image-form">


    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['multiple' => true], 'pluginOptions' => ['uploadUrl' => Url::to(['/images/images/upload']), 'uploadExtraData' => ['album_id' => 20, 'cat_id' => 'Nature'], 'maxFileCount' => 10]]);
?>



    <?php 
ActiveForm::end();
?>

</div>
/* @var $form yii\widgets\ActiveForm */
?>

<?php 
foreach (Yii::$app->session->getAllFlashes() as $key => $message) {
    echo '<div class="alert alert-' . $key . '">' . $message . '</div>';
}
?>

<div class="anexos-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

        <?php 
echo $form->field($model, 'file')->widget(FileInput::classname(), ['options' => ['accept' => '.pdf'], 'language' => 'pt', 'pluginOptions' => ['showRemove' => false, 'showUpload' => false, 'initialCaption' => $model->anexo]]);
?>

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

    <?php 
ActiveForm::end();
?>

</div>
Esempio n. 14
0
?>

    <?php 
echo $form->field($model, 'data_nasc')->input("date");
?>

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

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

    <?php 
echo $form->field($model, 'foto')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'jpeg', 'png', 'tif', 'tiff'], 'showUpload' => false]]);
?>

    <?php 
echo $form->field($model, 'email')->input("email");
?>
    
    <?php 
echo $form->field($model, 'password')->passwordInput();
?>

    <?php 
echo $form->field($model, 'password_repeat')->passwordInput();
?>

    <?php 
Esempio n. 15
0
        <h2><i class="fa fa-pencil"></i> General</h2>
    </div>
    <!-- END General Data Title -->
    <!-- General Data Content -->
    <?php 
$form = ActiveForm::begin(['id' => 'client-form', 'layout' => 'horizontal', 'options' => ['class' => 'form-horizontal form-bordered', 'enctype' => 'multipart/form-data'], 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-md-3 control-label']]]);
?>
		<?php 
echo $form->field($client, 'active')->checkbox(['template' => "{label}<div class='col-md-9'><label class='switch switch-primary'>{input}<span></span></label></div>\n"])->label('Active?', ['class' => 'col-md-3 control-label']);
?>

		<?php 
if (!empty($client->avatar)) {
    echo $form->field($client, 'avatar', ['template' => "{label}<div class='col-md-9'>{input}</div>\n{hint}\n{error}"])->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => [Html::img("/web/upload/avatar/{$client->avatar}", ['class' => 'file-preview-image'])], 'previewFileType' => 'image', 'showUpload' => false, 'allowedFileExtensions' => ['jpg', 'gif', 'png'], 'overwriteInitial' => true]]);
} else {
    echo $form->field($client, 'avatar', ['template' => "{label}<div class='col-md-9'>{input}</div>\n{hint}\n{error}"])->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => [Html::img("/web/upload/avatar/noavatar.jpg", ['class' => 'file-preview-image'])], 'previewFileType' => 'image', 'showUpload' => false, 'allowedFileExtensions' => ['jpg', 'gif', 'png'], 'overwriteInitial' => true]]);
}
?>
	

		<?php 
echo $form->field($client, 'company', ['template' => "{label}<div class='col-md-9'>{input}</div>\n{hint}\n{error}"])->textInput(array('placeholder' => 'Company Name', 'class' => 'form-control'));
?>
	

        <?php 
echo $form->field($client, 'firstname', ['template' => "{label}<div class='col-md-9'>{input}</div>\n{hint}\n{error}"])->textInput(array('placeholder' => 'First Name', 'class' => 'form-control'));
?>
	

        <?php 
Esempio n. 16
0
<div class="books-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

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

    <!--    --><?php 
//= $form->field($model, 'imageFile')->fileInput()
?>

    <?php 
echo $form->field($model, 'imageFile')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showPreview' => true, 'showCaption' => true, 'showRemove' => false, 'showUpload' => false, 'overwriteInitial' => true, 'initialCaption' => $model->preview_image ? $model->preview_image : "", 'initialPreview' => [$model->preview_image ? Html::img($model->preview_image, ['class' => 'file-preview-image', 'alt' => $model->name, 'title' => $model->name]) : null]]]);
?>



    <?php 
echo $form->field($model, 'author_id')->dropDownList($authors);
?>

    <?php 
echo $form->field($model, '_date')->widget(DatePicker::classname(), ['language' => 'ru', 'dateFormat' => 'dd.MM.yyyy', 'options' => ['class' => 'form-control']]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
Esempio n. 17
0
<div class="modal-body">
    <div class="row">
        <div class="col-xs-12">

            <?php 
echo $form->field($model, 'nombre', $inputOpciones)->textInput(['class' => $inputClase, 'autocomplete' => 'off']);
?>
            <span class="glyphicon glyphicon-ok form-control-feedback"></span>
            <?php 
//$form->field($model, 'icono', $inputOpciones)->fileInput(['class' => $inputClase])
?>

            <?php 
// your fileinput widget for single file upload
echo $form->field($model, 'imagenes')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png'], 'showCaption' => true, 'showRemove' => false, 'showUpload' => false, 'showPreview' => false, 'browseClass' => 'btn ink-reaction btn-primary btn-block', 'browseIcon' => '<i class="md md-photo-camera"></i> ', 'browseLabel' => 'Seleccionar icono']])->label(false);
?>

            <?php 
echo $form->field($model, 'estado')->radioList($model->listadoEstados(), $inputRadioListOpciones)->label($model->getAttributeLabel('tipo'), ['style' => 'margin-bottom: 10px;']);
?>

            <span class="opacity-50"><?php 
echo $model->getAttributeLabel('descripcion');
?>
</span>
            <?php 
echo $form->field($model, 'descripcion')->textarea(['class' => $inputClase . ' editorTexto control-3-rows', 'style' => 'margin-top:10px', 'placeholder' => 'Me describo como...'])->label(false);
?>
        </div>
    </div>
Esempio n. 18
0
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

    <?php 
echo $form->field($model, 'type')->dropDownList(['hot' => 'Hot', 'usual' => 'Usual'], ['prompt' => '']);
?>

    <?php 
echo $form->field($model, 'price')->textInput();
?>

    <?php 
echo $form->field($model, 'quantity')->textInput();
?>

    <?php 
echo $form->field($model, 'photo')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*']]);
?>

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

    <?php 
ActiveForm::end();
?>

</div>
Esempio n. 19
0
    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'amount_text')->widget(TouchSpin::classname(), ['pluginOptions' => ['min' => 0.25, 'max' => 9.0, 'step' => 0.25, 'decimals' => 2, 'boostat' => 1, 'maxboostedstep' => 1]])->label(Yii::t('backend', 'Amount') . '&#160;<span style="color: red;">*</span>');
?>

    <?php 
$unit_data = backend\models\Unit::find()->select(['unit_id', 'unit_text'])->orderBy('unit_text')->all();
$unit_list = \yii\helpers\ArrayHelper::map($unit_data, 'unit_id', 'unit_text');
echo $form->field($model, 'unit_id')->dropDownList($unit_list, ['prompt' => Yii::t('backend', 'Select...')])->label(Yii::t('backend', 'Use Unit') . '&#160;<span style="color: red;">*</span>');
?>

    <?php 
echo $form->field($model, 'amount_img_temp')->widget(FileInput::classname(), ['options' => ['accept' => 'image/jpeg, image/gif, image/png, image/svg+xml'], 'pluginOptions' => ['showCaption' => true, 'showRemove' => true, 'showUpload' => false, 'browseLabel' => '', 'removeLabel' => '', 'removeClass' => 'btn btn-danger', 'initialPreview' => !empty($model->amount_img) ? [Html::img($model->amount_img, ['class' => 'file-preview-image'])] : [], 'initialCaption' => !empty($model->amount_img) ? ' /' . $model->amount_img : ' ']])->label(Yii::t('backend', 'Image') . '&#160;<span style="color: red;">*</span>');
?>

    <?php 
echo $form->field($model, 'note')->textarea(['rows' => 6]);
?>

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

    <?php 
ActiveForm::end();
?>
Esempio n. 20
0
<?php

use yii\widgets\ActiveForm;
use yii\helpers\Url;
use kartik\file\FileInput;
?>

<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'], 'action' => Url::to(['upload', 'id' => $model->id])]);
?>

    <?php 
echo $form->field($model, 'files[]')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['maxFileCount' => 5, 'browseClass' => 'btn btn-success', 'uploadClass' => 'btn btn-info', 'removeClass' => 'btn btn-danger', 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i> ']])->label(false);
?>

<?php 
ActiveForm::end();
Esempio n. 21
0
    </div>


</div>

<?php 
$initialPreview = [];
$initialPreviewConfig = [];
if (!empty($model->PhotosUrl)) {
    $resImg = [];
    foreach ($model->PhotosUrl as $key => $photoUrl) {
        $initialPreview[] = Html::img($photoUrl, ['class' => 'file-preview-image']);
        $initialPreviewConfig[] = ['url' => Url::toRoute(['/profile/system/del-image', 'id' => $model->id, 'photoKey' => $key]), 'key' => $key, 'extra' => '{id: ' . $key . '}'];
    }
}
echo $form->field($model, 'imageFiles[]')->widget(FileInput::classname(), ['options' => ['multiple' => true], 'pluginOptions' => ['showUpload' => false, 'overwriteInitial' => false, 'previewFileType' => 'image', 'uploadUrl' => Url::to(['/site/file-upload']), 'initialPreview' => $initialPreview, 'initialPreviewConfig' => $initialPreviewConfig]]);
?>

<div class="row tech-char">
    <div class="ab_reg">
        Настройка доступа
    </div>
</div>

<div class="row tech-char">
    <?php 
echo $form->field($model, 'is_display')->radioList(['1' => 'Отображать', '0' => 'Не отображать']);
?>
</div>

<div class="row tech-char">
Esempio n. 22
0
<div class="country-form">

    <?php 
$form = ActiveForm::begin(['options' => ['autocomplete' => 'off', 'enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 255]);
?>
    
    <?php 
$pluginOptions = ['showUpload' => false, 'showRemove' => false, 'overwriteInitial' => true, 'browseLabel' => "Обзор...", 'allowedFileExtensions' => ['jpg', 'gif', 'png']];
if (isset($flag) && $flag->getFileUrl()) {
    $pluginOptions['initialPreview'] = [Html::img($flag->getFileUrl())];
}
echo $form->field($model, 'flag')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => false], 'pluginOptions' => $pluginOptions]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Изменить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
Esempio n. 23
0
<?php

use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
<div class="containerqq" style="background-color: #FFFFFF;border-radius: 10px">
<div style=" clear:both;display:block;">
<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']], ['data-pjax' => '']);
?>

    <?php 
echo $form->field($model, 'imageFiles')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*']]);
?>

<?php 
ActiveForm::end();
?>
</div>
<?php 
foreach ($pic as $pc) {
    ?>

    <div class=" col-xs-6 col-sm-3" style="position: relative;width: 19%">   <?php 
    $a = Html::img('@web/' . $pc->pic_name, ['alt' => ')))))))', 'data-lightbox' => "roadtrip", 'id' => $pc->id, 'style' => ['cursor' => 'pointer', 'width' => '206px', 'height' => '206px'], 'class' => '']);
    ?>
               <?php 
    echo Html::a($a, ['@web/' . $pc->pic_name], ['data-lightbox' => "roadtrip", 'data-toggle' => "confirmation"]);
    ?>
 <div class="nkr  "> <div aria-expanded="false" data-toggle="tooltip" title="Edit options" class=" dropdown ">
                <a href="#" data-toggle="dropdown" class="dropdown-toggle edopt"> </a>
Esempio n. 24
0
?>

    <?php 
echo $form->field($model, 'data_nasc')->input("date");
?>

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

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

    <?php 
echo $form->field($model, 'foto')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'jpeg', 'png', 'tif', 'tiff'], 'showUpload' => false, 'showRemove' => false, 'initialPreview' => [Html::img($model->getImageUrl(), ['class' => 'file-preview-image', 'alt' => 'Imagem atual', 'title' => 'Imagem Atual'])]]]);
?>

    <?php 
echo $form->field($model, 'email')->input("email");
?>
    
    <?php 
echo $form->field($model, 'password')->passwordInput(['value' => ""]);
?>

    <?php 
echo $form->field($model, 'password_repeat')->passwordInput(['value' => ""]);
?>

    <?php 
Esempio n. 25
0
echo $form->field($model, 'reminder_hours')->dropDownList($model->getEarlyReminderOptions(), ['prompt' => Yii::t('frontend', 'When would you like your early reminder?')])->label(Yii::t('frontend', 'Early reminders'));
?>

                  <?php 
echo $form->field($model, 'contact_share')->checkbox(['label' => Yii::t('frontend', 'Share my contact information with meeting participants'), 'uncheck' => $model::SETTING_NO, 'checked' => $model::SETTING_YES]);
?>
 

                  <?php 
echo $form->field($model, 'no_email')->checkbox(['label' => Yii::t('frontend', 'Turn off all email'), 'uncheck' => $model::SETTING_NO, 'checked' => $model::SETTING_YES]);
?>
                </div>
           <div class="tab-pane vertical-pad" id="photo">

             <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]);
?>
           </div> <!-- end of upload photo tab -->
           <div class="form-group">
               <?php 
echo Html::submitButton(Yii::t('frontend', 'Save Settings'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
           </div>
         </div> <!-- end tab content -->
         </div> <!--end left col -->
         <div class="col-md-4">
           <?php 
if ($model->avatar != '') {
    echo '<img src="' . Yii::getAlias('@web') . '/uploads/avatar/sqr_' . $model->avatar . '" class="profile-image"/>';
} else {
    echo \cebe\gravatar\Gravatar::widget(['email' => common\models\User::find()->where(['id' => Yii::$app->user->getId()])->one()->email, 'options' => ['class' => 'profile-image', 'alt' => common\models\User::find()->where(['id' => Yii::$app->user->getId()])->one()->username], 'size' => 128]);
 public function run()
 {
     if ($this->label === null) {
         $this->label = Yii::t('mediafile', 'Files');
     }
     if ($this->newFileLabel === null) {
         $this->newFileLabel = Yii::t('mediafile', 'New file');
     }
     $html = '';
     $html .= '<div class="form-group file-preview-wrapper ">';
     $html .= '<label class="control-label col col-sm-3">' . $this->label . '</label>';
     $html .= '<div class="col col-sm-6">';
     foreach ($this->model->mediafiles as $mediafile) {
         // Steal classes from kartik's plugin.
         if (preg_match('/^image\\//', $mediafile->mediafiletype->mimetype)) {
             $html .= '<div class="file-preview-frame">';
         } else {
             $html .= '<div class="file-preview-frame" style="width: 160px; height: auto; ">';
         }
         if (preg_match('/^image\\//', $mediafile->mediafiletype->mimetype)) {
             $html .= '<img src="' . Url::to(['mediafile/view', 'id' => $mediafile->primaryKey]) . '" style="width: auto; height: 160px;" />';
         } else {
             //$html .= '<div class="file-preview-other"><i class="glyphicon glyphicon-file"></i></div>';
             $name = $mediafile->title;
             if (!$name) {
                 $name = Yii::t('mediafile', 'File') . ' ' . $mediafile->primaryKey;
             }
             $name = preg_replace('/\\.[^\\.]+$/', '', $name);
             $html .= '<div class="file-caption-name">';
             $html .= $name;
             $html .= '</div>';
             $html .= '<div class="file-caption-name">';
             $html .= $mediafile->mediafiletype->extension . Yii::t('mediafile', '-file');
             $html .= '</div>';
         }
         $html .= '<br />';
         $html .= '<br />';
         $html .= '<a href="' . Url::to([$this->unassignAction, 'id' => $this->model->primaryKey, 'mediafile' => $mediafile->primaryKey]) . '" class="btn btn-warning center-block">' . Yii::t('mediafile', 'Unassign') . '</a>';
         $html .= '<br />';
         $html .= '</div>';
         // preview pane
     }
     $html .= '</div>';
     // col
     $html .= '</div>';
     // form-group
     $html .= '<div class="file-upload-wrapper">';
     // HACK: if you do not manually append [] to the name of the
     // attribute, only one file will be uploaded.
     $html .= $this->form->field($this->model, 'newFiles[]')->widget(FileInput::classname(), ['options' => ['accept' => ['image/*', 'video/*'], 'multiple' => true], 'pluginOptions' => ['showUpload' => false, 'maxFileCount' => $this->maxFileCount, 'autoReplace' => true]])->label($this->newFileLabel);
     $html .= '</div>';
     return $html;
 }
Esempio n. 27
0
<?php

$form = \yii\bootstrap\ActiveForm::begin();
?>

    <div class="row">
        <?php 
echo $form->field($model, 'general_image')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['file-upload-general']), 'uploadExtraData' => ['advert_id' => $model->idadvert], 'allowedFileExtensions' => ['jpg', 'png', 'gif'], 'initialPreview' => $image, 'showUpload' => true, 'showRemove' => false, 'dropZoneEnabled' => false]]);
?>

    </div>

    <div class="row">
        <?php 
echo \yii\helpers\Html::label('Images');
echo \kartik\file\FileInput::widget(['name' => 'images', 'options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['uploadUrl' => \yii\helpers\Url::to(['file-upload-images']), 'uploadExtraData' => ['advert_id' => $model->idadvert], 'overwriteInitial' => false, 'allowedFileExtensions' => ['jpg', 'png', 'gif'], 'initialPreview' => $images_add, 'showUpload' => true, 'showRemove' => false, 'dropZoneEnabled' => false]]);
?>

    </div>

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

<?php 
\yii\bootstrap\ActiveForm::end();
Esempio n. 28
0
/* @var $model app\models\Books */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="books-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

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

    <?php 
echo $form->field($model, 'preview')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => false]]);
?>

    <?php 
echo $form->field($model, 'date')->widget(DatePicker::classname(), ['value' => date('Y-m-d', strtotime('today')), 'options' => ['placeholder' => Yii::t('books', 'select Date')], 'pluginOptions' => ['hideInput' => true, 'format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map(Authors::find()->all(), 'id', 'fullName'), ['prompt' => Yii::t('books', 'select Author')]);
?>

    <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>
Esempio n. 29
0
?>
        
        <?php 
echo $form->field($model, 'mode')->dropDownList(Ad::getAdMode());
?>

	    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
	    
	    <?php 
echo $form->field($model, 'short_code')->textInput(['maxlength' => true]);
?>
	    
	    <?php 
echo $form->field($model, 'pic_url')->hint('<i class="fa fa-info-circle"></i> ' . Yii::t('fileinput', 'Note: Limit upload one picture.'))->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => false], 'pluginOptions' => ['uploadUrl' => Url::to(['/cms/ad/file-upload']), 'uploadAsync' => true, 'initialPreview' => General::showImages($model->pic_url), 'initialPreviewConfig' => General::showLinks($model->pic_url, 'pic_url', 'ad', '/cms/ad/file-upload'), 'previewFileType' => 'any', 'overwriteInitial' => true, 'maxFileSize' => Yii::$app->params['config']['config_pic_size'], 'allowedFileExtensions' => explode(',', Yii::$app->params['config']['config_pic_extension']), 'allowedFileTypes' => ['image'], 'maxFileCount' => 1, 'uploadExtraData' => ['dir' => 'ad', 'name' => 'Ad[pic_url]', 'route' => '/cms/ad/file-upload', 'field' => 'pic_url']]]);
?>
	    
	    <?php 
/*
	    FileInput::widget([
	    	'name' => 'pic_url',
	    	'options'=>[
	    		'accept' => 'image/*',//只接收图片类型
	    		'multiple'=>false,//这里不需要多选
	    	],
	    	'pluginOptions' => [
	    		'uploadUrl' => Url::to(['/cms/ad/file-upload']),
// 	    		'uploadAsync' => true,//异步上传
	    		'initialPreview'=>[
	    			//Html::img("/images/moon.jpg", ['class'=>'file-preview-image', 'alt'=>'The Moon', 'title'=>'The Moon']),
Esempio n. 30
0
            <?php 
echo $form->field($model, 'detail_image')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->getFileUrl('detail_image') ? [Html::img($model->getFileUrl('detail_image'), ['class' => 'file-preview-image'])] : [], 'initialPreviewConfig' => [['caption' => $model->getFileUrl('detail_image'), 'url' => \yii\helpers\Url::to(['delete-file', 'pk' => $model->id, 'attribute' => 'detail_image'])]], 'showUpload' => false, 'showRemove' => false]]);
?>

            <?php 
//= $form->field($model, 'path')->textInput(['maxlength' => 2000])
?>
        </div>
        <div id="advanced-options" class="tab-pane">
            <?php 
echo $form->field($model, 'preview_text')->textarea(['rows' => 10]);
?>

            <?php 
echo $form->field($model, 'preview_image')->widget(\kartik\file\FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->getFileUrl('preview_image') ? [Html::img($model->getFileUrl('preview_image'), ['class' => 'file-preview-image'])] : [], 'initialPreviewConfig' => [['caption' => $model->getFileUrl('preview_image'), 'url' => \yii\helpers\Url::to(['delete-file', 'pk' => $model->id, 'attribute' => 'preview_image'])]], 'showUpload' => false, 'showRemove' => false]]);
?>
        </div>
        <div id="meta-options" class="tab-pane">
            <?php 
echo $form->field($model, 'metakey')->textInput(['maxlength' => 255]);
?>

            <?php 
echo $form->field($model, 'metadesc')->textarea(['maxlength' => 2048]);
?>
        </div>
    </div>

    <?php 
echo Html::activeHiddenInput($model, 'lock');