01 2020
This commit is contained in:
parent
bed91c4f4a
commit
c8948338bb
122 changed files with 7911 additions and 1639 deletions
|
|
@ -56,6 +56,23 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row align-items-center">
|
||||
<div class="col-md-6 mb-4">
|
||||
<label class="form-label" for="travel_option_country_id">Filter Reiseland</label>
|
||||
<select class="custom-select" name="travel_option_country_id" id="travel_option_country_id">
|
||||
<option value="">Filter aus</option>
|
||||
@foreach($travel_countries as $id=>$name)
|
||||
<option value="{{$id}}">{{$name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-4">
|
||||
<label class="form-label" for="travel_option_agenda_id">Filter Programm</label>
|
||||
<select class="custom-select" name="travel_option_agenda_id" id="travel_option_agenda_id">
|
||||
<option value="">Filter aus</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row align-items-center">
|
||||
<div class="col-5 col-sm-2 mb-4">
|
||||
<label class="form-label">LeadID</label>
|
||||
|
|
@ -76,7 +93,7 @@
|
|||
</div>
|
||||
<div class="col-2 col-sm-2 mb-4 mt-4">
|
||||
<a href="{{ route('requests') }}" class="btn icon-btn btn-sm btn-outline-dark float-right">
|
||||
<span class="far fa-sync"></span>
|
||||
<span class="fa fa-sync"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -99,8 +116,8 @@
|
|||
<th>{{__('Vorname')}}</th>
|
||||
<th>{{__('Nachname')}}</th>
|
||||
<th>{{__('BookingID')}}</th>
|
||||
<th>{{__('Land')}}</th>
|
||||
<th>{{__('Reise')}}</th>
|
||||
<th>{{__('Reiseland')}}</th>
|
||||
<th>{{__('Programm')}}</th>
|
||||
<th>{{__('Anreise')}}</th>
|
||||
<th>{{__('Abreise')}}</th>
|
||||
<th>{{__('Reiseunterlage')}}</th>
|
||||
|
|
@ -115,6 +132,8 @@
|
|||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('#travel_option_agenda_id').prop('disabled', true);
|
||||
|
||||
var table = $('#datatables-requests').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
|
|
@ -136,6 +155,8 @@
|
|||
d.full_lead_id_search = $('input[name=full_lead_id_search]').val();
|
||||
d.full_booking_id_search = $('input[name=full_booking_id_search]').val();
|
||||
d.travel_option_search = $('select[name=travel_option_search]').val();
|
||||
d.travel_option_country_id = $('select[name=travel_option_country_id]').val();
|
||||
d.travel_option_agenda_id = $('select[name=travel_option_agenda_id]').val();
|
||||
}
|
||||
},
|
||||
"columns": [
|
||||
|
|
@ -144,7 +165,7 @@
|
|||
{ data: 'participant_firstname', name: 'participant_firstname' },
|
||||
{ data: 'participant_name', name: 'participant_name' },
|
||||
{ data: 'id', name: 'id' },
|
||||
{ data: 'travel_country_id', name: 'travel_country_id', orderable: false },
|
||||
{ data: 'travel_country_id', name: 'travel_country_id', orderable: false },
|
||||
{ data: 'travelagenda_id', name: 'travelagenda_id', orderable: false },
|
||||
{ data: 'start_date', name: 'start_date' },
|
||||
{ data: 'end_date', name: 'end_date' },
|
||||
|
|
@ -162,43 +183,6 @@
|
|||
},
|
||||
|
||||
initComplete: function () {
|
||||
this.api().columns(4).every( function () {
|
||||
var column = this;
|
||||
var title = $(column.header()).html();
|
||||
var select = $('<select class="selectpicker"><option value="">'+title+'</option></select>')
|
||||
.appendTo( $(column.header()).empty() )
|
||||
.on( 'change', function () {
|
||||
$('input[name=sort_travel_country_id]').val($(this).val());
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
} );
|
||||
column.data().unique().sort().each( function ( d, j ) {
|
||||
if(d !== ""){
|
||||
var text = $(d+' span').text();
|
||||
if(text != "" && text != "-"){
|
||||
select.append( '<option value="'+$(d).data('order')+'">'+ $(d+' span').text()+'</option>' );
|
||||
}
|
||||
}
|
||||
} );
|
||||
} );
|
||||
this.api().columns(5).every( function () {
|
||||
var column = this;
|
||||
var title = $(column.header()).html();
|
||||
var select = $('<select class="selectpicker"><option value="">'+title+'</option></select>')
|
||||
.appendTo( $(column.header()).empty() )
|
||||
.on( 'change', function () {
|
||||
$('input[name=sort_travelagenda_id]').val($(this).val());
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
} );
|
||||
column.data().unique().sort().each( function ( d, j ) {
|
||||
if(d !== ""){
|
||||
var text = $(d+' span').text();
|
||||
if(text != "" && text != "-"){
|
||||
select.append( '<option value="'+$(d).data('order')+'">'+ $(d+' span').text()+'</option>' );
|
||||
}
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
this.api().columns(8).every( function () {
|
||||
var column = this;
|
||||
var title = $(column.header()).html();
|
||||
|
|
@ -210,7 +194,6 @@
|
|||
} );
|
||||
column.data().unique().sort().each( function ( d, j ) {
|
||||
if(d !== ""){
|
||||
console.log($(d).data('order'));
|
||||
var text = $(d).data('order') ? "Ja" : "Nein";
|
||||
if(text != "" && text != "-"){
|
||||
select.append( '<option value="'+$(d).data('order')+'">'+ text+'</option>' );
|
||||
|
|
@ -237,27 +220,76 @@
|
|||
}
|
||||
} );
|
||||
} );
|
||||
$('.selectpicker').selectpicker();
|
||||
},
|
||||
drawCallback: function () {
|
||||
|
||||
console.log($('#travel_option_agenda_id').prop('disabled'));
|
||||
//only when is disabled, refesh list is load by other filter.
|
||||
if($('#travel_option_agenda_id').prop('disabled')) {
|
||||
var data = table.ajax.params();
|
||||
//console.log(data);
|
||||
var url = '{!! route( 'data_ajax_requests' ) !!}';
|
||||
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
contentType: contentType,
|
||||
encode: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
var select = $('#travel_option_agenda_id');
|
||||
select.empty().append('<option value="">Filter aus</option>');
|
||||
console.log(select);
|
||||
$.each(data, function (i, item) {
|
||||
select.append('<option value="' + i + '">' + item + '</option>');
|
||||
});
|
||||
$('#travel_option_agenda_id').prop('disabled', false);
|
||||
},
|
||||
error: function (xhr, status, errorThrown) {
|
||||
console.log(xhr);
|
||||
console.log(xhr.responseText);
|
||||
console.log(errorThrown);
|
||||
console.log("Sorry, there was a problem!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.selectpicker').selectpicker();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function clearTravelOptionAgenda(){
|
||||
$('#travel_option_agenda_id').empty().prop('disabled', true);
|
||||
}
|
||||
|
||||
$('#travel_option_search').on('change', function(){
|
||||
if($(this).val() != ""){
|
||||
if($(this).val() !== ""){
|
||||
$('.datepicker-base').removeClass('active');
|
||||
$('.datepicker-base').addClass('deactive');
|
||||
$(this).removeClass('deactive');
|
||||
$(this).addClass('active');
|
||||
$('.datepicker-base').val(null);
|
||||
|
||||
}else{
|
||||
$('.datepicker-base').removeClass('deactive');
|
||||
$(this).removeClass('active');
|
||||
}
|
||||
clearTravelOptionAgenda();
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
});
|
||||
|
||||
$('#travel_option_country_id').on('change', function(){
|
||||
clearTravelOptionAgenda();
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
});
|
||||
|
||||
$('#travel_option_agenda_id').on('change', function(){
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
// console.log($(this).val());
|
||||
// console.log($(this).attr('name'));
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -272,16 +304,14 @@
|
|||
$('.datepicker-base').removeClass('active');
|
||||
$('#travel_option_search').removeClass('deactive');
|
||||
}
|
||||
clearTravelOptionAgenda();
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
// console.log($(this).val());
|
||||
// console.log($(this).attr('name'));
|
||||
});
|
||||
|
||||
|
||||
$('.full_search').on('keyup', function(){
|
||||
clearTravelOptionAgenda();
|
||||
table.order( [ 3, 'desc' ] ).draw();
|
||||
// console.log($(this).val());
|
||||
// console.log($(this).attr('name'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue