173 lines
6.5 KiB
PHP
173 lines
6.5 KiB
PHP
@extends('backend.layouts.app')
|
|
|
|
@section('title',__('label.view_sangh_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.sanghs.index') }}" class="text-muted">{{ __('breadcrumb.sangh') }}</a>
|
|
</li>
|
|
<li class="breadcrumb-item">
|
|
{{ __('breadcrumb.view_sangh_request') }}
|
|
</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.view_sangh_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($sangh,['route' => ['admin.sanghs.update', $sangh->id],'method' => 'PATCH','id' => 'updateSanghForm', 'files' => true]) }}
|
|
@include('backend.sangh.partials._form')
|
|
{{ Form::close() }}
|
|
<!--end::Form-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('after-scripts')
|
|
@component('backend.layouts.components.validation')@endcomponent
|
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAoZv-67UKDVz5Rp3fa3e2xcHunahFGKOc&libraries=places"></script>
|
|
<script>
|
|
function initializeAutocomplete() {
|
|
const input = document.getElementById('sangh_address');
|
|
const autocomplete = new google.maps.places.Autocomplete(input, {
|
|
types: ['geocode'],
|
|
componentRestrictions: {'country': ['IN']}
|
|
});
|
|
|
|
autocomplete.addListener('place_changed', function() {
|
|
const place = autocomplete.getPlace();
|
|
lat = place.geometry.location.lat();
|
|
lng = place.geometry.location.lng();
|
|
document.getElementById('latitude').value = lat;
|
|
document.getElementById('longitude').value = lng;
|
|
|
|
|
|
input.value = place.formatted_address;
|
|
});
|
|
}
|
|
|
|
google.maps.event.addDomListener(window, 'load', initializeAutocomplete);
|
|
|
|
|
|
|
|
function demo1() {
|
|
$("#updateSanghForm").validate({
|
|
errorClass: 'is-invalid',
|
|
normalizer: function(value) {
|
|
return $.trim(value);
|
|
},
|
|
rules: {
|
|
// sangh_type: {
|
|
// required: true,
|
|
// },
|
|
// state: {
|
|
// required: true,
|
|
// },
|
|
// city: {
|
|
// required: true,
|
|
// },
|
|
sangh_address: {
|
|
required: true,
|
|
},
|
|
sangh_name: {
|
|
required: true,
|
|
},
|
|
// number_of_members: {
|
|
// required: true,
|
|
// },
|
|
// aaradhana_bhavan: {
|
|
// required: true,
|
|
// },
|
|
// pathshala: {
|
|
// required: true,
|
|
// },
|
|
// number_of_students: {
|
|
// required: true,
|
|
// },
|
|
// library: {
|
|
// required: true,
|
|
// },
|
|
// aayambilshala: {
|
|
// required: true,
|
|
// },
|
|
// bhojanshala: {
|
|
// required: true,
|
|
// },
|
|
// tiffin_service: {
|
|
// required: true,
|
|
// },
|
|
// mahila_mandal: {
|
|
// required: true,
|
|
// },
|
|
reject_reason: {
|
|
required: true,
|
|
},
|
|
},
|
|
submitHandler: function(form) {
|
|
form.submit();
|
|
},
|
|
onfocusout: function(element) {
|
|
this.element(element);
|
|
},
|
|
errorPlacement: function ( error, element ) {
|
|
if(element.parent().hasClass('dropdown')){
|
|
error.insertAfter( element.parent() );
|
|
} else{
|
|
error.insertAfter( element );
|
|
}
|
|
}
|
|
});
|
|
}
|
|
$(document).ready(function () {
|
|
demo1();
|
|
$("input[name$='status']").change(function(){
|
|
if ($(this).val() === 'Rejected') {
|
|
$('.reject_reason').show();
|
|
} else if ($(this).val() === 'Approved' || $(this).val() === '') {
|
|
$('.reject_reason').hide();
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
@endsection
|