api code global jain
This commit is contained in:
141
resources/views/backend/sampraday/edit.blade.php
Normal file
141
resources/views/backend/sampraday/edit.blade.php
Normal file
@@ -0,0 +1,141 @@
|
||||
@extends('backend.layouts.app')
|
||||
|
||||
@section('title',__('label.update_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.edit_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.update_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::model($sampraday,['route' => ['admin.sampraday.update', $sampraday->id],'method' => 'PATCH','id' => 'updateJatiForm', '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 = "{{ isset($sampraday) ? $sampraday->dharma_id : false}}";
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': "{{ csrf_token() }}"
|
||||
}
|
||||
});
|
||||
function getGachadhiPati() {
|
||||
$('#sants').selectpicker('destroy');
|
||||
$.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').trigger('change');
|
||||
}
|
||||
})
|
||||
}
|
||||
function demo1() {
|
||||
|
||||
$("#updateJatiForm").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 );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (dharma_id > 0) {
|
||||
getGachadhiPati();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
demo1();
|
||||
$(document).on('change', '#dharma', function (e) {
|
||||
getGachadhiPati();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('/js/pages/crud/forms/widgets/bootstrap-switch.js?v=7.2.8') }}"></script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user