Files
cheerstothe_season_2.0/resources/views/exports/reports.blade.php

202 lines
6.3 KiB
PHP
Raw Normal View History

2024-07-15 19:11:04 +05:30
<!DOCTYPE html>
<html>
<head>
<title>Report</title>
</head>
<body>
<h1>{{ $reportType }} Report</h1>
<!-- @if ($data->isEmpty())
<p>No data available</p>
@else -->
@if ($reportType === 'Total Subscribed')
<table>
<thead>
<tr>
<th>Sr No.</th>
<th>Subscription ID</th>
<th>User Name</th>
<th>State</th>
<th>Subscription Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $subscription)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $subscription->id }}</td>
<td>{{ $subscription->iamPrincipal->first_name ?? 'N/A' }} {{ $subscription->iamPrincipal->last_name ?? 'N/A' }} </td>
<td>{{ $subscription->iamPrincipal->state->name ?? 'N/A' }}</td>
<td>{{\Carbon\Carbon::parse($subscription->created_at)->format('m-d-Y H:i')}}</td>
</tr>
@endforeach
</tbody>
</table>
@elseif ($reportType === 'Total Users')
<table>
<thead>
<tr>
<th>Sr No.</th>
<th>Customer ID</th>
<th>Customer Name</th>
<th>State</th>
<th>Customer Join Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $user)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $user->id }}</td>
<td>{{ $user->first_name }} {{ $user->last_name }}</td>
<td>{{ $user->state->name }}</td>
<td>{{ \Carbon\Carbon::parse($user->created_at)->format('m-d-Y H:i') }}</td>
</tr>
@endforeach
</tbody>
</table>
@elseif ($reportType === 'Redemptions')
<table>
<thead>
<tr>
<th>Sr No.</th>
<th>Redemption ID</th>
<th>Restaurant Name</th>
<th>Customer Name</th>
<th>State</th>
<th>Redemption Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $redemption)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $redemption->id }}</td>
<td>{{ $redemption->restaurant->name }}</td>
<td>{{ $redemption->customer->first_name }} {{ $redemption->customer->last_name }}</td>
<td>{{ $redemption->customer->state->name }}</td>
<td>{{\Carbon\Carbon::parse($redemption->created_at)->format('m-d-Y H:i')}} </td>
</tr>
@endforeach
</tbody>
</table>
@elseif ($reportType === 'Redemptions for Specific Restaurants')
<table>
<thead>
<tr>
<th>Sr No.</th>
<th>Redemption ID</th>
<th>Restaurant Name</th>
<th>Customer Name</th>
<th>State</th>
<th>Redemption Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $redemption)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $redemption->id }}</td>
<td>{{ $redemption->restaurant->name }}</td>
<td>{{ $redemption->customer->first_name }} {{ $redemption->customer->last_name }}</td>
<td>{{ $redemption->customer->state->name }}</td>
<td>{{\Carbon\Carbon::parse($redemption->created_at)->format('m-d-Y H:i')}} </td>
</tr>
@endforeach
</tbody>
</table>
@elseif ($reportType === 'Subscriptions Cancelled')
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>State</th>
<th>Subscription Status</th>
<th>Subscription Cancel Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $item)
<tr>
<td>{{ $item->iamPrincipal->first_name }} {{ $item->iamPrincipal->last_name }}</td>
<td>{{ $item->iamPrincipal->email_address }}</td>
<td>{{ $item->iamPrincipal->state->name }}</td>
<td>{{ $item->subscription_status }}</td>
<td>{{ \Carbon\Carbon::parse($item->cancelled_at)->format('m-d-Y H:i') }}</td>
</tr>
@endforeach
</tbody>
</table>
@elseif ($reportType === 'Referrals Made')
<table>
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
<th>Phone Number</th>
<th>State</th>
<th>Referred Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $referral)
<tr>
<td>{{ $referral->id }}</td>
<td>{{ $referral->referredUser->first_name }} {{ $referral->referredUser->last_name }}</td>
<td>{{ $referral->referredUser->email_address }}</td>
<td>{{ $referral->referredUser->phone_number}}</td>
<td>{{ $referral->referredUser->state->name }}</td>
<td> {{ \Carbon\Carbon::parse($referral->referred_date_time)->format('m-d-Y H:i') }}</td>
</tr>
@endforeach
</tbody>
</table>
@elseif ($reportType === 'Referees Joined')
<table>
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
<th>Phone number</th>
<th>State</th>
<th>Referred Date Time</th>
</tr>
</thead>
<tbody>
@foreach($data as $referees)
<tr>
<td>{{$referees->id }}</td>
<td>{{ $referees->refeersUser->first_name }} {{ $referees->refeersUser->last_name }}</td>
<td>{{ $referees->refeersUser->email_address }}</td>
<td>{{ $referees->refeersUser->phone_number}}</td>
<td>{{ $referees->refeersUser->state->name }}</td>
<td> {{ \Carbon\Carbon::parse($referees->referred_date_time)->format('m-d-Y H:i') }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
<!-- @endif -->
</body>
</html>