2019-09-19 11:22:54 +02:00
|
|
|
@extends('layout.app')
|
|
|
|
|
|
|
|
@section('center-area')
|
2019-09-19 12:20:48 +02:00
|
|
|
@parent
|
2019-09-25 17:46:19 +02:00
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Laravel Dependent Dropdown Tutorial With Example</title>
|
|
|
|
<link rel="stylesheet" href="{{asset('css/app.css')}}">
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
2019-09-19 12:20:48 +02:00
|
|
|
<h2>Dodaj Jednostkę</h2>
|
2019-09-24 18:05:37 +02:00
|
|
|
<form method="POST" action="/jednostka">
|
2019-09-19 11:22:54 +02:00
|
|
|
{{ csrf_field() }}
|
|
|
|
<div class="form-group">
|
2019-09-19 12:20:48 +02:00
|
|
|
<label for="name">Nazwa Jednostki:</label>
|
2019-09-19 11:22:54 +02:00
|
|
|
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2019-09-19 12:20:48 +02:00
|
|
|
<label for="name">Numer Jednostki:</label>
|
|
|
|
<input type="text" class="form-control" id="number" name="number" value="{{ old('number') }}">
|
2019-09-19 11:22:54 +02:00
|
|
|
</div>
|
2019-09-25 17:46:19 +02:00
|
|
|
|
2019-09-19 12:20:48 +02:00
|
|
|
<div class="form-group">
|
2019-09-25 17:46:19 +02:00
|
|
|
<label for="voivodeship">Województwo:</label>
|
|
|
|
<select name="voivodeship" class="form-control" style="width:250px">
|
|
|
|
<option value="">--- Wybierz województwo ---</option>
|
|
|
|
@foreach ($voivodeships as $key => $value)
|
|
|
|
<option value="{{ $key }}">{{ $value }}</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
2019-09-19 12:20:48 +02:00
|
|
|
</div>
|
2019-09-19 11:22:54 +02:00
|
|
|
<div class="form-group">
|
2019-09-25 17:46:19 +02:00
|
|
|
<label for="county">Powiat:</label>
|
|
|
|
<select name="county" class="form-control"style="width:250px">
|
|
|
|
<option>--Wybierz powiat--</option>
|
|
|
|
</select>
|
2019-09-19 12:20:48 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2019-09-25 17:46:19 +02:00
|
|
|
<label for="community">Gmina:</label>
|
|
|
|
<select name="community" class="form-control"style="width:250px">
|
|
|
|
<option>--Wybierz gminę--</option>
|
|
|
|
</select>
|
2019-09-19 11:22:54 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2019-09-19 12:20:48 +02:00
|
|
|
<label for="name">Urząd Pocztowy:</label>
|
|
|
|
<input type="text" class="form-control" id="postOffice" name="postOffice" value="{{ old('postOffice') }}">
|
2019-09-19 11:22:54 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2019-09-19 12:20:48 +02:00
|
|
|
<label for="name">Kod Pocztowy:</label>
|
|
|
|
<input type="text" class="form-control" id="zipCode" name="zipCode" value="{{ old('zipCode') }}">
|
2019-09-19 11:22:54 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2019-09-19 12:20:48 +02:00
|
|
|
<label for="name">Ulica:</label>
|
|
|
|
<input type="text" class="form-control" id="address" name="address" value="{{ old('address') }}">
|
2019-09-19 11:22:54 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2019-09-25 17:46:19 +02:00
|
|
|
<label for="name">Szerokość Geograficzna:</label>
|
2019-09-19 12:20:48 +02:00
|
|
|
<input type="text" class="form-control" id="latitude" name="latitude" value="{{ old('latitude') }}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">Długość Geograficzna:</label>
|
|
|
|
<input type="text" class="form-control" id="longitude" name="longitude" value="{{ old('longitude') }}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">KRS:</label>
|
|
|
|
<input type="text" class="form-control" id="KRS" name="KRS" value="{{ old('KRS') }}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">NIP:</label>
|
|
|
|
<input type="text" class="form-control" id="NIP" name="NIP" value="{{ old('NIP') }}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">Numer telefonu:</label>
|
|
|
|
<input type="text" class="form-control" id="phoneNumber" name="phoneNumber" value="{{ old('phoneNumber') }}">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">Email:</label>
|
|
|
|
<input type="email" class="form-control" id="email" name="email" value="{{ old('email') }}">
|
2019-09-19 11:22:54 +02:00
|
|
|
</div>
|
|
|
|
|
2019-09-25 17:46:19 +02:00
|
|
|
|
2019-09-19 11:22:54 +02:00
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
|
|
|
|
</div>
|
|
|
|
@include('inc.formerrors')
|
|
|
|
</form>
|
|
|
|
|
2019-09-25 17:46:19 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
jQuery(document).ready(function ()
|
|
|
|
{
|
|
|
|
jQuery('select[name="voivodeship"]').on('change',function(){
|
|
|
|
var voivodeshipID = jQuery(this).val();
|
|
|
|
if(voivodeshipID)
|
|
|
|
{
|
|
|
|
jQuery.ajax({
|
|
|
|
url : 'jednostka/getcounties/' +voivodeshipID,
|
|
|
|
type : "GET",
|
|
|
|
dataType : "json",
|
|
|
|
success:function(data)
|
|
|
|
{
|
|
|
|
//console.log(data);
|
|
|
|
jQuery('select[name="county"]').empty();
|
|
|
|
jQuery('select[name="county"]').append(new Option('--Wybierz powiat--', ''));
|
|
|
|
jQuery('select[name="community"]').empty();
|
|
|
|
jQuery.each(data, function(key,value){
|
|
|
|
$('select[name="county"]').append('<option value="'+ key +'">'+ value +'</option>');
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('select[name="county"]').empty();
|
|
|
|
$('select[name="community"]').empty();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
jQuery('select[name="county"]').on('change',function(){
|
|
|
|
var countyID = jQuery(this).val();
|
|
|
|
if(countyID)
|
|
|
|
{
|
|
|
|
jQuery.ajax({
|
|
|
|
url : 'jednostka/getcommunities/' +countyID,
|
|
|
|
type : "GET",
|
|
|
|
dataType : "json",
|
|
|
|
success:function(data)
|
|
|
|
{
|
|
|
|
//console.log(data);
|
|
|
|
jQuery('select[name="community"]').empty();
|
|
|
|
jQuery.each(data, function(key,value){
|
|
|
|
$('select[name="community"]').append('<option value="'+ key +'">'+ value +'</option>');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('select[name="community"]').empty();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
2019-09-19 11:22:54 +02:00
|
|
|
@stop
|