@extends('admin.layouts.master') @section('content')

{{ trans('app.coupons') }}

@can('create', \App\Models\Coupon::class) {{ trans('app.add_coupon') }} @endcan
@can('massDelete', \App\Models\Coupon::class) @endcan @foreach ($coupons as $coupon) @can('massDelete', \App\Models\Coupon::class) @endcan @endforeach
{{ trans('app.name') }} {{ trans('app.code') }} {{ trans('app.restricted') }} {{ trans('app.value') }} {{ trans('app.starting_time') }} {{ trans('app.ending_time') }} {{ trans('app.option') }}
{{ $coupon->name }} @if ($coupon->ending_time < \Carbon\Carbon::now()) {{ strtoupper(trans('app.expired')) }} @elseif(!$coupon->isActive()) {{ strtoupper(trans('app.inactive')) }} @endif {{ $coupon->code }} {{ get_yes_or_no($coupon->customers_count || $coupon->promotion_zones_count) }} {{ $coupon->type == 'amount' ? get_formated_currency($coupon->value, 2, config('system_settings.currency.id')) : get_formated_decimal($coupon->value) . ' ' . trans('app.percent') }} {{ $coupon->starting_time ? $coupon->starting_time->toDayDateTimeString() : '' }} {{ $coupon->ending_time ? $coupon->ending_time->toDayDateTimeString() : '' }} @can('view', $coupon)   @endcan @can('update', $coupon)   @endcan @can('delete', $coupon) {!! Form::open(['route' => ['admin.promotion.coupon.trash', $coupon->id], 'method' => 'delete', 'class' => 'data-form']) !!} {!! Form::button('', ['type' => 'submit', 'class' => 'confirm ajax-silent', 'title' => trans('app.trash'), 'data-toggle' => 'tooltip', 'data-placement' => 'top']) !!} {!! Form::close() !!} @endcan

@can('massDelete', \App\Models\Coupon::class) {!! Form::open(['route' => ['admin.promotion.coupon.emptyTrash'], 'method' => 'delete', 'class' => 'data-form']) !!} {!! Form::button('', ['type' => 'submit', 'class' => 'confirm btn btn-default btn-flat ajax-silent', 'title' => trans('help.empty_trash'), 'data-toggle' => 'tooltip', 'data-placement' => 'right']) !!} {!! Form::close() !!} @else @endcan {{ trans('app.trash') }}

@foreach ($trashes as $trash) @endforeach
{{ trans('app.name') }} {{ trans('app.code') }} {{ trans('app.value') }} {{ trans('app.deleted_at') }} {{ trans('app.option') }}
{{ $trash->name }} {{ $trash->code }} @if ($trash->ending_time < \Carbon\Carbon::now()) ({{ trans('app.expired') }}) @endif {{ $trash->type == 'amount' ? get_formated_currency($trash->value, 2, config('system_settings.currency.id')) : get_formated_decimal($trash->value) . ' ' . trans('app.percent') }} {{ $trash->deleted_at->diffForHumans() }} @can('delete', $trash)   {!! Form::open(['route' => ['admin.promotion.coupon.destroy', $trash->id], 'method' => 'delete', 'class' => 'data-form']) !!} {!! Form::button('', ['type' => 'submit', 'class' => 'confirm ajax-silent', 'title' => trans('app.delete_permanently'), 'data-toggle' => 'tooltip', 'data-placement' => 'top']) !!} {!! Form::close() !!} @endcan
@endsection