138 lines
5.2 KiB
PHP
138 lines
5.2 KiB
PHP
@extends('backend.layouts.app')
|
|
|
|
@section('title',__('label.create_sampraday_page_title').' | '.env('APP_NAME'))
|
|
|
|
@push('after-styles')
|
|
@endpush
|
|
|
|
@section('breadcrumb')
|
|
<div class="subheader py-2 py-lg-4 subheader-solid" id="kt_subheader">
|
|
<div class="container-fluid d-flex align-items-center justify-content-between flex-wrap flex-sm-nowrap">
|
|
<!--begin::Info-->
|
|
<div class="d-flex align-items-center flex-wrap mr-1">
|
|
<!--begin::Page Heading-->
|
|
<div class="d-flex align-items-baseline mr-5">
|
|
<!--begin::Page Title-->
|
|
<!--end::Page Title-->
|
|
<!--begin::Breadcrumb-->
|
|
<ul class="breadcrumb breadcrumb-transparent breadcrumb-dot font-weight-bold p-0 my-2 font-size-sm">
|
|
<li class="breadcrumb-item active">
|
|
<a href="{{ route('admin.dashboard') }}" class="text-muted">{{ __('breadcrumb.dashboard') }}</a>
|
|
</li>
|
|
<li class="breadcrumb-item active">
|
|
<a href="{{ route('admin.sampraday.index') }}" class="text-muted">{{ __('breadcrumb.sampradays') }}</a>
|
|
</li>
|
|
<li class="breadcrumb-item">
|
|
{{ __('breadcrumb.add_sampraday') }}</a>
|
|
</li>
|
|
</ul>
|
|
<!--end::Breadcrumb-->
|
|
</div>
|
|
<!--end::Page Heading-->
|
|
</div>
|
|
<!--end::Info-->
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="card card-custom">
|
|
<div class="card-header">
|
|
<h3 class="card-title">
|
|
{{ __('label.create_sampraday_form_title') }}
|
|
</h3>
|
|
<div class="card-toolbar">
|
|
<div class="example-tools justify-content-center">
|
|
<span class="example-toggle" data-toggle="tooltip" title="View code"></span>
|
|
<span class="example-copy" data-toggle="tooltip" title="Copy code"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--begin::Form-->
|
|
{{ Form::open(['route' => 'admin.sampraday.store','id' => 'createJatiForm', 'files' => true]) }}
|
|
@include('backend.sampraday.partials._form')
|
|
{{ Form::close() }}
|
|
|
|
<!--end::Form-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('after-scripts')
|
|
@component('backend.layouts.components.validation')@endcomponent
|
|
<script>
|
|
var dharma_id = false;
|
|
|
|
$.ajaxSetup({
|
|
headers: {
|
|
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
|
}
|
|
});
|
|
|
|
function demo1() {
|
|
|
|
}
|
|
|
|
function getGachadhiPati() {
|
|
$.ajax({
|
|
url: "{{ route('admin.dharma.gachadhi-pati') }}",
|
|
type: "POST",
|
|
data: {
|
|
'dharma_id': $('#dharma').val(),
|
|
},
|
|
success: function (data) {
|
|
$('#sants').empty();
|
|
var emptyOption = new Option('Select the class name', '', false, false);
|
|
$('#sants').append(emptyOption);
|
|
$.each(data.gachadhi_paties, function (index, gachadhi_pati) {
|
|
if (dharma_id == gachadhi_pati.id) {
|
|
var newOption = new Option(gachadhi_pati.name, gachadhi_pati.id, true, true);
|
|
} else {
|
|
var newOption = new Option(gachadhi_pati.name, gachadhi_pati.id, false, false);
|
|
}
|
|
$('#sants').append(newOption);
|
|
});
|
|
$('#sants').selectpicker('refresh');
|
|
}
|
|
})
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
demo1();
|
|
$(document).on('change', '#dharma', function (e) {
|
|
getGachadhiPati();
|
|
});
|
|
$("#createJatiForm").validate({
|
|
errorClass: 'is-invalid',
|
|
normalizer: function(value) {
|
|
return $.trim(value);
|
|
},
|
|
rules: {
|
|
name: {
|
|
required: true,
|
|
},
|
|
dharma_id: {
|
|
required: true
|
|
}
|
|
},
|
|
onfocusout: function(element) {
|
|
// "eager" validation
|
|
// this.element(element);
|
|
},
|
|
errorPlacement: function ( error, element ) {
|
|
if(element.parent().hasClass('dropdown')){
|
|
error.insertAfter( element.parent() );
|
|
} else{
|
|
error.insertAfter( element );
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|