public function tasks() { $items = item::all(); $train_responses = train_response::all(); $categories = permission::select('projects.title as projecttitle', 'categories.*')->where('permissions.userid', '=', Auth::user()->id)->join('projects', 'permissions.projectid', '=', 'projects.id')->orderBy('projects.created_at', 'desc')->join('categories', 'categories.projectid', '=', 'projects.id')->orderBy('categories.codegroup', 'desc')->orderBy('projecttitle', 'desc')->get(); $data = array('categories' => $categories, 'items' => $items, 'train_responses' => $train_responses); return view('pages.tasks')->with($data); }
function add($id) { $ids = Session::get('id', array()); $price = Session::get('price', 0); $price = $price + item::find($id)->price; array_push($ids, $id); Session::put('id', $ids); Session::put('price', $price); echo "added"; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { session_start(); $loguser = $_SESSION['user_id']; $data = ['modified_by' => $loguser, 'deleted' => '1']; App\item::find($id)->update($data); }