| Server IP : 46.62.235.243 / Your IP : 216.73.216.217 Web Server : Apache/2.4.58 (Ubuntu) System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/linkabili/resources/views/auth/ |
Upload File : |
@extends('layouts.frontend.app')
@push('headsection')
<style>
.newsletter-wrap {
display: none
}
.signup-item {
max-width: initial;
}
.required:after {
content: " *";
color: red;
}
.hidden-td {
display: none;
}
.invalid-feedback-custom {
width: 100%;
margin-top: .25rem;
font-size: 80%;
color: #dc3545;
}
.toggle_pwd {
font-size: 40px;
margin-left: -50px;
cursor: pointer;
margin-top: 1px;
}
.password {
width: 100%
}
</style>
@endpush
@section('content')
<!-- Sign Up -->
<div class="signup-area">
<div class="container-fluid">
<div class="row">
{{-- <div class="col-lg-6 pl-0">--}}
{{-- <div class="signup-left">--}}
{{-- <img src="/theme/assets/img/signup-bg.jpg" alt="SignUp">--}}
{{-- </div>--}}
{{-- </div>--}}
<div class="offset-2 col-lg-8 ptb-100">
<div class="signup-item">
<div class="signup-head">
<h3>REGISTRATI GRATUITAMENTE </h3>
{{-- <span id="text_type"></span>--}}
<p>Se ti sei registrato,
<a href="/login">accedi qui</a>
</p>
</div>
<div class="signup-form">
<form method="POST" action="{{ route('register') }}" autocomplete="off"
class="needs-validation" novalidate>
@csrf
<div class="form-group ">
<div class="col-md-12">
<div class="form-check form-check-inline label_caregiver">
<input class="form-check-input" type="radio" name="user_type"
id="user_type-care_giver" value="care_giver"/>
<label class="form-check-label" for="user_type-care_giver">Cerchi
sostegno?</label>
</div>
<div class="form-check form-check-inline label_professionist"
>
<input class="form-check-input" type="radio" name="user_type"
id="user_type-professionist" value="professionist"/>
<label class="form-check-label" for="user_type-professionist">Sei un
professionista</label>
</div>
<div class="form-check form-check-inline label_medical_center"
>
<input class="form-check-input" type="radio" name="user_type"
id="user_type-medical_center" value="medical_center"/>
<label class="form-check-label" for="user_type-medical_center">Sei un Centro
Medico?</label>
</div>
<div class="form-check form-check-inline label_other_istitution"
>
<input class="form-check-input" type="radio" name="user_type"
id="user_type-other_istitution" value="other_istitution"/>
<label class="form-check-label" for="user_type-other_istitution">Sei un Ente
del Terzo Settore?</label>
</div>
<div class="form-check form-check-inline care_giver_azienda d-none"
>
<input class="form-check-input" type="radio" name="user_type"
id="care_giver_azienda" value="care_giver_azienda"/>
<label class="form-check-label" for="care_giver_azienda"></label>
</div>
</div>
</div>
<div class="row fields_care_giver_azienda">
@include('auth._parts.caregiver_azienda')
</div>
<div class="row fields_care_giver">
@include('auth._parts.caregiver')
</div>
<div class="row fields_professionist">
@include('auth._parts.professionist')
</div>
<div class="row fields_medical_center">
@include('auth._parts.medical_center')
</div>
<div class="row fields_other_istitution">
@include('auth._parts.other_istitution')
</div>
<div class="col-lg-12">
<div class="form-group">
<div class="form-check">
<input class="form-check-input " type="checkbox"
@if(old('accept_terms')) checked="checked" @endif name="accept_terms"
id="accept_terms">
<label class="form-check-label" for="gridCheck">
Accetto i <a target="_blank" href="#" id="terms">Termini e
Condizioni</a><span class="required"></span>
</label>
@if ($errors->has('accept_terms'))
<span class="help-block" style="display: block;color: red;">
<strong>{{ $errors->first('accept_terms') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<div class="form-check">
<input class="form-check-input " type="checkbox"
@if(old('accept_privacy_police')) checked="checked"
@endif name="accept_privacy_police" id="accept_privacy_police">
<label class="form-check-label" for="gridCheck">
Accetto la normativa <a target="_blank"
href="https://linkabili.it/privacy-policy">Privacy</a>
secondo il GDPR 2016/679<span class="required"></span>
</label>
@if ($errors->has('accept_privacy_police'))
<span class="help-block" style="display: block;color: red;">
<strong>{{ $errors->first('accept_privacy_police') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="accept_newsletter"
@if(old('accept_newsletter')) checked="checked"
@endif id="accept_newsletter">
<label class="form-check-label" for="gridCheck">
Acconsento a ricevere la newsletter di LinkAbili ogni due settimane
</label>
@if ($errors->has('accept_newsletter'))
<span class="help-block" style="display: block;color: red;">
<strong>{{ $errors->first('accept_newsletter') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="col-lg-12">
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="accept_commercial"
@if(old('accept_commercial')) checked="checked"
@endif id="accept_commercial">
<label class="form-check-label" for="gridCheck">
Acconsento alla normativa <a target="_blank"
href="https://linkabili.it/piattaforma-digitale-per-caregivers-e-persone-con-disabilita/privacy-policy-linkabili/">Privacy</a>
per la profilazione per scopi commerciali
</label>
@if ($errors->has('accept_commercial'))
<span class="help-block" style="display: block;color: red;">
<strong>{{ $errors->first('accept_commercial') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="form-group col-md-12">
<div class="g-recaptcha"
data-sitekey="{{env('GOOGLE_RECAPTCHA_KEY')}}">
</div>
@if ($errors->has('g-recaptcha-response'))
<span class="invalid-feedback-custom" role="alert">
<strong>{{ $errors->first('g-recaptcha-response') }}</strong>
</span>
@endif
</div>
<div class="col-lg-12">
<div class="text-center">
<button type="submit" class="btn signup-btn">Registrati gratis</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('footersection')
<script>
var PATHOLOGY_CARE = <?php !is_null(old('pathology')) ? print json_encode(old('pathology')) : print 'null' ?>;
var state_care_givers = <?php !is_null(old('state_care_givers')) ? print json_encode(old('state_care_givers')) : print 'null' ?>;
var profession_professionist = <?php !is_null(old('profession_professionist')) ? print json_encode(old('profession_professionist')) : print 'null' ?>;
var title_study = <?php !is_null(old('title_study')) ? print json_encode(old('title_study')) : print 'null' ?>;
var states = <?php !is_null(old('states')) ? print json_encode(old('states')) : print 'null' ?>;
var state_office = <?php !is_null(old('state_office')) ? print json_encode(old('state_office')) : print 'null' ?>;
var specialization_medical_center = <?php !is_null(old('specialization_medical_center')) ? print json_encode(old('specialization_medical_center')) : print 'null' ?>;
var medical_center = <?php !is_null(old('medical_center')) ? print json_encode(old('medical_center')) : print 'null' ?>;
var pathology_professionist = <?php !is_null(old('pathology_professionist')) ? print json_encode(old('pathology_professionist')) : print 'null' ?>;
var other_states = <?php !is_null(old('other_states')) ? print json_encode(old('other_states')) : print 'null' ?>;
var other_states_other = <?php !is_null(old('other_states_other')) ? print json_encode(old('other_states_other')) : print 'null' ?>;
var states_medical_center = <?php !is_null(old('states_medical_center')) ? print json_encode(old('states_medical_center')) : print 'null' ?>;
var services_istitution = <?php !is_null(old('services_istitution')) ? print json_encode(old('services_istitution')) : print 'null' ?>;
var pathology_istitution = <?php !is_null(old('pathology_istitution')) ? print json_encode(old('pathology_istitution')) : print 'null' ?>;
var certification_istitution = <?php !is_null(old('certification_istitution')) ? print json_encode(old('certification_istitution')) : print 'null' ?>;
var services = <?php !is_null(old('services')) ? print json_encode(old('services')) : print 'null' ?>;
var state_istitution = <?php !is_null(old('state_istitution')) ? print json_encode(old('state_istitution')) : print 'null' ?>;
var medical_center_ets = <?php !is_null(old('medical_center_ets')) ? print json_encode(old('medical_center_ets')) : print 'null' ?>;
var certification_medical_center = <?php !is_null(old('certification_medical_center')) ? print json_encode(old('certification_medical_center')) : print 'null' ?>;
var other_profession_professionist = <?php !is_null(old('other_profession_professionist')) ? print json_encode(old('other_profession_professionist')) : print 'null' ?>;
var specialization_professionist = <?php !is_null(old('specialization_professionist')) ? print json_encode(old('specialization_professionist')) : print 'null' ?>;
var services_medical_center = <?php !is_null(old('services_medical_center')) ? print json_encode(old('services_medical_center')) : print 'null' ?>;
var pathology_medical_center = <?php !is_null(old('pathology_medical_center')) ? print json_encode(old('pathology_medical_center')) : print 'null' ?>;
var other_states_istitution = <?php !is_null(old('other_states_istitution')) ? print json_encode(old('other_states_istitution')) : print 'null' ?>;
var newOption_website = '';
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? sParam : decodeURIComponent(sParameterName[1]);
}
}
};
function removeParam(parameter) {
var url = document.location.href;
var urlparts = url.split('?');
if (urlparts.length >= 2) {
var urlBase = urlparts.shift();
var queryString = urlparts.join("?");
var prefix = encodeURIComponent(parameter) + '=';
var pars = queryString.split(/[&;]/g);
for (var i = pars.length; i-- > 0;)
if (pars[i].lastIndexOf(prefix, 0) !== -1)
pars.splice(i, 1);
url = urlBase + '?' + pars.join('&');
window.history.pushState('', document.title, url); // added this line to push the new url directly to url bar .
}
return url;
}
$(function () {
'use strict';
window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function (form) {
form.addEventListener('submit', function (event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
$('.fields_medical_center, .fields_professionist, .fields_care_giver, .fields_other_istitution, .fields_care_giver_azienda').hide();
$('.pathology, .states, .js-example-basic-multiple, .profession, .specialization, .ets').select2({
escapeMarkup: function (text) {
return text;
}
});
$('.other_profession').select2();
$('input[type=radio][name=user_type]').change(function () {
/*
* user_type values = user, professionista, care_giver
*/
var user_type = this.value;
if (user_type == 'care_giver') {
$('#terms').attr('href', "https://linkabili.it/termini-e-condizioni-chi-cerca-sostegno/");
// $('#terms').text("Termini e condizioni Care Givers");
} else {
$('#terms').attr('href', "https://linkabili.it/termini-e-condizioni-professionista/");
// $('#terms').text("Termini e condizioni Professionisti");
}
//< $('#terms').attr('href', '/terms-' + user_type);
$('.fields_medical_center, .fields_professionist, .fields_care_giver, .fields_other_istitution, .fields_care_giver_azienda').hide();
$('.fields_' + user_type).show();
});
$('.city').select2({
ajax: {
url: '/ajax/getCities',
method: "GET",
data: (params) => ({nome: params.term}),
processResults: (data) => ({results: data.map(elem => ({id: elem.id, text: elem.nome}))}),
cache: true
},
})
$.ajax({
url: '/ajax/ajaxGetPathology',
method: "GET",
dataType: 'json',
success: function (response, status) {
$('.pathology').empty().trigger("change");
$.each(response.data, function (key, val) {
newOption_website = new Option(decodeURIComponent(val.name), val.id, false, false);
$('.pathology').append(newOption_website);
});
},
complete: function (response, statue) {
if ((PATHOLOGY_CARE)) {
$('.pathology').val(PATHOLOGY_CARE).trigger("change")
}
if ((pathology_professionist)) {
$('.pathology').val(pathology_professionist).trigger("change")
}
if ((pathology_medical_center)) {
$('.pathology').val(pathology_medical_center).trigger("change")
}
if ((pathology_istitution)) {
$('.pathology').val(pathology_istitution).trigger("change")
}
}
});
$.ajax({
url: "/ajax/ajaxGetNotSpecializationProfession",
method: "GET",
dataType: 'json',
success: function (response, status) {
$('.profession').empty().trigger("change");
newOption_website = new Option('Seleziona...', '', true, true);
$('.profession').append(newOption_website);
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.profession').append(newOption_website);
});
},
complete: function (response, statue) {
if ((profession_professionist)) {
$('.profession').val(profession_professionist).trigger("change")
}
}
});
$.ajax({
url: "/ajax/ajaxGetProfession",
method: "GET",
dataType: 'json',
success: function (response, status) {
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.other_profession').append(newOption_website);
});
},
complete: function (response, statue) {
if ((other_profession_professionist)) {
$('.other_profession').val(other_profession_professionist).trigger("change")
}
if ((other_states_istitution)) {
$('.other_profession').val(other_states_istitution).trigger("change")
}
if ((other_states_other)) {
$('.other_states_other').val(other_states_other).trigger("change")
}
}
});
$('.profession').on("change", function (e, i) {
var id = ($(this).val());
$.ajax({
url: "/ajax/ajaxGetSpecialition/" + id,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('.specialization_professionist').empty().trigger("change");
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.specialization_professionist').append(newOption_website);
});
},
complete: function (response, statue) {
if ((specialization_professionist)) {
$('.specialization_professionist').val(specialization_professionist).trigger("change")
}
}
});
});
$.ajax({
url: '/ajax/ajaxGetStates',
method: "GET",
dataType: 'json',
success: function (response, status) {
$('.other_states').empty().trigger("change");
$('.other_states_other').empty().trigger("change");
console.log('daasdsa')
$.each(response.data, function (key, val) {
newOption_website = new Option(val.provincia, val.id, false, false);
$('.other_states').append(newOption_website);
newOption_website = new Option(val.provincia, val.id, false, false);
$('.other_states_other').append(newOption_website)
});
},
complete: function (response, statue) {
if ((other_states)) {
$('.other_states').val(other_states).trigger("change")
}
if ((other_states_other)) {
$('.other_states_other').val(other_states_other).trigger("change")
}
}
});
$.ajax({
url: '/ajax/ajaxGetStates',
method: "GET",
dataType: 'json',
success: function (response, status) {
newOption_website = new Option('Seleziona...', '', true, true);
$('.states').append(newOption_website);
$.each(response.data, function (key, val) {
newOption_website = new Option(val.sigla, val.id, false, false);
$('.states').append(newOption_website);
});
},
complete: function (response, statue) {
if ((state_care_givers)) {
$('.states').val(state_care_givers).trigger("change")
}
if ((states)) {
$('.states').val(states).trigger("change")
}
if ((states_medical_center)) {
$('.states').val(states_medical_center).trigger("change")
}
}
});
$.ajax({
url: "/ajax/ajaxGetEts",
method: "GET",
dataType: 'json',
success: function (response, status) {
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.ets').append(newOption_website);
});
},
complete: function (response, statue) {
if ((medical_center_ets)) {
$('.ets').val(medical_center_ets).trigger("change")
}
}
});
$.ajax({
url: "/ajax/ajaxGetMedicalCenters",
method: "GET",
dataType: 'json',
success: function (response, status) {
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.medical_center').append(newOption_website);
});
},
complete: function (response, statue) {
if ((medical_center)) {
$('.medical_center').val(medical_center).trigger("change")
}
}
});
$('.medical_center').on("change", function (e, i) {
var id = ($(this).val());
$.ajax({
url: "/ajax/ajaxGetSpecialitionMedicalCenter/" + id,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#specialization_medical_center').empty().trigger("change");
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('#specialization_medical_center').append(newOption_website);
});
},
complete: function (response, statue) {
if ((specialization_medical_center)) {
$('#specialization_medical_center').val(specialization_medical_center).trigger("change")
}
}
});
});
$.ajax({
url: '/ajax/ajaxGetService',
method: "GET",
dataType: 'json',
success: function (response, status) {
$('.services').empty().trigger("change");
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.services').append(newOption_website);
});
},
complete: function (response, statue) {
if ((services)) {
$('.services').val(services).trigger("change")
}
if ((services_medical_center)) {
$('.services').val(services_medical_center).trigger("change")
}
if ((services_istitution)) {
$('.services').val(services_istitution).trigger("change")
}
}
});
$.ajax({
url: '/ajax/ajaxGetCertification',
method: "GET",
dataType: 'json',
success: function (response, status) {
$('.certification').empty().trigger("change");
$.each(response.data, function (key, val) {
newOption_website = new Option(val.name, val.id, false, false);
$('.certification').append(newOption_website);
});
},
complete: function (response, statue) {
if ((certification_istitution)) {
$('.certification').val(certification_istitution).trigger("change")
}
if ((certification_medical_center)) {
$('.certification').val(certification_medical_center).trigger("change")
}
if ((certification_istitution)) {
$('.certification').val(certification_istitution).trigger("change")
}
}
});
$(".toggle_pwd").click(function () {
$(this).toggleClass("icofont-eye-blocked icofont-eye");
var type = $(this).hasClass("icofont-eye") ? "text" : "password";
$(".password").attr("type", type);
});
});
</script>
@if(!empty(session('user_type_error')) && session('user_type_error') == 'medical_center')
<script>
$(function () {
$('#user_type-medical_center').prop('checked', true).trigger('change');
// $('#text_type').text('Studio Medico o Studio Associato')
});
</script>
@elseif(!empty(session('user_type_error')) && session('user_type_error') == 'professionist')
<script>
$(function () {
$('#user_type-professionist').prop('checked', true).trigger('change');
// $('#text_type').text('Professionista')
});
</script>
@elseif(!empty(session('user_type_error')) && session('user_type_error') == 'other_istitution')
<script>
$(function () {
$('#user_type-other_istitution').prop('checked', true).trigger('change');
// $('#text_type').text('Associazioni e/o Cooperative')
});
</script>
@elseif(!empty(session('user_type_error')) && session('user_type_error') == 'care_giver_azienda')
<script>
$(function () {
$('#care_giver_azienda').prop('checked', true).trigger('change');
$('.label_caregiver').hide();
$('.label_other_istitution').hide();
$('.label_professionist').hide();
$('.label_medical_center').hide();
$('.fields_care_giver_azienda').show();
$('.select_care_giver_azienda').show();
});
</script>
@else
<script>
$(function () {
$('#user_type-care_giver').prop('checked', true).trigger('change');
//$('#text_type').text('Care Giver')
});
</script>
@endif
<script>
// This sample uses the Autocomplete widget to help the user select a
// place, then it retrieves the address components associated with that
// place, and then it populates the form fields with those details.
// This sample requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script
// src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
var placeSearch, autocomplete;
function addNewInitAutoComplete(count) {
autocomplete111111 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('first_care_giver_city_' + (counter - 1))), {
types: ['geocode']
});
// When the user selects an address from the dropdown, populate the address
// fields in the form.
autocomplete111111.addListener('place_changed', function () {
var place = autocomplete111111.getPlace();
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "locality") {
$('#first_care_giver_city_' + (counter - 1)).val(place.address_components[i].long_name);
}
}
});
}
function initAutocomplete() {
// Create the autocomplete object, restricting the search to geographical
// location types.
autocomplete = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('caregiver')), {
types: ['geocode']
});
// When the user selects an address from the dropdown, populate the address
// fields in the form.
autocomplete.addListener('place_changed', function () {
fillInAddress(autocomplete, "caregiver");
});
autocomplete2 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('professionist_work')), {
types: ['geocode']
});
autocomplete2.addListener('place_changed', function () {
fillInAddress(autocomplete2, "professionist_work");
});
autocomplete3 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('professionist_office')), {
types: ['geocode']
});
autocomplete3.addListener('place_changed', function () {
fillInAddress(autocomplete3, "professionist_office");
});
autocomplete4 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('medical_center_operative')), {
types: ['geocode']
});
autocomplete4.addListener('place_changed', function () {
fillInAddress(autocomplete4, "medical_center_operative");
});
autocomplete5 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('medical_center_legal')), {
types: ['geocode']
});
autocomplete5.addListener('place_changed', function () {
fillInAddress(autocomplete5, "medical_center_legal");
});
autocomplete6 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('other_istitution_operative')), {
types: ['geocode']
});
autocomplete6.addListener('place_changed', function () {
fillInAddress(autocomplete6, "other_istitution_operative");
});
autocomplete7 = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */
(document.getElementById('other_istitution_legal')), {
types: ['geocode']
});
autocomplete7.addListener('place_changed', function () {
fillInAddress(autocomplete7, "other_istitution_legal");
});
}
function fillInAddress(autocomplete, type) {
// Get the place details from the autocomplete object.
var place = autocomplete.getPlace();
console.log(place);
// Get each component of the address from the place details,
// and then fill-in the corresponding field on the form.
if (type == 'caregiver') {
caregiver(place);
}
if (type == 'professionist_work') {
professionist_work(place);
}
if (type == 'professionist_office') {
professionist_office(place);
}
if (type == 'medical_center_operative') {
medical_center_operative(place);
}
if (type == 'medical_center_legal') {
medical_center_legal(place);
}
if (type == 'other_istitution_operative') {
other_istitution_operative(place);
}
if (type == 'other_istitution_legal') {
other_istitution_legal(place);
}
}
function other_istitution_legal(place) {
console.log('other_istitution_legal');
console.log(place);
var number = '';
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "street_number") {
number = place.address_components[i].long_name;
}
if (addressType == "locality") {
$('#municipality_legal_istitution').val(place.address_components[i].long_name);
}
if (addressType == "route") {
$('#address_legal_istitution').val(place.address_components[i].long_name + ',' + number);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
console.log(response);
$('#state_legal_istitution').val(response.state.id).trigger("change");
},
});
}
}
}
function other_istitution_operative(place) {
console.log('other_istitution_operative');
console.log(place);
var number = '';
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "street_number") {
number = place.address_components[i].long_name;
}
if (addressType == "locality") {
$('#city_other_istitute').val(place.address_components[i].long_name);
}
if (addressType == "route") {
$('#address_istitution').val(place.address_components[i].long_name + ',' + number);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#state_istitution').val(response.state.id).trigger("change");
},
});
}
}
}
function medical_center_legal(place) {
var number = '';
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "street_number") {
number = place.address_components[i].long_name;
}
if (addressType == "locality") {
$('#municipality_legal_medical_center').val(place.address_components[i].long_name);
}
if (addressType == "route") {
$('#address_legal_medical_center').val(place.address_components[i].long_name + ',' + number);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#state_legal_medical_center').val(response.state.id).trigger("change");
},
});
}
}
}
function medical_center_operative(place) {
var number = '';
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "street_number") {
number = place.address_components[i].long_name;
}
if (addressType == "locality") {
$('#municipality_medical_center').val(place.address_components[i].long_name);
}
if (addressType == "route") {
$('#address_medical_center').val(place.address_components[i].long_name + ',' + number);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#state_medical_center').val(response.state.id).trigger("change");
},
});
}
}
}
function professionist_office(place) {
var number = ''
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "street_number") {
number = place.address_components[i].long_name;
}
if (addressType == "locality") {
$('#municipality_office_professionist').val(place.address_components[i].long_name);
}
if (addressType == "route") {
$('#address_office_professionist').val(place.address_components[i].long_name + ',' + number);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#state_office_professionist').val(response.state.id).trigger("change");
},
});
}
}
}
function professionist_work(place) {
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (addressType == "locality") {
$('#municipality_work_professionist').val(place.address_components[i].long_name);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#state_work_professionist').val(response.state.id).trigger("change");
},
});
}
}
}
function caregiver(place) {
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
console.log(addressType);
if (addressType == "locality") {
$('#municipality_caregiver').val(place.address_components[i].long_name);
$('#first_care_giver_city_N').val(place.address_components[i].long_name);
}
if (addressType == "administrative_area_level_2") {
console.log(place.address_components[i].short_name);
$.ajax({
url: '/ajax/ajaxGetStatesByShortName/' + place.address_components[i].short_name,
method: "GET",
dataType: 'json',
success: function (response, status) {
$('#state_care_givers').val(response.state.id).trigger("change");
},
});
}
}
}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key={{env('KEY_AUTO_COMPLETE_GOOGLE')}}&libraries=places&callback=initAutocomplete"
async defer></script>
<script>
$(function () {
var param = getUrlParameter('type');
if (typeof param != 'undefined') {
if (param == 'professionist' || param == 'professionista') {
$('#user_type-professionist').prop('checked', true).trigger('change');
// $('#text_type').text('Professionista')
// $('.label_caregiver').hide();
// $('.label_medical_center').hide();
// $('.label_other_istitution').hide();
}
if (param == 'terzosettore' || param == 'other_istitution') {
$('#user_type-other_istitution').prop('checked', true).trigger('change');
// $('#text_type').text('Associazioni e/o Cooperative')
// $('.label_medical_center').hide();
// $('.label_professionist').hide();
// $('.label_caregiver').hide();
}
if (param == 'centromedico' || param == 'medical_center') {
$('#user_type-medical_center').prop('checked', true).trigger('change');
// $('#text_type').text('Studio Medico o Studio Associato')
// $('.label_other_istitution').hide();
// $('.label_professionist').hide();
// $('.label_caregiver').hide();
}
if (param == 'cercosostegno' || param == 'care_giver') {
$('#user_type-care_giver').prop('checked', true).trigger('change');
// $('#text_type').text('Care Giver')
// $('.label_other_istitution').hide();
// $('.label_professionist').hide();
// $('.label_medical_center').hide();
}
if (param == 'care_giver_azienda') {
$('#care_giver_azienda').prop('checked', true).trigger('change');
$('.label_caregiver').hide();
$('.label_other_istitution').hide();
$('.label_professionist').hide();
$('.label_medical_center').hide();
$('.fields_care_giver_azienda').show();
$('.select_care_giver_azienda').show();
}
window.history.pushState('', '/', window.location.pathname)
}
});
</script>
@endpush
</script>