Commit 0c4a4b21 by Yonatan Parapat

Server Live

parent 226a4f92
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\User;
use App\Barang;
use App\Pembelian;
use App\RequestBarang;
use App\DataRequest;
use App\Http\Requests;
......@@ -15,15 +16,50 @@ use Illuminate\Support\Facades\Auth;
class CustomerController extends Controller
{
//----------------------------Pembelian Barang----------------------//
public function BeliBarang()
{
$barangs = Barang::all();
return view('adminlte::customer.BeliBarang.index', compact('barangs'));
}
public function createPembelian($id)
{
$barangs = Barang::where('id', $id)->first();
return view('adminlte::customer.BeliBarang.createPembelian')->with('barangs', $barangs);
}
public function list(){
// $barangs = Barang::all();
$key = Input::get('search');
if(isset($key)){
$this->data['barang'] = Barang::where('nama_barang','like','%'.$key.'%')->orderBy('id','desc')->paginate(10);
}else{
$this->data['barang'] = Barang::orderBy('id','desc')->paginate(10);
}
$this->data['total'] = DB::table('barangs')->get();
return view('adminlte::customer.BeliBarang.index',$this->data);
}
public function savePembelian(Request $request)
{
$pembelians = new Pembelian();
$pembelians->user_id = $request->user_id;
$pembelians->username = $request->username;
$pembelians->nama_barang = $request->nama_barang;
$pembelians->kategori = $request->kategori;
$pembelians->harga =$request->harga;
$pembelians->jumlah = $request->jumlah;
$harga = $request->harga;
$jumlah = $request->jumlah;
$total_harga = $harga * $jumlah;
$pembelians->total_harga = $total_harga;
$pembelians->status_pengantaran = $request->status_pengantaran;
$pembelians->save();
return redirect('BeliBarang');
}
public function create()
{
return view('adminlte::inventori.BeliBarang.create');
......@@ -51,12 +87,6 @@ class CustomerController extends Controller
return redirect('BeliBarang');
}
//----------------------------Data Request----------------------//
public function RequestBarang()
{
$data_requests = DataRequest::all();
......@@ -92,22 +122,21 @@ class CustomerController extends Controller
return redirect('RequestBarang');
}
//----------------------------Check Saldo----------------------------//
public function CheckSaldo()
{
$users = User::all();
return view('adminlte::customer.CheckSaldo.index');
}
//----------------------------Histori Transaksi----------------------//
public function HistoryTransaksi()
public function HistoryRequest()
{
$request_barangs = RequestBarang::all();
return view('adminlte::customer.HistoryTransaksi.index')->with('request_barangs', $request_barangs);
return view('adminlte::customer.HistoryRequest.index', compact('request_barangs'));
}
public function HistoryPembelian()
{
$pembelians = Pembelian::all();
return view('adminlte::customer.HistoryPembelian.index', compact('pembelians'));
}
}
\ No newline at end of file
......@@ -7,9 +7,12 @@ use Illuminate\Http\Request;
use App\Http\Requests;
use App\Barang;
use App\RequestBarang;
use App\DataRequest;
use App\Pembelian;
class InventoriController extends Controller
{
......@@ -27,16 +30,16 @@ class InventoriController extends Controller
public function store(Request $request)
{
$this->validate($request, [
'nama' => 'required',
'jumlah' => 'required',
'nama_barang' => 'required',
'stock' => 'required',
'harga' => 'required',
'kategori' => 'required',
'gambar' => 'required',
]);
$barangs = new Barang();
$barangs->nama = $request['nama'];
$barangs->jumlah = $request['jumlah'];
$barangs->nama_barang = $request['nama_barang'];
$barangs->stock = $request['stock'];
$barangs->harga = $request['harga'];
$barangs->kategori = $request['kategori'];
$barangs->gambar = $request['gambar'];
......@@ -55,16 +58,16 @@ class InventoriController extends Controller
public function update(Request $request, $id)
{
$this->validate($request, [
'nama' => 'required',
'jumlah' => 'required',
'nama_barang' => 'required',
'stock' => 'required',
'harga' => 'required',
'kategori' => 'required',
'gambar' => 'required',
]);
$barangs = Barang::findOrFail($id);
$barangs->nama = $request->nama;
$barangs->jumlah = $request->jumlah;
$barangs->nama_barang = $request->nama_barang;
$barangs->stock = $request->stock;
$barangs->harga = $request->harga;
$barangs->kategori = $request->kategori;
$barangs->gambar = $request->gambar;
......@@ -95,8 +98,13 @@ class InventoriController extends Controller
}
public function ListPembelian()
{
$pembelians = Pembelian::all();
return view('adminlte::inventori.ListPembelian.index', compact('pembelians'));
}
//----------------------------Data Request----------------------//
public function DataRequest()
{
......@@ -158,5 +166,28 @@ class InventoriController extends Controller
return redirect('DataRequest');
}
public function konfirmasiBarang($id)
{
$datauP = RequestBarang::find ($id);
$datauP->status_request = 'Terkonfirmasi';
$datauP->update();
return redirect('ListRequest');
}
public function RejectedBarang($id)
{
$datauP = RequestBarang::find ($id);
$datauP->status_request = 'Rejected';
$datauP->update();
return redirect('ListRequest');
}
}
\ No newline at end of file
......@@ -6,6 +6,8 @@ use App\Http\Requests;
use App\User;
use App\Transaksi;
use App\RequestBarang;
use App\pembelian;
class KasirController extends Controller
{
......@@ -15,10 +17,16 @@ class KasirController extends Controller
return view('adminlte::kasir.ListCustomer.index', compact('users'));
}
public function ListTransaksi()
public function ListPembelians()
{
$transaksis = Transaksi::all();
return view('adminlte::kasir.ListTransaksi.index', compact('transaksis'));
$pembelians = Pembelian::all();
return view('adminlte::kasir.ListPembelian.index', compact('pembelians'));
}
public function ListRequests()
{
$request_barangs = RequestBarang::where('status_request', 'like', 'Terkonfirmasi')->get();
return view('adminlte::kasir.ListRequest.index', compact('request_barangs'));
}
......@@ -36,8 +44,29 @@ class KasirController extends Controller
return redirect('ListCustomer');
}
public function KonfirmasiBarang($id){
DB::table('request_barangs')->where('id', $id)->update(['status_request'=> 1]);
return redirect()->back();
public function konfPengantaran($id)
{
$datauP = Pembelian::find ($id);
$datauP->status_pengantaran = 'Terkirim';
$datauP->update();
return redirect('ListPembelians');
}
public function konfAntar($id)
{
$datauP = RequestBarang::find ($id);
$datauP->status_pengantaran = 'Terkirim';
$datauP->update();
return redirect('ListRequests');
}
}
\ No newline at end of file
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Pembelian extends Model
{
protected $table = 'pembelians';
protected $fillable = [
'username','nama_barang', 'kategori','jumlah','total_harga','user_id','status_pengantaran',
];
public function user(){
return $this->belongsTo(User::class);
}
}
......@@ -54,7 +54,7 @@
</div>
<div class="form-group has-feedback">
<select name="status" class="form-control">
<option value="user">User</option>
<option value="customer">Customer</option>
</select>
</div>
<div class="row">
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
Create
@endsection
@section('contentheader_title')
Page Request Barang
@endsection
@section('main-content')
<div class="container">
<div class="row">
<!-- edit form column -->
<form class="form-horizontal" role="form" method="POST" action="{{url('/savePembelian')}}" >
{!! csrf_field() !!}
<div class="col-md-9 personal-info">
<div class="form-group">
<label class="col-md-4 control-label">User ID</label>
<div class="col-lg-6">
<input name="user_id" class="form-control" type="integer" value="{{$user->id}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Username</label>
<div class="col-lg-6">
<input name="username" class="form-control" type="text" value="{{$user->username}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Nama Barang</label>
<div class="col-md-6">
<input name="nama_barang" class="form-control" type="text" value="{{$barangs->nama_barang}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Kategori</label>
<div class="col-md-6">
<input name="kategori" class="form-control" type="text" value="{{$barangs->kategori}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Harga</label>
<div class="col-md-6">
<input name="harga" class="form-control" type="integer" value="{{$barangs->harga}}" readonly>
</div>
</div>
<div class="form-group{{ $errors->has('jumlah') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Jumlah</label>
<div class="col-md-6">
<input type="number" onkeyup="Harga(this.value)" min="1" class="form-control" name="jumlah" value="{{ old('jumlah') }} " required>
@if ($errors->has('jumlah'))
<span class="help-block">
<strong>{{ $errors->first('jumlah') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('total_harga') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">Total Harga</label>
<div class="col-md-6">
<span class="form-control" id="total_harga" name="total_harga" value="{{ old('total_harga') }}"></span>
</div>
</div>
<div class="form-group{{ $errors->has('status_pengantaran') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Status Pengantaran</label>
<div class="col-md-6">
<select name="status_pengantaran" class="form-control">
<option value="Request">Request</option>
</select>
@if ($errors->has('status_pengantaran'))
<span class="help-block">
<strong>{{ $errors->first('status_pengantaran') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="col-md-9">
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<input type="submit" class="btn btn-primary" value="Save Changes">
<span></span>
</div>
</div>
</div>
</form>
</div>
</div>
<script>function Harga(str)
{
document.getElementById("total_harga").innerHTML = str*{{$barangs->harga}};
return;
}
</script>
@endsection
......@@ -9,6 +9,15 @@
@endsection
@section('main-content')
<form action="{{url('/list')}}">
<div class="form-group">
<label style="margin: 20px 20px 0;font-size: 15px">Search by Username</label>
<input type="text" name="search" placeholder="Nama Barang" id="search" class="form-control" style="font-size: 15px;color:white;background-color:rgba(0,0,0,0.4)"/>
</div>
<button type="submit" id="button-filter" class="btn btn-danger pull-right" style="margin-right: 20px">
<i class="fa fa-search"></i> Search
</button>
</form>
<table class="table table-striped">
<thead>
<tr>
......@@ -24,17 +33,16 @@
<tbody>
@foreach($barangs as $barang)
<tr>
<td>{{$barang->nama}}</td>
<td>{{$barang->jumlah}}</td>
<td>{{$barang->nama_barang}}</td>
<td>{{$barang->stock}}</td>
<td>{{$barang->harga}}</td>
<td>{{$barang->kategori}}</td>
<td>{{$barang->gambar}}</td>
<td><img src="{{ asset('image/'. $barang->gambar) }}" style="height: 50px; width: 50px; "></td>
<td>
<a href="{{ url('/beli', $barang->id) }}" type="submit" button type="button" class="btn btn-warning">Beli</a>
<a href="{{ url('/createPembelian', $barang->id) }}" type="submit" button type="button" class="btn btn-warning">Beli</a>
<!-- <a href="{{ url('/delete', $barang->id) }}" <onclick="return confirm('Yakin mau hapus data ini sob?')" class="btn btn-warning">Delete</a> -->
</tr>
@endforeach
</tbody>
</table>
<a href="{{ url('/create') }}" button type="button" class="btn btn-info">Create</a></button>
@endsection
......@@ -5,14 +5,16 @@
@endsection
@section('contentheader_title')
<center>Check Saldo</center>
<center>My Saldo</center>
@endsection
@section('main-content')
<div class="container-fluid spark-screen">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<p style="font-size: 15px">Saldo= Rp. {{$user->saldo}}</p>
<div class="panel-body">
<label style="font-weight:bolder;color:black;font-size: 17px"></center><b>Saldo : Rp.{{$user->saldo}}</b></label>
</div>
</div>
</div>
</div>
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('contentheader_title')
<center>Histori Pembelian</center>
@endsection
@section('main-content')
<table class="table table-striped">
<thead>
<tr>
<th>Nama Barang</th>
<th>Kategori</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Total Harga</th>
<th>Status Pengantaran</th>
</tr>
</thead>
<tbody>
@foreach($pembelians as $pembelian)
<tr>
<td>{{$pembelian->nama_barang}}</td>
<td>{{$pembelian->kategori}}</td>
<td>{{$pembelian->harga}}</td>
<td>{{$pembelian->jumlah}}</td>
<td>{{$pembelian->total_harga}}</td>
<td>{{$pembelian->status_pengantaran}}</td>
</tr>
@endforeach
</tbody>
</table>
@endsection
......@@ -5,33 +5,31 @@
@endsection
@section('contentheader_title')
<center>Histori Transaksi</center>
<center>Histori Request</center>
@endsection
@section('main-content')
<table class="table table-striped">
<thead>
<tr>
<th>Username</th>
<th>Nama Barang</th>
<th>Kategori</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Total Harga</th>
<th>Status Request</th>
<th>Pengantaran</th>
</tr>
</thead>
<tbody>
@foreach($request_barangs as $requestBarang)
<tr>
<td>{{$requestBarang->username}}</td>
<td>{{$requestBarang->nama_barang}}</td>
<td>{{$requestBarang->kategori}}</td>
<td>{{$requestBarang->harga}}</td>
<td>{{$requestBarang->jumlah}}</td>
<td>{{$requestBarang->total_harga}}</td>
<td>{{$requestBarang->status_request}}</td>
<td>{{$requestBarang->status_pengantaran}}</td>
</tr>
@endforeach
</tbody>
......
......@@ -14,30 +14,31 @@
<div class="panel-body">
<form class="form-horizontal" action="{{ url('store') }}" method="POST">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
<div class="form-group{{ $errors->has('nama_barang') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Nama</label>
<div class="col-md-6">
<input type="text" class="form-control" name="nama" value="{{ old('nama') }}" >
@if ($errors->has('nama'))
<input type="text" class="form-control" name="nama_barang" value="{{ old('nama_barang') }}" >
@if ($errors->has('nama_barang'))
<span class="help-block">
<strong>{{ $errors->first('nama') }}</strong>
<strong>{{ $errors->first('nama_barang') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('jumlah') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Jumlah</label>
<div class="form-group{{ $errors->has('stock') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Stock</label>
<div class="col-md-6">
<input type="text" class="form-control" name="jumlah" value="{{ old('jumlah') }}" >
@if ($errors->has('jumlah'))
<input type="integer" class="form-control" name="stock" value="{{ old('stock') }}" >
@if ($errors->has('stock'))
<span class="help-block">
<strong>{{ $errors->first('jumlah') }}</strong>
<strong>{{ $errors->first('stock') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('harga') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Harga</label>
<div class="col-md-6">
......
......@@ -14,26 +14,26 @@
<div class="panel-body">
<form class="form-horizontal" action="{{ url('update', $barangs->id) }}" method="POST">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('nama') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Nama</label>
<div class="form-group{{ $errors->has('nama_barang') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Nama Barang </label>
<div class="col-md-6">
<input type="text" class="form-control" name="nama" value="{{ $barangs->nama}}" >
@if ($errors->has('nama'))
<input type="text" class="form-control" name="nama_barang" value="{{ $barangs->nama_barang}}" >
@if ($errors->has('nama_barang'))
<span class="help-block">
<strong>{{ $errors->first('nama') }}</strong>
<strong>{{ $errors->first('nama_barang') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('jumlah') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Jumlah</label>
<div class="form-group{{ $errors->has('stock') ? ' has-error' : '' }}">
<label for="title" class="col-md-4 control-label">Stock</label>
<div class="col-md-6">
<input type="text" class="form-control" name="jumlah" value="{{ $barangs->jumlah}}" >
@if ($errors->has('jumlah'))
<input type="text" class="form-control" name="stock" value="{{ $barangs->stock}}" >
@if ($errors->has('stock'))
<span class="help-block">
<strong>{{ $errors->first('jumlah') }}</strong>
<strong>{{ $errors->first('stock') }}</strong>
</span>
@endif
</div>
......
......@@ -24,8 +24,8 @@
<tbody>
@foreach($barangs as $barang)
<tr>
<td>{{$barang->nama}}</td>
<td>{{$barang->jumlah}}</td>
<td>{{$barang->nama_barang}}</td>
<td>{{$barang->stock}}</td>
<td>{{$barang->harga}}</td>
<td>{{$barang->kategori}}</td>
<td><img src="{{ asset('image/'. $barang->gambar) }}" style="height: 150px; width: 200px; "> </td>
......
......@@ -5,37 +5,35 @@
@endsection
@section('contentheader_title')
<center>List Customer</center>
<center>List Pembelian</center>
@endsection
@section('main-content')
<table class="table table-striped">
<table class="table table-striped">
<thead>
<tr>
<th>Username</th>
<th>Nama Barang</th>
<th>Kategori</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Total Harga</th>
<!-- <th>Status Pengantaran</th> -->
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach($transaksis as $transaksi)
@foreach($pembelians as $pembelian)
<tr>
<td>{{$transaksi->username}}</td>
<td>{{$transaksi->nama_barang}}</td>
<td>{{$transaksi->kategori}}</td>
<td>{{$transaksi->jumlah}}</td>
<td>{{$transaksi->total_harga}}</td>
<!-- <td>{{$transaksi->status_pengantaran}}</td> -->
<td>
<a href="{{ url('/konfirmasiAntar', $transaksi->id) }}" type="submit" button type="button" class="btn btn-warning">Konfirmasi</a>
<td>
<td>{{$pembelian->username}}</td>
<td>{{$pembelian->nama_barang}}</td>
<td>{{$pembelian->kategori}}</td>
<td>{{$pembelian->harga}}</td>
<td>{{$pembelian->jumlah}}</td>
<td>{{$pembelian->total_harga}}</td>
</tr>
@endforeach
</tbody>
</table>
@endsection
......@@ -5,7 +5,7 @@
@endsection
@section('contentheader_title')
<center>Request Barang</center>
<center>List Request</center>
@endsection
@section('main-content')
......@@ -18,7 +18,6 @@
<th>Harga</th>
<th>Jumlah</th>
<th>Total Harga</th>
<th>Status Request</th>
<th>Action</th>
</tr>
</thead>
......@@ -32,9 +31,26 @@
<td>{{$requestBarang->harga}}</td>
<td>{{$requestBarang->jumlah}}</td>
<td>{{$requestBarang->total_harga}}</td>
<td>{{$requestBarang->status_request}}</td>
<td>
<a href="{{ url('/KonfirmasiBarang', $requestBarang->id) }}" type="submit" button type="button" class="btn btn-warning">Konfirmasi</a>
@if($requestBarang->status_request=="Terkonfirmasi")
<p>Accept</p>
@elseif($requestBarang->status_request=="Rejected")
<p>Reject</p>
@elseif($requestBarang->status_request=="Request")
<form action="{{url('konfirmasiBarang/'.$requestBarang->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Accept</i></button>
</form>
<form action="{{url('RejectedBarang/'.$requestBarang->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Eject</i></button>
</form>
@endif
</td>
</tr>
@endforeach
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('contentheader_title')
<center>List Customer</center>
@endsection
@section('main-content')
<table class="table table-striped">
<thead>
<tr>
<th>Username</th>
<th>Nama Barang</th>
<th>Kategori</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Total Harga</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach($pembelians as $rb)
<tr>
<td>{{$rb->username}}</td>
<td>{{$rb->nama_barang}}</td>
<td>{{$rb->kategori}}</td>
<td>{{$rb->harga}}</td>
<td>{{$rb->jumlah}}</td>
<td>{{$rb->total_harga}}</td>
<td>
@if($rb->status_pengantaran=="Terkirim")
<p>Delivered</p>
@else($rb->status_pengantaran=="Request")
<form action="{{url('konfPengantaran/'.$rb->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Delivered</i></button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('contentheader_title')
<center>List Customer</center>
@endsection
@section('main-content')
<table class="table table-striped">
<thead>
<tr>
<th>Username</th>
<th>Nama Barang</th>
<th>Kategori</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Total Harga</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach($request_barangs as $rb)
<tr>
<td>{{$rb->username}}</td>
<td>{{$rb->nama_barang}}</td>
<td>{{$rb->kategori}}</td>
<td>{{$rb->harga}}</td>
<td>{{$rb->jumlah}}</td>
<td>{{$rb->total_harga}}</td>
<td>
@if($rb->status_pengantaran=="Terkirim")
<p>Delivered</p>
@else($rb->status_pengantaran=="Request")
<form action="{{url('konfAntar/'.$rb->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Delivered</i></button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection
......@@ -39,19 +39,25 @@
@elseif(Auth::user()->status=="customer")
<li><a href="{{ url('/BeliBarang') }}"><i class='fa fa-link'></i> <span>Beli Barang</span></a></li>
<li><a href="{{ url('/RequestBarang') }}"><i class='fa fa-link'></i> <span>Request Barang</span></a></li>
<li><a href="{{ url('/CheckSaldo') }}"><i class='fa fa-link'></i> <span>Check Saldo</span></a></li>
<li><a href="{{ url('/HistoryTransaksi') }}"><i class='fa fa-link'></i> <span>History Transaksi</span></a></li>
<li><a href="{{ url('/HistoryPembelian') }}"><i class='fa fa-link'></i> <span>History Pembelian</span></a></li>
<li><a href="{{ url('/HistoryRequest') }}"><i class='fa fa-link'></i> <span>History Request</span></a></li>
@elseif(Auth::user()->status=="inventori")
<li><a href="{{ url('/ListBarang') }}"><i class='fa fa-link'></i> <span>List Barang</span></a></li>
<li><a href="{{ url('/ListRequest') }}"><i class='fa fa-link'></i> <span>List Transaksi Request</span></a></li>
<li><a href="{{ url('/DataRequest') }}"><i class='fa fa-link'></i> <span>Data Request</span></a></li>
<li><a href="{{ url('/ListPembelian') }}"><i class='fa fa-link'></i> <span>List Pembelian</span></a></li>
<li><a href="{{ url('/ListRequest') }}"><i class='fa fa-link'></i> <span>List Request</span></a></li>
@elseif(Auth::user()->status=="kasir")
<li><a href="{{ url('/ListCustomer') }}"><i class='fa fa-link'></i> <span>List Customer</span></a></li>
<li><a href="{{ url('/ListTransaksi') }}"><i class='fa fa-link'></i> <span>List Transaksi</span></a></li>
<li><a href="{{ url('/ListPembelians') }}"><i class='fa fa-link'></i> <span>List Pembelian</span></a></li>
<li><a href="{{ url('/ListRequests') }}"><i class='fa fa-link'></i> <span>List Request</span></a></li>
@endif
......
......@@ -53,13 +53,20 @@ Route::group(['middleware' => ['web','auth','customer']], function () {
Route::get('/BeliBarang', 'CustomerController@BeliBarang');
Route::get('/CheckSaldo', 'CustomerController@CheckSaldo');
Route::get('/createPembelian/{id}', 'CustomerController@createPembelian');
Route::post('/storePembelian', 'CustomerController@storePembelian');
Route::post('/savePembelian', 'CustomerController@savePembelian');
Route::get('/list','CustomerController@list');
Route::get('/RequestBarang', 'CustomerController@RequestBarang');
Route::get('/createRequest/{id}', 'CustomerController@createRequest');
Route::post('/storeRequest', 'CustomerController@storeRequest');
Route::post('/saveRequest', 'CustomerController@saveRequest');
Route::get('/HistoryTransaksi', 'CustomerController@HistoryTransaksi');
});
Route::get('/HistoryPembelian', 'CustomerController@HistoryPembelian');
Route::get('/HistoryRequest', 'CustomerController@HistoryRequest');
});
......@@ -71,8 +78,7 @@ Route::group(['middleware' => ['web','auth','inventori']], function () {
Route::get('/edit/{id}', 'InventoriController@edit');
Route::post('/update/{id}', 'InventoriController@update');
Route::get('/delete/{id}', 'InventoriController@destroy');
Route::get('/ListPembelian', 'InventoriController@ListPembelian');
Route::get('/ListRequest', 'InventoriController@ListRequest');
Route::get('/editRequest/{id}', 'InventoriController@editRequest');
Route::post('/update/{id}', 'InventoriController@update');
......@@ -85,6 +91,10 @@ Route::group(['middleware' => ['web','auth','inventori']], function () {
Route::get('/editDataRequest/{id}', 'InventoriController@editDataRequest');
Route::post('/updateDataRequest/{id}', 'InventoriController@updateDataRequest');
Route::get('/deleteDataRequest/{id}', 'InventoriController@destroyDataRequest');
Route::post('/konfirmasiBarang/{id}', 'InventoriController@KonfirmasiBarang');
Route::put('/konfirmasiBarang/{id}', 'InventoriController@KonfirmasiBarang');
Route::post('/RejectedBarang/{id}', 'InventoriController@RejectedBarang');
Route::put('/RejectedBarang/{id}', 'InventoriController@RejectedBarang');
});
......@@ -93,7 +103,12 @@ Route::group(['middleware' => ['web','auth','inventori']], function () {
Route::group(['middleware' => ['web','auth','kasir']], function () {
Route::get('/ListCustomer', 'KasirController@ListCustomer');
Route::get('/ListTransaksi', 'KasirController@ListTransaksi');
Route::get('/ListPembelians', 'KasirController@ListPembelians');
Route::get('/ListRequests', 'KasirController@ListRequests');
Route::get('/addSaldo/{id}','KasirController@addSaldo');
Route::put('/saldo/{id}','KasirController@saldo');
Route::post('/konfPengantaran/{id}', 'KasirController@konfPengantaran');
Route::put('/konfPengantaran/{id}', 'KasirController@konfPengantaran');
Route::post('/konfAntar/{id}', 'KasirController@konfAntar');
Route::put('/konfAntar/{id}', 'KasirController@konfAntar');
});
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 19, 2017 at 10:06 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ud_antoni`
--
-- --------------------------------------------------------
--
-- Table structure for table `barangs`
--
CREATE TABLE `barangs` (
`id` int(10) UNSIGNED NOT NULL COMMENT 'ID',
`nama_barang` varchar(100) COLLATE latin1_general_ci NOT NULL COMMENT 'Nama',
`stock` int(10) DEFAULT NULL COMMENT 'Jumlah',
`harga` decimal(10,0) NOT NULL COMMENT 'harga',
`kategori` varchar(50) COLLATE latin1_general_ci NOT NULL,
`gambar` varchar(100) COLLATE latin1_general_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
--
-- Dumping data for table `barangs`
--
INSERT INTO `barangs` (`id`, `nama_barang`, `stock`, `harga`, `kategori`, `gambar`, `created_at`, `updated_at`) VALUES
(18, 'Beng-beng', 100, '1500', 'makanan', 'beng@.jpg', '2017-05-19 08:02:34', '2017-05-19 08:02:34'),
(19, 'Coca-cola', 100, '4500', 'minuman', 'cocacola.jpg', '2017-05-19 08:07:04', '2017-05-19 08:07:04'),
(20, 'Pepsodent', 50, '9000', 'alat mandi', 'pepsoden.jpg', '2017-05-19 08:08:14', '2017-05-19 08:08:14'),
(21, 'Kalkulator', 50, '45000', 'alat tulis', 'kalkulator.jpg', '2017-05-19 08:09:25', '2017-05-19 08:09:25');
-- --------------------------------------------------------
--
-- Table structure for table `data_requests`
--
CREATE TABLE `data_requests` (
`id` int(10) UNSIGNED NOT NULL,
`nama_barang` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`kategori` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`harga` int(10) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `data_requests`
--
INSERT INTO `data_requests` (`id`, `nama_barang`, `kategori`, `harga`, `created_at`, `updated_at`) VALUES
(19, 'Kue Bolu ', 'makanan', 40000, '2017-05-19 08:11:34', '2017-05-19 08:12:10'),
(20, 'Kue Tart', 'makanan', 80000, '2017-05-19 08:11:50', '2017-05-19 08:11:50'),
(21, 'Piscok', 'makanan', 1000, '2017-05-19 08:12:02', '2017-05-19 08:12:02');
-- --------------------------------------------------------
--
-- Table structure for table `pembelians`
--
CREATE TABLE `pembelians` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`nama_barang` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`kategori` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`harga` int(10) NOT NULL,
`jumlah` int(10) NOT NULL,
`total_harga` int(10) NOT NULL,
`status_pengantaran` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `pembelians`
--
INSERT INTO `pembelians` (`id`, `username`, `nama_barang`, `kategori`, `harga`, `jumlah`, `total_harga`, `status_pengantaran`, `user_id`, `created_at`, `updated_at`) VALUES
(18, 'customer123', 'Beng-beng', 'makanan', 1500, 3, 4500, 'Terkirim', 22, '2017-05-19 08:31:51', '2017-05-19 09:01:31');
-- --------------------------------------------------------
--
-- Table structure for table `request_barangs`
--
CREATE TABLE `request_barangs` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`nama_barang` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`kategori` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`harga` int(10) DEFAULT NULL,
`jumlah` int(10) NOT NULL,
`total_harga` int(10) DEFAULT NULL,
`status_request` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`status_pengantaran` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `request_barangs`
--
INSERT INTO `request_barangs` (`id`, `username`, `nama_barang`, `kategori`, `harga`, `jumlah`, `total_harga`, `status_request`, `status_pengantaran`, `user_id`, `created_at`, `updated_at`) VALUES
(38, 'customer123', 'Piscok', 'makanan', 1000, 5, 5000, 'Request', 'Request', 22, '2017-05-19 09:36:21', '2017-05-19 09:36:21'),
(39, 'customer123', 'Kue Tart', 'makanan', 80000, 2, 160000, 'Request', 'Request', 22, '2017-05-19 09:36:31', '2017-05-19 09:36:31');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`saldo` int(20) NOT NULL DEFAULT '0',
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `username`, `password`, `status`, `saldo`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'admin@yahoo.com', 'admin', '$2y$10$HpjF1.bHvOGu7dsxljvrG.Gn.cO7fBxtsZt7vApf5VuSzfk4NhpWC', 'admin', 0, 'BFv7MkWmkdc41QkpoEwvcBVdrFIjwnBj6DvAx07wJutJTkpPiQsKx9lh6E5C', '2017-01-05 10:14:15', '2017-05-19 06:42:56'),
(22, 'customer', 'customer@yahoo.com', 'customer123', '$2y$10$EoyGEfjo/bUMEM7C7yYyN.JeWQ1TsbdQzYbWIgWYfR4Y1vQ/FfulW', 'customer', 200000, 'e0qqKYhu6HDvYkHCc0F9jnyqI2IwcFEmlXwjE3bOmwhvX4NGUYKMc2dcX0ZI', '2017-05-19 06:39:36', '2017-05-19 14:05:59'),
(23, 'inventori', 'inventori@yahoo.com', 'inventori', '$2y$10$Zm024gkgCi5sMdMSJWwJh.G.Y04dUDzgkdMY3YRlbrn7WxOycXDMO', 'inventori', 0, 'N4V0fUGNs6yCLTGg53zWn7qJ6BQljnMhC8Iq7oOkBEgdXojyf1Pw5D6LeTOo', '2017-05-19 06:41:46', '2017-05-19 09:43:54'),
(24, 'kasir', 'kasir@yahoo.com', 'kasir', '$2y$10$nHqhy6fu91vLtyxuAHdanO0M62Y0y9H8qOPxq519rwSL8JhdCT5ee', 'kasir', 0, '0qC64zLJk7n1GIhAPRlCcLw1DBsaEfiujnFx8WA28ZttBmSeTWMDk4Y20Lxi', '2017-05-19 06:42:18', '2017-05-19 09:15:54');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `barangs`
--
ALTER TABLE `barangs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `data_requests`
--
ALTER TABLE `data_requests`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pembelians`
--
ALTER TABLE `pembelians`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `request_barangs`
--
ALTER TABLE `request_barangs`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `user_id_2` (`user_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `barangs`
--
ALTER TABLE `barangs`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `data_requests`
--
ALTER TABLE `data_requests`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `pembelians`
--
ALTER TABLE `pembelians`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `request_barangs`
--
ALTER TABLE `request_barangs`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `pembelians`
--
ALTER TABLE `pembelians`
ADD CONSTRAINT `pembelians_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Constraints for table `request_barangs`
--
ALTER TABLE `request_barangs`
ADD CONSTRAINT `request_barangs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment