public function orderDelivered($idTransaksi) { $orderDelivered = Transaksi::where('idTransaksi', $idTransaksi)->first(); $orderDelivered->statustransaksi = 'terkirim'; $standDelivered = Stand::where('idStand', $orderDelivered->idStand)->first(); $standDelivered->saldo = $standDelivered->saldo + $orderDelivered->hargaTotal; $orderDelivered->save(); $standDelivered->save(); return Redirect::to('user/admin'); }
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8"> <div class="table-responsive"> <table class="table "> <thead> <tr> <th>Menu</th> <th>Jumlah Pesan</th> <th>Lokasi</th> <th>Status Order</th> <th>Action</th> </tr> </thead> <?php $userLoggedIn = User::where('username', Session::get('user'))->first(); $menuOrdered = Transaksi::where('username', $userLoggedIn->username)->where('statustransaksi', '!=', 'terkirim')->orderBy('statustransaksi', 'asc')->get(); ?> <tbody> @if($menuOrdered->count() == 0) <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Info</h3> </div> <div class="panel-body"> <h2 style="color:#000">You Have NO ORDER</h2> </div> </div> @endif @foreach($menuOrdered as $menu) <tr> <td>{{$menu->menuname}}</td>
$standLoggedIn = Stand::where('username', Session::get('user'))->first(); ?> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav navbar-right"> @if(Session::has('user')) <li><a><?php echo Session::get('user'); ?> </a></li> @if(Session::get('status') != 'kasir') <li><a href="{{ url() }}/vendor-admin/myMenu">My Menu</a></li> <li><a href="#">Saldo Rp {{$standLoggedIn->saldo}}</a></li> <li><a href="#">Waiting List <span class="badge"> <?php $menuOrdered = Transaksi::where('idStand', $standLoggedIn->idStand)->where('statustransaksi', 'prepare')->get(); ?> {{ $menuOrdered->count() }} </span> </a></li> @endif <li><a href="{{ url() }}/logout">Logout</a></li> @else <li><a href="{{ url() }}/vendor-login">Login</a></li> <li><a href="{{ url() }}/register">Register</a></li> @endif </ul> </div><!-- /.navbar-collapse --> </nav> </div>