@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 ])
In-store Vouchers
E-Commerce/Partner Promo Code
Physical Item (Delivery)
Cash Voucher (Fund Transfer)
@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 ])
Purchase with Purchase (PWP)
Percentage Off
Money Off
Free Gift
@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)
{{$opt}}
@endforeach
@php
$use_by_min = 1;
$use_by_max = 365;
$tid = 'use_by_date_days';
$hasError = $errors->has($tid);
@endphp
@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'])
Save Step
@else
Next Step
@endif
@endslot
@endcomponent
@endsection