@extends('admin.layouts.app') @section('title', 'Passengers') @section('content') @include('admin.includes.alerts')
{!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'GET', 'route' => ['SMS All Passenger'])) !!} {!! Form::submit('SMS Passengers', array('class' => 'btn btn-sm btn-dark pull-right')) !!} {!! Form::close() !!}
@if(\Illuminate\Support\Facades\Auth::user()->role == 1 || \Illuminate\Support\Facades\Auth::user()->role == 2) @endif @foreach($passengers as $i => $passenger) @if(\Illuminate\Support\Facades\Auth::user()->role == 1 || \Illuminate\Support\Facades\Auth::user()->role == 2) @endif @endforeach
SN Full Name Mobile MNO Gender Frequency Collection Discount RegisteredCompanyAction
{{$i + $passengers->firstItem()}} {{$passenger->full_name}} {{$passenger->msisdn}} @php $number = substr($passenger->msisdn, 0, 5); $tigo_codes = array('25571', '25565', '25567'); $voda_codes = array('25576', '25575', '25574', '25566'); $airtel_codes = array('25578', '25568', '25569'); $ttcl_codes = array('25573'); $halotel_codes = array('25562'); if (in_array($number, $tigo_codes)) { $mno = 'TIGO'; } elseif (in_array($number, $voda_codes)) { $mno = 'VODACOM'; } elseif (in_array($number, $airtel_codes)) { $mno = 'AIRTEL'; } elseif (in_array($number, $ttcl_codes)) { $mno = 'TTCL'; } elseif (in_array($number, $halotel_codes)) { $mno = 'HALOTEL'; } else { $mno = 'NA'; } echo $mno; @endphp {{$passenger->gender}} {{$passenger->frequency}} {{$passenger->collection}} {{$passenger->discount}} {{$passenger->created_at}}{{ \App\Models\Company::where(['id' => $passenger->company])->first()->name }} @if($passenger->subscription == 1) {!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'GET', 'onsubmit' => "return confirm('".trans("Are sure you want to Deactivate Subscriber")."');", 'route' => ['Cancel Booking', $passenger->id])) !!} {!! Form::submit('Cancel', array('class' => 'btn btn-sm btn-danger')) !!} {!! Form::close() !!} @else {!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'GET', 'onsubmit' => "return confirm('".trans("Are sure you want to Enable Subscriber")."');", 'route' => ['Enable Booking', $passenger->id])) !!} {!! Form::submit('Enable', array('class' => 'btn btn-sm btn-success')) !!} {!! Form::close() !!} @endif
{{ $passengers->links() }}
@endsection