Пример #1
2
 public function run()
 {
     echo $this->form->field($this->model, $this->attr)->widget(FileInput::classname(), ['options' => ['accept' => ''], 'pluginOptions' => ['showPreview' => false, 'showCaption' => true, 'showRemove' => true, 'showUpload' => false]]);
     if ($this->model->getAttribute($this->attr) !== null) {
         echo '<div class="file-upload-update"><label class="col-sm-2"> </label>' . Html::a($this->model->getAttribute($this->attr), ['/uploads/' . $this->model->getAttribute($this->attr)]) . '</div>';
     }
 }
Пример #2
0
 public function run()
 {
     if (isset($this->modelId) && isset($this->model) && !$this->model->isNewRecord) {
         /** @var  $fileModel File*/
         $fileModel = \Yii::createObject(File::className());
         $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
         $files = $fileModel->find()->where(['model' => get_class($this->model), 'model_id' => $this->modelId])->all();
         $initialPreview = $initialPreviewConfig = [];
         foreach ($files as $file) {
             $initialPreview[] = "<img src='" . \Yii::$app->params['imageDomain'] . '/' . $file->url . "' class='file-preview-image'>";
             $initialPreviewConfig[] = ['caption' => $file->name, 'url' => Url::to(['/system/widgets/file-upload/delete', 'id' => $file->file_id])];
         }
         echo $form->field($fileModel, 'files[]')->widget(FileInput::classname(), ['options' => ['multiple' => true], 'pluginOptions' => ['initialPreview' => $initialPreview, 'initialPreviewConfig' => $initialPreviewConfig, 'overwriteInitial' => false, 'uploadUrl' => Url::to(['/system/widgets/file-upload/upload']), 'uploadExtraData' => ['model' => get_class($this->model), 'modelId' => $this->modelId], 'maxFileCount' => 10, 'allowedFileExtensions' => ['jpg', 'gif', 'png']]]);
         $form::end();
     }
 }
Пример #3
0
echo Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save']);
?>
    </div>
<?php 
$this->endBlock('submit');
?>

    <section id="widget-grid">
        <div class="row">

            <article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
                <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Watermark'), 'icon' => 'list-ul', 'footer' => $this->blocks['submit']]);
$options = [];
if ($model->isNewRecord === false) {
    $this->registerCss('span.file-input > div.file-preview {display:block;}');
    $this->registerCss('.file-preview img {max-width:100%;}');
    $options = ['initialPreview' => [Html::img($model->file)]];
}
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => $options]);
echo $form->field($model, 'position')->dropDownList(Watermark::getPositions());
BackendWidget::end();
?>
            </article>


        </div>
    </section>

<?php 
ActiveForm::end();
Пример #4
0
?>
                    <?php 
echo $form->field($jobModel, 'agent_job_industry')->listBox(\app\modules\job\models\Job::getCategoryOptions(), ['multiple' => true])->hint(Yii::t('job', 'Please Use CTR to select multiple options. (Select up to 3)'));
?>
                    <?php 
echo $form->field($jobModel, 'agent_job_function')->listBox(\app\modules\job\models\JobFunction::getOptions(), ['multiple' => true])->hint(Yii::t('job', 'Please Use CTR to select multiple options. (Select up to 3)'));
?>
                    <?php 
echo $form->field($jobModel, 'agent_summary')->textarea();
?>
                    <?php 
$imageConfig = ['options' => ['accept' => 'uploads/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showCaption' => FALSE, 'showRemove' => TRUE, 'showUpload' => FALSE, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Photo', 'removeClass' => 'btn btn-danger', 'removeLabel' => "Delete", 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i>', 'allowedFileExtensions' => ['jpg', 'gif', 'png', 'jpeg']]];
if (!empty($model->image)) {
    $imageConfig['pluginOptions']['initialPreview'] = [Html::img(\app\helpers\LetHelper::getFileUploaded($model->image), ['class' => 'file-preview-image'])];
}
echo $form->field($model, 'image')->widget(FileInput::classname(), $imageConfig);
?>

                    <div class="checkbox policy_check">
                        <?php 
echo $form->field($jobModel, 'accept')->checkbox(['label' => 'I have read, understand, and I accept the <a href="#" target="_blank">terms of use</a> and <a href="#" target="_blank">privacy policy</a>.']);
?>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-9 col-sm-offset-3">
                            <?php 
echo Html::submitButton(Yii::t('account', 'Sign up'), ['class' => 'button button-primary']);
?>
                        </div>
                    </div>
Пример #5
0
?>
            <?php 
echo $form->field($model, 'published')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal'], 'inlineLabel' => false]);
echo $form->field($model, 'startdate')->widget(DatePicker::classname(), ['options' => ['placeholder' => 'เริ่มวันที่', 'style' => 'width: 160px;'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
echo $form->field($model, 'finishdate')->widget(DatePicker::classname(), ['options' => ['placeholder' => 'สิ้นสุดวันที่', 'style' => 'width: 160px;'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
    
        </div>
    </div>
    <?php 
if (Yii::$app->user->can('Administrator')) {
    ?>
        <div class="row">
            <div class="col-md-12">
                <?php 
    echo $form->field($model, 'upload_files[]')->widget(FileInput::classname(), ['options' => ['multiple' => true], 'pluginOptions' => ['showPreview' => true, 'showUpload' => false, 'showCaption' => false, 'uploadClass' => 'btn btn-info', 'removeClass' => 'btn btn-danger', 'elCaptionText' => '#customCaption']]);
    ?>
                <div class="file-input">
                    <div class="file-preview-thumbnails">            
                        <?php 
    $mPath = \Yii::getAlias('@webroot') . '/images/article/news_' . $model->id;
    $mUrl = \Yii::getAlias('@web') . '/images/article/news_' . $model->id;
    if (!is_dir($mPath)) {
        \yii\helpers\BaseFileHelper::createDirectory($mPath);
    }
    foreach (scandir($mPath) as $img) {
        if ($img != '.' && $img != '..' && $img != 'thumb') {
            $mThumb = $mUrl . '/thumb/' . $img;
            //ตรวจสอบภาพตัวอย่าง ว่าถูกสร้างขึ้นมาหรือยัง
            if (!file_exists($mThumb)) {
                //ตรวจสอบโฟลเดอร์ภาพตัวอย่าง
Пример #6
0
<div class="sales-road-image-form">

     <?php 
$form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true]);
?>



  <?php 
echo $form->field($model, 'ID_ROAD')->widget(Select2::classname(), ['data' => $data_road, 'options' => ['placeholder' => 'Select a Road ...'], 'pluginOptions' => ['allowClear' => true]])->label('Road');
?>


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

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

    <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>

    <?php 
ActiveForm::end();
?>
Пример #7
0
<?php

use dpodium\filemanager\FilemanagerAsset;
use kartik\widgets\ActiveForm;
use kartik\widgets\FileInput;
use yii\helpers\Url;
if ($uploadType == \dpodium\filemanager\components\Filemanager::TYPE_MODAL) {
    FilemanagerAsset::register($this);
}
$form = ActiveForm::begin(['action' => \Yii::$app->urlManager->createUrl(['/filemanager/files/upload']), 'id' => 'fm-upload-form', 'options' => ['enctype' => 'multipart/form-data']]);
if (!empty($folderArray)) {
    echo $form->field($model, 'folder_id')->dropDownList($folderArray);
}
$script = <<<SCRIPT
    function (event, params) {
        params.form.append('uploadType', {$uploadType});
        if(jQuery('select[name="Files[folder_id]"]').val() != undefined) {
            params.form.append('uploadTo', jQuery('select[name="Files[folder_id]"]').val());        
        } else {
            params.form.append('uploadTo', '{$model->folder_id}'); 
        }
    }
SCRIPT;
echo $form->field($model, 'upload_file[]')->widget(FileInput::classname(), ['options' => ['multiple' => $multiple, 'accept' => implode(',', \Yii::$app->controller->module->acceptedFilesType)], 'pluginOptions' => ['uploadUrl' => Url::to(['/filemanager/files/upload']), 'browseClass' => 'btn btn-sm btn-success', 'uploadClass' => 'btn btn-sm btn-info', 'removeClass' => 'btn btn-sm btn-danger', 'maxFileCount' => $maxFileCount], 'pluginEvents' => ['filepreupload' => $script]]);
ActiveForm::end();
Пример #8
0
    $initialPreview[] = $_preview . Html::hiddenInput($model->formName() . '[' . $property_key . '][]', $file);
    $initialPreviewConfig[] = ['caption' => $file, 'url' => $urlDelete, 'key' => $property_key, 'extra' => ['value' => $file]];
}
$modelArrayMode = $model->setArrayMode(false);
// @TODO: maybe it's a good to replace fileuploaded with fileloaded (and this part of code for it)
//    $_js = <<< 'JSCODE'
//    function(event, file, previewId, index, reader) {
//        var name = file.name;
//        var hi = $('<input type="hidden" name="%s" />').val(name);
//        $('div.file-preview-frame[title="'+name+'"]').append(hi);
//    }
//JSCODE;
?>
<div class="file_input_preview">
<?php 
echo $form->field($model, $prop)->widget(\kartik\widgets\FileInput::classname(), ['options' => ['multiple' => $multiple], 'pluginOptions' => ['uploadUrl' => $urlUpload, 'multiple' => $multiple, 'initialPreview' => $initialPreview, 'initialPreviewConfig' => $initialPreviewConfig, 'initialPreviewShowDelete' => true, 'maxFileCount' => $multiple ? 0 : 1, 'showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => true, 'overwriteInitial' => false, 'uploadAsync' => true, 'layoutTemplates' => $layoutTemplates, 'allowedPreviewTypes' => ['image']], 'pluginEvents' => ['fileuploaded' => 'function(event, data, previewId, index) {
                    var name = data.files[index]["name"];
                    try {
                        jQuery(".file-thumbnail-footer input[value=\\"" + name + "\\"]")
                            .last()
                            .attr("name", event.target.name)
                            .val(data.response[name]["fileName"]);
                    } catch ($e) {}
                }']]);
?>
</div>
<?php 
$model->setArrayMode($modelArrayMode);
?>

<style>
Пример #9
0
      <h4 class="panel-title">
        <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="false" aria-controls="collapseSix">
          Documenten
        </a>
      </h4>
    </div>
    <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix">
      <div class="panel-body">
          
       <div class="panel panel-warning">
  <div class="panel-heading">
    <h3 class="panel-title">Upload documenten</h3>
  </div>
  <div class="panel-body">
          <?php 
echo $form->field($user, 'documentfile')->widget(FileInput::classname(), ['pluginOptions' => ['showPreview' => false, 'showCaption' => true, 'showRemove' => true, 'showUpload' => true, 'allowedFileExtensions' => ['pdf']]]);
?>
 
   </div>
</div>

      
</div>
</div>
</div>
<!--END   tariefReizen ------------------------------------------>


</div>

Пример #10
0
use yii\helpers\Html;
use kartik\form\ActiveForm;
use kartik\widgets\FileInput;
?>

<div class="profile-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => $model->formName(), 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]);
?>

    <div class="row">
      <div class="col-sm-6">

        <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['pluginOptions' => ['browseIcon' => '<i class="glyphicon glyphicon-folder-open"></i>', 'overwriteInitial' => true, 'showCaption' => false, 'showClose' => false, 'browseLabel' => '', 'removeLabel' => '', 'removeIcon' => '<i class="glyphicon glyphicon-remove"></i>', 'removeTitle' => 'Cancel or reset changes', 'showUpload' => false, 'defaultPreviewContent' => '<img src="https://www.mautic.org/media/images/default_avatar.png" alt="Your Avatar" style="width:160px">']])->label(false);
?>

      </div>
     <div class="col-sm-6">
		<?php 
echo $form->field($model, 'NM_FIRST')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'NM_MIDDLE')->textInput(['maxlength' => true]);
?>
      <?php 
echo $form->field($model, 'NM_END')->textInput(['maxlength' => true]);
?>
    </div>
    </div>
Пример #11
0
echo $form->field($model, 'ciudad')->textInput(['maxlength' => true]);
?>

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

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

    <?php 
echo $form->field($model, 'cp')->textInput();
?>
    
    <?php 
echo $form->field($model, 'imagenes[]')->widget(FileInput::classname(), ['options' => ['multiple' => true, 'accept' => 'image/*'], 'pluginOptions' => ['showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-info btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Examinar...', 'previewFileType' => 'image']]);
?>

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

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

</div>
Пример #12
0
?>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-md-6">
				<div class="">
					<div class="panel panel-danger dummy-data">
						<div class="panel-heading bg-red">
							<h3 class="panel-title">ภาพประกอบโครงการ</h3>
						</div>
						<div class="panel-body search-result-contents">
							<div class="row">
								<?php 
echo $form->field($imageUploadForm, 'file')->widget(FileInput::classname(), ['disabled' => $model->PROJECT_ID == null ? true : false, 'options' => ['class' => 'document-upload-input', 'multiple' => true, 'disabled' => $mode == 'view' ? true : false], 'pluginOptions' => ['uploadUrl' => Url::to(["image-upload"]), 'uploadAsync' => true, 'minFileCount' => 1, 'maxFileCount' => 5, 'overwriteInitial' => false, 'initialPreview' => isset($imageUploadFormConfigs['initialPreview']) ? $imageUploadFormConfigs['initialPreview'] : [], 'initialPreviewConfig' => isset($imageUploadFormConfigs['initialPreviewConfig']) ? $imageUploadFormConfigs['initialPreviewConfig'] : [], 'uploadExtraData' => ['project_id' => $model->PROJECT_ID], 'allowedFileExtensions' => ['jpg', 'gif', 'png']], 'pluginEvents' => ['filepredelete' => "function(event, key) {\n\t\t\t\t\t\t\t\t\t\t\t                return (!confirm('Are you sure you want to delete ?'));\n\t\t\t\t\t\t\t\t\t\t\t            }"]])->label(false);
?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<?php 
if ($mode != 'view') {
    ?>
	    <div class="form-group" style="text-align:center;">
	        <?php 
    echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
Пример #13
0
</div>

<div class="page-header">
<h4>ความสามารถ </h4>
</div>

    <?php 
echo $form->field($model, 'social')->inline()->checkboxList(Employee::itemAlias('social'));
?>

  <?php 
echo $form->field($model, 'skill')->widget(Select2::classname(), ['language' => 'de', 'data' => Employee::itemAlias('skill'), 'options' => ['multiple' => true, 'placeholder' => 'เลือกความสามารถ ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <?php 
echo $form->field($model, 'resume')->widget(FileInput::classname(), ['pluginOptions' => ['initialPreview' => empty($model->resume) ? [] : [Yii::getAlias('@web') . '/resumes/' . $model->resume], 'allowedFileExtensions' => ['pdf'], 'showPreview' => false, 'showCaption' => true, 'showRemove' => true, 'showUpload' => false]]);
?>

<div class="form-group field-upload_files">
  <label class="control-label" for="upload_files[]"> อัพโหลดไฟล์ต่างๆ </label>
<div>
<?php 
echo FileInput::widget(['name' => 'upload_files[]', 'options' => ['multiple' => true], 'pluginOptions' => ['overwriteInitial' => false, 'initialPreviewShowDelete' => true, 'initialPreview' => $initialPreview, 'initialPreviewConfig' => $initialPreviewConfig, 'previewFileType' => 'any', 'uploadUrl' => Url::to(['/employee/upload']), 'uploadExtraData' => ['request_id' => $model->token_forupload], 'maxFileCount' => 100]]);
?>
</div>
</div>

<br>
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => ($model->isNewRecord ? 'btn btn-success' : 'btn btn-primary') . ' btn-lg btn-block']);
Пример #14
0
            <div class="btn-group pull-right">
                <?php 
echo $buttons;
?>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><?php 
echo Yii::t('common', 'Information');
?>
</h5>
                </div>
                <div class="ibox-content">
                    <?php 
$form = ActiveForm::begin(['id' => 'formDefault', 'layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data'], 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10', 'error' => 'help-block m-b-none', 'hint' => '']]]);
echo $form->field($model, 'file_path')->widget(FileInput::classname(), $fileConfig);
echo $form->field($model, 'model_namespace')->widget(app\modules\common\components\FieldNamespace::className(), []);
ActiveForm::end();
?>
                </div>
            </div>
        </div>
    </div>
</div>


Пример #15
0
<?php

use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use kartik\builder\Form;
use kartik\datecontrol\DateControl;
use kartik\builder\TabularForm;
use kartik\widgets\FileInput;
/**
 * @var yii\web\View $this
 * @var common\models\Osusuarios $model
 * @var yii\widgets\ActiveForm $form
 */
$model->usu_activo = $model->isNewRecord ? 1 : $model->usu_activo;
?>
<div class="osusuarios-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 1, 'attributes' => ['usu_nomusu' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Nombre de Usuario...', 'maxlength' => 64]], 'usu_activo' => ['type' => Form::INPUT_CHECKBOX, 'options' => ['placeholder' => 'Estado del Usuario...']], 'usu_nombre' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Nombre Completo del Usuario...', 'maxlength' => 64]], 'usu_clave' => ['type' => Form::INPUT_PASSWORD, 'options' => ['placeholder' => 'Contraseña...', 'maxlength' => 64]]]]);
echo $form->field($model, 'uploadedFile')->widget(FileInput::classname(), ['pluginOptions' => ['showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t('admin', 'Select Photo')], 'options' => ['accept' => 'image/*']]);
echo Html::submitButton($model->isNewRecord ? Yii::t('yii', 'Create') : Yii::t('yii', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
ActiveForm::end();
?>

</div>
Пример #16
0
<div class="test-form">

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


            <div class="row">
        <div class="col-md-6">
        <?php 
$plugins = ["options" => ["accept" => "image/*"]];
if ($model->image) {
    $plugins = ["options" => ["accept" => "image/*"], "pluginOptions" => ["initialPreview" => [kartik\helpers\Html::img($model->thumbnailTrue, ["class" => "file-preview-image"])]]];
}
echo $form->field($model, "image")->widget(FileInput::classname(), $plugins);
?>
        </div>

        <div class="col-md-6">
        
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
echo $form->field($model, "description")->widget(CKEditor::className(), ["editorOptions" => ["preset" => "full", "inline" => false]]);
?>
        </div>

    </div>

    <div class="row">
        <div class="col-md-10 col-md-offset-1">
Пример #17
0
echo $form->field($model, 'width');
?>
                <?php 
echo $form->field($model, 'height');
?>
                <?php 
echo $form->field($model, 'creativeId');
?>
                <?php 
echo $form->field($model, 'creativeTradeId');
?>
                <?php 
echo $form->field($model, 'advertiserId');
?>
                <?php 
echo $form->field($model, 'adviewType');
?>
                <?php 
echo $form->field($model, 'file')->widget(FileInput::classname(), ['pluginOptions' => ['previewFileType' => 'any']]);
?>
                <div class="form-group text-center">
                    <?php 
echo Html::submitButton(Yii::t('app', 'Submit'), ['class' => 'btn btn-primary', 'name' => 'login-button']);
?>
                </div>
            <?php 
ActiveForm::end();
?>
        </div>
    </div>
Пример #18
0
use kartik\widgets\FileInput;
use kartik\icons\Icon;
use kartik\popover\PopoverX;
use kartik\password\PasswordInput;
/**
 * @var yii\web\View $this
 * @var common\models\Osusuarios $model
 */
$this->title = $model->usu_nombre;
$this->params['breadcrumbs'][] = ['label' => Yii::t('admin', 'Osusuarios'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $model->usu_nomusu;
?>
<div class="osusuarios-view">
    <!--<div class="page-header">
        <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    </div>-->


    <?php 
echo DetailView::widget(['model' => $model, 'condensed' => false, 'hover' => true, 'mode' => Yii::$app->request->get('edit') == 't' ? DetailView::MODE_EDIT : DetailView::MODE_VIEW, 'panel' => ['heading' => $this->title, 'type' => DetailView::TYPE_INFO], 'formOptions' => ['options' => ['enctype' => 'multipart/form-data']], 'attributes' => [['attribute' => 'uploadedFile', 'format' => 'raw', 'value' => $model->usu_type ? '<a href="#" class="thumbnail">
                        <img src="data:' . $model->usu_type . ';base64,' . base64_encode($model->usu_foto) . '" alt="" class="">
                    </a>' : '<a href="#" class="thumbnail">
                        <img src="' . Yii::$app->params['assetUrl'] . 'images/noavatar_man.png" alt="" class="">
                    </a>', 'type' => DetailView::INPUT_WIDGET, 'widgetOptions' => ['class' => FileInput::classname(), 'pluginOptions' => ['showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t('admin', 'Select Photo')], 'options' => ['accept' => 'image/*']]], 'usu_nomusu', 'usu_nombre', ['attribute' => 'usu_feccre', 'format' => ['datetime', isset(Yii::$app->modules['datecontrol']['displaySettings']['datetime']) ? Yii::$app->modules['datecontrol']['displaySettings']['datetime'] : 'd-m-Y H:i:s A'], 'type' => DetailView::INPUT_WIDGET, 'displayOnly' => true, 'widgetOptions' => ['class' => DateControl::classname(), 'type' => DateControl::FORMAT_DATETIME]], ['attribute' => 'usu_ulting', 'format' => ['datetime', isset(Yii::$app->modules['datecontrol']['displaySettings']['datetime']) ? Yii::$app->modules['datecontrol']['displaySettings']['datetime'] : 'd-m-Y H:i:s A'], 'type' => DetailView::INPUT_WIDGET, 'displayOnly' => true, 'widgetOptions' => ['class' => DateControl::classname(), 'type' => DateControl::FORMAT_DATETIME]], ['attribute' => 'usu_activo', 'format' => 'raw', 'value' => $model->usu_activo ? '<span class="label label-success">Activo</span>' : '<span class="label label-danger">Inactivo</span>', 'type' => DetailView::INPUT_SWITCH], ['attribute' => 'usu_ultemp', 'displayOnly' => true]], 'deleteOptions' => ['url' => ['delete', 'id' => $model->usu_id], 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']], 'enableEditMode' => true, 'buttons' => [['label' => Icon::show('key'), 'title' => Yii::t('admin', 'Change Password'), 'html' => PopoverX::widget(['header' => '<i class="glyphicon glyphicon-lock"></i> ' . Yii::t('admin', 'Change Password'), 'placement' => PopoverX::ALIGN_BOTTOM_RIGHT, 'size' => PopoverX::SIZE_LARGE, 'footer' => Html::submitButton(Yii::t('admin', 'Enviar'), ['class' => 'btn btn-sm btn-primary']), 'content' => '<label class="control-label">' . Yii::t('admin', 'Password') . '</label>' . PasswordInput::widget(['model' => $model, 'attribute' => 'passwd']), 'toggleButton' => ['label' => Icon::show('key'), 'class' => 'btn btn-xs btn-info', 'data-toggle' => 'tooltip', 'data-original-title' => Yii::t('admin', 'Change Password')]])]]]);
?>

</div>
Пример #19
0
                <?php 
echo Html::resetButton('<i class="glyphicon glyphicon-remove"></i> ยกเลิก', ['class' => 'btn']);
?>
            </div>
        </div>
    </div>
    <br/>
    <div class="dashboard_box" style="padding-top: 15px;">
        <div class="row">
            <div class="col-sm-8">
                <?php 
echo $form->field($model, 'cid')->dropDownList(app\models\TblSlidertype::makeDropDown(), ['style' => 'width:200px; max-width: 400px;']);
?>

                <?php 
echo $form->field($model, 'upload_files')->widget(FileInput::classname(), ['options' => ['multiple' => false], 'pluginOptions' => ['showUpload' => false, 'showPreview' => true, 'showCaption' => false, 'uploadClass' => 'btn btn-info', 'removeClass' => 'btn btn-danger', 'elCaptionText' => '#customCaption', 'initialPreview' => [Html::img("{$model->slider_Url}", ['class' => 'file-preview-image', 'alt' => '', 'title' => ''])]]]);
echo "ขนาดภาพ Slide: 1,263*520 px<br/>ขนาดภาพ Event: 800*600px<br/><br/>";
//echo $form->field($model, 'target')->input('checkbox', ['style' => 'width: 400px;']);
echo $form->field($model, 'id', ['options' => ['class' => 'sr-only']])->hiddenInput();
echo $form->field($model, 'langs', ['options' => ['class' => 'sr-only']])->hiddenInput();
?>
            </div>
            <div class="col-sm-4">
                <?php 
echo $form->field($model, 'title')->input('text');
?>
                <?php 
echo $form->field($model, 'fulltexts')->textarea();
?>
                <?php 
echo $form->field($model, 'positions')->dropDownList(['left' => 'ซ้าย', 'center' => 'ตรงกลาง', 'right' => 'ขวา']);
Пример #20
0
        <h1>Parsing Excel test</h1>
    </div>


    <div class="test-form">


        <div class="test-form">
            <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
?>

            <div class="row">
                <div class="col-md-10">
                    <?php 
echo $form->field($model, 'fileori')->widget(FileInput::classname(), ['options' => ['accept' => '.xls']]);
?>

                </div>


            </div>

            <div class="row">
                <div class="col-md-10 col-md-offset-1">
                    <?php 
echo Html::submitButton('Upload ', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
                </div>
            </div>
            <div class="notifications" style="display: none">Please wait, while loading.... <img src="/abc/web/img/loadingAnimation.gif"></div>
Пример #21
0
?>
            </div>
        </div>

        <div class="panel panel-danger">
            <div class="panel-heading">แนบหลักฐานให้ครบถ้วน และถูกต้องตามรายการ</div>
            <div class="penel-body well">               
                <p><i class="glyphicon glyphicon-send"></i> ภาพถ่ายหนังสือเดินทางของผู้ขับรถ   <i class="glyphicon glyphicon-send"></i>ภาพถ่ายใบอนุญาตขับรถตามลักษณะที่ขออนุญาต</p>
                    
                <div class="row">
                </div><span class="label label-danger">กรุณาตั้งชื่อไฟล์ ตามชนิดเอกสาร</span>
                <?php 
echo PopoverX::widget(['header' => 'การตั้งชื่อเอกสาร', 'type' => PopoverX::TYPE_INFO, 'placement' => PopoverX::ALIGN_TOP, 'size' => PopoverX::SIZE_LARGE, 'content' => Html::img('images/sampledoc.gif'), 'toggleButton' => ['label' => 'คลิก เพื่อดูตัวอย่าง', 'class' => 'label label-primary']]);
?>
                <?php 
echo $form->field($model2, 'docs[]')->widget(FileInput::classname(), ['options' => ['multiple' => true], 'pluginOptions' => ['initialPreview' => $model2->initialPreview($model2->docs, 'docs', 'file'), 'initialPreviewConfig' => $model2->initialPreview($model2->docs, 'docs', 'config'), 'allowedFileExtensions' => ['pdf', 'jpg', 'png', 'docx', 'xls', 'xlsx'], 'showPreview' => true, 'showCaption' => true, 'showRemove' => true, 'showUpload' => true, 'overwriteInitial' => false]])->label(false);
?>
            </div>
        </div>
        <div class="form-group">
            <?php 
echo Html::submitButton($model2->isNewRecord ? '<i class="fa fa-plus"></i> เพิ่มข้อมูลคนขับ' : 'Update', ['class' => $model2->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>

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

    </div>    
</div>
Пример #22
0
?>

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

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

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>
    
     <?php 
echo $form->field($model, 'gambar')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png']]]);
?>

     <!--$form->field($model, 'image')->fileInput() ?>-->

    
     
    <?php 
echo $form->field($model, 'itemType')->widget(Select2::classname(), ['data' => $datastatik, 'options' => ['placeholder' => 'pilih  ...'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Пример #23
0
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><?php 
echo Yii::t('common', 'Information');
?>
</h5>
                </div>
                <div class="ibox-content">
                    <?php 
$form = ActiveForm::begin(['id' => 'formDefault', 'layout' => 'horizontal', 'options' => ['enctype' => 'multipart/form-data'], 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-2', 'wrapper' => 'col-sm-10', 'error' => 'help-block m-b-none', 'hint' => '']]]);
// Image
$imageConfig = ['options' => ['accept' => 'uploads/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showCaption' => FALSE, 'showRemove' => FALSE, 'showUpload' => FALSE, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Photo', 'removeClass' => 'btn btn-danger', 'removeLabel' => "Delete", 'removeIcon' => '<i class="glyphicon glyphicon-trash"></i>', 'allowedFileExtensions' => ['jpg', 'gif', 'png', 'jpeg']]];
if (!empty($model->image)) {
    $imageConfig['pluginOptions']['initialPreview'] = [Html::img(LetHelper::getFileUploaded($model->image), ['class' => 'file-preview-image'])];
}
// END Image
$tabs = [['label' => Yii::t('common', 'General information'), 'content' => $form->field($model, 'name')->textInput() . $form->field($model, 'class')->textInput() . $form->field($model, 'skin')->textInput() . $form->field($model, 'image')->widget(FileInput::classname(), $imageConfig) . $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['style' => 'height: 400px;'], 'configs' => ['plugins' => 'moxiemanager advlist autolink lists link image charmap print preview hr anchor pagebreak ' . 'searchreplace wordcount visualblocks visualchars code fullscreen ' . 'insertdatetime media nonbreaking save table contextmenu directionality ' . 'emoticons template paste textcolor colorpicker textpattern', 'toolbar1' => 'insertfile undo redo | styleselect | fontselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', 'toolbar2' => 'print preview media | forecolor backcolor emoticons', 'moxiemanager_image_settings' => ['moxiemanager_title' => 'Images', 'moxiemanager_extensions' => 'jpg,png,gif', 'moxiemanager_rootpath' => '/uploads/editor', 'moxiemanager_view' => 'thumbs'], 'external_plugins' => ['moxiemanager' => Url::base() . '/plugins/moxiemanager/plugin.min.js'], 'entity_encoding' => 'raw', 'force_p_newlines' => true, 'force_br_newlines' => false, 'auto_cleanup_word' => false, 'relative_urls' => true, 'convert_urls' => false, 'remove_script_host' => true, 'verify_html' => false, 'forced_root_block' => false, 'content_css' => 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css', 'templates' => Url::to(['template'])]]) . $form->field($model, 'description')->textarea() . $form->field($model, 'promotion')->widget(SwitchInput::className(['type' => SwitchInput::RADIO])) . $form->field($model, 'status')->widget(SwitchInput::className(['type' => SwitchInput::RADIO])), 'active' => true], ['label' => 'Seo', 'content' => $form->field($model, 'slug')->textInput() . $form->field($model, 'slug_prefix')->textInput() . $form->field($model, 'seo_url')->textInput() . $form->field($model, 'seo_title')->textInput() . $form->field($model, 'seo_desc')->textInput(), $form->field($model, 'seo_keyword')->textInput()]];
echo Html::hiddenInput('save_type', 'save');
echo yii\bootstrap\Tabs::widget(['items' => $tabs]);
ActiveForm::end();
?>
                </div>
            </div>
        </div>
    </div>
</div>


Пример #24
0
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use kartik\widgets\FileInput;
$this->title = Yii::t('app', 'Загрузка');
?>
<div class="container">
	<div class="col-md-6">
		<?php 
$form = ActiveForm::begin(['class' => 'form-horisontal', 'options' => ['enctype' => 'multipart/form-data']]);
?>
		
		<?php 
echo $form->field($model, 'file')->widget(FileInput::classname(), ['options' => ['multiple' => false, 'accept' => 'image/*'], 'pluginOptions' => ['showPreview' => true, 'showCaption' => true, 'showRemove' => false, 'showUpload' => false]]);
?>
		
		<?php 
echo $form->field($model, 'name');
?>
		
		<?php 
echo $form->field($model, 'tags');
?>
		
		<div class="form-group">
			<div class="col-lg-offset-1 col-lg-11">
				<?php 
echo Html::submitButton(\Yii::t('app', 'Загрузить'), ['class' => 'btn btn-primary', 'name' => 'login-button']);
?>
Пример #25
0
                    
                    <div id="image" class="tab-pane fade">
                    
                    	<p class="bg-info">
							<?php 
echo Yii::t('articles', 'Allowed Extensions');
?>
: <?php 
echo $imagetype;
?>
                        </p>
                        
                        <div class="col-lg-6">
                        
                        	<?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['options' => ['accept' => 'image/' . $imagetype], 'pluginOptions' => ['previewFileType' => 'image', 'showUpload' => false, 'browseLabel' => Yii::t('articles', 'Browse &hellip;')]]);
?>
 
                            
                            <?php 
if (isset($model->image) && !empty($model->image)) {
    ?>
                            
                            <div class="thumbnail">                       	
                            	<img alt="200x200" class="img-thumbnail" data-src="holder.js/300x250" style="width: 300px;" src="<?php 
    echo $model->getImageUrl();
    ?>
">
                            	<div class="caption">
                            		<p></p>
                            	    <p>
Пример #26
0
<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<div class="box-body">
    <div class="row">
        <div class="col-md-4">
                <div class="form-group">
                <?php 
if ($model->getImage()) {
    foreach ($model->getImage() as $image) {
        echo Html::img("/storages/" . $image->getFullPath(), ['class' => 'img-thumbnail', 'width' => 90, 'height' => 90]);
    }
}
// your fileinput widget for single file upload
echo $form->field($model, 'thumbnail[]')->widget(FileInput::classname(), ['options' => ['accept' => 'image/*', 'multiple' => true], 'pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png'], 'previewFileType' => 'any']]);
?>
            </div>
        </div>
        <div class="col-md-8">
            <div class="form-group">
                <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
?>
            </div>
            <div class="row">
                <div class="form-group col-md-6">
                    <?php 
echo $form->field($model, 'category_id')->dropDownList(ArrayHelper::map(Category::find()->notParent()->all(), 'id', 'title'), ['prompt' => Yii::t('view', 'Select A Category')]);
?>
                </div>
Пример #27
0
/* @var $model \common\modulse\article\models\Article */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="article-form">

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

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

    <?php 
echo $form->field($model, 'image')->widget(FileInput::classname(), ['pluginOptions' => ['allowedFileExtensions' => ['jpg', 'gif', 'png'], 'language' => 'de', 'showCaption' => false, 'showRemove' => false, 'showUpload' => false, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Image', 'initialPreview' => [$model->getImageTag('thumb')]], 'options' => ['accept' => 'image/*']]);
?>

    <?php 
echo $form->field($model, 'content')->widget('common\\widgets\\Redactor');
?>

    <?php 
echo $form->field($model, 'status')->widget(CheckboxX::classname(['initInputType' => CheckboxX::INPUT_CHECKBOX]), ['pluginOptions' => ['threeState' => false]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('Article', 'Create') : Yii::t('Article', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Пример #28
0
            <?php 
$usr = User::find()->all();
$usrs = ArrayHelper::map($usr, function ($model) {
    return $model->_id->{'$id'};
}, 'username');
echo $form->field($model, 'share_to')->label('Share To')->widget(Select2::classname(), ['data' => $usrs, 'options' => ['placeholder' => 'Select User', 'id' => 'file_id'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>
    <div class="row">
        <div class="col-md-8">

                    <!--?= $form->field($model, 'file')->fileInput() ?-->
                    <?php 
echo $form->field($model, 'file')->widget(FileInput::classname(), ['options' => ['accept' => 'file/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showUpload' => false]]);
?>
        </div>
        <?php 
$model->status = 1;
?>
    <?php 
echo $form->field($model, 'status')->hiddenInput()->label(false);
?>
    </div>
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Пример #29
0
<?php

use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use kartik\widgets\ActiveField;
use yii\helpers\ArrayHelper;
use kartik\widgets\FileInput;
$message = '';
?>
<div class="wrapper headline" style="">
    <label class="head">
        <span class="badge">2</span>&nbsp;
        <i class="fa fa-image fa-lg"></i>&nbsp;
        <?php 
echo Yii::t('app', 'Avatar');
?>
    </label>
    <i class="fa fa-chevron-right chevron"></i>
</div>
<div class="wrapper body notshown fadeIn animated" style="border-top:none;">
<?php 
echo $this->render('../_hint.php', ['message' => $message]);
?>
	<?php 
echo $form->field($model, 'user_avatar')->widget(FileInput::classname(), ['options' => ['multiple' => false, 'accept' => 'image/*'], 'pluginOptions' => ['previewFileType' => 'any', 'showCaption' => false, 'showUpload' => false, 'browseClass' => 'btn btn-info shadow', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => Yii::t('app', 'Izaberite profilnu sliku'), 'removeLabel' => Yii::t('app', 'Izbaci'), 'resizeImage' => true, 'maxImageWidth' => 200, 'maxImageHeight' => 200, 'resizePreference' => 'width']]);
echo $this->render('_submitButton.php');
?>
</div>
Пример #30
-1
?>
        </div>
		<!--VIEW IMPORT!-->
		<div class="col-sm-12 col-md-12 col-lg-12">
            <?php 
//print_r($gvValidateColumn);
echo GridView::widget(['id' => 'gv-view-import', 'dataProvider' => $dataProviderViewImport, 'filterModel' => $searchModelViewImport, 'columns' => $gvRows, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-validate']], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false, 'panel' => [''], 'toolbar' => [''], 'panel' => ['heading' => '<h3 class="panel-title">LIST DATA</h3>', 'type' => 'info', 'before' => Html::a('<i class="fa fa-remove"></i> ' . Yii::t('app', 'Clear', ['modelClass' => 'Clear']), '', ['id' => 'clear', 'data-pjax' => true, 'data-toggle-clear' => '1', 'class' => 'btn btn-danger btn-sm']) . ' ' . Html::a('<i class="fa fa-database"></i> ' . Yii::t('app', 'Send Data', ['modelClass' => 'Kategori']), '', ['id' => 'fix', 'data-pjax' => true, 'data-toggle-fix' => '1', 'class' => 'btn btn-success btn-sm']), 'showFooter' => false]]);
?>
        </div>
    </div>
</div>

<?php 
Modal::begin(['id' => 'file-import', 'header' => '<div style="float:left;margin-right:10px">' . Html::img('@web/img_setting/warning/upload1.png', ['class' => 'pnjg', 'style' => 'width:40px;height:40px;']) . '</div><div style="margin-top:10px;"><h4><b>Upload Path Of File!</b></h4></div>', 'headerOptions' => ['style' => 'border-radius:5px; background-color:rgba(142, 202, 223, 0.9)']]);
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'], 'method' => 'post', 'action' => ['/sales/import-data/upload']]);
echo $form->field($modelFile, 'uploadExport')->widget(FileInput::classname(), ['options' => ['accept' => '*']]);
// echo FileInput::widget([
// 'name'=>'import_file',
// 'name' => 'attachment_48[]',
// 'options'=>[
// 'multiple'=>true
// ],
// 'pluginOptions' => [
// 'uploadUrl' => Url::to(['/sales/import-data/upload']),
// 'showPreview' => false,
// 'showUpload' => false,
// 'showCaption' => true,
// 'showRemove' => true,
// 'uploadExtraData' => [
// 'album_id' => 20,
// 'cat_id' => 'Nature'