@extends('layouts.main')
@section('title', 'Auktionshäuser verwalten')
@section('headline', 'Auktionshäuser verwalten')
@section('content')

    {{--<div class="page-title">
        <h3 class="breadcrumb-header pull-left">@yield('headline')</h3>
    </div>--}}
    <div id="main-wrapper">
        <div class="row">
            <div class="col-md-12">

                {{--@if($alert == 'successDelete')
                    <div class="alert alert-success" role="alert">
                        Das Auktionshaus wurde erfolgreich gelöscht!
                    </div>
                @elseif($alert == 'errorDelete')
                    <div class="alert alert-danger" role="alert">
                        Beim Löschen das Auktionshauses ist ein Fehler aufgetreten!
                    </div>
                @elseif($alert == 'successCreate')
                    <div class="alert alert-success" role="alert">
                        Das Auktionshaus wurde erfolgreich angelegt!
                    </div>
                @elseif($alert == 'successUpdate')
                    <div class="alert alert-success" role="alert">
                        Das Auktionshaus wurde erfolgreich aktualisiert!
                    </div>
                @endif--}}
                <div class="panel panel-white">
                    <div class="panel-body">
                        <div class="table-responsive">
                            <div class="filter-container" id="filterContainer">
                                {!! Form::open(['action' => 'SourceTypes\SourceTypesOverviewController@index', 'class' => 'form-horizontal', 'id' => 'filterSourceTypesForm', 'method' => 'get', 'role' => 'form', 'files' => true]) !!}
                                <input name="filtered" id="filtered" type="hidden" value="1">
                                <input name="page" id="page" type="hidden" value="{{$page}}">
                                    <div id="pageLen" style="float: right; margin-left: 20px;">
                                        <input class="form-control" name="len" id="inputPageLen" type="text" value="@if($pageLength){{$pageLength}}@else{{auth()->user()->table_page_length}}@endif" style="float: left; width: 50px;"> <label style="float: right; padding: 7px 5px 0;">Einträge anzeigen</label>
                                    </div>
                                {!! Form::close() !!}
                            </div>
                            <div class="button-line" id="buttonLine">
                                <a class="btn btn-primary" href="{{ route('create-source-type') }}"><i class="menu-icon icon-plus"></i> Neues Auktionshaus</a>
                            </div>

                            {{$dataTable->table(['id' => 'data-table-source-types'])}}

                            <script>
                                $(function() {
                                    $.ajaxSetup({
                                        headers: {
                                            'X-CSRF-TOKEN': '{{csrf_token()}}'
                                        }
                                    });

                                    var editor = new $.fn.dataTable.Editor({
                                        ajax: "/auktionshaeuser",
                                        table: "#data-table-source-types",
                                        method: 'POST',
                                        //display: "bootstrap",
                                        idSrc:  'id',
                                        fields: [
                                            {label: "Name", name: "name"},
                                            {label: "Ort", name: "location"},
                                            //{label: "Domain", name: "url"}
                                        ]
                                    });

                                    $('#data-table-source-types').on('click', 'tbody td:not(:first-child)', function (e) {
                                        editor.inline(this);
                                    });

                                    {{$dataTable->generateScripts()}}

                                })
                            </script>

                            {!! Form::open(['action' => 'SourceTypes\SourceTypeController@destroy', 'class' => 'form-horizontal', 'id' => 'deleteSourceTypeForm', 'method' => 'post', 'role' => 'form', 'files' => true]) !!}
                                <input type="hidden" id="deleteSourceTypeId" name="source_type_id" value="">
                                <input type="hidden" id="deleteSourceTypeSortPage" name="source_type_sort_page" value="">
                                <input type="hidden" id="deleteSourceTypeSortLength" name="source_type_sort_length" value="">
                                <input type="hidden" id="deleteSourceTypeSortColumn" name="source_type_sort_column" value="">
                                <input type="hidden" id="deleteSourceTypeSortDirection" name="source_type_sort_direction" value="">
                            {!! Form::close() !!}

                        </div>

                        <p>* Spalte editierbar</p>
                    </div>


                </div>

            </div>
        </div><!-- Row -->
    </div><!-- Main Wrapper -->


@stop
