Store Customer, Store Booking details

This commit is contained in:
Kevin Adametz 2021-05-19 18:04:31 +02:00
parent b362b93bca
commit 6706d28f51
33 changed files with 1048 additions and 257 deletions

View file

@ -4,12 +4,6 @@
<style>
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn-xs {
line-height: 1.3em;
@ -32,40 +26,104 @@
.input-group-text {
padding: 0.438rem 0.475rem;
}
</style>
<div class="float-right mt-3">
<a href="{{route('customers')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
<a href="{{ make_old_url('/index.php/customer/'.$customer->id.'/edit') }}" class="btn btn-sm btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
</div>
<h4 class="font-weight-bold py-3 mb-1">
Kunden verwalten
</h4>
{!! Form::open(['url' => route('customer_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!}
<ul class="nav nav-sm nav-tabs nav-justified tabs-alt mb-3" id="top-nav-quick-jump">
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseCustomerDetail">
Kunde
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)" data-collapse="#collapseCustomerBooking">
Anfrage / Buchung
</a>
</li>
</ul>
{!! Form::open(['url' => route('customer_detail', [$id]), 'class' => 'form-horizontal', 'id'=>'customer-form-validation']) !!}
<input type="hidden" name="id" id="id" value="{{$id}}">
<!-- Kunde -->
@include('customer._detail_customer')
<!-- draft -->
<div class="card mb-2">
<div class="card-body row">
<div class="form-group col-sm-6">
<label class="form-label" for="customer_id">{{ __('Nr.') }}*</label>
{{ Form::text('id', $customer->id, array('placeholder'=>__('Nr.'), 'class'=>'form-control', 'id'=>'customer_id', 'readonly')) }}
</div>
</div>
</div>
<div class="text-left mt-3">
<button type="submit" name="action" value="saveAll" class="btn btn-submit">{{ __('save changes') }}</button>&nbsp;
<a href="{{route('customers')}}" class="btn btn-default">{{ __('zur Übersicht') }}</a>
<a href="{{ make_old_url('/index.php/customer/'.$customer->id.'/edit') }}" class="btn btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
@if($id !== "new" && $customer)
@include('customer._detail_booking')
@endif
<div class="float-right mt-3">
<a href="{{route('customers')}}" class="btn btn-sm btn-default">{{ __('zur Übersicht') }}</a>
<a href="{{ make_old_url('/index.php/customer/'.$customer->id.'/edit') }}" class="btn btn-sm btn-default float-right">{{ __('zurück ins CRM v2') }}</a>
</div>
{!! Form::close() !!}
<script>
$(document).ready(function() {
var collapseHashValue = null;
$('[rel="tooltip"]').tooltip({trigger: "hover"});
$('#top-nav-quick-jump .nav-link').on('click', function (e) {
e.preventDefault();
$('#top-nav-quick-jump .nav-link').removeClass('active');
$(this).addClass('active');
var collapse_id = $(this).data('collapse');
//console.log(collapse_id);
$(collapse_id).collapse('show');
// animate
$('html, body').animate({
scrollTop: $(collapse_id).parent('.card').offset().top
}, 300, function(){
// when done, add hash to url
// (default click behaviour)
window.location.hash = collapse_id;
});
});
$(".collapse").on('shown.bs.collapse', function (){
if(collapseHashValue){
$('a[data-collapse="#'+collapseHashValue+'"]').click();
collapseHashValue = null;
}
CookiesAddJSONValue('customer_collapse', $(this).attr('id'));
window.location.hash = "#"+$(this).attr('id');
});
$(".collapse").on('hidden.bs.collapse', function (){
CookiesRemoveJSONValue('customer_collapse', $(this).attr('id'));
});
function init_site(){
if(window.location.hash){
value = $(window.location.hash).attr('id');
if(value){
collapseHashValue = value;
CookiesAddJSONValue('customer_collapse', value);
}
}
var customer_collapses = Cookies.get('customer_collapse');
if (customer_collapses != null)
{
customer_collapses = JSON.parse(customer_collapses);
for (var customer_collapse in customer_collapses){
$("#"+customer_collapses[customer_collapse]).collapse("show");
}
}
}
init_site();
});
</script>