StocksNew/Modules/Training/resources/views/training-list/partials/action.blade.php

100 lines
4.0 KiB
PHP
Raw Permalink 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('Title')->class('form-label') }}
{{ html()->text('title')->class('form-control')->placeholder('Training Title') }}
</div>
<div>
<h1></h1>
</div>
<div class="row">
<div class="col-lg-12">
{{ html()->label('Training By')->class('form-label') }}
<div class="row mt-2">
<div class="col-sm-3">
<div class="form-check form-radio-success">
{{ html()->radio('training_by', false, 'external')->class('form-check-input training-by')->checked($editable && $trainingList->training_by == 'external') }}
{{ html()->label('External Trainer')->class('form-check-label me-1') }}
</div>
</div>
<div class="col-sm-6">
<div class="form-check form-radio-success">
{{ html()->radio('training_by', false, 'office')->class('form-check-input training-by')->checked($editable && $trainingList->training_by == 'office') }}
{{ html()->label('Office Trainer')->class('form-check-label me-1') }}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 external-dropdown d-none">
{{ html()->label('Office Trainer')->class('form-label') }}
{{ html()->select('assigned_id',$employee)->class('form-select select2')->placeholder('Office Trainer') }}
</div>
<div class="col-lg-4 col-md-6 office-dropdown d-none">
{{ html()->label('External Trainer')->class('form-label') }}
{{ html()->select('trainer_id',$trainer)->class('form-select select2')->placeholder('External Trainer') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Training Members')->class('form-label') }}
{{ html()->select('department_id',$department)->class('form-select select2')->placeholder('Training Members') }}
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Start Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('start_date')->class('form-control flatpickr-date')->id('event-start-date')->placeholder('Training Start Date') }}
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('End Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('end_date')->class('form-control flatpickr-date')->id('event-end-date')->placeholder('Training End Date') }}
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
</div>
</div>
<div class="col-lg-4 col-md-6">
{{ html()->label('Shift')->class('form-label') }}
{{ html()->text('shift')->class('form-control')->placeholder('Training Shift') }}
</div>
<div class="col-lg-12 col-md-12">
{{ html()->label('Remarks')->class('form-label') }}
{{ html()->textarea('remarks')->class('form-control')->placeholder('Training Remarks')->attributes(['rows' => 3]) }}
</div>
<x-form-buttons :editable='$editable' label='Add' href="{{ route('trainingList.index') }}" />
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.training-by').change(function() {
let value = $(this).val();
console.log(value);
if (value == 'external') {
$('.office-dropdown').removeClass('d-none');
$('.external-dropdown').addClass('d-none');
}
if(value == 'office'){
$('.office-dropdown').addClass('d-none');
$('.external-dropdown').removeClass('d-none');
}
});
});
</script>
@endpush