Files
CKB/resources/views/dealer_recap.blade.php

155 lines
7.7 KiB
PHP
Executable File

@extends('layouts.backapp')
@section('content')
<div class="row">
<div class="col-12">
<div class="kt-portlet kt-portlet--mobile" id="kt_blockui_datatable">
<div class="kt-portlet__head kt-portlet__head--lg">
<div class="kt-portlet__head-label">
<span class="kt-portlet__head-icon">
<i class="kt-font-brand flaticon2-line-chart"></i>
</span>
<h3 class="kt-portlet__head-title">
Laporan {{ $dealer->name }}
</h3>
</div>
<div class="kt-portlet__head-toolbar">
<div class="kt-portlet__head-wrapper">
<div class="kt-portlet__head-actions mt-4">
<form action="{{ route('dealer_recap', $dealer->id) }}" method="get">
<div class="form-group row">
{{-- <div class="col-2">
<label><b>Bulan</b></label>
</div> --}}
<div class="col-6">
<label for="month">Bulan</label>
<select name="month" id="month" class="form-control">
<option value="01" @if($month == '01') selected @endif>Januari</option>
<option value="02" @if($month == '02') selected @endif>Februari</option>
<option value="03" @if($month == '03') selected @endif>Maret</option>
<option value="04" @if($month == '04') selected @endif>April</option>
<option value="05" @if($month == '05') selected @endif>Mei</option>
<option value="06" @if($month == '06') selected @endif>Juni</option>
<option value="07" @if($month == '07') selected @endif>Juli</option>
<option value="08" @if($month == '08') selected @endif>Agustus</option>
<option value="09" @if($month == '09') selected @endif>September</option>
<option value="10" @if($month == '10') selected @endif>Oktober</option>
<option value="11" @if($month == '11') selected @endif>November</option>
<option value="12" @if($month == '12') selected @endif>Desember</option>
</select>
</div>
<div class="col-4">
<label for="year">Tahun</label>
<input type="number" class="form-control" name="year" id="year" value="{{ $year }}">
</div>
<div class="col-2">
<br>
<button class="btn btn-primary mt-2">Cari</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="kt-portlet__body">
<!--begin: Datatable -->
<table class="table table-responsive table-striped table-bordered table-hover table-checkable" id="kt_table">
<thead>
<tr>
<th rowspan="2" style="width: 17%;">Tanggal</th>
<th colspan="{{ $works_count }}" class="text-center">Pekerjaan</th>
</tr>
<tr>
@foreach ($works as $work)
<th>{{ $work->name }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($trxs as $trx)
<tr>
<td>{{ $trx['date'] }}</td>
@foreach ($trx['works'] as $item)
<td>{{ $item['qty'] }}</td>
@endforeach
</tr>
@endforeach
{{-- <tr>
<td>Pt B</td>
<td>2</td>
<td>9</td>
<td>9</td>
<td><a href="#" class="btn btn-info btn-sm">Detail</a></td>
</tr> --}}
</tbody>
<tfoot style="background: #C5CEFF !important;">
<tr>
<th style="background: #C5CEFF !important;">
<p>Total Bulan Ini</p><hr>
<p>Total Bulan Kemarin</p>
</th>
@foreach ($totals as $total)
<th style="background: #C5CEFF !important;">
<p>{{ $total['now'] }} @if($total['now'] > $total['prev']) <i class="ml-3 fa fa-caret-up text-success"></i> @else <i class="ml-3 fa fa-caret-down text-danger"></i> @endif</p><hr>
<p>{{ $total['prev'] }}</p>
</th>
@endforeach
</tr>
</tfoot>
</table>
<!--end: Datatable -->
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="kt-portlet kt-portlet--mobile" id="kt_blockui_datatable">
<div class="kt-portlet__head kt-portlet__head--lg">
<div class="kt-portlet__head-label">
<span class="kt-portlet__head-icon">
<i class="kt-font-brand flaticon2-line-chart"></i>
</span>
<h3 class="kt-portlet__head-title">
Laporan {{ $dealer->name }}
</h3>
</div>
</div>
<div class="kt-portlet__body">
<!--begin: Datatable -->
<table class="table table-responsive table-striped table-bordered table-hover table-checkable" id="kt_table">
<thead>
<tr>
<th rowspan="2">SA</th>
<th colspan="{{ $works_count }}" class="text-center">Pekerjaan</th>
</tr>
<tr>
@foreach ($works as $work)
<th>{{ $work->name }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($dealer_trxs as $trx)
<tr>
<td>{{ $trx['sa_name'] }}</td>
@foreach ($trx['works'] as $item)
<td>{{ $item['qty'] }}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
<!--end: Datatable -->
</div>
</div>
</div>
</div>
@endsection
@section('javascripts')
<script src="{{ url('js/pages/dashboard.js') }}" type="text/javascript"></script>
@endsection