Viewing file: index.blade.php (6.55 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.master')
@section('title') Service Rating @endsection
@section('content')
@component('components.breadcrumb')
@slot('li_1') Service @endslot
@slot('title')Rating List @endslot
@endcomponent
<div class="row">
<div class="col-lg-12">
<div class="card">
@if ($errors->any())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
<span class="each-error">{{ $error }} </span><br/>
@endforeach
</div>
@endif
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
<div class="card-body border border-dashed border-end-0 border-start-0">
<form method="POST" action="{{ route('rating.filter') }}">
@csrf
<div class="row g-3">
<div class="col-xxl-2 col-sm-3" style="max-height:40px;">
<div>
@php
$agent_dt = (isset($agent)) ? $agent : "all";
@endphp
@if(Auth::user()->is_agent == 1)
<input type="hidden" name="agent" value="{{ Auth::user()->id }}">
<input type="text" class="form-control" value="{{ Auth::user()->name }}" disabled>
@else
<select class="js-example-basic-single form-control"
name="agent" id="idAgent">
<option value="" disabled>Select Agent</option>
<option value="all" selected>All Agent</option>
@if(isset($agents))
@foreach($agents as $agent)
<option value="{{$agent->id}}">{{ $agent->name }}</option>
@endforeach
@endif
</select>
@endif
</div>
</div>
<!--end col-->
<div class="col-xxl-2 col-sm-4">
<div>
@php
$date_dt = (isset($date_range)) ? $date_range : "";
@endphp
<input type="text" class="form-control" data-provider="flatpickr"
data-date-format="d M, Y" data-range-date="true"
id="demo-datepicker" data-default-date="{{ $date_dt }}" name="date_range" placeholder="Select date">
</div>
</div>
<!--end col-->
<div class="col-xxl-1 col-sm-3">
<div>
<button type="submit" class="btn btn-primary w-100"> <i
class="ri-equalizer-fill me-1 align-bottom"></i>
Search
</button>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
</form>
</div>
<div class="card-body">
<div class="">
<table id="ratingTable" class="table nowrap dt-responsive align-middle table-hover table-bordered" style="width:100%">
<thead>
<tr>
@if(Auth::user()->is_agent !== 1)
<th>Agent ID</th>
<th>Agent Name</th>
@endif
<th>Token No.</th>
<th>Rating</th>
<th>DateTime</th>
</tr>
</thead>
<tbody>
@php
$i=1;
@endphp
@if(isset($ratings))
@foreach($ratings as $rating)
<tr>
@if(Auth::user()->is_agent !== 1)
<td> {{ $rating->agent_Data ? $rating->agent_Data->agent_id : 'N/A' }}</td>
<td> @php echo ( $rating->agent_Data ? $rating->agent_Data->name : 'N/A'); @endphp</td>
@endif
<td>{{ $rating->trans_id }}</td>
<td>@php echo ($rating->rating ? $rating->rating : 0); @endphp</td>
<td>{{ $rating->updated_at->setTimezone('Asia/Dhaka')->format('Y-m-d H:i:s') }}</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
@endsection
@section('script')
<script>
$(document).ready(function () {
$('#ratingTable').DataTable({
order: [],
dom: 'Bfrtip', // B = Buttons, f = filter, r = processing, t = table, i = info, p = pagination
buttons: [
{
extend: 'copyHtml5',
text: 'Copy'
},
{
extend: 'csvHtml5',
text: 'CSV'
},
{
extend: 'excelHtml5',
text: 'Excel'
},
// {
// extend: 'pdfHtml5',
// text: 'PDF'
// },
{
extend: 'print',
text: 'Print'
}
]
});
var agent_dt = "<?php echo $agent_dt; ?>";
$('#idAgent').val(agent_dt);
$('#idAgent').trigger('change.select2');
});
</script>
@endsection
|