Файловый менеджер - Редактировать - /home/clickysoft/public_html/resources/views/admin/assets/edit.blade.php
Назад
@extends('layouts.admin') @section('content') <div class="card"> <div class="card-header"> {{ trans('global.edit') }} {{ trans('cruds.asset.title_singular') }} </div> <div class="card-body"> <form method="POST" action="{{ route("admin.assets.update", [$asset->id]) }}" enctype="multipart/form-data"> @method('PUT') @csrf <div class="form-group"> <label class="required" for="organization_id">{{ trans('cruds.asset.fields.organization') }}</label> <select class="form-control select2 {{ $errors->has('organization') ? 'is-invalid' : '' }}" name="organization_id" id="organization_id" required> @foreach($organizations as $id => $entry) <option value="{{ $id }}" {{ (old('organization_id') ? old('organization_id') : $asset->organization->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('organization')) <span class="text-danger">{{ $errors->first('organization') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.organization_helper') }}</span> </div> <div class="form-group"> <label class="required" for="asset_name">{{ trans('cruds.asset.fields.asset_name') }}</label> <input class="form-control {{ $errors->has('asset_name') ? 'is-invalid' : '' }}" type="text" name="asset_name" id="asset_name" value="{{ old('asset_name', $asset->asset_name) }}" required> @if($errors->has('asset_name')) <span class="text-danger">{{ $errors->first('asset_name') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.asset_name_helper') }}</span> </div> <div class="form-group"> <label class="required" for="asset_status_id">{{ trans('cruds.asset.fields.asset_status') }}</label> <select class="form-control select2 {{ $errors->has('asset_status') ? 'is-invalid' : '' }}" name="asset_status_id" id="asset_status_id" required> @foreach($asset_statuses as $id => $entry) <option value="{{ $id }}" {{ (old('asset_status_id') ? old('asset_status_id') : $asset->asset_status->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('asset_status')) <span class="text-danger">{{ $errors->first('asset_status') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.asset_status_helper') }}</span> </div> <div class="form-group"> <label class="required" for="category_id">{{ trans('cruds.asset.fields.category') }}</label> <select class="form-control select2 {{ $errors->has('category') ? 'is-invalid' : '' }}" name="category_id" id="category_id" required> @foreach($categories as $id => $entry) <option value="{{ $id }}" {{ (old('category_id') ? old('category_id') : $asset->category->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('category')) <span class="text-danger">{{ $errors->first('category') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.category_helper') }}</span> </div> <div class="form-group"> <label for="manufacturer_id">{{ trans('cruds.asset.fields.manufacturer') }}</label> <select class="form-control select2 {{ $errors->has('manufacturer') ? 'is-invalid' : '' }}" name="manufacturer_id" id="manufacturer_id"> @foreach($manufacturers as $id => $entry) <option value="{{ $id }}" {{ (old('manufacturer_id') ? old('manufacturer_id') : $asset->manufacturer->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('manufacturer')) <span class="text-danger">{{ $errors->first('manufacturer') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.manufacturer_helper') }}</span> </div> <div class="form-group"> <label for="supplier_id">{{ trans('cruds.asset.fields.supplier') }}</label> <select class="form-control select2 {{ $errors->has('supplier') ? 'is-invalid' : '' }}" name="supplier_id" id="supplier_id"> @foreach($suppliers as $id => $entry) <option value="{{ $id }}" {{ (old('supplier_id') ? old('supplier_id') : $asset->supplier->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('supplier')) <span class="text-danger">{{ $errors->first('supplier') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.supplier_helper') }}</span> </div> <div class="form-group"> <label class="required" for="company_id">{{ trans('cruds.asset.fields.company') }}</label> <select class="form-control select2 {{ $errors->has('company') ? 'is-invalid' : '' }}" name="company_id" id="company_id" required> @foreach($companies as $id => $entry) <option value="{{ $id }}" {{ (old('company_id') ? old('company_id') : $asset->company->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('company')) <span class="text-danger">{{ $errors->first('company') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.company_helper') }}</span> </div> <div class="form-group"> <label class="required" for="branch_id">{{ trans('cruds.asset.fields.branch') }}</label> <select class="form-control select2 {{ $errors->has('branch') ? 'is-invalid' : '' }}" name="branch_id" id="branch_id" required> @foreach($branches as $id => $entry) <option value="{{ $id }}" {{ (old('branch_id') ? old('branch_id') : $asset->branch->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('branch')) <span class="text-danger">{{ $errors->first('branch') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.branch_helper') }}</span> </div> <div class="form-group"> <label for="qty">{{ trans('cruds.asset.fields.qty') }}</label> <input class="form-control {{ $errors->has('qty') ? 'is-invalid' : '' }}" type="number" name="qty" id="qty" value="{{ old('qty', $asset->qty) }}" step="1"> @if($errors->has('qty')) <span class="text-danger">{{ $errors->first('qty') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.qty_helper') }}</span> </div> <div class="form-group"> <label for="notes">{{ trans('cruds.asset.fields.notes') }}</label> <textarea class="form-control {{ $errors->has('notes') ? 'is-invalid' : '' }}" name="notes" id="notes">{{ old('notes', $asset->notes) }}</textarea> @if($errors->has('notes')) <span class="text-danger">{{ $errors->first('notes') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.notes_helper') }}</span> </div> <div class="form-group"> <label for="asset_image">{{ trans('cruds.asset.fields.asset_image') }}</label> <div class="needsclick dropzone {{ $errors->has('asset_image') ? 'is-invalid' : '' }}" id="asset_image-dropzone"> </div> @if($errors->has('asset_image')) <span class="text-danger">{{ $errors->first('asset_image') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.asset_image_helper') }}</span> </div> <div class="form-group"> <label for="asset_expiration_date">{{ trans('cruds.asset.fields.asset_expiration_date') }}</label> <input class="form-control date {{ $errors->has('asset_expiration_date') ? 'is-invalid' : '' }}" type="text" name="asset_expiration_date" id="asset_expiration_date" value="{{ old('asset_expiration_date', $asset->asset_expiration_date) }}"> @if($errors->has('asset_expiration_date')) <span class="text-danger">{{ $errors->first('asset_expiration_date') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.asset_expiration_date_helper') }}</span> </div> <div class="form-group"> <label for="next_audit_date">{{ trans('cruds.asset.fields.next_audit_date') }}</label> <input class="form-control date {{ $errors->has('next_audit_date') ? 'is-invalid' : '' }}" type="text" name="next_audit_date" id="next_audit_date" value="{{ old('next_audit_date', $asset->next_audit_date) }}"> @if($errors->has('next_audit_date')) <span class="text-danger">{{ $errors->first('next_audit_date') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.next_audit_date_helper') }}</span> </div> <div class="form-group"> <label for="purchase_date">{{ trans('cruds.asset.fields.purchase_date') }}</label> <input class="form-control date {{ $errors->has('purchase_date') ? 'is-invalid' : '' }}" type="text" name="purchase_date" id="purchase_date" value="{{ old('purchase_date', $asset->purchase_date) }}"> @if($errors->has('purchase_date')) <span class="text-danger">{{ $errors->first('purchase_date') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.purchase_date_helper') }}</span> </div> <div class="form-group"> <label for="eol_date">{{ trans('cruds.asset.fields.eol_date') }}</label> <input class="form-control date {{ $errors->has('eol_date') ? 'is-invalid' : '' }}" type="text" name="eol_date" id="eol_date" value="{{ old('eol_date', $asset->eol_date) }}"> @if($errors->has('eol_date')) <span class="text-danger">{{ $errors->first('eol_date') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.eol_date_helper') }}</span> </div> <div class="form-group"> <label for="purchase_cost">{{ trans('cruds.asset.fields.purchase_cost') }}</label> <input class="form-control {{ $errors->has('purchase_cost') ? 'is-invalid' : '' }}" type="number" name="purchase_cost" id="purchase_cost" value="{{ old('purchase_cost', $asset->purchase_cost) }}" step="0.01"> @if($errors->has('purchase_cost')) <span class="text-danger">{{ $errors->first('purchase_cost') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.purchase_cost_helper') }}</span> </div> <div class="form-group"> <label for="currency_id">{{ trans('cruds.asset.fields.currency') }}</label> <select class="form-control select2 {{ $errors->has('currency') ? 'is-invalid' : '' }}" name="currency_id" id="currency_id"> @foreach($currencies as $id => $entry) <option value="{{ $id }}" {{ (old('currency_id') ? old('currency_id') : $asset->currency->id ?? '') == $id ? 'selected' : '' }}>{{ $entry }}</option> @endforeach </select> @if($errors->has('currency')) <span class="text-danger">{{ $errors->first('currency') }}</span> @endif <span class="help-block">{{ trans('cruds.asset.fields.currency_helper') }}</span> </div> <div class="form-group"> <button class="btn btn-danger" type="submit"> {{ trans('global.save') }} </button> </div> </form> </div> </div> @endsection @section('scripts') <script> Dropzone.options.assetImageDropzone = { url: '{{ route('admin.assets.storeMedia') }}', maxFilesize: 2, // MB acceptedFiles: '.jpeg,.jpg,.png,.gif', maxFiles: 1, addRemoveLinks: true, headers: { 'X-CSRF-TOKEN': "{{ csrf_token() }}" }, params: { size: 2, width: 4096, height: 4096 }, success: function (file, response) { $('form').find('input[name="asset_image"]').remove() $('form').append('<input type="hidden" name="asset_image" value="' + response.name + '">') }, removedfile: function (file) { file.previewElement.remove() if (file.status !== 'error') { $('form').find('input[name="asset_image"]').remove() this.options.maxFiles = this.options.maxFiles + 1 } }, init: function () { @if(isset($asset) && $asset->asset_image) var file = {!! json_encode($asset->asset_image) !!} this.options.addedfile.call(this, file) this.options.thumbnail.call(this, file, file.preview ?? file.preview_url) file.previewElement.classList.add('dz-complete') $('form').append('<input type="hidden" name="asset_image" value="' + file.file_name + '">') this.options.maxFiles = this.options.maxFiles - 1 @endif }, error: function (file, response) { if ($.type(response) === 'string') { var message = response //dropzone sends it's own error messages in string } else { var message = response.errors.file } file.previewElement.classList.add('dz-error') _ref = file.previewElement.querySelectorAll('[data-dz-errormessage]') _results = [] for (_i = 0, _len = _ref.length; _i < _len; _i++) { node = _ref[_i] _results.push(node.textContent = message) } return _results } } </script> @endsection
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка