%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/digiprint/resources/views/dashboard/
Upload File :
Create Path :
Current File : /var/www/html/digiprint/resources/views/dashboard/technologiesDetails.blade.php

@extends('dashboard.layouts.app')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h1>
                            <span>Technologies</span>
                            <span class="pull-right">
                                @if ($technology && $technology->id)
                                    <a class="btn btn-default"
                                       href="{{route('dashboard.technologies.gallery', $technology->id)}}">
                                    <span>Gallery</span>
                                </a>
                                @endif
                                <a class="btn btn-success" href="{{route('dashboard.technologies')}}">
                                <span>Back</span>
                            </a>
                            </span>
                        </h1>
                    </div>
                </div>

                <form class="form-horizontal" method="POST" autocomplete="off" enctype="multipart/form-data"
                      action="{{ route('dashboard.technologies.createOrUpdate', $id) }}">
                    {{ csrf_field() }}

                    <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
                        <label for="name" class="col-md-3 control-label">Name</label>
                        <div class="col-md-6">
                            <input id="name" type="text" class="form-control" name="name"
                                   value="{{ $technology->name }}" required autofocus>
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('order') ? ' has-error' : '' }}">
                        <label for="order" class="col-md-3 control-label">Order</label>
                        <div class="col-md-6">
                            <input id="order" type="number" class="form-control" name="order"
                                   value="{{ $technology->order }}" required>
                            @if ($errors->has('order'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('order') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('description') ? ' has-error' : '' }}">
                        <label for="description" class="col-md-3 control-label">Description</label>

                        <div class="col-md-6">
                            <textarea id="description" class="form-control" name="description" rows="11" required
                            >{{ $technology->description }}</textarea>
                            @if ($errors->has('description'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('description') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group{{ $errors->has('file') ? ' has-error' : '' }}">
                        <label for="description" class="col-md-3 control-label">Image</label>

                        <div class="col-md-6">
                            <input type="file" name="file" id="file" accept="image/*" onchange="fileChanged(this)">
                            @if ($errors->has('file'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('file') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                            @if($technology->media()->count() > 0)
                                <img class="img img-responsive full-width" id="image-preview-uploaded"
                                     src="{{env('APP_URL') . 'uploads/' . $technology->media()->where('media_type', \Digiprint\Models\Media::MEDIA_TYPE_IMAGE_CATEGORY)->first()->file_name}}">
                            @endif
                            <img class="img img-responsive full-width" id="image-preview">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-8 col-md-offset-3">
                            <button type="submit" class="btn btn-primary">
                                Save
                            </button>
                        </div>
                    </div>
                </form>

            </div>
        </div>
    </div>
@endsection

<script>
  function fileChanged(input) {
    if (input.files && input.files[0]) {
      var reader = new FileReader();

      reader.onload = function (e) {
        $('#image-preview').attr('src', e.target.result);
        $('#image-preview-uploaded').css('display', 'none');
      };

      reader.readAsDataURL(input.files[0]);
    }
  }
</script>

Zerion Mini Shell 1.0