@extends('layouts.app') @section('content')

Corridors

@if(Session::has('flash_message'))

{{ Session::get('flash_message') }}

@endif
Corridor Records
@if(count($page_data['fuel_applies_data'])) @foreach($page_data['fuel_applies_data'] as $value) {!! Form::open(['url' => '/admin/corridor/create','class' => 'form-vertical validateForm', 'files' => true]) !!} {!! Form::hidden('fuel_applies_id', encrypt($value->id), ['class' => 'm-wrap span12']) !!}
{!! Form::text('origin', $value->origin, ['class' => 'm-wrap span12']) !!} {!! $errors->first('origin', '

:message

') !!}
{!! Form::select('from_country', [$value->from => $value->from] , $value->from, ['class' => 'form-control arr span12 fromcontry-select-class']) !!} {!! $errors->first('from_country', '

:message

') !!}
{!! Form::text('destination', $value->destination, ['class' => 'm-wrap span12']) !!} {!! $errors->first('destination', '

:message

') !!}
{!! Form::select('to_country', [$value->to => $value->to], null, ['class' => 'form-control arr span12 tocountry-select-class']) !!}
{!! $errors->first('to_country', '

:message

') !!}
{!! Form::hidden('amount', ($value->combination_border_id != null) ? $value->combinationborder->amount : 0, ['id'=>'amountAddId','class' => 'form-control arr span12']) !!} {!! Form::select('border', [$value->border => $value->border], null, ['id'=>'borderAddId','class' => 'form-control arr span12']) !!}
{!! $errors->first('border', '

:message

') !!}
{!! Form::text('Km', $value->km, ['class' => 'm-wrap span12 kmcal-class']) !!} {!! $errors->first('Km', '

:message

') !!}
{!! Form::text('fuel_allowed', ($value->km/2), ['class' => 'm-wrap span12', 'readonly' => 'true']) !!} {!! $errors->first('fuel_allowed', '

:message

') !!}
{!! Form::text('allowance', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('allowance', '

:message

') !!}
{!! Form::text('days_to_border', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('days_to_border', '

:message

') !!}
{!! Form::select('type', [''=>'Type','import'=>'Import','export'=>'Export'], null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('type', '

:message

') !!}
{!! Form::text('bonus', ($value->combination_border_id != null) ? $value->combinationborder->amount * $value->km : 0, ['class' => 'm-wrap span12', 'id' => 'bonusAddId']) !!}
{!! Form::select('status', ['Inactive', 'Active'], null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('status', '

:message

') !!}
{!! Form::submit(isset($submitButtonText) ? $submitButtonText : 'Create', ['class' => 'btn green', 'style' => 'margin-top: 28%;']) !!}
{!! Form::close() !!} @endforeach @endif {!! Form::open(['url' => '/admin/corridor/create','id'=>'myform','class' => 'form-vertical validateForm', 'files' => true]) !!}
{!! Form::text('origin', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('origin', '

:message

') !!}
{!! Form::select('from_country', ['' => 'From Country'] + $page_data['country_from_list']->toArray() , null, ['id'=>'fromcountry','class' => 'form-control arr span12 fromcontry-select-class']) !!} {!! $errors->first('from_country', '

:message

') !!}
{!! Form::text('destination', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('destination', '

:message

') !!}
{!! Form::select('to_country', ['' => 'To Country'], null, ['id'=>'tocountry','class' => 'form-control arr span12 tocountry-select-class']) !!}
{!! $errors->first('to_country', '

:message

') !!}
{!! Form::select('border', ['' => 'Border'], null, ['id'=>'borderAddId','class' => 'form-control arr span12']) !!}
{!! $errors->first('border', '

:message

') !!}
{!! Form::text('Km', null, ['class' => 'm-wrap span12 kmcal-class']) !!} {!! $errors->first('Km', '

:message

') !!}
{!! Form::text('fuel_allowed', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('fuel_allowed', '

:message

') !!}
{!! Form::text('allowance', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('allowance', '

:message

') !!}
{!! Form::text('days_to_border', null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('days_to_border', '

:message

') !!}
{!! Form::select('type', [''=>'Type','import'=>'Import','export'=>'Export'], null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('type', '

:message

') !!}
{!! Form::text('bonus', null, ['id' => 'bonusAddId', 'class' => 'm-wrap span12']) !!}
{!! Form::select('status', ['Inactive', 'Active'], null, ['class' => 'm-wrap span12']) !!} {!! $errors->first('status', '

:message

') !!}
{!! Form::submit(isset($submitButtonText) ? $submitButtonText : 'Create', ['class' => 'btn green', 'style' => 'margin-top: 28%;']) !!}
{!! Form::close() !!}
@foreach($corridor as $item) @endforeach
OriginDestinationFrom CountryTo CountryBorderKmFuel AllowedDaysDays To BorderTypeBN/KMBonusUSDMZMZARStatusActions
{{ $item->origin }} {{ $item->destination }} {{ $item->from_country }} {{ $item->to_country }} {{ $item->border }} {{ $item->Km }} {{ $item->fuel_allowed }} {{ $item->allowance }} {{ $item->days_to_border }} {{ $item->type }} {{ ($item->combination_border_id != null && $item->combinationborder->currency_id != null) ? $item->combinationborder->currency->currency.''.number_format($item->combinationborder->amount, 2) : '' }} {{ $item->bonus }} @php $sum = 0; @endphp @foreach($item->corridorcharge as $c) @if($c->currency == 'USD') @php $sum += $c->amount; @endphp @endif @endforeach {{ $sum }} @php $sum = 0; @endphp @foreach($item->corridorcharge as $c) @if($c->currency == 'MZM') @php $sum += $c->amount; @endphp @endif @endforeach {{ $sum }} @php $sum = 0; @endphp @foreach($item->corridorcharge as $c) @if($c->currency == 'ZAR') @php $sum += $c->amount; @endphp @endif @endforeach {{ $sum }} {!! $item->status == 0 ? 'Inactive' : 'Active' !!} {!! Form::open([ 'method'=>'DELETE', 'url' => ['/admin/corridor', $item->id], 'style' => 'display:inline' ]) !!} {!! Form::button('', array( 'type' => 'submit', 'class' => 'btn red btn-xs', 'title' => 'Delete Corridor', 'onclick'=>'return confirm("Confirm delete?")' )) !!} {!! Form::close() !!}
@endsection