StocksNew/Modules/Admin/resources/views/partials/promotiondemotions/action.blade.php

85 lines
3.4 KiB
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<div class="row gy-3">
<div class="col-lg-4 col-md-6">
{{ html()->label('Employee')->class('form-label') }}
{{ html()->select('employee_id', $employeeList)->class('form-control select2 employee-dropdown')->placeholder('Employee Name')->required() }}
{{ html()->div('Employee')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Ranking Type')->class('form-label') }}
{{ html()->select('type', $rankingTypeList)->class('form-control select2')->placeholder('Ranking Type')->required() }}
{{ html()->div('Please select ranking type')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Previous Designation')->class('form-label') }}
{{ html()->select('old_designation_id', $designationList)->class('form-control select2 designation-dropdown')->placeholder('Previous Desgination')->required() }}
{{ html()->div('Please select previous designation')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('New Department')->class('form-label') }}
{{ html()->select('new_department_id', $departmentList)->class('form-control select2')->placeholder('New Department')->required() }}
{{ html()->div('Please select new deparment')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('New Designation')->class('form-label') }}
{{ html()->select('new_designation_id', $designationList)->class('form-control select2')->placeholder('New Desgination')->required() }}
{{ html()->div('Please select new designation')->class('invalid-feedback') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Date')->class('form-label') }}
{{ html()->text('date')->class('form-control flatpickr-date')->placeholder('Select Date')->required() }}
{{ html()->div('Please select date')->class('invalid-feedback') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Description')->class('form-label') }}
{{ html()->textarea('description')->class('form-control ckeditor-classic') }}
</div>
<x-form-buttons :editable='$editable' label='Add' href="{{ route('promotionDemotion.index') }}" />
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.employee-dropdown').change(function() {
let employeeId = $(this).val();
$.ajax({
url: "{{ route('employee.getEmployeeById') }}",
type: "POST",
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
employeeId: employeeId
},
success: function(response) {
console.log(response.designation_id);
console.log(response);
$(".designation-dropdown").val(response.designation_id);
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
}
})
})
})
</script>
@endpush