@extends('layouts.admin') @section('style') @parent @include('admin.components.create_voucher_series_style') @endsection @section('script') @include('admin.components.create_voucher_series_script', ['voucher_series',$voucher_series]) @endsection @section('content') @php $step = '1'; @endphp @component('admin.components.step_form_pages', ['post_url'=>$post_url, 'type'=>'voucher', 'voucher_series'=>$voucher_series, 'title'=> config('admin.create_voucher')['step_1']['title'] , 'step'=> $step ]) @php $form = config('admin.new_voucher')@endphp @php $id = 'image'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_100', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ])
@php $imgsrc = $voucher_series['image'] ?? old('image') ?? '' ; $link_array = explode('/',$imgsrc); $imgsrc2 = end($link_array); $last_array2 = explode('?',$imgsrc2); $imgsrc3 = reset($last_array2); @endphp {{-- --}}
@component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'title'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_100', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent {{-- @php $id = 'title2'; $hasError = $errors->has($id) @endphp--}} {{-- @component('admin.components.form_field_100', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ])--}} {{-- --}} {{-- @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent--}} {{-- @endcomponent--}} @php $id = 'voucher_type'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50', ['label'=>$form[$id]['label'], 'help'=>'redeem_guide','required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'promotion_type'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent
@php $id = 'redemption_period'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_100', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ])
@component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'use_by'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_100', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @php $use_by_opt = $voucher_series['use_by_date_option'] ?? old('use_by_date_option') ?? 'custom'; $use_by_opts = [ '14_days_after_download' => '14 days after a user has downloaded the voucher', 'custom_days_after_download' => 'Number of days after a user has downloaded the voucher', 'custom' => 'Custom date', 'midnight_daily' => 'Midnight daily', ]; @endphp
@foreach ($use_by_opts as $key => $opt)
@endforeach
@php $use_by_min = 1; $use_by_max = 365; $tid = 'use_by_date_days'; $hasError = $errors->has($tid); @endphp
Accepted range between {{$use_by_min}} - {{$use_by_max}} @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($tid) }}@endcomponent
Month/ Day/ Year Hour:Minute Period
@component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'redeem_max'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'max_usable_voucher'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'max_use'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent
@php $id = 'allow_download_after_expired'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50')
@component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'allow_download_after_used'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50')
@component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @php $id = 'max_download_per_series_per_user'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_50', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent
@php $id = 'tc'; $hasError = $errors->has($id) @endphp @component('admin.components.form_field_100', ['label'=>$form[$id]['label'], 'required'=>$form[$id]['req'], 'description'=>$form[$id]['descr'], 'hasError'=>$hasError ]) @component('admin.components.form_error_msg', ['hasError'=>$hasError]){{ $errors->first($id) }}@endcomponent @endcomponent @slot('footer_back') @if($voucher_series['series_id']) Back @endif @endslot @slot('footer_next') @if($voucher_series['series_id']) @else @endif @endslot @endcomponent @endsection