@php use Carbon\Carbon; @endphp @extends('layouts.iconbar') @section('title') Edit Hardware Job @endsection @section('custom_styles') @endsection @section('content') @section('breadcrumbs') {{ Breadcrumbs::render(\Request::route()->getName(), $job) }} @endsection
{!! Form::model($job, ['method' => 'PUT', 'route' => ['admin.jobs.hardware.update', $job->id], 'files' => true, 'id' => 'create', 'class' => 'needs-validation', 'novalidate', 'entype' => 'multipart/form-data']) !!}
{!! Form::hidden('job_type', 'Hardware') !!} {{--Left Column--}}
@if (Auth::user()->hasRole('Admin') ) {!! Form::text('internal_id', old('internal_id'), ['class' => 'form-control', 'placeholder' => '', 'required'=>'']) !!} @else {!! Form::text('internal_id', old('internal_id'), ['class' => 'form-control', 'placeholder' => '', 'required'=>'', 'readonly']) !!} @endif {!! Form::label('internal_id', 'Internal Id', ['class' => 'floating-label', 'style' => 'top: -2rem;']) !!} @if($errors->has('internal_id'))

{{ $errors->first('internal_id') }}

@endif
@if(Auth::user()->hasRole('Admin') )
{!! Form::select('user_id', $users, old('user_id'), ['class' => 'form-control select2','id' => 'customer', 'v-if' => "newOrExisting == 'New'"]) !!} {!! Form::select('user_id', $users, old('user_id'), ['class' => 'form-control select2','id' => 'customer', 'v-if' => "newOrExisting == 'Existing'", 'disabled' => true]) !!} {!! Form::hidden('user_id', null,['v-if' => "newOrExisting == 'Existing'", 'id' => 'user_id']) !!} {!! Form::label('user_id', 'Customer', ['class' => 'floating-label', 'style' => ' top: -.8rem;', 'style' => 'top: -2rem;']) !!} @if($errors->has('user_id'))

{{ $errors->first('user_id') }}

@endif
@else {!! Form::hidden('user_id', Auth::user()->id) !!} @endif
{!! Form::text('name', old('name'), ['class' => 'form-control empty', 'id' => 'name','placeholder' => '', 'required'=>'']) !!} {!! Form::label('name', trans('global.jobs.fields.name').'*', ['class' => 'floating-label', 'style'=>"top: -2rem;"]) !!}
Name field is required.
{!! Form::select('hardwares', $hardwares->pluck('name', 'id'), old('hardwares'), ['class' => 'form-control hardware select2', 'id' => 'hardware_options', 'multiple' => true]) !!} {!! Form::label('hardwares', trans('global.jobs.fields.hardwares').'*', ['class' => 'floating-label', 'style' => 'top: -2rem;']) !!}
Please select hadware.
@if($errors->has('hadware'))

{{ $errors->first('hadware') }}

@endif
@foreach ($hardwares as $k => $hardware) @php $qty = $job->hardwares->where('id', $hardware->id)->first()->pivot->qty ?? null @endphp
@endforeach
Item field is required.
Qty field is required.
Price field is required.
{!! Form::label('delivery_date', trans('global.jobs.fields.delivery_date').'', ['class' => 'floating-label']) !!}
{!! Form::hidden('delivery_date', old('delivery_date', Carbon::now()->addDays(10)->format('d-m-Y')), ['class' => 'form-control date', 'placeholder' => '', 'required', 'id' => 'delivery_date']) !!}
Delivery Date is required Field
@if($errors->has('delivery_date'))

{{ $errors->first('delivery_date') }}

@endif
{{--Right Column--}}
{!! Form::label('order_pdf', trans('global.jobs.fields.upload_files').'', ['class' => 'floating-label']) !!}
@if($errors->has('order_pdf'))

{{ $errors->first('order_pdf') }}

@endif
{!! Form::textarea('customer_notes', old('customer_notes', strip_tags($job->customer_notes)), ['class' => 'form-control ', 'placeholder' => '']) !!}
Customer note is required.
@if($errors->has('customer_notes'))

{{ $errors->first('customer_notes') }}

@endif
{!! old('special_packing', $job->special_packing) !!}
{!! Form::textarea('special_packing', old('special_packing'), ['class' => 'form-control ', 'placeholder' => '', 'style' => 'display:none;']) !!} @if($errors->has('special_packing'))

{{ $errors->first('special_packing') }}

@endif
{{--End Right Column--}} {{--Submit Button--}}
{!! Form::close() !!}
@stop @section('javascript') @parent @stop