first commit

This commit is contained in:
Kevin Adametz 2021-01-08 17:48:20 +01:00
commit 0baac018a2
1011 changed files with 145854 additions and 0 deletions

View file

@ -0,0 +1,43 @@
@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Create/Edit Land') }}
</h4>
{!! Form::open(['url' => route('admin_country_store'), 'class' => 'form-horizontal', 'id'=>'']) !!}
<input type="hidden" name="id" id="id" value="@if($country->id>0){{$country->id}}@else new @endif">
<div class="text-left mt-0 mb-2">
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>&nbsp;
<a href="{{ route('admin_countries') }}" class="btn btn-default">{{ __('back') }}</a>
</div>
@include('admin.country.form')
<div class="text-left mt-0 mb-2">
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>&nbsp;
<a href="{{ route('admin_countries') }}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@endsection

View file

@ -0,0 +1,179 @@
<div class="card mb-2">
<h5 class="card-header">
{{ __('Land') }}
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $country->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('aktiv')}}</span>
</label>
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="de">{{ __('Name DE') }}*</label>
{{ Form::text('name', $country->de, array('placeholder'=>__('Land DE'), 'class'=>'form-control', 'id'=>'de', 'required')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="en">{{ __('Name EN') }}</label>
{{ Form::text('en', $country->en, array('placeholder'=>__('Land EN'), 'class'=>'form-control', 'id'=>'en')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="es">{{ __('Name ES') }}*</label>
{{ Form::text('es', $country->es, array('placeholder'=>__('Land ES'), 'class'=>'form-control', 'id'=>'es')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="fr">{{ __('Name FR') }}</label>
{{ Form::text('fr', $country->fr, array('placeholder'=>__('Land FR'), 'class'=>'form-control', 'id'=>'fr')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="it">{{ __('Name IT') }}</label>
{{ Form::text('it', $country->it, array('placeholder'=>__('Land IT'), 'class'=>'form-control', 'id'=>'it')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="ru">{{ __('Name RU') }}</label>
{{ Form::text('ru', $country->ru, array('placeholder'=>__('Land RU'), 'class'=>'form-control', 'id'=>'ru')) }}
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="code">Ländercode</label>
{{ Form::text('code', $country->code, array('placeholder'=>__('code'), 'class'=>'form-control', 'id'=>'code')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="phone">Telefonvorwahl</label>
{{ Form::text('phone', $country->phone, array('placeholder'=>__('phone'), 'class'=>'form-control', 'id'=>'phone')) }}
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
Anzeige und Währung
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-12">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('switch', 1, $country->switch, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">Land aus Auswahl auf der Webseite anzeigen (Länderwechsel)</span>
</label>
</div>
<div class="form-group col-sm-12">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('own_eur', 1, $country->own_eur, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">Land hat eigenen EURO Preis</span>
</label>
</div>
<div class="col-12">
<hr class="mt-0">
</div>
<div class="form-group col-sm-6">
<label class="form-label">Eigene Währung</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('currency', 1, $country->currency, ['class'=>'custom-control-input', 'id'=>'currency']) !!}
<span class="custom-control-label">Land hat eigene Währung<br>(Währung wird nur zuzsätzlich zum EUR angezeigt, bezahlt wird in EUR)</span>
</label>
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="currency_unit">Abkürzung der Währung</label>
{{ Form::text('currency_unit', $country->currency_unit, array('placeholder'=>__('CHF'), 'class'=>'form-control', 'id'=>'currency_unit')) }}
</div>
</div>
<div id="show_currency_calc" style="display: @if($country->currency) block @else none @endif">
<div class="form-row">
<div class="col-12">
<hr class="mt-0" >
</div>
<div class="form-group col-sm-6">
<label class="form-label">Umrechnungsfaktor zum EUR {{$country->currency_calc}}</label>
<div class="custom-controls-stacked">
<label class="custom-control custom-radio">
{!! Form::radio('currency_calc', 0, !$country->currency_calc, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">dient nur als Anzeigungshilfe, jeder Preis wird manuell angegeben</span>
</label>
<label class="custom-control custom-radio">
{!! Form::radio('currency_calc', 1, $country->currency_calc, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">berechnet den Preis automatisch</span>
</label>
</div>
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="currency_faktor">Faktor Währungen zum Euro (z.B. 1 Euro zu 1,07 CHF)</label>
{{ Form::text('currency_faktor', formatNumber($country->currency_faktor, 4), array('placeholder'=>__('1,07'), 'class'=>'form-control', 'id'=>'currency_faktor')) }}
</div>
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
{{trans('register.required_fields')}}
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-3">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('attr[tax_number]', 1, $country->getAttrByKey('tax_number'), ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('SteuerNr.')}}</span>
</label>
</div>
<div class="form-group col-sm-3">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('attr[tax_id_number]', 1, $country->getAttrByKey('tax_id_number'), ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('UST-ID')}}</span>
</label>
</div>
<div class="form-group col-sm-3">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('attr[taxable_sales]', 1, $country->getAttrByKey('taxable_sales'), ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('Umsatzsteuerpflichtig')}}</span>
</label>
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
{{ __('Übersetzungen') }}
</h5>
<div class="card-body">
@foreach($trans as $lang)
@if(!in_array($lang, ['en', 'de', 'es', 'fr', 'it', 'ru']))
<div class="form-row">
<div class="form-group col-12">
<label for="trans_name_{{$lang}}" class="form-label">{{__('Name')}} <strong style="text-transform: uppercase">{{$lang}}</strong></label>
{{ Form::text('trans_name['.$lang.']', $country->getLocated($lang), array('class'=>'form-control', 'id'=>'trans_name_'.$lang)) }}
</div>
</div>
@endif
@endforeach
</div>
</div>
<script type="application/javascript">
$( document ).ready(function() {
$('input#currency').on('change', function () {
if($(this).prop('checked')){
$('input#show_currency_calc').prop('checked', true);
$('#show_currency_calc').show('slow');
}else{
$('input#show_currency_calc').prop('checked', false);
$('#show_currency_calc').hide('slow');
}
});
});
</script>

View file

@ -0,0 +1,77 @@
@extends('layouts.layout-2')
@section('content')
<div class="card">
<h6 class="card-header">
{{__('Länder')}}
</h6>
<div class="card-datatable table-responsive">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('DE')}}</th>
<th>{{__('Code')}}</th>
<th>{{__('Phone')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Länderwechsel')}}</th>
<th>{{__('e. Preis')}}</th>
<th>{{__('e. Währung')}}</th>
<th>{{__('Kalkulation')}}</th>
</tr>
</thead>
<tbody>
@foreach($values as $value)
<tr>
<td data-sort="{{ $value->id }}">
<a href="{{route('admin_country_edit', [$value->id])}}" class="btn icon-btn btn-sm btn-primary">
<span class="far fa-edit"></span>
</a>
</td>
<td>{{ $value->de }}</td>
<td>{{ $value->code }}</td>
<td>{{ $value->phone }}</td>
<td data-sort="{{ $value->active }}">{!! get_active_badge($value->active) !!}</td>
<td data-sort="{{ $value->switch }}">{!! get_active_badge($value->switch) !!}</td>
<td data-sort="{{ $value->own_eur }}">{!! get_active_badge($value->own_eur) !!}</td>
<td data-sort="{{ $value->currency }}">{!! get_active_badge($value->currency) !!} {{$value->currency_unit}}</td>
<td data-sort="{{ $value->currency_calc }}">
@if($value->currency)
@if($value->currency_calc)
<span class="badge badge-secondary"><i class="fa fa-cogs"></i> {{$value->currency_faktor}} </span>
@else
<span class="badge badge-info"><i class="fa fa-edit"></i> {{$value->currency_faktor}} </span>
@endif
@else - @endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 ml-4">
{{--
<a href="{{route('admin_product_category_edit', ['new'])}}" class="btn btn-sm btn-primary">
{{__('Neue Kategorie erstellen')}}
</a>
--}}
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$('.datatables-style').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"order": [[ 0, "asc" ]],
"language": {
"url": "/js/German.json"
}
});
});
</script>
@endsection