@extends('backend.includes.panel') @section('page_css') @stop @section('page_title','Coupon') @section('inner_page_link') @stop @section('main_content')
@php $duration_value = ''; $duration_type = ''; $coupon_status = 'checked'; @endphp @if(isset($coupon)) {{ Form::model($coupon, ['route' => ['coupon.update',$coupon->id], 'method' => 'patch','class'=>'form-horizontal form-material','data-parsley-validate'=>'','autocomplete'=>'off']) }} @php $duration_parts = explode(' ',$coupon->duration); $coupon_status = ($coupon->status == 1 ? 'checked' : false); @endphp @if($duration_parts > 0) @php $duration_value = $duration_parts[0]; $duration_type = array_search($duration_parts[1],\Config::get('custom.coupon-duration')); @endphp @endif @else {{ Form::open(['route' => 'coupon.store','class'=>'form-horizontal form-material','data-parsley-validate'=>'','method'=>'POST','autocomplete'=>'off']) }} @endif

Coupon Details

Details of Coupon
Name {{ Form::text('name',Input::old('name'),['class'=>'form-control','placeholder'=>'Coupon Name','data-parsley-required'=>'true','autofocus'=>'true']) }} @if(isset($errors) && $errors->first('name')) {{ $errors->first('name') }} @endif
Code {{ Form::text('code',Input::old('code'),['class'=>'form-control','placeholder'=>'Coupon Code','data-parsley-required'=>'true']) }} @if(isset($errors) && $errors->first('code')) {{ $errors->first('code') }} @endif
Type {{ Form::select('type',\Config::get('custom.coupon-types'),Input::old('type'),['class'=>'form-control','placeholder'=>'Coupon Type','data-parsley-required'=>'true']) }} @if(isset($errors) && $errors->first('type')) {{ $errors->first('type') }} @endif
Usable Limit {{ Form::number('usable_limit',Input::old('usable_limit'),['class'=>'form-control','placeholder'=>'Usage Limit','data-parsley-required'=>'true','step'=>1,'min' => 1]) }} @if(isset($errors) && $errors->first('usable_limit')) {{ $errors->first('usable_limit') }} @endif

Coupon status

{{ Form::checkbox('status',1,null,['data-on-color'=>'info','data-off-color'=>'danger','checked'=>$coupon_status]) }}
{{ Form::close() }}
@stop @section('page_script') @stop