/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // $client = Clients::findOrFail($id); $data = ['client' => $client, 'NewOrderCounter' => Purchase::Neworders()->count()]; return view('admin.client')->with($data); }
public function indexInfo() { // $info = Info::find('1'); $data = ['info' => $info, 'NewOrderCounter' => Purchase::Neworders()->count()]; return view('admin.content.info')->with($data); }
public function editPersonal() { // $user = Auth::user(); $data = ['user' => $user, 'NewOrderCounter' => Purchase::Neworders()->count()]; return view('admin.personal')->with($data); }
public function showCart($id) { $order = Purchase::findOrFail($id); $totalCount = 0; $totalSumm = 0; foreach ($order->items as $item) { /* if (!in_array($item->product_id, ['np','fast', 'gift'])) { $totalCount=$totalCount+$item->qty; $totalSumm=$totalSumm+($item->product->price*$item->qty); }*/ if ($item->product_id == 'np') { $totalSumm = $totalSumm + Setting::get('product.np'); } else { if ($item->product_id == 'fast') { $totalSumm = $totalSumm + Setting::get('product.fast'); } else { if ($item->product_id == 'gift') { $totalSumm = $totalSumm + Setting::get('product.gift') * $item->qty; } else { $totalCount = $totalCount + $item->qty; $totalSumm = $totalSumm + $item->product->price * $item->qty; } } } } $data = ['order' => $order, 'totalCount' => $totalCount, 'totalSumm' => $totalSumm, 'NewOrderCounter' => Purchase::Neworders()->count()]; return view('admin.cartOrder')->with($data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $data = ['NewOrderCounter' => Purchase::Neworders()->count()]; return view('admin.money')->with($data); }
public function showCart($id) { $order = Purchase::findOrFail($id); $totalCount = 0; $totalSumm = 0; foreach ($order->items as $item) { /* if (!in_array($item->product_id, ['np','fast', 'gift'])) { $totalCount=$totalCount+$item->qty; $totalSumm=$totalSumm+($item->product->price*$item->qty); }*/ if ($item->product_id == 'np') { $totalSumm = $totalSumm + Setting::get('product.np'); } else { if ($item->product_id == 'fast') { $totalSumm = $totalSumm + Setting::get('product.fast'); } else { if ($item->product_id == 'gift') { $totalSumm = $totalSumm + Setting::get('product.gift') * $item->qty; } else { if (strpos($item->product_id, '0000')) { //dd('consist'); $pID = explode('0000', $item->product_id); $option = Options::findOrFail($pID[1]); $product = Products::findOrFail($pID[0]); $productPrice = $option->price; $item->productPrice = $productPrice; $item->productName = $product->name . ' (' . $option->name . ')'; $item->productCover = $product->cover; $item->productUrlhash = $product->urlhash; } else { $productPrice = $item->product->price; $item->productPrice = $item->product->price; $item->productName = $item->product->name; $item->productCover = $item->product->cover; $item->productUrlhash = $item->product->urlhash; } $totalCount = $totalCount + $item->qty; $totalSumm = $totalSumm + $item->productPrice * $item->qty; } } } } $data = ['order' => $order, 'totalCount' => $totalCount, 'totalSumm' => $totalSumm, 'NewOrderCounter' => Purchase::Neworders()->count()]; return view('admin.cartOrder')->with($data); }