Promotion Backend v1
This commit is contained in:
parent
0ed47d3553
commit
f0da981737
43 changed files with 2765 additions and 45 deletions
|
|
@ -45,5 +45,8 @@ return [
|
|||
'invoice' => 'Rechnungen',
|
||||
'revenue' => 'Umsätze',
|
||||
'paycredit' => 'Einkaufsguthaben',
|
||||
'commissions' => 'Provisionen'
|
||||
'commissions' => 'Provisionen',
|
||||
'promotion' => 'Promotion',
|
||||
'my_promotions' => 'Meine Promotions'
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -22,4 +22,5 @@ return [
|
|||
],
|
||||
'payment_for_account' => 'Aufladung durch Mitgliedschaft',
|
||||
'user_order_deduction' => 'Abzug durch Bestellung',
|
||||
'user_order_return' => 'Rückführung durch Storno',
|
||||
];
|
||||
|
|
@ -212,6 +212,7 @@ return [
|
|||
'sales_partnership' => 'Vertriebspartnerschaft',
|
||||
'sales_partnership_message' => 'Vertriebspartnerschaft Hinweis',
|
||||
'tax_number' => 'Steuernummer',
|
||||
'tax_identification_number' => 'USt-ID Nummer'
|
||||
'tax_identification_number' => 'USt-ID Nummer',
|
||||
'user_promotion_url' => "Promotion Domain"
|
||||
],
|
||||
];
|
||||
|
|
|
|||
72
resources/views/admin/modal/promotion-product.blade.php
Normal file
72
resources/views/admin/modal/promotion-product.blade.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{!! Form::open(['url' => route('admin_promotion_detail', [$data['promotion_id']]), 'class' => 'modal-content form-prevent-multiple-submits', 'enctype' => 'multipart/form-data']) !!}
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
{{ __('Produkt') }} <span class="font-weight-light">hinzufügen / bearbeiten</span>
|
||||
<span class="font-weight-light">hinzufügen</span>
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="action" value="{{$data['action']}}">
|
||||
<input type="hidden" name="id" value="{{$data['id']}}">
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="country_ids" class="form-label">{{__('Produkt')}}</label>
|
||||
<select class="selectpicker" name="product_id" id="product_id" data-style="btn-light" data-live-search="true" required>
|
||||
{!! HTMLHelper::getProductsOptions([$value->product_id], true) !!}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('shipping', 1, $value->shipping, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Versandkosten für dieses Produkt berechnen</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('active', 1, $value->active, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Produkt aktiv</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('calcu_commission', 1, $value->calcu_commission, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Provision der User-Rolle vom Preis abziehen</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-12">
|
||||
<hr class="mt-0">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('own_price', 1, $value->own_price, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Neuer Preis (sonst wird der eingestellte Produktpreis genommen)</span>
|
||||
</label>
|
||||
{{ Form::text('price', $value->getFormattedPrice(), array('placeholder'=>__('Neuer Preis in Euro / Brutto'), 'class'=>'form-control', 'id'=>'price')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-12">
|
||||
<hr class="mt-0">
|
||||
|
||||
<label class="form-label" for="max_items">{{ __('Max. Produkte für diese Promotion') }}</label>
|
||||
{{ Form::text('max_items', $value->max_items, array('placeholder'=>__('Einheiten in Stück'), 'class'=>'form-control', 'id'=>'max_items')) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
|
||||
<button type="submit" class="btn btn-primary button-prevent-multiple-submits">{{__('save')}}</button>
|
||||
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
45
resources/views/admin/modal/promotion-products.blade.php
Normal file
45
resources/views/admin/modal/promotion-products.blade.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{!! Form::open(['url' => route('admin_payments_credit'), 'class' => 'modal-content form-prevent-multiple-submits', 'enctype' => 'multipart/form-data']) !!}
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
{{ __('Gutschrift') }}
|
||||
<span class="font-weight-light">hinzufügen</span>
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="action" value="{{$data['action']}}">
|
||||
<input type="hidden" name="id" value="{{$data['id']}}">
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-12">
|
||||
<label for="member_id" class="form-label">{{ __('Vertriebspartner auswählen') }}*</label>
|
||||
<select class="selectpicker" name="member_id" data-style="btn-light" data-live-search="true" required>
|
||||
{!! HTMLHelper::getMembersOptions(0, true) !!}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-12">
|
||||
<label class="form-label" for="credit">{{ __('Betrag') }} netto*</label>
|
||||
{{ Form::text('credit', '', array('placeholder'=>__('in Euro'), 'class'=>'form-control', 'required'=>true)) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-12">
|
||||
<label class="form-label" for="message">{{ __('Mitteilung') }}*</label>
|
||||
{{ Form::textarea('message', '' , array('placeholder'=>__('Mitteilung'), 'class'=>'form-control', 'rows'=>4, 'required'=>true)) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
|
||||
<button type="submit" class="btn btn-primary button-prevent-multiple-submits">{{__('Gutschrift hinzufügen')}}</button>
|
||||
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
46
resources/views/admin/promotion/detail.blade.php
Normal file
46
resources/views/admin/promotion/detail.blade.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
@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 Promotion') }}
|
||||
</h4>
|
||||
|
||||
{!! Form::open(['url' => route('admin_promotion_detail', $promotion->id), 'class' => 'form-horizontal']) !!}
|
||||
<input type="hidden" name="id" id="id" value="@if($promotion->id>0){{$promotion->id}}@else new @endif">
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit" name="action" value="save-promotion">{{ __('save') }}</button>
|
||||
<a href="{{ route('admin_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
@include('admin.promotion.form')
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit" name="action" value="save-promotion">{{ __('save') }}</button>
|
||||
<a href="{{ route('admin_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
{!! Form::close() !!}
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
150
resources/views/admin/promotion/form.blade.php
Normal file
150
resources/views/admin/promotion/form.blade.php
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
|
||||
<div class="card mb-2">
|
||||
|
||||
<h5 class="card-header">
|
||||
{{ __('Promotion') }}
|
||||
</h5>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group ">
|
||||
<label class="custom-control custom-checkbox float-right">
|
||||
{!! Form::checkbox('active', 1, $promotion->active, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">{{__('aktiv')}}</span>
|
||||
</label>
|
||||
<label class="form-label" for="name">{{ __('Promotionname / Titel') }}*</label>
|
||||
{{ Form::text('name', $promotion->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="type">{{ __('Promotiontyp') }}*</label>
|
||||
{{ Form::select('type', $promotion->promotionType, $promotion->type, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'type') ) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label" for="">Zusätzliches einkaufen</label>
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('shop', 1, $promotion->shop, ['class'=>'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Shop bei Promotion anzeigen</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-12">
|
||||
<label class="form-label" for="description">{{ __('Promotioninfo') }}</label>
|
||||
{{ Form::textarea('description', $promotion->description , array('placeholder'=>__('Interne Notiz'), 'class'=>'form-control', 'rows'=>2, 'id'=>'description')) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<label class="form-label" for="max_bugdet">{{ __('Max. gesamtes Budget für diese Promotion') }}</label>
|
||||
{{ Form::text('max_bugdet', $promotion->getFormattedMaxBugdet(), array('placeholder'=>__('Budget in Euro / Brutto'), 'class'=>'form-control', 'id'=>'max_bugdet')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<label class="form-label" for="max_items">{{ __('Max. gesamte Produkte für diese Promotion') }}</label>
|
||||
{{ Form::text('max_items', $promotion->max_items, array('placeholder'=>__('Einheiten in Stück'), 'class'=>'form-control', 'id'=>'max_items')) }}
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label"> </label><br>
|
||||
<i>Ist das Budget oder Einheiten erreicht, wird auf der Microseite keine Promotion mehr angezeigt.</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-3">
|
||||
<label class="form-label" for="from">{{ __('Promotion Datum ab') }}</label>
|
||||
{!! Form::text('from', $promotion->from, ['class'=>'form-control datepicker-base']) !!}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<label class="form-label" for="to">{{ __('Promotion Datum bis') }}</label>
|
||||
{!! Form::text('to', $promotion->to, ['class'=>'form-control datepicker-base']) !!}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="form-label"> </label><br>
|
||||
<i>Ist das ab oder bis Datum gesetzt wird die Promotion nur innerhalb dieses Zeitraumns angezeigt.</i>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card mb-2">
|
||||
<h5 class="card-header">
|
||||
{{ __('Produkte') }}
|
||||
</h5>
|
||||
@if($promotion->id > 0)
|
||||
|
||||
<div class="mt-3 ml-3">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="new"
|
||||
data-promotion_id="{{ $promotion->id }}"
|
||||
data-action="save-promotion_product"
|
||||
data-back="{{url()->current()}}"
|
||||
data-route="{{ route('modal_load') }}"><span class="far fa-plus-circle"></span> Produkt hinzufügen
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="card-body px-0">
|
||||
<div class="card-datatable table-responsive pt-0">
|
||||
<table class="datatables-style table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="max-width: 60px;"> </th>
|
||||
<th>{{__('Bild')}}</th>
|
||||
|
||||
<th>{{__('Produkt')}}</th>
|
||||
<th>{{__('Versandkosten') }}</th>
|
||||
<th>{{__('Provision') }}</th>
|
||||
<th>{{__('Neuer Preis')}}</th>
|
||||
<th>{{__('Preis B.') }}</th>
|
||||
<th>{{__('max. P.') }}</th>
|
||||
<th>{{__('verkauft P.') }}</th>
|
||||
<th>{{__('active') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($promotion->promotion_admin_products as $promotion_admin_products)
|
||||
<tr>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="{{ $promotion_admin_products->id }}"
|
||||
data-promotion_id="{{ $promotion->id }}"
|
||||
data-action="save-promotion_product"
|
||||
data-back="{{url()->current()}}"
|
||||
data-route="{{ route('modal_load') }}"><span class="fa fa-edit"></span></button>
|
||||
</td>
|
||||
<td>
|
||||
@if(count($promotion_admin_products->product->images))
|
||||
<img class="img-fluid" alt="" style="max-height: 80px" src="{{ route('product_image', [$promotion_admin_products->product->images->first()->slug]) }}">
|
||||
@endif
|
||||
</td>
|
||||
<td><a href="{{ route('admin_product_edit', [$promotion_admin_products->product->id]) }}">{{ $promotion_admin_products->product->name }}</a></td>
|
||||
<td>{!! get_active_badge($promotion_admin_products->calcu_commission) !!}</td>
|
||||
<td>{!! get_active_badge($promotion_admin_products->shipping) !!}</td>
|
||||
<td>{!! get_active_badge($promotion_admin_products->own_price) !!}</td>
|
||||
<td>{{ $promotion_admin_products->getFormattedRealPrice() }} €</td>
|
||||
<td>{{ $promotion_admin_products->max_items }}</td>
|
||||
<td>{{ $promotion_admin_products->used_items }}</td>
|
||||
<td>{!! get_active_badge($promotion_admin_products->active) !!}</td>
|
||||
<td><a class="text-danger" href="{{ route('admin_promotion_delete', [$promotion_admin_products->id, 'promotion_admin_product']) }}" onclick="return confirm('{{__('Produkt entfernen?')}}');"><i class="far fa-trash-alt"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
90
resources/views/admin/promotion/index.blade.php
Normal file
90
resources/views/admin/promotion/index.blade.php
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
@extends('layouts.layout-2')
|
||||
|
||||
@section('content')
|
||||
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
|
||||
<div>{{ __('navigation.promotion') }} / {{ __('navigation.overview') }}</div>
|
||||
<a href="{{route('admin_promotion_detail', ['new'])}}" class="btn btn-secondary rounded-pill d-block float-right"><span class="ion ion-md-add"></span> Neue Promotion anlegen</a>
|
||||
</h4>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
@foreach($values as $value)
|
||||
<div class="card mb-4">
|
||||
<div class="card-body d-flex justify-content-between align-items-start pb-2">
|
||||
<div>
|
||||
<a href="{{route('admin_promotion_detail', [$value->id])}}" class="text-body text-big font-weight-semibold">{{$value->name}}</a>
|
||||
</div>
|
||||
@if($value->canDelete())
|
||||
<div class="btn-group project-actions">
|
||||
<a href="{{ route('admin_promotion_delete', [$value->id, 'admin_promotion']) }}"
|
||||
class=" dropdown-item" onclick="return confirm('Promotion wirklich löschen?');">
|
||||
<span class="ion ion-md-trash text-danger"></span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress rounded-0" style="height: 2px;">
|
||||
<div class="progress-bar" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div class="card-body pt-3 pb-1">
|
||||
{{$value->description}}
|
||||
<hr>
|
||||
</div>
|
||||
<div class="card-body pt-0">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="text-muted small">Typ</div>
|
||||
<div class="font-weight-bold">{{$value->getPromotionType()}}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->promotion_admin_products->count()}}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">max Budget</div>
|
||||
<div class="font-weight-bold">{{ $value->getFormattedMaxBugdet() }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">max Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->max_items}}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Datum von</div>
|
||||
<div class="font-weight-bold">{{ $value->from }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Datum bis</div>
|
||||
<div class="font-weight-bold">{{ $value->to }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Aktiv</div>
|
||||
<div class="font-weight-bold">{!! get_active_badge($value->active) !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="m-0">
|
||||
<div class="card-body py-3">
|
||||
<div class="d-flex flex-wrap">
|
||||
<a href="{{route('admin_promotion_detail', [$value->id])}}" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Bearbeiten</a>
|
||||
<a href="{{route('admin_promotion_show', ['promotion', $value->id])}}" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-rocket"></i> User Promotions ansehen</a>
|
||||
{{--
|
||||
<a href="#" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-basket"></i> Bestellung ansehen (n.b!)</a>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<hr class="mt-0">
|
||||
<a href="{{route('admin_promotion_show', ['all'])}}" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-rocket"></i> Alle User Promotions ansehen</a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
76
resources/views/admin/promotion/show.blade.php
Normal file
76
resources/views/admin/promotion/show.blade.php
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
@extends('layouts.layout-2')
|
||||
|
||||
@section('content')
|
||||
|
||||
<h4 class="font-weight-bold py-2 mb-2">
|
||||
{{ __('navigation.promotion') }} /
|
||||
@if($by === 'promotion')
|
||||
{{ $promotion->name }} User Promotions
|
||||
@endif
|
||||
@if($by === 'all')
|
||||
Alle User Promotions
|
||||
@endif
|
||||
</h4>
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<a href="{{ route('admin_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatable-users table table-striped table-bordered">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{__('User')}}</th>
|
||||
<th>{{__('Name')}}</th>
|
||||
<th>{{__('aktive Produkte')}}</th>
|
||||
<th>{{__('geplant Produkte')}}</th>
|
||||
<th>{{__('geordert Produkte')}}</th>
|
||||
<th>{{__('Potentielle Kosten')}}</th>
|
||||
<th>{{__('User Guthaben')}}</th>
|
||||
<th>{{__('Kosten bisher')}}</th>
|
||||
<th>{{__('aktiv')}}</th>
|
||||
<th>{{__('Abholung')}}</th>
|
||||
<th>{{__('Gelöscht')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$('.datatable-users').dataTable({
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ajax": '{!! route('admin_promotion_datatable', [$by, $id]) !!}',
|
||||
"order": [[0, "desc" ]],
|
||||
"columns": [
|
||||
{data: 'id', name: 'id'},
|
||||
{ data: 'user', name: 'user', orderable: false, searchable: false },
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'products_active', name: 'products_active', orderable: false, searchable: false },
|
||||
{ data: 'count_open_items', name: 'count_open_items', orderable: false, searchable: false },
|
||||
{ data: 'count_sell_items', name: 'count_sell_items', orderable: false, searchable: false },
|
||||
{ data: 'user_promotion_cart_price', name: 'user_promotion_cart_price', orderable: false, searchable: false },
|
||||
{ data: 'user_credit', name: 'user_credit', orderable: false, searchable: false },
|
||||
{ data: 'user_promotion_sell_price', name: 'user_promotion_sell_price', orderable: false, searchable: false },
|
||||
{ data: 'active', name: 'active', searchable: false },
|
||||
{ data: 'pick_up', name: 'pick_up', searchable: false },
|
||||
{ data: 'user_delete', name: 'user_delete', orderable: false, searchable: false },
|
||||
],
|
||||
"bLengthChange": false,
|
||||
"iDisplayLength": 50,
|
||||
"language": {
|
||||
"url": "/js/German.json"
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
|
@ -39,7 +39,6 @@
|
|||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
@if(Auth::user()->isActiveAccount())
|
||||
<li class="sidenav-item @if(Request::is('user/team/*')) open @endif">
|
||||
<a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
|
||||
|
|
@ -85,6 +84,23 @@
|
|||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
{{-- TODO Remove isAdmin --}}
|
||||
@if(Auth::user()->isActiveAccount() && Auth::user()->isAdmin())
|
||||
<li class="sidenav-item @if(Request::is('user/promotions', '/user/promotion/*')) open @endif">
|
||||
<a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
|
||||
<i class="sidenav-icon ion ion-md-rocket"></i>
|
||||
<div>{{ __('navigation.my_promotions') }}</div>
|
||||
<div class="pl-1 ml-auto">
|
||||
<div class="badge badge-secondary">Admin</div>
|
||||
</div>
|
||||
</a>
|
||||
<ul class="sidenav-menu">
|
||||
<li class="sidenav-item{{ Request::is('user/promotions') ? ' active' : '' }}">
|
||||
<a href="{{ route('user_promotions') }}" class="sidenav-link"><i class="sidenav-icon ion-md-rocket"></i><div>{{ __('navigation.overview') }}</div></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->isAdmin())
|
||||
|
|
@ -153,6 +169,19 @@
|
|||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="sidenav-item @if(Request::is('admin/promotions', '/admin/promotion/*')) open @endif">
|
||||
<a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
|
||||
<i class="sidenav-icon ion ion-ios-rocket"></i>
|
||||
<div>{{ __('navigation.promotion') }}</div>
|
||||
</a>
|
||||
<ul class="sidenav-menu">
|
||||
<li class="sidenav-item{{ Request::is('admin/promotions') ? ' active' : '' }}">
|
||||
<a href="{{ route('admin_promotions') }}" class="sidenav-link"><i class="sidenav-icon ion-ios-rocket"></i><div>{{ __('navigation.overview') }}</div></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
{{--
|
||||
<li class="sidenav-item @if(Request::is('admin/sites/*')) open @endif">
|
||||
<a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
@if($user->isRenewalAccount())
|
||||
<div class="card w-100 mb-4">
|
||||
<h5 class="card-header">Deine Mitglidschaft wurde am {{ $user->nextRenewalAccount() }} verlängert.</h5>
|
||||
<h5 class="card-header">Deine Mitgliedschaft wurde am {{ $user->nextRenewalAccount() }} verlängert.</h5>
|
||||
<div class="card-body">
|
||||
@if($userHistoryPaymentOrder && $userHistoryPaymentOrder->status > 2)
|
||||
<h6 class="alert badge-{{$userHistoryPaymentOrder->getStatusColor()}}">Eine Zahlung wurde ausgeführt. Status: {{ trans('payment.status.'.$userHistoryPaymentOrder->getStatusType())}}</h6>
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
<div class="card w-100 mb-4">
|
||||
<h5 class="card-header">{{__('Mitgliedschaft')}} {{__('anpassen')}}</h5>
|
||||
<div class="card-body">
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitglidschaft bis zur nächsten Vertragsverlängerung, am {{ $user->nextRenewalAccount() }}, ändern.</h6>
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitgliedschaft bis zur nächsten Vertragsverlängerung, am {{ $user->nextRenewalAccount() }}, ändern.</h6>
|
||||
<p>Die restlichen Laufzeiten bleiben erhalten, erst mit der Verlängerung wird das geänderte Paket aktiv.</p>
|
||||
@include('user.membership._change')
|
||||
</div>
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
<div class="card w-100 mb-4">
|
||||
<h5 class="card-header">{{__('Mitgliedschaft')}} {{__('anpassen')}}</h5>
|
||||
<div class="card-body">
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitglidschaftsrolle bis zur nächsten Vertragsverlängerung ({{ $user->nextRenewalAccount() }}), ändern.
|
||||
<h6 class="d-block text-dark">Du kannst Deine Mitgliedschaftsrolle bis zur nächsten Vertragsverlängerung ({{ $user->nextRenewalAccount() }}), ändern.
|
||||
<br> <span class="small">Erst nach der Verlängerug ist die neue Rolle aktiv.</span>
|
||||
</h6>
|
||||
@include('user.membership._change_level')
|
||||
|
|
|
|||
17
resources/views/user/promotion/cart.blade.php
Normal file
17
resources/views/user/promotion/cart.blade.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<h5>
|
||||
Potentielle Kosten für diese Promotion:
|
||||
{{ formatNumber($user_promotion_cart['price_net']) }} € netto / {{ formatNumber($user_promotion_cart['price']) }} € inkl. MwSt.
|
||||
</h5>
|
||||
<p>Text ...</p>
|
||||
|
||||
@if(isset($checkPaymentCredit))
|
||||
@if($checkPaymentCredit === 'empty')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Du hast kein Guthaben aus Deinem Konto auf, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'okay')
|
||||
<h6 class="alert badge-success mt-3 py-2">Dein Guthaben ist für diese Promotion</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'not')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Dein Guthaben ist nicht ausreichend für diese Promotion, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
@endif
|
||||
47
resources/views/user/promotion/detail.blade.php
Normal file
47
resources/views/user/promotion/detail.blade.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
@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">
|
||||
<div>{{ __('navigation.my_promotions') }} / {{ __('bearbeiten') }}</div>
|
||||
</h4>
|
||||
|
||||
{!! Form::open(['url' => route('user_promotion_detail', $user_promotion->id), 'class' => 'form-horizontal', 'id'=>"user-promotion-form-validations"]) !!}
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit" name="action" value="save-user-promotion">Promotion {{ __('save') }}</button>
|
||||
<a href="{{ route('user_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
@include('user.promotion.form')
|
||||
|
||||
<div class="text-left mt-0 mb-2">
|
||||
<button type="submit" class="btn btn-submit" name="action" value="save-user-promotion">Promotion {{ __('save') }}</button>
|
||||
<a href="{{ route('user_promotions') }}" class="btn btn-default">{{ __('back') }}</a>
|
||||
</div>
|
||||
|
||||
{!! Form::close() !!}
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
341
resources/views/user/promotion/form.blade.php
Normal file
341
resources/views/user/promotion/form.blade.php
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
|
||||
<div class="card mb-2">
|
||||
<h5 class="card-header">
|
||||
{{ __('Promotion') }}
|
||||
</h5>
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12 {{ $errors->has('name') ? 'has-error' : '' }}">
|
||||
<label class="custom-control custom-checkbox float-right">
|
||||
{!! Form::checkbox('active', 1, $user_promotion->active, ['class' => 'custom-control-input']) !!}
|
||||
<span class="custom-control-label">{{ __('Promotion aktiv') }}</span>
|
||||
</label>
|
||||
<label class="form-label" for="name">Promotion Name vergeben*</label>
|
||||
{{ Form::text('name', $user_promotion->name, ['placeholder' => __('Promotion Name'), 'class' => 'form-control', 'id' => 'name', 'required' => true]) }}
|
||||
@if ($errors->has('name'))
|
||||
<span class="help-block">
|
||||
<strong>{{ $errors->first('name') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-12">
|
||||
<label class="form-label" for="description">Kurzbeschreibung (optional)</label>
|
||||
{{ Form::textarea('description', $user_promotion->description, ['placeholder' => __('Kurzbeschreibung'), 'class' => 'form-control', 'rows' => 2, 'id' => 'description']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Text...</p>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-8">
|
||||
<div class="input-group mt-2 mb-2 ">
|
||||
<span class="input-group-prepend">
|
||||
<div class="py-2 px-1">
|
||||
<strong>www.testemicht.jetzt/ </strong>
|
||||
</div>
|
||||
</span>
|
||||
{{ Form::text('user_promotion_url', $user_promotion->url, ['placeholder' => 'z.B. "thomas" oder "dani21" o.ä.', 'class' => 'form-control' . ($errors->has('user_promotion_url') ? ' is-invalid' : ''), 'id' => 'user_promotion_url', 'required' => true]) }}
|
||||
</div>
|
||||
@if ($errors->has('user_promotion_url'))
|
||||
<span class="invalid-feedback" style="display: inline-block;">
|
||||
<strong>{{ $errors->first('user_promotion_url') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="px-3 py-0 py-md-3">
|
||||
<div class="badge badge-success" style="display: none" id="user_promotion_url_success"><i
|
||||
class="fa fa-check"></i> ist noch frei</div>
|
||||
<div class="badge badge-danger" style="display: none" id="user_promotion_url_error"><i
|
||||
class="fa fa-times"></i> nicht verfügbar/Fehler</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="from-group mb-2 col-md-8">
|
||||
<label class="form-label">Vorschau Domain</label>
|
||||
{{ Form::text('preview_user_promotion_url', $user_promotion->getUrlPreview(), ['placeholder' => __('Vorschau Shop-Internet Adresse'), 'class' => 'form-control', 'id' => 'preview_user_promotion_url', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-sm-12">
|
||||
<hr>
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('pick_up', 1, $user_promotion->pick_up, ['class' => 'custom-control-input']) !!}
|
||||
<span class="custom-control-label">Kunden können bei mir persönlich abholen.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
<div class="card-body">
|
||||
<p>Text ...</p>
|
||||
<h5>
|
||||
Aktuelles Guthaben: {{ Auth::user()->getFormattedPaymentCredit() }} €
|
||||
<span class="text-muted small">(Guthaben aufladen unter: <a
|
||||
href="{{ route('user_order_my_delivery', ['me']) }}">Bestellungen aufgeben</a> -> Produkt
|
||||
Guthaben aufladen)</span>
|
||||
</h5>
|
||||
<style>
|
||||
table.table-product,
|
||||
table.table-product tr td,
|
||||
table.table-product tr th {
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.table-product tr.border-top td {
|
||||
border-top: 1px solid #b8b8b9;
|
||||
}
|
||||
|
||||
table.table-product tr.border-bottom td,
|
||||
table.table-product tr.border-bottom th {
|
||||
border-bottom: 1px solid #b8b8b9;
|
||||
}
|
||||
|
||||
|
||||
.btn-md-extra {
|
||||
padding: 0.3rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.5;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.md-btn-extra {
|
||||
width: calc(1.7rem + 2px) !important;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
.form-control.input-extra {
|
||||
padding: 0.28rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
min-height: calc(1.8rem + 2px);
|
||||
height: calc(1.8rem + 2px);
|
||||
width: 44px;
|
||||
}
|
||||
|
||||
.input-group-min-w {
|
||||
min-width: 102px;
|
||||
}
|
||||
|
||||
.img-extra {
|
||||
min-width: 55px;
|
||||
max-height: 160px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.default-style:not([dir=rtl]) div.card-datatable table.dataTable thead th:first-child, .default-style:not([dir=rtl]) div.card-datatable table.dataTable tbody td:first-child, .default-style:not([dir=rtl]) div.card-datatable table.dataTable tfoot th:first-child {
|
||||
padding-left: 0.6rem !important;
|
||||
}
|
||||
|
||||
.img-extra {
|
||||
min-width: 35px;
|
||||
max-height: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-product table-striped m-0" id="datatables-promotion-list" data-url="{{ route('user_promotion_load') }}" data-action="updateCart" data-user_promotion_id="{{ $user_promotion->id }}">
|
||||
<thead>
|
||||
<tr class="border-bottom">
|
||||
<th style="max-width: 60px;">Aktiv</th>
|
||||
<th>{{ __('Anzahl') }}</th>
|
||||
<th>{{ __('Produkt') }}</th>
|
||||
<th class="text-right">{{ __('Mein Preis netto') }}</th>
|
||||
<th class="text-right">{{ __('Mein Preis brutto') }}</th>
|
||||
<th class="text-right">{{ __('geordert') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user_promotion->promotion_admin->promotion_admin_products_active as $promotion_admin_product)
|
||||
<tr class="border-bottom">
|
||||
<td class="align-middle">
|
||||
<label class="custom-control custom-checkbox mt-2">
|
||||
{!! Form::checkbox('products_active['.$promotion_admin_product->id.']', 1, $promotion_admin_product->getPromotionUserProducts($user_promotion, 'active'),
|
||||
['class' => 'custom-control-input check-event-promotion-onchange', 'id'=>'product_check_'.$promotion_admin_product->id]) !!}
|
||||
<span class="custom-control-label"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="no-line-break input-group-min-w">
|
||||
<div class="input-group d-inline-flex w-auto">
|
||||
<span class="input-group-prepend">
|
||||
<button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-product-promotion" data-product-id="{{ $promotion_admin_product->id }}">-</button>
|
||||
</span>
|
||||
<input type="text" class="form-control text-center input-extra input-event-promotion-onchange"
|
||||
name="products_qty[{{ $promotion_admin_product->id }}]"
|
||||
id="product_qty_{{ $promotion_admin_product->id }}" data-product-id="{{ $promotion_admin_product->id }}"
|
||||
value="{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'open_items') }}">
|
||||
<input type="hidden" name="products_user[{{ $promotion_admin_product->id }}]" value="{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'id') }}">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary icon-btn md-btn-extra add-product-promotion" data-product-id="{{ $promotion_admin_product->id }}">+</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-3 py-2 align-middle">
|
||||
<div class="media align-items-center">
|
||||
@if ($promotion_admin_product->product)
|
||||
@if ($promotion_admin_product->product->images)
|
||||
@if ($image = $promotion_admin_product->product->images->first())
|
||||
<img src="{{ route('product_image', [$image->slug]) }}"
|
||||
class="d-block ui-w-80 mr-4" alt>
|
||||
@endif
|
||||
@endif
|
||||
<div class="media-body">
|
||||
<a href="{{ route('admin_product_edit', [$promotion_admin_product->product->id]) }}"
|
||||
class="d-block">{{ $promotion_admin_product->product->name }}
|
||||
<span
|
||||
class="text-muted">#{{ $promotion_admin_product->product->number }}</span></a>
|
||||
<small>
|
||||
<span class="text-muted">Inhalt: </span>
|
||||
{{ $promotion_admin_product->product->contents }}<br>
|
||||
<span class="text-muted">Gewicht: </span>
|
||||
{{ $promotion_admin_product->product->weight }} g<br>
|
||||
</small>
|
||||
<a href="" class="" data-modal="modal-lg" data-toggle="modal" data-target="#modals-load-content"
|
||||
data-id="{{ $promotion_admin_product->product->id }}"
|
||||
data-route="{{ route('modal_load') }}"
|
||||
data-action="user-order-show-product" data-view="customer">
|
||||
<div class=""><i class="ion ion-md-eye"></i></div></a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 nowrap text-right" style="">
|
||||
{{ $promotion_admin_product->getFormattedPriceWith(true) }} €
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 text-right" style="">
|
||||
{{ $promotion_admin_product->getFormattedPriceWith(false) }} €
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 text-right" style="">
|
||||
{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'sell_items') }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
<div class="card-body" id="holder_html_view_cart">
|
||||
@include('user.promotion.cart', ['user_promotion_cart'=> $user_promotion_cart, 'checkPaymentCredit' => $checkPaymentCredit] )
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="application/javascript">
|
||||
$(document).ready(function() {
|
||||
$.extend($.validator.messages, {
|
||||
required: "Dieses Feld ist ein Pflichtfeld.",
|
||||
maxlength: $.validator.format("Gib bitte maximal {0} Zeichen ein."),
|
||||
minlength: $.validator.format("Gib bitte mindestens {0} Zeichen ein."),
|
||||
rangelength: $.validator.format("Gib bitte mindestens {0} und maximal {1} Zeichen ein."),
|
||||
email: "Gib bitte eine gültige E-Mail Adresse ein.",
|
||||
url: "Gib bitte eine gültige URL ein.",
|
||||
date: "Bitte gib ein gültiges Datum ein.",
|
||||
number: "Gib bitte eine Nummer ein.",
|
||||
digits: "Gib bitte nur Ziffern ein.",
|
||||
equalTo: "Bitte denselben Wert wiederholen.",
|
||||
range: $.validator.format("Gib bitte einen Wert zwischen {0} und {1} ein."),
|
||||
max: $.validator.format("Gib bitte einen Wert kleiner oder gleich {0} ein."),
|
||||
min: $.validator.format("Gib bitte einen Wert größer oder gleich {0} ein."),
|
||||
creditcard: "Gib bitte eine gültige Kreditkarten-Nummer ein."
|
||||
});
|
||||
// Set up validator
|
||||
var message = 'Default error message';
|
||||
$('#user-promotion-form-validations').validate({
|
||||
rules: {
|
||||
'user_promotion_url': {
|
||||
required: true,
|
||||
remote: {
|
||||
url: "{{ route('user_promotion_load') }}",
|
||||
type: "post",
|
||||
data: {
|
||||
user_promotion_url: function() {
|
||||
return $(
|
||||
'#user-promotion-form-validations :input[name="user_promotion_url"]'
|
||||
).val();
|
||||
},
|
||||
action: 'validate_url'
|
||||
},
|
||||
encode: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
dataFilter: function(response) {
|
||||
response = $.parseJSON(response);
|
||||
console.log(response);
|
||||
$('#user_promotion_url_success').hide();
|
||||
$('#user_promotion_url_error').hide();
|
||||
if (response.success === true) {
|
||||
$('#user_promotion_url_success').show();
|
||||
$('#preview_user_promotion_url').val(response
|
||||
.preview_user_promotion_url);
|
||||
return true;
|
||||
} else {
|
||||
$('#user_promotion_url_error').show();
|
||||
message = response.errors.user_promotion_url;
|
||||
$('#preview_user_promotion_url').val('');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
errorPlacement: function errorPlacement(error, element) {
|
||||
$(element).parents('.form-group').find('.input-group').after(
|
||||
error.addClass('invalid-feedback d-block font-weight-bold')
|
||||
)
|
||||
},
|
||||
highlight: function(element) {
|
||||
if($(element).attr('required')){
|
||||
$(element).parent().find('button').removeClass('btn-success');
|
||||
$(element).parent().find('button').addClass('btn-danger');
|
||||
$(element).parent().find('button i').removeClass('fa-check');
|
||||
$(element).parent().find('button i').addClass('fa-times');
|
||||
$(element).removeClass('is-valid');
|
||||
$(element).addClass('is-invalid');
|
||||
}
|
||||
},
|
||||
unhighlight: function(element) {
|
||||
if($(element).attr('required')){
|
||||
$(element).removeClass('is-invalid');
|
||||
$(element).addClass('is-valid');
|
||||
$(element).parent().find('button').removeClass('btn-danger');
|
||||
$(element).parent().find('button').addClass('btn-success');
|
||||
$(element).parent().find('button i').removeClass('fa-times');
|
||||
$(element).parent().find('button i').addClass('fa-check');
|
||||
$(element).parents('.form-group').find('.is-invalid').removeClass('is-invalid');
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
messages: {
|
||||
required: "{{ __('This field is required.') }}",
|
||||
user_promotion_url: {
|
||||
email: "{{ __('Please enter a valid email address.') }}",
|
||||
remote: function() {
|
||||
return message;
|
||||
}
|
||||
},
|
||||
},
|
||||
onkeyup: function(element) {
|
||||
$(element).valid()
|
||||
},
|
||||
});
|
||||
|
||||
var iqPromotionCart = IqPromotionCart.init();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@section('scripts')
|
||||
<script src="{{ asset('/js/iq-promotion-cart.js') }}?v=2{{ get_file_last_time('/js/iq-promotion-cart.js') }}"></script>
|
||||
@endsection
|
||||
199
resources/views/user/promotion/index.blade.php
Normal file
199
resources/views/user/promotion/index.blade.php
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
@extends('layouts.layout-2')
|
||||
|
||||
@section('content')
|
||||
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
|
||||
<div>{{ __('navigation.my_promotions') }} / {{ __('navigation.overview') }}</div>
|
||||
<button type="button" class="btn btn-secondary rounded-pill d-block float-right" data-toggle="modal" data-target="#modals-new-user-promotion">
|
||||
<span class="ion ion-md-add"></span> Neue Promotion anlegen
|
||||
</button>
|
||||
</h4>
|
||||
|
||||
<p> Text ...</p>
|
||||
|
||||
<div class="card mb-3">
|
||||
<h5 class="card-header bg-white">
|
||||
<a href="#" class="" data-toggle="collapse" data-target="#collapsePromotionFaq" aria-expanded="false" aria-controls="collapsePromotionFaq">
|
||||
<i class="fa fa-caret-expand"></i> {{ __('Und so geht\'s / FAQs') }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="collapse" id="collapsePromotionFaq">
|
||||
<div class="px-4 py-3">
|
||||
<p>Text ...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
@foreach($values as $value)
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-body d-flex justify-content-between align-items-start pb-2">
|
||||
<div>
|
||||
<a href="{{route('user_promotion_detail', [$value->id])}}" class="text-body text-big font-weight-semibold">{{$value->name}}</a>
|
||||
</div>
|
||||
@if($value->canDelete())
|
||||
<div class="btn-group project-actions">
|
||||
<a href="{{ route('user_promotion_delete', [$value->id, 'user_promotion']) }}"
|
||||
class=" dropdown-item" onclick="return confirm('Promotion wirklich löschen?');">
|
||||
<span class="ion ion-md-trash text-danger"></span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress rounded-0" style="height: 2px;">
|
||||
<div class="progress-bar" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div class="card-body pt-3 pb-1">
|
||||
{{$value->description}}
|
||||
<hr>
|
||||
</div>
|
||||
<div class="card-body pt-0">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="text-muted small">Promotion Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->promotion_admin->promotion_admin_products_active->count()}}
|
||||
{{ formatPlural($value->promotion_admin->promotion_admin_products_active->count(), 'Sorte', 'n') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">aktive Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->promotion_user_products_active->count()}}
|
||||
{{ formatPlural($value->promotion_user_products_active->count(), 'Sorte', 'n') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">geplant Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->getCountOpenItems()}} Stk.</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">geordert Produkte</div>
|
||||
<div class="font-weight-bold">{{$value->getCountSellItems()}} Stk.</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="text-muted small">Promotion aktiv</div>
|
||||
<div class="font-weight-bold">{!! get_active_badge($value->active) !!}</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="text-muted small">persönliche Abholung</div>
|
||||
<div class="font-weight-bold">{!! get_active_badge($value->pick_up) !!}</div>
|
||||
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Potentielle Kosten</div>
|
||||
@php($user_promotion_cart = $value->calculateCart())
|
||||
<div class="font-weight-bold">{{ formatNumber($user_promotion_cart['price']) }} € brutto</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="text-muted small">Kosten bisher</div>
|
||||
@php($user_promotion_sell = $value->calculateSell())
|
||||
<div class="font-weight-bold">{{ formatNumber($user_promotion_sell['price']) }} € brutto</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
<div class="card-body py-3">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-10 mb-0">
|
||||
<label class="form-label">Domain / URL für Deine Promotion</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-prepend">
|
||||
<button class="btn btn-sm btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#promotion_link_{{$value->id}}"><i class="ion ion-ios-copy"></i> Domain kopieren</button>
|
||||
</span>
|
||||
<input type="text" class="form-control" name="promotion_link_{{$value->id}}" value="{{ $value->getUrlPreview() }}" id="promotion_link_{{$value->id}}" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-2 mb-0">
|
||||
<label class="form-label"> </label>
|
||||
<div>
|
||||
<a class="btn btn-sm btn-outline-primary mt-1" href="{{ $value->getUrlPreview() }}" target="_blank"><i class="ion ion-ios-share-alt"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php($checkPaymentCredit = $value->checkPaymentCredit())
|
||||
@if($checkPaymentCredit === 'empty')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Du hast kein Guthaben aus Deinem Konto auf, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'okay')
|
||||
<h6 class="alert badge-success mt-3 py-2">Dein Guthaben ist für diese Promotion</h6>
|
||||
@endif
|
||||
@if($checkPaymentCredit === 'not')
|
||||
<h6 class="alert badge-danger mt-3 py-2">Dein Guthaben ist nicht ausreichend für diese Promotion, lade Dein Konto auf, bis dahin ist die Promotion gestoppt.</h6>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<hr class="m-0">
|
||||
<div class="card-body py-3">
|
||||
<div class="d-flex flex-wrap">
|
||||
<a href="{{route('user_promotion_detail', [$value->id])}}" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Bearbeiten</a>
|
||||
{{--
|
||||
<a href="#" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-basket"></i> Promotions ansehen (n.b!)</a>
|
||||
<a href="#" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-md-basket"></i> Bestellung ansehen (n.b!)</a>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Modal template -->
|
||||
<div class="modal fade" id="modals-new-user-promotion">
|
||||
<div class="modal-dialog">
|
||||
<form class="modal-content" action="{{route('user_promotion_detail', ['new'])}}" method="post">
|
||||
@csrf
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Neue Promotion anlegen</span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="country_ids" class="form-label">Wähle die Art deiner Promotion</label>
|
||||
<select class="selectpicker" name="promotion_admin_id" id="promotion_admin_id" data-style="btn-light" data-live-search="true" required>
|
||||
{!! HTMLHelper::getAnyOptions(null, \App\Models\PromotionAdmin::getActiveAdminPromotionsAsArray(), true) !!}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{__('close')}}</button>
|
||||
<button type="submit" class="btn btn-primary" name="action" value="new-user-promotion">{{__('anlegen')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$( document ).ready(function() {
|
||||
var clipboardDemos = new ClipboardJS('[data-clipboard-demo]');
|
||||
clipboardDemos.on('success', function (e) {
|
||||
e.clearSelection();
|
||||
$(e.trigger).tooltip('enable').tooltip('show');
|
||||
});
|
||||
clipboardDemos.on('error', function (e) {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
});
|
||||
|
||||
$('button[data-clipboard-demo]').on('mouseout', function () {
|
||||
$(this).tooltip('disable');
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Loading…
Add table
Add a link
Reference in a new issue