233 lines
9.0 KiB
PHP
233 lines
9.0 KiB
PHP
@extends('layouts.base')
|
|
|
|
@section('content-header')
|
|
<div class="col-12">
|
|
<div class="container" style="display: contents">
|
|
<div class="row mb-2">
|
|
<div class="col-sm-6">
|
|
<h1 class="m-0"> Kasir <small>kasir 3.0</small></h1>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<ol class="breadcrumb float-sm-right">
|
|
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
|
<li class="breadcrumb-item"><a href="#">Kasir</a></li>
|
|
<li class="breadcrumb-item active">History</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="col-12 mt-2">
|
|
<div class="container" style="display: contents">
|
|
<div class="card">
|
|
<div class="card bg-warning" style="min-height:5px; border-radius:1px;"></div>
|
|
<div class="card-header mt-0 pt-0">
|
|
<div class="d-flex">
|
|
<h3>Daftar Menu</h3>
|
|
<!-- Button trigger modal -->
|
|
<div class="ml-auto">
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-default">
|
|
Tambah Menu
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
{{-- <h5 class="card-title">Form List Data</h5> --}}
|
|
<div class="table-responsive mt-3">
|
|
<table id="tabelku" class="table table-hover display" style="width: 100%">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center">No</th>
|
|
<th>Kode Produk</th>
|
|
<th>Nama Produk</th>
|
|
<th>Harga Produk</th>
|
|
<th>Kategori Produk</th>
|
|
<th class="text-center"><i class="fas fa-cog"></i></th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal Tambah Menu -->
|
|
<div class="modal fade" id="modal-default" data-backdrop="static">
|
|
<div class="modal-dialog modal-lg modal-dialog-centered">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Tambah Menu</h4>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form>
|
|
<div class="form-group row">
|
|
<div class="col-md-6">
|
|
<label for="kategori_produk" class="col-form-label">Kategori Produk:</label>
|
|
<select type="text" class="form-control select2" id="kategori_produk" name="kategori_produk" onchange="kelompokKategori(this.value)">
|
|
<option value="">Pilih Kategori</option>
|
|
@foreach ($kategori_produks as $kategori)
|
|
<option value="{{ $kategori->id }}">{{ $kategori->nama_kategori_produk }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="kelompok_produk" class="col-form-label">Kelompok Produk:</label>
|
|
<input type="text" class="form-control" id="kelompok_produk" name="kelompok_produk" value="">
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<div class="col-md-6">
|
|
<label for="kode_produk" class="col-form-label">Kode Produk:</label>
|
|
<input type="text" class="form-control" id="kode_produk" name="kode_produk" value="">
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="nama_produk" class="col-form-label">Nama Produk:</label>
|
|
<input type="text" class="form-control" id="nama_produk" name="nama_produk" value="">
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<div class="col-md-6">
|
|
<label for="harga_produk" class="col-form-label">Harga Produk:</label>
|
|
<input type="number" class="form-control" id="harga_produk" name="harga_produk" value="">
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="stok_produk" class="col-form-label">Stok Produk:</label>
|
|
<input type="text" class="form-control" id="stok_produk" name="stok_produk" value="">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="deskripsi_produk" class="col-form-label">Deskripsi Produk:</label>
|
|
<textarea class="form-control" id="deskripsi_produk" name="deskripsi_produk"></textarea>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Tutup</button>
|
|
<button type="button" class="btn btn-primary">Simpan</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@push('styles')
|
|
<!-- Toastr -->
|
|
<style>
|
|
@media only screen and (max-width : 991px) {
|
|
/* Styles */
|
|
}
|
|
|
|
@media only screen and (max-width : 768px) {
|
|
/* Styles */
|
|
}
|
|
|
|
@media only screen and (max-width : 414px) {
|
|
/* Styles */
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" href="{{ asset('assets/plugins/toastr/toastr.min.css') }}">
|
|
<link rel="stylesheet" href="{{asset('assets/datatables/datatables.min.css')}}">
|
|
@endpush
|
|
|
|
@push('style2')
|
|
<link rel="stylesheet" href="{{ asset('assets/plugins/select2/css/select2.min.css') }}">
|
|
<link rel="stylesheet" href="{{ asset('assets/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css') }}">
|
|
@endpush
|
|
|
|
@push('scripts')
|
|
<script src="{{ asset('assets/datatables/datatables.min.js') }}"></script>
|
|
<script src="{{ asset('assets/plugins/select2/js/select2.full.min.js') }}"></script>
|
|
<script src="{{ asset('assets/plugins/toastr/toastr.min.js') }}"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#tabelku').DataTable({
|
|
processing: true,
|
|
serverSide: true,
|
|
ajax: "{{ route('menu.getDataMenu') }}",
|
|
columns: [{
|
|
data: 'nomor',
|
|
name: 'nomor',
|
|
orderable: false,
|
|
className: 'text-center'
|
|
},
|
|
{
|
|
data: 'kode_produk',
|
|
name: 'kode_produk'
|
|
},
|
|
{
|
|
data: 'nama_produk',
|
|
name: 'nama_produk'
|
|
},
|
|
{
|
|
data: 'harga_produk',
|
|
name: 'harga_produk'
|
|
},
|
|
{
|
|
data: 'kategori_produk',
|
|
name: 'kategori_produk'
|
|
},
|
|
{
|
|
data: 'ubah',
|
|
name: 'ubah',
|
|
className: 'text-center'
|
|
},
|
|
]
|
|
})
|
|
})
|
|
</script>
|
|
<script>
|
|
$('.select2').select2();
|
|
|
|
function kelompokKategori(id) {
|
|
$.ajax({
|
|
url: "{{ route('menu.kelompok-kategori', '') }}/" + id,
|
|
method: "GET",
|
|
success: function(result) {
|
|
console.log(result);
|
|
},
|
|
error: function(xhr, status, error) {
|
|
toastr.error(xhr.responseJSON.message, 'Error', {
|
|
timeOut: 3000
|
|
});
|
|
}
|
|
})
|
|
}
|
|
|
|
// function tambah() {
|
|
// var data = {
|
|
// _token: "{{ csrf_token() }}",
|
|
// orderMenus: orderMenus,
|
|
// };
|
|
|
|
// $.ajax({
|
|
// url: "{{ route('menu.store') }}",
|
|
// method: "POST",
|
|
// data: data,
|
|
// success: function(result) {
|
|
// toastr.success(result.message, 'Success', {
|
|
// timeOut: 2000
|
|
// });
|
|
// window.open(result.url, '_blank');
|
|
// // window.open(result.url, '_blank', "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=900,height=600");
|
|
|
|
// setTimeout(function() {
|
|
// window.location.reload(1);
|
|
// }, 1000);
|
|
// },
|
|
// error: function(xhr, status, error) {
|
|
// toastr.error(xhr.responseJSON.message, 'Error', {
|
|
// timeOut: 3000
|
|
// });
|
|
// }
|
|
// });
|
|
// }
|
|
</script>
|
|
@endpush |