pos-gis/resources/views/content/ref/index.blade.php

179 lines
9.3 KiB
PHP
Raw Normal View History

2024-10-07 06:13:42 +00:00
@section('content')
{{-- <x-other.titleHeader judul="{{$title}}" /> --}}
<div class="d-flex flex-column-fluid">
<div class="container-fluid">
<div class="row mt-4">
<div class="col-md-12">
<x-card.content title="{{$title}}" subTitle="Table {{$title}}">
<x-slot name="toolbar">
@if ($title == 'EDC Device')
<button type="button" onclick="importExcel();" class="btn btn-transparent-success mr-3">
<i class="la la-file-excel"></i>Import Excel <b></b>
</button>
@endif
@if ($title == 'Billing')
<button type="button" onclick="G_cetakAny('csv','laporan_billing');" class="btn btn-success mr-3">
<span>
<span>Export CSV</span>
</span>
</button>
@elseif ($title == 'Order')
<button type="button" onclick="G_cetakAny('csv','laporan_order');" class="btn btn-success mr-3">
<span>
<span>Export CSV</span>
</span>
</button>
@elseif ($title == 'Transaction')
<button type="button" onclick="G_cetakAny('csv','laporan_transaction');" class="btn btn-success mr-3">
<span>
<span>Export CSV</span>
</span>
</button>
@elseif ($title == 'Gross Profit and Sales')
<button type="button" onclick="G_cetakAny('xlsx','laporan_gross');" class="btn btn-success mr-3">
<span>
<span>Export CSV</span>
</span>
</button>
@elseif ($title == 'Outlet')
<button type="button" onclick="refreshTable();" class="btn btn-transparent-warning mr-3">
<i class="la la-sync"></i>Sync <b></b>
</button>
<button id="btn-add-ref" type="button" onclick="clearForm();znModal('mForm');" class="btn btn-primary mr-3">
<i class="la la-plus mr-2"></i>Tambah <b></b>
</button>
@else
<button type="button" onclick="refreshTable();" class="btn btn-transparent-warning mr-3">
<i class="la la-sync"></i>Sync <b></b>
</button>
@if (Auth::user()->role != 3)
<button id="btn-add-ref" type="button" onclick="clearForm();znModal('mForm');" class="btn btn-primary mr-3">
<i class="la la-plus mr-2"></i>Tambah <b></b>
</button>
@endif
@endif
</x-slot>
<x-slot name="content">
@if($title == 'Outlet' || $title == 'EDC Device')
<div class="row">
<div class="col-md-2">
<div class="form-group">
<div>
@php
$ds = \DB::table("merchant")
->when(Auth::user()->role == 3, function ($query) {
$query->where('city_id', Auth::user()->id_kota);
})->get();
@endphp
<div class="form-group">
2024-10-08 06:24:47 +00:00
<div class="mb-2">Company</div>
2024-10-07 06:13:42 +00:00
<div id="block_merchant">
<select autocomplete="off" onchange="getTable()" class="form-control select2 znSelect2" style="width: 100%" name="merchant_filter" id="merchant_filter">
<option selected value="all">Semua</option>
@foreach($ds as $item)
<option value="{{$item->mid}}">{{$item->merchant_nm}}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
@if ($title == 'Billing' || $title == 'Order' || $title == 'Transaction' || $title == 'Gross Profit and Sales')
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>Pilih Tanggal Awal</label>
<div>
<input autocomplete="off" onchange="getTable()" type="text" value="{{date('d-m-Y')}}" name="berkala_startDate" id="berkala_startDate" class="form-control znDate" />
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>Pilih Tanggal Akhir</label>
<div>
<input autocomplete="off" onchange="getTable()" type="text" value="{{date('d-m-Y')}}" name="berkala_endDate" id="berkala_endDate" class="form-control znDate" />
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<div>
@php
$ds = \DB::table("merchant")
->when(Auth::user()->role == 3, function ($query) {
$query->where('city_id', Auth::user()->id_kota);
})->get();
@endphp
<div class="form-group">
2024-10-08 06:24:47 +00:00
<div class="mb-2">Company</div>
2024-10-07 06:13:42 +00:00
<div id="block_merchant">
<select autocomplete="off" onchange="getTable()" class="form-control select2 znSelect2" style="width: 100%" name="merchant_filter" id="merchant_filter">
<option selected value="all">Semua</option>
@foreach($ds as $item)
<option value="{{$item->mid}}">{{$item->merchant_nm}}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
<table class="table table-separate table-head-custom table-checkable" id="indexTable">
<thead>
<tr>
@foreach($tableHead as $item)
<th class="{{$item[1]}}"
{{($item[0] == 'Act') ? "style='width:50px;'":""}}
{{($item[0] == 'Status') ? "style='width:70px;'":""}}>{{$item[0]}}</th>
@endforeach
</tr>
</thead>
</table>
</x-slot>
</x-card.content>
</div>
</div>
</div>
</div>
<x-master.refScript />
@include($vForm)
@include('content.ref.ref_action_global')
@include($vAction)
@endsection