public function getClosed()
 {
     $previousRecord = "";
     $data['previousRecord'] = $previousRecord;
     $nextRecord = "";
     $data['nextRecord'] = $nextRecord;
     $purchaseordersCount = purchaseorder::where('status', 'closed')->count();
     $data['purchaseordersCount'] = $purchaseordersCount;
     $data['orderType'] = "closed";
     $purchaseorders = purchaseorder::where('status', 'closed')->get();
     $data['purchaseorders'] = $purchaseorders;
     return view("tablelayout", $data);
 }
Exemplo n.º 2
0
 public function postOrder($id)
 {
     if (isset($_POST['btnCancelOrder'])) {
         $order = purchaseorder::where('user_id', Auth::user()->id)->where('id', $id)->first();
         $order->status = "cancelled";
         $order->save();
         return redirect("/order/{$id}")->with('message', "Order was cancelled");
     }
 }