public function get_activate($id) { $item = MerchItem::find($id); $item->active = 1; $item->save(); return Redirect::to('rms/merch/items')->with('success', 'Successfully Activated Item'); }
public function get_admin($current = 'current') { if ($current == 'current') { $year = Year::current_year(); } else { $year = Year::find($current); } if ($year) { $orders = MerchOrder::where('year_id', '=', $year->id)->get(); $items = MerchItem::current_merch(); $sizes = array('8' => '8', '10' => '10', '12' => '12', '14' => '14', 'XS' => 'XS', 'S' => 'S', 'M' => 'M', 'L' => 'L', 'XL' => 'XL', 'XXL' => 'XXL'); return View::make('merch.orders.admin')->with('orders', $orders)->with('items', $items)->with('sizes', $sizes)->with('year', $year); } else { return "Invalid ID"; } }
public static function current_merch() { return MerchItem::where('active', '=', 1)->get(); }