<div id="window_ufileIndex" class="page-window">
    <input type="hidden" class="prev_window"/>
    <div class="row">
        <div class="col-lg-12">
            <section class="panel">
              <header class="panel-heading">
                <div class="panel-actions">
                  <a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
                  <a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
                </div>

                <h2 class="panel-title"><?php echo e(trans('resource.file.file')); ?></h2>
              </header>
              <div class="panel-body">
                <form action="" id="ufile_action_form" class="form-horizontal form-bordered" enctype="multipart/form-data">

                  <input type="hidden" name="id" value="<?php echo e((count($vw_ufile) > 0) ? $vw_ufile->id : ''); ?>"/>

                  <?php $__currentLoopData = $langs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                    <div class="form-group">
                      <label class="col-md-3 control-label"><?php echo e(trans('resource.category.name')); ?> <?php echo e($item->lang_name); ?></label>
                      <div class="col-md-6">
                        <input class="form-control " type="text" value="<?php echo e((count($source->get($item->lang_key)) > 0) ? $source->get($item->lang_key)->source : ''); ?>" name="name[<?php echo e($item->lang_key); ?>]">
                      </div>
                    </div>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                  <div class="form-group">
                    <label class="col-md-3 control-label"><?php echo e(trans('resource.file.type')); ?></label>
                    <div class="col-md-6">
                      <select name="type_id" class="uselect2" style="width:100%">
                        <?php $__currentLoopData = $vw_filetype; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                            <?php if(count($vw_ufile) > 0): ?>
                                <?php if($item->ft_id == $vw_ufile->type_id): ?>
                                    <option selected="selected" value="<?php echo e($item->ft_id); ?>"><?php echo e($item->source); ?></option>
                                <?php else: ?>
                                    <option value="<?php echo e($item->ft_id); ?>"><?php echo e($item->source); ?></option>
                                <?php endif; ?>
                            <?php else: ?>
                                <option value="<?php echo e($item->ft_id); ?>"><?php echo e($item->source); ?></option>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                      </select>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-md-3 control-label"><?php echo e(trans('resource.main.number')); ?></label>
                    <div class="col-md-6">
                      <input class="form-control " type="text" value="<?php echo e((count($vw_ufile) > 0) ? $vw_ufile->number: ''); ?>" name="number">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-md-3 control-label"><?php echo e(trans('resource.main.confirm_date')); ?></label>
                    <div class="col-md-6">
                      <input class="form-control " type="text" value="<?php echo e((count($vw_ufile) > 0) ? $vw_ufile->confirm_date: ''); ?>" name="confirm_date">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-md-3 control-label"><?php echo e(trans('resource.file.file')); ?></label>
                    <div class="col-md-6">
                      <?php if(count($vw_ufile) > 0): ?>
                          <a href="<?php echo e($vw_ufile->path); ?>" target="_blank"><?php echo e(trans('resource.file.show')); ?></a>
                      <?php endif; ?>
                      <div class="input-group">
                        <input class="form-control" id="thumbnail" type="text" name="img_hidden" value="<?php echo e((count($vw_ufile) > 0) ? $vw_ufile->path : ''); ?>"/>
                        <div class="spinner-buttons input-group-btn">
                            <span class="btn btn-default" id="lfm" data-input="thumbnail" data-preview="holder">
                                 <i class="fa fa-file-picture-o"></i>
                            </span>
                        </div>
                      </div>
                      <input type="file" name="img" style="display:none"/>
                    </div>
                  </div>

                  <div class="form-group usticky" style="background: #fff;">
                    <div class="col-md-12">
                      <div style="float: right;">
                        <button type="button" class="btn btn-primary" onclick="ufile.save();"><?php echo e(trans('resource.buttons.save')); ?></button>
                        <button type="button" class="btn" onclick="uPage.close('window_ufileIndex')"><?php echo e(trans('resource.buttons.close')); ?></button>
                      </div>
                    </div>
                  </div>
                </form>
              </div>
            </section>
        </div>
    </div>
      <script type="text/javascript">
          $(document).ready(function(){

            $(".uselect2").select2();

            $('#lfm').filemanager('image', {prefix: route_prefix});

          });
      </script>
</div>
