/** * Show the form for creating a new resource. * * @return Response */ public function create() { // $user_id = 1; // $productsCount = Products::count(); // $product = Products::get(); // $ordersCount = DB::select('select count(*) as say from orders where cast(created_at as DATE) = ?', array(Carbon::now()->format('Y-m-d'))); // // if ($productsCount != ($ordersCount[0]->say)) { // foreach ($product as $key => $pro) { //// $ordersCount = DB::select('select count(*) as say from orders where cast(created_at as DATE) = ? and ProductName = ? ', array(Carbon::now()->format('Y-m-d'), $pro->Name)); ////dd(Carbon::now()->format('Y-m-d h:i:s')); //// dd(Carbon::now()); // $today = Carbon::now()->format('Y-m-d h:n:s'); // $ifnotinsert = DB::insert(DB::raw("INSERT INTO orders (ProductName,CustomerId,CustomerName,quantity,Alish,Satish,Income,created_at,updated_at,user_id) //SELECT * FROM (SELECT '$pro->Name' as name, '$pro->CustomerId' as cusid, '$pro->CustomerId' as cusname, 0 as quantity , '$pro->Alish' as alish , '$pro->Satish' as satish, '$pro->Income' as income, '$today' as created_at, '$today' as updated_at,0 as user_id) AS tmp //WHERE NOT EXISTS ( // SELECT * FROM orders WHERE ProductName = '$pro->Name' and CustomerId = '$pro->CustomerId' and Format(Alish,2) = Format('$pro->Alish',2) AND //Format(Satish,2)= Format('$pro->Satish',2)) LIMIT 1")); // // } // } $CustomerName = Customers::lists('name', 'id'); $CategoryName = Categories::lists('name', 'id'); return view('orders.newAlish', compact('CustomerName', $CustomerName), compact('CategoryName')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $post = Posts::findOrFail($id); $pageTitle = 'Posts'; $pageDescription = 'Edit existing post'; $categories = Categories::lists('name', 'id'); $tags = Tags::lists('name', 'id'); return view('posts.edit', compact('pageTitle', 'pageDescription', 'post', 'categories', 'tags')); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { $categories = Categories::lists('name', 'id'); $tags = Tags::lists('name', 'id'); return view('articles.create', compact('categories', 'tags')); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { $CategoryName = Categories::lists('name', 'id'); $CustomerName = Customers::lists('name', 'id'); return view('products.create', compact('CustomerName', $CustomerName), compact('CategoryName')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $article = Articles::findOrFail($id); $categories = Categories::lists('name', 'id'); $tags = Tags::lists('name', 'id'); $selected_tags = $article->tags()->lists('id')->all(); return view('articles.update', compact('article', 'categories', 'tags', 'selected_tags')); }
/** * Show the form for editing the specified resource. * * @param $id * @return $this */ public function edit($id) { $books = Book::findOrFail($id); $bindings = Binding::lists('binding_type', 'id'); $categories = Categories::lists('category_type', 'id'); $conditions = Condition::lists('condition_type', 'id'); $editions = Edition::lists('edition_type', 'id'); $publishers = Publisher::lists('publishers', 'id'); $rarities = Rarity::lists('rarity_type', 'id'); $signatures = Signature::lists('type', 'id'); return view('admin.library.edit')->with('books', $books)->with('bindings', $bindings)->with('categories', $categories)->with('conditions', $conditions)->with('editions', $editions)->with('publishers', $publishers)->with('rarities', $rarities)->with('signatures', $signatures); }
/** * View Create Form * * @return \Illuminate\View\View */ public function create() { $categories = Categories::lists('name', 'id'); return view('todo.create', compact('categories')); }